uid
stringlengths
6
55
question
stringlengths
34
465
context_short
sequence
context_long
sequence
tags
sequence
answer
stringlengths
1
25
relation
stringclasses
1 value
setrlimit@posix@38
setrlimit -- system call included in @placeholder which allows setting of limits on operating-system resources like cpu memory files and possibly others .
{ "confidence": [ 35.157196044921875, 34.363006591796875, 33.96955490112305, 33.46710968017578, 31.90938949584961, 31.618545532226562, 31.531192779541016, 30.9197998046875, 30.785018920898438, 30.459335327148438, 30.40853500366211, 29.32418441772461, 29.165977478027344, 29.06614875793457, 28.460826873779297, 28.424856185913086, 27.992223739624023, 27.992223739624023, 27.94178009033203, 27.308629989624023, 26.855541229248047, 26.582382202148438, 26.184261322021484, 26.184261322021484, 26.13248634338379, 26.06043815612793, 25.89474105834961, 25.833316802978516, 25.824670791625977, 25.824670791625977, 25.7757511138916, 25.679338455200195, 25.631568908691406, 25.232227325439453, 25.232227325439453, 24.836559295654297, 24.77037239074707, 24.77037239074707, 24.598155975341797, 24.512977600097656, 24.482402801513672, 24.276172637939453, 24.27365493774414, 24.10785675048828, 23.83399772644043, 23.708988189697266, 23.623878479003906, 23.62004852294922, 23.62004852294922, 23.25352668762207, 23.229368209838867, 23.15407943725586, 23.143295288085938, 22.807941436767578, 22.67752456665039, 22.60308837890625, 22.436616897583008, 22.18356704711914, 22.18172264099121, 22.139257431030273, 21.901500701904297, 21.86663818359375, 21.642894744873047, 21.44845199584961, 21.44845199584961, 21.44845199584961, 21.295856475830078, 21.295856475830078, 21.223182678222656, 21.18212890625, 21.14809226989746, 21.14809226989746, 20.965608596801758, 20.72350311279297, 20.656665802001953, 20.576906204223633, 20.4886474609375, 20.4886474609375, 20.4886474609375, 20.324081420898438, 20.324081420898438, 20.324081420898438, 20.324081420898438, 20.196866989135742, 20.196866989135742, 20.171485900878906, 20.119388580322266, 20.119388580322266, 20.119388580322266, 20.04832649230957, 20.03457260131836, 19.98548698425293, 19.803951263427734, 19.76719093322754, 19.537227630615234, 19.528339385986328, 19.528339385986328, 19.528339385986328, 19.41873550415039, 19.41873550415039 ], "content": [ "All setrlimit http : linux.die.net man 2 setrlimit limits are upper limits .", "It depends on the operating-system to do that .", "POSIX only allows for second precision in setrlimit .", "setrlimit and shell limits effects the main thread s stack .", "As you can see setrlimit can set limits on the user of the calling process .", "You set limits for a process with setrlimit the shell ulimit command really calls setrlimit when interpreted .", "Out of system resources .", "I m trying to use setrlimit to limit cpu resources of a process that is cloned using CLONE NEWPID flag which in result puts it a new linux pid namespace .", "@Paulo1205 as described in link process can increase limits by calling setrlimit again", "Are you setting setrlimit before the threads were created", "There might be operating specific extensions that you can use but I m not aware of any operating-system with that .", "To prevent forkbombs the application calls setrlimit http : linux.die.net man 2 setrlimit and limits RLIMIT NPROC to 50 before executing user code .", "What was your setrlimit call and what was the return-value", "The operating-system is going to see the problem and notify the shell to do something about it .", "BTW resource limits are intended to protect the system - not to tune the behaviour of individual processes .", "That seems to waste CPU resources .", "Look on setrlimit manpage http : linux.die.net man 2 setrlimit for more information .", "In the following code : .. . .. . the setrlimit line fails I get the error calling setrlimit .", "CentOS 5.5 64 bit is the operating-system that I am using .", "Is setrlimit simply unreliable", "I noted that in etc security limits.conf the limits are configured on a per user basis or per group basis for example : @faculty hard nproc 50 .. . .. . I assume that it is setrlimit that does the work to set limits but setrlimit works on a process basis that is it only sets resource limits on its calling process so since it can t set limits on user how can OS honor resource limits configured in limits.conf", "I was thinking I would write up a quick C program with setrlimit http : linux.die.net man 2 setrlimit to call Python and test it from there .", "@mafso setrlimit returned 0 .", "I m not denying that setrlimit is useful .", "You will have to consult the documentation of your target operating-system s to find out if and which of those flags are supported .", "I don t see anything about RLIMIT AS in the setrlimit 2 manpage : developer.apple.com library ios documentation system http : developer.apple.com library ios documentation system conceptual manpages iphoneos man2 setrlimit.2.html How about using RLIMIT DATA instead", "I m trying to use setrlimit http : linux.die.net man 2 setrlimit to cap the amount of time a process takes .", "I want to set limits for how long programs spawned by execv can use a certain amount of memory and a certain amount of CPU time .", "I think setrlimit moves the resource pointers but doesn t apply the new limits until you exec a new copy of the program .", "I tried using ulimit also but this did not work either and am pretty sure ulimit uses setrlimit to set limits .", "Mac OS X do not support this function as a system call .", "Currently I am using BSD : : Resource : : setrlimit RLIMIT FSIZE newsoft newhard which set file size limit on all files generated by the process .", "I have asked question http : stackoverflow.com questions 36722875 limiting-memory-usage-of-spawned-process about setrlimit but people in comments written that user can cancel limits may be there is a way to prevent user from doing this", "If setrlimit fails try again with rlim cur set to OPEN MAX .", "I am currently using setrlimit RLIMIT NPROC in Linux .", "cpu memory AS or so how can OS enforce these", "From the setrlimit manual page http : linux.die.net man 2 setrlimit : .. . .. . The soft limit is the value that the kernel enforces for the corresponding resource .", "from man setrlimit : .. . .. . setrlimit now returns with errno set to EINVAL in places that historically succeeded .", "I m just trying to reduce overall memory usage especially since I m running on a system with 64MB of memory and no swap .", "An idea which comes to mind which should work on any nix system is :", "ETA : See the note in COMPATIBILITY in the setrlimit 2 man page https : developer.apple.com library mac documentation Darwin Reference ManPages man2 setrlimit.2.html .", "Thanks .. . .. . Update 1 : Seems like I m going to give up on being able to set the stack size using setrlimit RLIMIT STACK .. . . I checked the resident memory and found it s a lot less than the virtual-memory .", "I therefore tried to implement a memory-management system based on setrlimit however it doesn t seem to affect the spawned threads std : : thread as they will happily ignore the limit - I know this because of calls to getrlimit in the threaded functions - and eventually cause my program to be killed .", "setrlimit is one of the first things I do in main", "Then all future descendant processes though fork clone will inherit those limits and the limits persist across system calls that change the program image execve and credentials setuid setgid setgroups etc .", "Assuming setrlimit actually worked what will happen is that your process either gets killed or can t allocate memory somewhere random which is clearly a pretty awful way to deal with the issue.. .", "And again same behaviour and we re not reproducing the issue of setrlimit returning success when setting a 2k stack ceiling :", "Is there anyway to set the hard limit open-file-max setrlimit RLIMIT NOFILE to the maximum", "Apparently NVIDIA s implementation calls setrlimit and pushes the limit to rlim max .", "I have a feeling your results depend on how many files are open in other programs on the system .", "I have limited controls over the binaries so if it s possible to do with a system call I d prefer that .", "When you do the fib call you hammer the CPU so that elapsed and CPU time are close most of the process time is spent using the CPU .", "As the title suggests i need to know if there is some way to have less then second precision with the setrlimit RLIMIT CPU", "Either by setting the FD CLOEXEC flag for a file-descriptor using fcntl http : stackoverflow.com q 6125068 507519 or with the O CLOEXEC flag for open the operating-system is instructed to close that specific file-descriptor before calling exec .", "On single-threaded applications this can be done with a call to setrlimit but with multiple threads it has no effect unless called from the main thread .", "It looks like MacOS reads limits for open files once during initialization of stdio in libc and doesn t read them again later .", "My question is whether the call to setrlimit simply works with split-stacks or in the negative case if one can call the underlying brk mmap sbrk and do it manually .", "A process is allowed to use as much resources as it needs to as long as it stays under the soft limits .", "I confirmed by print that they have been set .. . .. . Physical memory usage goes above 2.4Gb at which point CPU usage falls 5 and it hangs .", "For example I want to set limits like a program cannot exceed 100MB for 30 seconds and a program cannot use 90 or more of the CPU for more than 20 seconds .", "Even though the child processes have called exit they are still kept around by the operating-system and count toward the limit until a parent process either abandons them or calls wait .", "What about other limits", "What are the Windows equivalents to the resource limit mechanisms exposed on Unix systems by Python s resource http : docs.python.org library resource.html module and POSIX setrlimit http : linux.die.net man 2 setrlimit", "The man page states that setrlimit affects the whole process so I m kind of clueless why the threads don t seem to be affected .", "The sandbox is where setrlimit is called so why should the error be reported by a totally separate enclosing process", "I am trying to use setrlimit to limit the number of processes a program can create .", "I believe it will also depend on what else is going on on your system .", "The program does not itself monitor the file system for max-file-size .", "I know that on a typical system a program may take on 10ms at a time I do not even need it to be a millisecond precision .", "What would be the best way for me to set some limits on how much memory it s using", "Here is the code that I am using to test setRlimit on linux and osx .", "Also is there a signal I can catch when setrlimit soft or hardlimit is exceeded .", "I have a sandbox program which uses setrlimit to limit the output file size of another program run under its control which I run like so : .. . .. . The -max 2048 switch tells the sandbox to limit the output to a maximum of 2K bytes .", "According to setrlimit documentation http : man7.org linux man-pages man2 setrlimit.2.html RLIMIT NPROC is defined as : .. . .. . The maximum number of processes or more precisely on Linux threads that can be created emphasis mine for the real user ID of the calling process .", "The init process whith pid 1 is the first process in a pid namespace and there is a thing about the init process : it doesn t catch all the signals even with the sender having root capabilities among these uncaught signals is the SIGXCPU which is used by the kernel to stop a process when it uses all their allowed cpu time set by setrlimit .", "The kernel only enforces the soft limits during the operation of a process - the hard limits are checked only when a process tries to change the resource limits .", "I ve tried .. . .. . where r is a struct holding the limits .", ": - .. . .. . and also a definition for limited malloc that limits what can be done .", "These values are the default or starting values for per process limits .", "Python provides setrlimit http : docs.python.org library resource.html so you can stay in Python .", "That s what I get for reading the man page for setrlimit from an online linux reference instead of the OSX man pages.. .", "I tried using setrlimit RLIMIT STACK.. . inside my main function but that doesn t seem to have any effect .", "Second as an implementation detail glibc uses the stack limit from setrlimit ulimit to derive the stack size for threads created by pthread create .", "You can perhaps influence the size this way but it s not portable and as you ve found not reliable even there it s not working when you call setrlimit from within the process itself .", "It s possible that glibc only probes the limit once when the relevant code is first initialized so I would try moving the setrlimit call as early as possible in main to see if this helps .", "That does not mean that a specific system actually has it or that your process should use it .", "From man setrlimit .. . .. . RLIMIT NPROC The maximum number of processes or more precisely on Linux threads that can be created for the real user ID of the calling process .", "Prequisites .. . .. . POSIX.1 2008 http : pubs.opengroup.org onlinepubs 9699919799 specifies http : pubs.opengroup.org onlinepubs 9699919799 functions setrlimit.html the setrlimit and getrlimit functions .", "man getrlimit setrlimit RLIMIT NPROC The maximum number of processes or more precisely on Linux threads that can be created for the real user ID of the calling process .", "Runtime checks for something like this are prone to failure and waste CPU cycles .", "Also I need a way to collect code stats memory usage cpu-usage etc .", "If you are worried about a Java process taking over your server then I wonder if there are OS settings that would be better in controlling how many system resources are given to the process .", "But I am able to see the value of the soft and Hard limits in proc process number limits correctly set to the above said values .", "I want to be able to set limits like MAXMEM 100M : 30 meaning a program can exceed 100M for only 30 seconds and MAXCPU 90 : 20 meaning a program can run at most 20 seconds when using 90 or more of the CPU .", "Reason for closure : RLIMIT NOFILE limit of the setrlimit constrains the number of file descriptors that a process may allocate.If we want to restrict our child-process by setting this limit it depends on the already allocated file descriptors .", "I just tried it on a Red Hat 5 system and got the same numbers with and without the Hello .", "My gut feeling is that lots of things violate POSIX and a 100 POSIX compliant system is as rare as a strictly-confirming C compiler .", "The limit is indeed the number of current processes not the total number of processes created since the system started .", "intermittent I have to use the limits just to give the process boundary for the processes .", "You can set hard and soft limits per user group ." ] }
{ "confidence": [ 50.53693389892578, 50.36418151855469, 48.89658737182617, 45.61553955078125, 45.402706146240234, 44.629310607910156, 44.508670806884766, 43.876075744628906, 43.714420318603516, 41.058589935302734, 40.684715270996094, 40.525394439697266, 39.54505920410156, 37.84591293334961, 37.68942642211914, 36.904296875, 36.70529556274414, 36.32856750488281, 36.03926086425781, 35.19219970703125 ], "content": [ "Question : null .. . Answer : I am writing isolated sandbox for untrusted code so I am looking for safe way to isolate code execution . Also I need a way to collect code stats memory usage cpu-usage etc . I have tried Docker but Stats API can stream only with a second period and some code especially written in C or C++ runs 1000+ times faster . I have asked question http : stackoverflow.com questions 36722875 limiting-memory-usage-of-spawned-process about setrlimit but people in comments written that user can cancel limits may be there is a way to prevent user from doing this Also I have heard about ulimit . Is that way safe enough and can t be overwritten by user Comment : A user process can always lower a ulimit-controlled resource . ulimit-controlled resources cannot be increased except by root more or less . Comment : You set limits for a process with setrlimit the shell ulimit command really calls setrlimit when interpreted . Then all future descendant processes though fork clone will inherit those limits and the limits persist across system calls that change the program image execve and credentials setuid setgid setgroups etc . . Comment : @Paulo1205 as described in link process can increase limits by calling setrlimit again Comment : @NikitaLapkov there are two kinds of limits : soft and hard . Soft limits can be freely changed down or up by any user at any time as long as they don t exceed the corresponding hard limits . Hard limits can only be lowered and never again increased unless the user trying to perform the increase is root . Comment : To collect data check perf Don t know about Docker Stats API but it probably reports data once per second but collects data much faster .", "Question : For a process I have set a soft limit value of 335544320 and hard limit value of 1610612736 for the resource RLIMIT AS . Even after setting this value the address space of the process goes up to maximum 178MB . But I am able to see the value of the soft and Hard limits in proc process number limits correctly set to the above said values . I wanted to know whether RLIMIT AS is working in my OS and would also like to know how I can test for the RLIMIT AS feature . CentOS 5.5 64 bit is the operating-system that I am using . Some please help me with regard to this . Thank you Comment : Err.. . 335544320 320MB . Your process is quite a bit lower than that . What exactly is the problem Comment : I would like to know why the process is not raising up to the value that I have set 320MB instead of limiting itself to 178MB . I am in need to increase the size of the process in 64 bit systems . I want a process to grow to a larger size when RAM is available . Comment : @Rajath : It s up to the process how much memory to allocate as long as it doesn t go over your limit . If you want it to have larger buffers or something that will depend on exactly what you are running . Comment : could some one please let me know how OS uses this soft and hard limit values . I meant whether the process is allocated 320MB in my case while the process gets started or the OS allocates as and when memory is needed by the process . Comment : @Rajath : The soft limit is the actual resource limit and the hard limit is the maximum of what an unprivileged process can set its soft limit to . But they are both limits . That s it . It s up to your process to grow shrink whatever within those limits . .. . Answer : All setrlimit http : linux.die.net man 2 setrlimit limits are upper limits . A process is allowed to use as much resources as it needs to as long as it stays under the soft limits . From the setrlimit manual page http : linux.die.net man 2 setrlimit : .. . .. . The soft limit is the value that the kernel enforces for the corresponding resource . The hard limit acts as a ceiling for the soft limit : an unprivileged process may only set its soft limit to a value in the range from 0 up to the hard limit and irreversibly lower its hard limit . A privileged process under Linux : one with the CAP SYS RESOURCE capability may make arbitrary changes to either limit value . Practically this means that the hard limit is an upper limit for both the soft limit and itself . The kernel only enforces the soft limits during the operation of a process - the hard limits are checked only when a process tries to change the resource limits . In your case you specifiy an upper limit of 320MB for the address space and your process uses about 180MB of those - well within its resource limits . If you want your process to grow you need to do it in its code . BTW resource limits are intended to protect the system - not to tune the behaviour of individual processes . If a process runs into one of those limits it s often doubtful that it will be able to recover no matter how good your fault handling is . If you want to tune the memory usage of your process by e.g . allocating more buffers for increased performance you should do one or both of the following : .. . .. . ask the user for an appropriate value . This is in my opinion the one thing that should always be possible . The user or a system administrator should always be able to control such things overriding any and all guesswork from your application . check how much memory is available and try to guess a good amount to allocate . As a sidenote you can and should deal with 32-bit vs 64-bit at compile-time . Runtime checks for something like this are prone to failure and waste CPU cycles . Keep in mind however that the CPU bitness does not have any direct relation with the available memory : .. . .. . 32-bit systems do indeed impose a limit usually in the 1-3 GB range on the memory that a process can use . That does not mean that this much memory is actually available . 64-bit systems being relatively newer usually have more physical memory . That does not mean that a specific system actually has it or that your process should use it . For example many people have built 64-bit home file servers with 1GB of RAM to keep the cost down . And I know quite a few people that would be annoyed if a random process forced their DBMS to swap just because it only thinks of itself .", "Question : I noted that in etc security limits.conf the limits are configured on a per user basis or per group basis for example : @faculty hard nproc 50 .. . .. . I assume that it is setrlimit that does the work to set limits but setrlimit works on a process basis that is it only sets resource limits on its calling process so since it can t set limits on user how can OS honor resource limits configured in limits.conf Another question If a certain process exceeds its resource quota will it be killed If so by what signal Thank you . .. . Answer : From man setrlimit .. . .. . RLIMIT NPROC The maximum number of processes or more precisely on Linux threads that can be created for the real user ID of the calling process . Upon encountering this limit fork 2 fails with the error EAGAIN . As you can see setrlimit can set limits on the user of the calling process . So it can set limits on a user through the calling process of that user . To your second question in a few instances the kernel does not allow a process to exceed its limit in the first place . In the above example fork itself fails rather than killing the calling process after allocating more resources . In some instances for example in CPU usage when the process exceeds its SOFT LIMIT a SIGXCPU is sent . And when it exceeds its HARD LIMIT SIGKILL is sent Comment : What about other limits e.g . cpu memory AS or so how can OS enforce these Or does OS collect the memory usage of all the processes belonging to certain user", "Question : I m using a library which creates a pthread using the default stack size of 8MB . Is it possible to programatically reduce the stack size of the thread the library creates I tried using setrlimit RLIMIT STACK.. . inside my main function but that doesn t seem to have any effect . ulimit -s seems to do the job but I don t want to set the stack size before my program is executed . Any ideas what I can do Thanks .. . .. . Update 1 : Seems like I m going to give up on being able to set the stack size using setrlimit RLIMIT STACK .. . . I checked the resident memory and found it s a lot less than the virtual-memory . That s a good enough reason for me to give up on trying to limit the stack size . Comment : What was your setrlimit call and what was the return-value Comment : Is it pthreads library if so you could use pthread attr setstacksize . Comment : @BlueMoon I can t use pthread attr setstacksize because the pthread is created in the library I m using . @mafso setrlimit returned 0 . BTW I set rlim cur and rlim max to 1MB but it s as-if the created thread is still using a stack size of 8MB . Comment : I see . So it s a wrapper to pthreads or some other library . Why doesn t it provide an interface to set the attributes for threads Btw what are you trying to achieve by reducing stack size Are you setting setrlimit before the threads were created Comment : Can t answer why an option to set the thread attributes wasn t provided . I m just trying to reduce overall memory usage especially since I m running on a system with 64MB of memory and no swap . Yes I m setting rlimit before the threads were created . setrlimit is one of the first things I do in main .. . Answer : There are a couple aspects to answering this question . First as stated in the comments pthread attr setstacksize is The Right Way to do this . If the library calling pthread create doesn t have a way to let you do this fixing the library would be the ideal solution . If the thread is purely internal to the library not calling code from the calling application it really should set its own preference for the stack size based on something like PTHREAD STACK MIN + ITS OWN NEEDS . If it s calling back to your code it should let you request how much stack space you need . Second as an implementation detail glibc uses the stack limit from setrlimit ulimit to derive the stack size for threads created by pthread create . You can perhaps influence the size this way but it s not portable and as you ve found not reliable even there it s not working when you call setrlimit from within the process itself . It s possible that glibc only probes the limit once when the relevant code is first initialized so I would try moving the setrlimit call as early as possible in main to see if this helps . Finally the stack size for threads may not even be relevant to your application . Even if the stack size is 8MB only the pages which have actually been modified probably 4k or at most 8k unless you have big arrays on the stack are actually using physical memory . The rest is just tying up virtual-address-space of which you always have at least 2-3 GB and possibly commit charge . By default Linux enables overcommit so commit charge will not be strictly enforced and therefore the fact that glibc is requesting too much may not even matter . You could make the overcommit checking even less strict by writing a 1 to proc sys vm overcommit memory but this will cause you to loose information about when you re running out-of-memory and make your program crash instead . On such a constrained system you may prefer even stricter overcommit accounting but then you have to fix the thread stack size problem.. .", "Question : I m using a library which creates a pthread using the default stack size of 8MB . Is it possible to programatically reduce the stack size of the thread the library creates I tried using setrlimit RLIMIT STACK.. . inside my main function but that doesn t seem to have any effect . ulimit -s seems to do the job but I don t want to set the stack size before my program is executed . Any ideas what I can do Thanks .. . .. . Update 1 : Seems like I m going to give up on being able to set the stack size using setrlimit RLIMIT STACK .. . . I checked the resident memory and found it s a lot less than the virtual-memory . That s a good enough reason for me to give up on trying to limit the stack size . Comment : What was your setrlimit call and what was the return-value Comment : Is it pthreads library if so you could use pthread attr setstacksize . Comment : @BlueMoon I can t use pthread attr setstacksize because the pthread is created in the library I m using . @mafso setrlimit returned 0 . BTW I set rlim cur and rlim max to 1MB but it s as-if the created thread is still using a stack size of 8MB . Comment : I see . So it s a wrapper to pthreads or some other library . Why doesn t it provide an interface to set the attributes for threads Btw what are you trying to achieve by reducing stack size Are you setting setrlimit before the threads were created Comment : Can t answer why an option to set the thread attributes wasn t provided . I m just trying to reduce overall memory usage especially since I m running on a system with 64MB of memory and no swap . Yes I m setting rlimit before the threads were created . setrlimit is one of the first things I do in main .. . Answer : I think you are out of luck . If the library you are using does not provide a way to set the stack limit then you can t change it after the thread has been created . setrlimit and shell limits effects the main thread s stack . Threads are created within the processes memory space so their stacks are allocated when the threads are created . On Unix I believe the stack will be mapped to RAM on demand so you may not actually use 8 Megs of RAM if you don t need it virtual vs resident memory .", "Question : As the title suggests i need to know if there is some way to have less then second precision with the setrlimit RLIMIT CPU I know that on a typical system a program may take on 10ms at a time I do not even need it to be a millisecond precision . 100ms will do just fine . So I am curious could it be something like this : .. . .. . I do not see the relevance in explaining the reason why I need this and how I use it . If it s needed I ll edit the question and the information . Thanks in advance .. . .. . Ex .. . Answer : POSIX only allows for second precision in setrlimit . There might be operating specific extensions that you can use but I m not aware of any operating-system with that . RLIMIT CPU is a left over from the days of multi user systems at universities where you needed to limit the damage student could do with their attempts to learn programming . As such it s rarely polished debugged and improved in modern systems . From experience I know that accounting for CPU time and the enforcement of RLIMIT CPU is horribly limited on different systems and you might not even get a SIGXCPU for a process after twice as much time as you ve limited it to if you use short timeouts . So whatever problem you re solving you probably want to rethink what you want to accomplish and do it differently . If you really need to kill a process that has spent too much CPU time with millisecond precision the best you can do is to have a supervising process that probes the child-process with getrusage RUSAGE CHILDREN often enough and shoots it . But beware that the counters you get from getrusage are often probabilistic sampled by a clock interrupt and the reported CPU usage can be very far off from the real CPU usage especially in the early stages of running a process those counters may or may not be the same as the ones used for RLIMIT CPU . Comment : Thank you so much for explaining that RLIMIT CPU is a left-over . getrusage seams to give some flickering results . The time before i kill a sub-proccess in the interval 250ms - 2500ms . I will start playing around with setitimer for the moment as it s my best hope for killing the sub-proccess in time . Or do you have any better idea for time-measuring like setitimer with ITIMER REALPROF", "Question : I want to set limits for how long programs spawned by execv can use a certain amount of memory and a certain amount of CPU time . For example I want to set limits like a program cannot exceed 100MB for 30 seconds and a program cannot use 90 or more of the CPU for more than 20 seconds . .. . Answer : No . You will need to run some sort of supervisor around the code either as a program that will fork exec or as an injected library that will intercept libc system calls . Comment : You mean like a function that keeps checking the status of child processes Comment : Something like that yes . Comment : That seems to waste CPU resources . Is there a better way than to have it keep checking Comment : Don t keep checking per se . Check every time a call is made but no more than say once every 5 seconds .", "Question : null .. . Answer : I m trying to use setrlimit to limit cpu resources of a process that is cloned using CLONE NEWPID flag which in result puts it a new linux pid namespace . the problem is it doesn t work as expected but works great with CLONE NEWPID removed as a flag . my question is why the example code is as follows : .. . .. . EDIT .. . .. . Actually I ve found out why it doesn t work that way . The init process whith pid 1 is the first process in a pid namespace and there is a thing about the init process : it doesn t catch all the signals even with the sender having root capabilities among these uncaught signals is the SIGXCPU which is used by the kernel to stop a process when it uses all their allowed cpu time set by setrlimit . the solution is to set the limits on child of that process by forking a second time .", "Question : I noted that in etc security limits.conf the limits are configured on a per user basis or per group basis for example : @faculty hard nproc 50 .. . .. . I assume that it is setrlimit that does the work to set limits but setrlimit works on a process basis that is it only sets resource limits on its calling process so since it can t set limits on user how can OS honor resource limits configured in limits.conf Another question If a certain process exceeds its resource quota will it be killed If so by what signal Thank you . .. . Answer : You can set hard and soft limits per user group . To be able to change its own hard limit the process needs to be privileged root . What happens when process attempts to exceed its soft limit depends on the resourse : .. . .. . 1 . data limit - malloc and new would fail .. . 2 . open files - creation of file-descriptor failes open creat socket accept etc . 3 . core - core-file would be truncated .. . 4 . file size - SIGXFSZ is delivered to offending thread . 5 . stack - SIGSEGV delivered to offending thread .. . 6 . etc . Look on setrlimit manpage http : linux.die.net man 2 setrlimit for more information . In limits.conf you assign limits per process for a specified user group . So if you set 10MiB stack limit for user X it means that each and every process executed with user X credentials has 10MB stack limit set . It is not a limit that describes a sum of resources for all processes owned by user X Comment : : thanks for your replay maybe I need state my question more clearly . e.g . I have a user A and I want to set his her rss limit to 100k but you know setrlimit can only set limit on process so if user A forks 3 processes each calling setrlimit to set its rss limit to 100K but since user A has 3 processes his her rss consumption is 300k well exceeding the limit I posed on this user . So I wonder how OS guarantee that user can t consume more resources as indicated in limits.conf Comment : Ok maybe I should be more precise too : In limits.conf you assign limits per process for a specified user group . So if you set 10MB stack limit for user X it means that each and every process executed with user X credentials has 10MB stack limit set . Comment : Oh well I misinterpret it thank you . Comment : @sirgeorge Any citation for the per-process limit even in limits.conf . Someone the docs I ve stumbled into aren t specific about this Comment : @Pavan Manjunath : It is difficult to find it written explicitely but since all limits are per process you can figure it out or check it yourself . These values are the default or starting values for per process limits . The closest citation still not perfect is here : ss64.com bash limits.conf.html http : ss64.com bash limits.conf.html : The values specified with this token can be thought of as default values for normal system usage .", "Question : I m trying to use setrlimit http : linux.die.net man 2 setrlimit to cap the amount of time a process takes . However it doesn t seem to work when I do certain operations like printf . Here is a test program illustrating the problem : .. . .. . However if I replace the for-loop with a different routine like naive fibonacci : .. . .. . It works perfectly . What s going on here Is setrlimit simply unreliable Comment : That code doesn t even compile Let me fix that for you . Comment : @paxdiablo : Ah thanks I did some on the fly editing : .. . Answer : The CPU limit is a limit on CPU seconds rather than elapsed time . CPU seconds is basically how many seconds the CPU has been in use and does not necessarily directly relate to the elapsed time . When you do the fib call you hammer the CPU so that elapsed and CPU time are close most of the process time is spent using the CPU . That s not the case-when printing since most time there is spent in I O . So what s happening in your particular case is that the rlimit is set but you re just not using your three seconds of CPU time before the process finishes . Changing the main as follows causes the signal to be delivered on my system : .. . .. . When you time that under Linux you see : .. . .. . In that case it took almost 20 seconds of elapsed time but the CPU was in use for only 3.36 seconds user + sys . Comment : The rest of the time was probably spent blocked waiting for your ultra-slow GNOME libvte whatever-based terminal to finish redrawing and read from the pty master device again.. . : - Comment : So how do you limit elapsed time Comment : @Dustin you start up the process with another process which then monitors wall time and if it s exceeded kills off the one you re trying to limit .", "Question : I m using a Python library SimpleParse http : simpleparse.sourceforge.net that I seem to be causing some runaway recursion with it . It s already crashed my computer once when I was just trying to debug it . What would be the best way for me to set some limits on how much memory it s using I was thinking I would write up a quick C program with setrlimit http : linux.die.net man 2 setrlimit to call Python and test it from there . .. . Answer : Setting the recursion limit here is unlikely a reasonable solution . If the library has a bug please report or fix it . If your code has an error please fix it . SimpleParse is not widely used...you may look into other parser options . Since you did not explain what your real problem is that you are trying to solve there is little recommendation we can give on alternative tools .", "Question : I m taking a look at the implementation of the Android exploit Rage Against The Cage . The idea behind it is that it creates as many processes as necessary to reach RLIMIT NPROC for the shell UID so that the next time the Android Debug Bridge ADB daemon tried to drop its privileges from root to shell the call to setuid fails and it continues executing as root that bug has been fixed by checking the result-of the setuid call before proceeding . According to setrlimit documentation http : man7.org linux man-pages man2 setrlimit.2.html RLIMIT NPROC is defined as : .. . .. . The maximum number of processes or more precisely on Linux threads that can be created emphasis mine for the real user ID of the calling process . Upon encountering this limit fork 2 fails with the error EAGAIN . This limit is not enforced for processes that have either the CAP SYS ADMIN or the CAP SYS RESOURCE capability . Moreover this is how the exploit was implemented : .. . .. . So RLIMIT NPROC is defined as the maximum number of processes that can be created created not execute at the same time and the implementation seconds that definition by terminating every child-process created by the second fork . First of all I can t understand how limiting the number of process created per UID could possibly work we d have to restart our machines from time to time to reset that count wouldn t we . Second even the guy who reverse engineered http : pastebin.com fXsGij3N the exploit obtaining an implementation equivalent to the one shown above defines the RLIMIT NPROC differently : .. . .. . It the exploit takes advantage of RLIMIT NPROC max which is a value that defines how many processes a given UID can have running . That said how RLIMIT NPROC actually works Which definition is more precise .. . Answer : The limit is indeed the number of current processes not the total number of processes created since the system started . The key to how the exploit code worked is zombie processes . Even though the child processes have called exit they are still kept around by the operating-system and count toward the limit until a parent process either abandons them or calls wait . In this case the parent does not do this so they hang around until the parent itself exits .", "Question : null .. . Answer : I am trying to modify some JNI code to limit the amount of memory that a process can consume . Here is the code that I am using to test setRlimit on linux and osx . In linux it works as expected and the buf is null . This code sets the limit to 32 MB and then tries to malloc a 64 MB buffer if buffer is null then setrlimit works . On linux machine this is my result .. . .. . On osx 10.8 .. . .. . My question is that if this does not work on osx is there a way to acomplish this task in darwin kernel . The man pages all seem to say it will work but it does not appear to do so . I have seen that launchctl has some support for limiting memory but my goal is to add this ability in code . I tried using ulimit also but this did not work either and am pretty sure ulimit uses setrlimit to set limits . Also is there a signal I can catch when setrlimit soft or hardlimit is exceeded . I haven t been able to find one . Bonus points if it can be accomplished in windows also . Thanks for any advice .. . .. . Update .. . As pointed out the RLIMIT AS is explicitly defined in the man page but is defined as the RLIMIT RSS so if referring to the documentation RLIMIT RSS and RLIMIT AS are interchangable on OSX . usr include sys resource.h on osx 10.8 .. . .. . Tested trojanfoe s excellent suggestion to use RLIMIT DATA which is described here .. . .. . The result was the same for linux and osx and that was the malloc was successful for both . Comment : I don t see anything about RLIMIT AS in the setrlimit 2 manpage : developer.apple.com library ios documentation system http : developer.apple.com library ios documentation system conceptual manpages iphoneos man2 setrlimit.2.html How about using RLIMIT DATA instead Comment : Thank you for the comment I actually meant to add that to the question . Thank you it is defined in sys resource.h as RLIMIT RSS . I will update the comment accordingly Comment : @trojanfoe I tried using RLIMIT DATA on linux and osx and both times the result was the same that the malloc was successful Comment : possible duplicate of How to limit memory of a OS X program ulimit -v neither -m are working http : stackoverflow.com questions 3274385 how-to-limit-memory-of-a-os-x-program-ulimit-v-neither-m-are-working", "Question : Following this SO question http : stackoverflow.com q 3166783 1393890 and this answer http : stackoverflow.com a 3214064 1393890 in particular it seems that calling setrlimit after a printf make it not working . Here is the example code : .. . .. . Here is the console output : .. . .. . If I comment the first printf here is the console output : .. . .. . Is there any reason for that Edit I am running MAc OS X 10.7.5 with Xcode 4.6.2 . Comment : 1 . Your code doesn t match the output . 2 . I just tried it on a Red Hat 5 system and got the same numbers with and without the Hello . I believe it will also depend on what else is going on on your system . Comment : This is the exact code I am using . I am on Mac OS 10.7 with Xcode 4.6.2 maybe that s why . Comment : Really The exact code you are using contains printf after.. . but prints limit .. . Your printf implementation is seriously broken Comment : sorry I did not see this typo thanks for pointing it to me . but this does not change anything to the problem . Comment : Well it does matter . You should always post output from the exact code you are posting . How are people supposed to guess the differences between the code you posted and the code you ran But anyway are these results repeatedly reproducible I have a feeling your results depend on how many files are open in other programs on the system . I m hoping someone who knows for sure will chime in here just trying to push for more helpful information since no one else is saying anything . .. . Answer : Here s a better version of the program that demonstrates more facets of the problem . If you run this program with the if 1 changed to if 0 it works as expected . It looks like MacOS reads limits for open files once during initialization of stdio in libc and doesn t read them again later . Your first call to printf initializes stdio in libc and that caches whatever the rlimit value was for number of open files . Running dtruss on a trivial hello world shows : .. . .. . Which shows that this is in fact what happens . This is something that you should take up with Apple though it smells like a bug .", "Question : I m using a Python library SimpleParse http : simpleparse.sourceforge.net that I seem to be causing some runaway recursion with it . It s already crashed my computer once when I was just trying to debug it . What would be the best way for me to set some limits on how much memory it s using I was thinking I would write up a quick C program with setrlimit http : linux.die.net man 2 setrlimit to call Python and test it from there . .. . Answer : Python provides setrlimit http : docs.python.org library resource.html so you can stay in Python . Unless you re happier in C : .. . .. . Note that the Linux kernel hasn t supported the RSS accounting in a long time the address space accounting is probably your best bet but it might be overly restrictive . If the program mmap 2 s a few gigabytes but never bothers reading or writing it it won t really matter the rlimits might forbid the mmap 2 rather than forbid actually using the memory . Comment : Ah I didn t even realize that . This might do the trick .", "Question : I m thinking of developing my own work-stealing scheduler and one of the issues that needs to be solved is the possibility of stack overflows . These occur only on infrequent cases where one worker continuously steals tasks from the others e.g . : .. . .. . Several techniques can be used to avoid this pattern however simply increasing stack space is probably the best option as it allows for other optimizations . On single-threaded applications this can be done with a call to setrlimit but with multiple threads it has no effect unless called from the main thread . This behavior is possibly related to stacks having a fixed size across multiple threads . However with split-stacks implemented on GCC 4.6.0+ this restriction is no longer true . My question is whether the call to setrlimit simply works with split-stacks or in the negative case if one can call the underlying brk mmap sbrk and do it manually . .. . Answer : In a hackish way I guess I could use pthread attr setstacksize pthread create pthread-join to create a new thread and do all the the work inside it this however as the unnecessary overhead of thread creation scheduling .", "Question : Prequisites .. . .. . POSIX.1 2008 http : pubs.opengroup.org onlinepubs 9699919799 specifies http : pubs.opengroup.org onlinepubs 9699919799 functions setrlimit.html the setrlimit and getrlimit functions . Various constants are provided for the resource argument some of which are reproduced below for easier understaning of my question . The following resources are defined : .. . .. . .. . .. . .. . RLIMIT DATA .. . .. . This is the maximum size of a data segment of the process in bytes . If this limit is exceeded the malloc function shall fail with errno set to ENOMEM . .. . .. . .. . .. . RLIMIT STACK .. . .. . This is the maximum size of the initial thread s stack in bytes . The implementation does not automatically grow the stack beyond this limit . If this limit is exceeded SIGSEGV shall be generated for the thread . If the thread is blocking SIGSEGV or the process is ignoring or catching SIGSEGV and has not made arrangements to use an alternate stack the disposition of SIGSEGV shall be set to SIG DFL before it is generated . .. . RLIMIT AS .. . .. . This is the maximum size of total available memory of the process in bytes . If this limit is exceeded the malloc and mmap functions shall fail with errno set to ENOMEM . In addition the automatic stack growth fails with the effects outlined above . Furthermore POSIX.1 2008 defines http : pubs.opengroup.org onlinepubs 9699919799 basedefs V1 chap03.html tag 03 125 data segment like this : .. . .. . 3.125 Data Segment .. . .. . Memory associated with a process that can contain dynamically allocated data . I understand that the RLMIT DATA resource was traditionally used to denote the maximum amount of memory that can be assigned to a process with the brk function . Recent editions of POSIX.1 do no longer specify this function and many operating systems e.g . Mac OS X do not support this function as a system call . Instead it is emulated with a variant of mmap which is not part of POSIX.1 2008 . Questions .. . .. . I am a little bit confused about the semantic and use of the RLIMIT DATA resource . Here are the concrete questions I have : .. . .. . Can the stack be part of the data segment according to this specification The standard says about RLIMIT DATA : If this limit is exceeded the malloc function shall fail with errno set to ENOMEM . Does this mean that memory allocated with malloc must be part of the data segment On Linux memory allocated with mmap does not count towards the data segment . Only memory allocated with brk or sbrk is part of the data segment . Recent versions of the glibc use a malloc implementation that allocates all its memory with mmap . The value of RLIMIT DATA thus has no effect on the amount of memory you can allocate with this implementation of malloc . Is this a violation of POSIX.1 2008 Do other platforms exhibit similar behavior The standard says about RLIMIT AS : If this limit is exceeded the malloc and mmap functions shall fail with errno set to ENOMEM . As the failure of mmap is not specified for RLIMIT DATA I conclude that memory obtained from mmap does not count towards the data segment . Is this assumption true Does this only apply to non-POSIX variants of mmap .. . Answer : FreeBSD also shares the problem of malloc 3 being implemented using mmap 2 in the default malloc implementation . I ran into this when porting a product from FreeBSD 6 to 7 where the switch happened . We switched the default limit for each process from RLIMIT DATA 512M to RLIMIT VMEM 512M i.e . limit the virtual-memory allocation to 512MB . As for whether this violates POSIX I don t know . My gut feeling is that lots of things violate POSIX and a 100 POSIX compliant system is as rare as a strictly-confirming C compiler . EDIT : heh and now I see that FreeBSD s name RLIMIT VMEM is non-standard they define RLIMIT AS as RLIMIT VMEM for POSIX compatibility . Comment : That s sad to hear . Notice that RLIMIT VMEM will also affect mmap -ed files that don t consume RAM . On a 64-bit machine you could mmap a multiple-terabyte file without issues and it wouldn t even consume much RAM especially if the file is sparse . So there s no method today to effectively limit the amount of real memory a process consumes.. .", "Question : I have a sandbox program which uses setrlimit to limit the output file size of another program run under its control which I run like so : .. . .. . The -max 2048 switch tells the sandbox to limit the output to a maximum of 2K bytes . If an exception occurs inside myprogram.exe or if I deliberately write something to stderr from inside myprogram.exe it appears in r2 as expected . However when the file size limit is exceeded I get this error message : .. . .. . but instead of being written to the error-log r2 as expected it comes out on the console . Can anyone tell me why this is happening Is there any way I can arrange for this message to be written to r2 along with everything else .. . Answer : It looks like an error that would be reported by the shell not the program . The shell s stdout stderr aren t being redirected anywhere . Comment : Why the shell The sandbox is where setrlimit is called so why should the error be reported by a totally separate enclosing process I have meanwhile tried using parentheses and other devices to run my sandbox in a separate process and redirecting stderr in the enclosing process no effect . Comment : I have finally succeeded in grabbing the error by putting the sandbox command in a file x and running . x r1 2 r2 but I m getting confused which process is which . Case 1 : sandbox foo 2 r2 : the shell starts a process to run sandbox with stderr redirected to r2 then sandbox starts a process to run foo . Case 2 : the shell starts a process to execute . x with stderr redirected to r2 then . x starts a process to run the sandbox which starts a process to run foo . Using sandbox foo 2 r2 doesn t work neither does bash -c sandbox foo 2 r2 . Comment : OK sorry the above should say sandbox execs foo . No subprocess involved . Comment : When you redirect stdout stderr you are affecting output that the program itself creates in the programming of that program . The program does not itself monitor the file system for max-file-size . It depends on the operating-system to do that . So the program itself is not going to either notice the problem nor report it . The operating-system is going to see the problem and notify the shell to do something about it . The shell is going to abort your program and explain why with an error message . Comment : Thanks I marked this as answering the question . I m still slightly puzzled if I do sandbox foo 2 r2 the command sandbox foo should be run by a subshell and the subshell s stderr should be redirected which should include the file size error . Instead I see exactly the same behaviour . Ditto using bash -c . Any explanation", "Question : I am currently working on a pipeline which loads and transforms multiple images at once . As this is happening to many images at the same time 1440 the memory-footprint is quite heavy . I therefore tried to implement a memory-management system based on setrlimit however it doesn t seem to affect the spawned threads std : : thread as they will happily ignore the limit - I know this because of calls to getrlimit in the threaded functions - and eventually cause my program to be killed . Here is the code I use for setting the limit : .. . .. . I m using Linux . The man page states that setrlimit affects the whole process so I m kind of clueless why the threads don t seem to be affected . Edit : By the way the function above is called at the very beginning of main . Comment : Aside from the actual question why do you think this is the right solution Surely the right solution is to not start as many threads or load as many images at once or whatever you need to do to limit your memory usage Assuming setrlimit actually worked what will happen is that your process either gets killed or can t allocate memory somewhere random which is clearly a pretty awful way to deal with the issue.. . Comment : I do check the available memory before loading . If there is no memory left loading halts - at least in theory . My problem is that the existing limit is ignored by the threads and I don t know why or how to work around it . Comment : Please show a minimal buildable example that demonstrates the problem . Comment : Not reproducible here see live demo http : coliru.stacked-crooked.com a aec50f8f68a66065 . Comment : The code posted here seems to work just fine . Are you perhaps getting the actual memory limit wrong My code : gist.github.com Leporacanthicus 11086960 https : gist.github.com Leporacanthicus 11086960 .. . Answer : The problem was quite hard to find as it consisted of two entirely independent components : .. . .. . 1 . My executable was compiled with -fomit-frame-pointer . This will result in a reset of the limit . See the following example : .. . .. . rlimit.cpp .. . include iostream .. . include thread .. . include vector .. . .. . include sys resource.h .. . .. . class A .. . .. . public : .. . void foo .. . .. . struct rlimit limit .. . getrlimit RLIMIT AS limit .. . std : : cout Limit : limit.rlim cur std : : endl .. . .. . .. . .. . int main .. . .. . struct rlimit limit .. . limit.rlim cur 500 1024 1024 .. . setrlimit RLIMIT AS limit .. . std : : cout Limit : limit.rlim cur std : : endl .. . .. . std : : vector std : : thread t .. . .. . for int i 0 i 5 i++ .. . .. . A a .. . t.push back std : : thread A : : foo a .. . .. . .. . for auto thread : t .. . thread.join .. . .. . return 0 .. . .. . .. . .. . Outputs : .. . .. . g++ -std c++11 -pthread -fomit-frame-pointer rlimit.cpp -o limit .. . . limit .. . Limit : 524288000 .. . Limit : 18446744073709551615 .. . Limit : 18446744073709551615 .. . Limit : 18446744073709551615 .. . Limit : 18446744073709551615 .. . Limit : 18446744073709551615 .. . .. . g++ -std c++11 -pthread rlimit.cpp -o limit .. . . limit .. . Limit : 524288000 .. . Limit : 524288000 .. . Limit : 524288000 .. . Limit : 524288000 .. . Limit : 524288000 .. . Limit : 524288000 .. . .. . .. . 2 . For the image-processing part I work with OpenCL . Apparently NVIDIA s implementation calls setrlimit and pushes the limit to rlim max .", "Question : I noted that in etc security limits.conf the limits are configured on a per user basis or per group basis for example : @faculty hard nproc 50 .. . .. . I assume that it is setrlimit that does the work to set limits but setrlimit works on a process basis that is it only sets resource limits on its calling process so since it can t set limits on user how can OS honor resource limits configured in limits.conf Another question If a certain process exceeds its resource quota will it be killed If so by what signal Thank you . .. . Answer : As already answered the OS honors user limits per process not per user . Should you want the limits to apply to all processes belonging to a user you can use control cgroups : .. . .. . http : en.wikipedia.org wiki Cgroups Comment : good advice this remind me that I ve just attended a lecture about cgroup IBM s load leveller has been built on cgroup to enforce user resource control . Comment : Here is also an article about cgroups : oracle.com technetwork articles servers-storage-admin http : www.oracle.com technetwork articles servers-storage-admin resource-controllers-linux-1506602.html" ] }
[ "yes-answer-long", "yes-answer-short" ]
posix
UNK_RELATION
page-jump@scroll@61
page-jump -- a page-jump refers to the sudden change in the @placeholder position of the document that s loaded in a browser .
{ "confidence": [ 47.862457275390625, 44.526119232177734, 43.75249481201172, 43.75249481201172, 43.51683044433594, 42.349708557128906, 42.132911682128906, 42.12314224243164, 41.743072509765625, 41.126686096191406, 40.456336975097656, 38.95849609375, 38.44691467285156, 37.73241424560547, 37.6930046081543, 37.273780822753906, 36.110595703125, 36.01642990112305, 36.01642990112305, 35.22037887573242, 35.06746292114258, 35.06746292114258, 35.06746292114258, 34.975685119628906, 34.975685119628906, 34.971336364746094, 34.00700759887695, 34.00700759887695, 34.00700759887695, 34.00700759887695, 33.593666076660156, 33.39088821411133, 33.299110412597656, 33.299110412597656, 33.294761657714844, 32.95580291748047, 32.95580291748047, 32.95580291748047, 32.95580291748047, 32.95580291748047, 32.40875244140625, 32.150543212890625, 31.932193756103516, 31.83881187438965, 31.83881187438965, 31.631364822387695, 31.381465911865234, 31.381465911865234, 31.27922821044922, 31.27922821044922, 31.27922821044922, 31.27922821044922, 31.159404754638672, 30.750934600830078, 30.255619049072266, 30.162235260009766, 30.111408233642578, 30.111408233642578, 30.111408233642578, 30.111408233642578, 30.111408233642578, 30.111408233642578, 29.269805908203125, 29.269805908203125, 28.984752655029297, 28.627880096435547, 28.434831619262695, 28.434831619262695, 28.434831619262695, 28.434831619262695, 28.434831619262695, 28.434831619262695, 28.40081787109375, 28.40081787109375, 28.370576858520508, 28.370576858520508, 28.246196746826172, 27.552173614501953, 27.443695068359375, 27.443695068359375, 27.308176040649414, 27.15705108642578, 27.071496963500977, 27.029335021972656, 26.956933975219727, 26.956933975219727, 26.956933975219727, 26.956933975219727, 26.956933975219727, 26.951303482055664, 26.951303482055664, 26.694000244140625, 26.694000244140625, 26.425411224365234, 26.425411224365234, 26.425411224365234, 26.42078399658203, 26.42078399658203, 26.406023025512695, 26.406023025512695 ], "content": [ "Is there a way to have it jump to the top of the page", "But when the page-jump event is executed my page will not load properly and most content above the called is not loaded .", "how to stop page-jump im my website", "Thing is it makes my page literally jump to the top .", "When clicking on the a href parents Jump to parents question a link this will jump to item on page and fire the next anchor with the opener class .", "Is there any way to put something in the HTML CSS that will signal to the browser that it needs to jump to a new page at that point", "I dropped provided logic into a page and did not see a jump .", "I can always assign the class pagebreak only to the H1 s that should make the page-jump .", "However when clicking the page will jump to the top .", "Meaning I want a div or a href link-to jump to a url in the same page say a href http : www.mydomain.ask.html Ask a .. . .. . I know for sure that jumping from an anchor such as a href jump jump a to a div such as div id jump jump to point div works fine .", "I am creating a website with navigation that causes a page-jump .", "The default behavior of the iFrame causes a page-jump to the top of the document when links inside are interacted with .", "I am trying to link the value of the two drop boxes to a page-jump .", "I think the issue is that I am linking it from another page the jump to the top is happening on the loading of the page when I put this in it made no change .", "the difference here is i dont have one constant jump to point but the bottom of any page the user is currently using .", "Could you please help me stop the page-jump so the page does not move when a button link is clicked", "Why does it jump to the span", "The page will jump down to the span you just clicked and scroll back a little due to the div s height .", "Here is a copy of my navigation : .. . .. . How can I fix the code so that the items above the page-jump are visible", "In my jQuery code I m also using e.preventDefault that helps avoiding the jump to the top of the page but even using it the page always jumps to some part of the page above the sublinks .", "A jump instruction moves the instruction pointer to a new location .", "The E9 opcode is a relative jump with a 32-bit offset .", "For some unknown reason the jump link is not working correctly .", "I m trying to high jack an anchor link with tag .. . .. . The desired result is to page-jump to the anchor with the hash name reference and open the accordion to that item .", "I have created a password filling form and i am trying to make it jump to another page after you fill it correctly .", "I m trying to make an HTML button on the top of the page above a table add a new table entry and jump to the bottom of the page at the same time so that the new entry is visible .", "Re : their solution does any one have any ideas about how to get the page to jump to this question answer", "Problem .. . .. . I expected the window.scrollTo 0 0 would work to make the page-jump to the top .", "I m trying to jump from a url like to a bootstrap tab on another page but keep pulling blank .", "http : jsfiddle.net nitd24 kyyupk3z .. . .. . just give the div that you want your page to jump to as a combination of the values of both the dropdowns .", "the page jumps very fast to the top of the page and then back to the previous position .", "If all issues detected are warnings the cursor won t jump .", "I ve checked out the other page-jump questions here on SO and I haven t found anything that matches so here we go.. .", "Part of the navigation contains a jump-to-section nav that takes the user to a section on the page that correlates with the link in the nav you know how this works .", "I spotted this extra line in your click function : .. . .. . This is the cause of the jump you re adding the hash to the URL of the page so the page will automatically scroll to that anchor in this case it will scroll to the element that was clicked since you re appending its id .", "i have no clue why it doesn t jump further down. .", "A relative jump jumps to an address specified relative to the current instruction pointer .", "Note that there are different jump opcodes for jumps with differently sized offsets .", "The address is relative to the end of the jump instruction hence the SizeOf NewCode adjustment .", "How can I get the link-to jump to a div id", "This jump only occurs when I add a new tab - if I click between the different tabs later it does not jump at all .", "Heh I thought I added the hash change after I noticed the jump .", "The button already adds the new entry like this .. . .. . onclick addrange .. . .. . What can I add to the button to make it jump to the bottom of the page in addition to the new entry all in one press", "I tried using what was demonstrated in this : jQuery : jump to next section http : stackoverflow.com questions 7906001 jquery-jump-to-next-section .. . .. . I saved the Javascript into it s own file named jump.js .", "I was trying to make a div jump from a href FAQ FAQ a to a div id and could success easily but since I have a fixed link-to jump to I can t seem to find a way how to do that .", "http : stackoverflow.com questions 7600454 how-to-prevent-page-scrolling-when-scrolling-a-div-element .. . .. . How to go to anchor tag in scrollable div without having the whole browser jump down", "Your example doesn t jump to the top in chrome .", "This did not resolve jump issue for me : thnx", "From the syntastic s docs : .. . .. . When set to 0 the cursor won t jump automatically .", "It could even jump to the top of the submenu but not much above it as it s doing", "Yep when animation happens the jump is triggered again But hey it s working", "Does it jump as soon as the link is clicked or after the fadeIn is finished", "Is there a way to change that menu button name contact me to scroll down to the end of the page in use no matter what that page is", "The only time I noticed a jump problem was when my browser was less than the height of your widget and the widget got pushed off the screen .", "In my opinion the switching content can t be to blame because there never is only one div that has display : none and if that was the case the page should jump to the top instead of jumping to the span right", "JQuery UI Tabs Causing Screen to Jump http : stackoverflow.com questions 243794 jquery-ui-tabs-causing-screen-to-jump .. . Stop jquery TABS from jumping scrolling up when clicked on", "Now I thought that instead of creating different subpages it d be better to be able to jump down to the relevant content .", "E9 is a 32-bit relative jump instruction - JMP in assembler language http : en.wikipedia.org wiki JMP x86 instruction", "however I want only a jump from target div to test one way", "I have been looking for a simple way to jump via link-to a certain part of the screen similar to the a href linkname in HTML .", "As I said when I click on jump to top the URL changes but nothing happens .", "The jump link in WP just works by adding an href definition then adding another element with the name of the href .", "The problem is a Horizontal Jump caused by no scroll bar being displayed in some browsers .", "I wish to jump to the selected hash whenever my URL contains a .", "It won t show up on the page but will break up the page when printing .", "that s my code for one part of the menu here s the scrollbox with images : .. . .. . So as you can see I would like clicking on the menu link section 1 cause to jump down the scrollbox to the desired image location without changing the page itself .", "let g : syntastic auto jump 0 When set to 1 the cursor will always jump to the first issue detected regardless of type .", "let g : syntastic auto jump 1 When set to 2 the cursor will jump to the first issue detected but only if this issue is an error .", "let g : syntastic auto jump 2 When set to 3 the cursor will jump to the first error detected if any .", "I created a workaround by using IDs for the hash that don t exist so it can t jump .", "This allows me to open tabs without the jump occurring.. . but it doesn t seem a very elegant solution .", "I have created a website which allows the user to jump to a chapter from the Table of Contents .", "I put that line in to ensure that the page is scrolled all the way up when changing pages Otherwise if you were in the middle of the page and clicked a menu icon the new page would display in the middle of the page .", "for the top of the page i have : .. . .. . for bottom of the page : .. . .. . this is working except for the bottom part which will link-to the next page 2 or 3 in correct way but it stays on bottom of the page .", "http : www.dscottclarkphoto.com portfolio adventure adventure.html .. . .. . I would like to be able to include arrows that when clicked jump the viewer to the next photograph .", "A friend and I wrote this javascript function : .. . .. . And the menu icons are coded like this : .. . .. . It works great except if trying to jump to a particular div id .", "I would vote up but don t have enough reputation points yet Does any one have any ideas about how to get the page to jump to this question answer", "The page is a closed page .", "Possible duplicate of Scroll to top of page http : stackoverflow.com questions 10745485 scroll-to-top-of-page .", "If you want to skip the first header on the first page try h1 : not : first-child page-break-before : always", "I m trying to make page jumps on a page in blogger using : .. . .. . for the source and .. . .. . for the target .", "This all works fine apart from whenever I add a new tab the browser jumps to the top of the page .", "You can use the CSS property page-break-before https : developer.mozilla.org en-US docs Web CSS page-break-before or page-break-after .", "Previous problam solved @ use selectors in variable jquery http : stackoverflow.com questions 15380047 use-selectors-in-variable-jquery on same coe .. . .. . i have to made functionality like this http : www.biz.konicaminolta.com lineup index.html this is using a big jquery code i didn t understand .. . .. . and here is my jsfiddle http : jsfiddle.net Hg4zp 4 i have make the same functionality but when it is clicked the page jumps to that element i dont want page to jump i need some fadein and out .. . .. . and html .. . .. . i want to show popup on anchor click but dont want to page-jump scroll to that id i have given top : 10000px in fiddle for testing this issue because in my original page it moves to particular element .. . .. . full code on fiddle http : jsfiddle.net Hg4zp 4 and i want this functionality http : www.biz.konicaminolta.com lineup index.html", "Whenever I click on the button the page jumps .", "The content of the page mainly images and videos will be displayed in a scrollbox .", "i tried with the element but still stays on bottom of the page.. .", "This will the hash on the anchor will be used to scroll the page to that anchor point .", "you could also use page-break-after : always", "Thanks for the tip on the name thing but unfortunately neither that nor the preventDefault worked preventDefault stops a link from navigating at all which is bad - I still want the stuff to load I just don t want the stupid page to jump down like it is .", "Form validation error pointing on sticky header http : i.stack.imgur.com 9rZkl.png 5D .. . .. . Now my question is : .. . .. . Is there a sensible way to prevent this behaviour and add some pixels to the relative page-jump caused by submit event when form.checkValidity is false", "If I use a min-height that s at least the height of the bigger content the problem is kinda solved I already checked that but there must be a way to avoid this jump doesn t it", "http : stackoverflow.com questions 12455997 jquery-tabs-how-do-i-stop-the-jump-on-click .. . .. . but I haven t found one that quite solves my problem.. .", "I have happily used ctr-w gF to jump to the file and go to the line number following the file for a while .", "Now if you click the link id1 or id2 the content jump on top and all content before the id is not visible .", "Editors like Emacs and Vim give me the ability to jump between paragraphs easily .", "just found out in your example that I have to click test to jump to the target div and then click the target div to go back to test anchor which is good .", "See the link zwooping in the following webpage : http : zbl.zwoop.be page id 65 .. . .. . As you may notice the jump distance depends on the current scroll location when I click the link .", "the link contact contact would not take the user to the bottom of the page if they were lets say on the about us page then the link would need to be about contact .", "See developer.mozilla.org en-US docs Web CSS page-break-after https : developer.mozilla.org en-US docs Web CSS page-break-after" ] }
{ "confidence": [ 46.96326446533203, 45.302032470703125, 44.71160888671875, 43.812835693359375, 42.71498489379883, 42.69269561767578, 42.07856750488281, 41.93681335449219, 41.78776931762695, 41.76812744140625, 41.390079498291016, 41.243995666503906, 41.08938217163086, 40.18025207519531, 40.017494201660156, 39.923057556152344, 39.80038070678711, 39.751258850097656, 39.62702178955078, 39.611236572265625 ], "content": [ "Question : I m making a HTML report that is going to be printable and it has sections that should start in a new page . Is there any way to put something in the HTML CSS that will signal to the browser that it needs to jump to a new page at that point I don t need this to work in every browser out there I think I can tell people to use a specific set of browsers in order to print this . Thanks .. . Daniel .. . Answer : Try this link http : www.w3schools.com CSSref pr print pagebb.asp Comment : I think this is a better answer as it doesn t involve mangling the HTML to achieve a visual effect . Comment : I actually like the other one better since it gives me more control . I can always assign the class pagebreak only to the H1 s that should make the page-jump . But it s still a good solution . +1 for @media although screen should ignore page-break-before I guess . Thanks Comment : the h1 is an example of what you can use as a tag for the print break . You can substitute and tag name there you like . you could also use page-break-after : always Comment : h1 is not a good example since it means a 1st level heading and a page should normally have just one such heading . Comment : If you want to skip the first header on the first page try h1 : not : first-child page-break-before : always", "Question : I am creating a website with navigation that causes a page-jump . But when the page-jump event is executed my page will not load properly and most content above the called is not loaded . Here is a copy of my navigation : .. . .. . How can I fix the code so that the items above the page-jump are visible Thanks Comment : not sure what you are asking but the above sample shows that you are using an achor in your href - no problem here . .. . Answer : you just need to put a name bear-logo where you want the page to scroll to when the user clicks the link and the same for the others . For example if you wanted to scroll to the p tag below you could do it like this :", "Question : I ve checked out the other page-jump questions here on SO and I haven t found anything that matches so here we go.. . I m working on building a website that uses CSS3 transitions and a bunch of hash-links as opposed to using jQuery to load transition different pages elements just for fun to prove that I CSS can . The problem I m having is that when I click on one of my links the scrollbar automagically jumps down about 100px for no apparent reason . I don t recall it doing this the entire time so maybe something in my CSS went weird . I also added some a name tags at the top to try to pull it back up but that s not working either . I also tried putting onclick window.scrollTo 0 0 in the links as well and that doesn t work either : .. . .. . Any ideas help would be awesome as it s really annoying poor usability to have to scroll every time you navigate to the page . You can view the page here http : bradorego.com . System Info : .. . .. . Browser s : Chrome 16.0.912.75 FireFox 9.0.1 Opera 11.6 .. . .. . OS : Windows 7 Comment : I ve noticed it doesn t happen on the websites page so maybe I ll look into that a little and see what s different about it.. . .. . Answer : I m not familiar with CSS3 transitions so I don t fully understand what you re doing . However : .. . .. . 1 . I assume this behavior that you find undesirable has something to do with the browser s native behavior of scrolling an element into view based on the fragment-identifier in the URL . I m not sure if overriding that with a name elements would work but in any case you ve incorrectly set the name values by prefixing them with a hash . E.g should be a name about a not a name about a . 2 . At least for debugging purposes I d try adding a click event-listener and calling preventDefault in it to see if it stops the scrolling . 3 . It would be helpful to state what browser including OS and version you re experiencing the issue in . Comment : Added browser OS info . Thanks for the tip on the name thing but unfortunately neither that nor the preventDefault worked preventDefault stops a link from navigating at all which is bad - I still want the stuff to load I just don t want the stupid page to jump down like it is . Comment : Yeah but these are just links to sections of the same document and you re implementing a different interface than scrolling to display them . So unless preventDefault would break what you re doing with CSS I don t see what the problem would be . Re : your other comment yeah I was thinking this probably has something to do with your fixed-position navigation . Perhaps positioning the content sections you re linking to so the top is below the nav would fix it or position their top at the document top and give them padding-top . Comment : It 100 breaks the CSS - the way this trick works is CSS transitions bring the pieces of the document into out of view by moving them changing opacity etc . Technically the entire page is there all the time but different sections are either invisible or off the top left of the screen . It looks like padding-top works though : D", "Question : I am creating a website with navigation that causes a page-jump . But when the page-jump event is executed my page will not load properly and most content above the called is not loaded . Here is a copy of my navigation : .. . .. . How can I fix the code so that the items above the page-jump are visible Thanks Comment : not sure what you are asking but the above sample shows that you are using an achor in your href - no problem here . .. . Answer : There doesn t seem to be any error in the displayed HTML . However you shouldn t need to include the target for inline page anchors . I assume you actually have the links on the page . For example a id bear-logo a a id fiat-logo a and so on . Moreover the issue you describe seems to indicate that there is some invalid code elsewhere on the page perhaps JS or jQuery . I d recommend commenting out sections of your HTML until you isolate the interfering culprit . BTW have you considering using a simple jQuery script to flow the navigation to the logos instead of just abruptly jumping to them", "Question : I was trying to make a div jump from a href FAQ FAQ a to a div id and could success easily but since I have a fixed link-to jump to I can t seem to find a way how to do that . Meaning I want a div or a href link-to jump to a url in the same page say a href http : www.mydomain.ask.html Ask a .. . .. . I know for sure that jumping from an anchor such as a href jump jump a to a div such as div id jump jump to point div works fine . However how about the opposite way does it work I mean jumping from div id to an anchor works Comment : if I didn t try it would why I ask then : Comment : I would recommend creating simple html file to test what you want to do . Comment : why don t you @Digitalsite try it then .. . Answer : I think then you have to add a href yourid page place a inside your first div and have to give id to your anchor tag a href yourplace id idname a Comment : this solution is going somewhere around the right track.. . not sure if I can understand it well . Thanks anyways .", "Question : I have this weird thing happening : when clicking spans in the navigation the content has to switch . Everything works except that when you click a span the page jumps to it the span will be right at the top then . All I find about page jumps is about anchor tags and return false but nothing about spans . In my opinion the switching content can t be to blame because there never is only one div that has display : none and if that was the case the page should jump to the top instead of jumping to the span right Preventing any actions doesn t seem to work on spans . If the explanation was confusing go here : http : gaming-siblings.com v2.0 news and click Statistics in the navigation on the left . The page will jump down to the span you just clicked and scroll back a little due to the div s height . Why does it jump to the span It s probably not weird but reasonable . I just don t get it : - .. . .. . I ve tried this for 2 days now taking breaks from it because that mostly helps but not this time . Any ideas solutions As mentioned return false or preventDefault didn t work when I tried because it s spans I guess . .. . Answer : I spotted this extra line in your click function : .. . .. . This is the cause of the jump you re adding the hash to the URL of the page so the page will automatically scroll to that anchor in this case it will scroll to the element that was clicked since you re appending its id . There isn t really a workaround that I know of that won t reload the page completely . Your best bet is to just use separate pages or not use the hash at all . Comment : Heh I thought I added the hash change after I noticed the jump . Never thought changing the hash would actually work like a hash anchor . Thanks for pointing that out . It makes perfect sense then . I created a workaround by using IDs for the hash that don t exist so it can t jump . I guess it s a little dirty but it works .", "Question : I m making a HTML report that is going to be printable and it has sections that should start in a new page . Is there any way to put something in the HTML CSS that will signal to the browser that it needs to jump to a new page at that point I don t need this to work in every browser out there I think I can tell people to use a specific set of browsers in order to print this . Thanks .. . Daniel .. . Answer : You can use the CSS property page-break-before https : developer.mozilla.org en-US docs Web CSS page-break-before or page-break-after . Just set page-break-before : always on those block-level elements e.g . heading div p or table elements that should start on a new line . For example to cause a line break before any 2nd level heading and before any element in class newpage e.g . div class newpage .. . you would use", "Question : I am developing a website that loads different pages depending on what menu icon a user clicks . A friend and I wrote this javascript function : .. . .. . And the menu icons are coded like this : .. . .. . It works great except if trying to jump to a particular div id . For example .. . .. . Taking out the .scrollTo 0 0 doesn t solve the issue . I put that line in to ensure that the page is scrolled all the way up when changing pages Otherwise if you were in the middle of the page and clicked a menu icon the new page would display in the middle of the page . What have I missed How can I get the link-to jump to a div id Comment : First verify that the function is called . Use console.log or alert or such . Comment : Verified . Function is indeed being called . Comment : window .scrollTop +targetUrl.split 1 .split .php 0 .position . top extremly rough . Comment : Is this in-place of the line window.scrollTo 0 0 .. . Answer : The two URL s are not different . The one with the bookmark just gets the same HTML code . Since you are not telling the browser to go to a specific bookmark it should display the same information . Unless your server sends different info for that link of course .. . .. . I guess you d have to manually move the view to the bookmark you want . And then give the ID for the target as another parameter . If that s not possible you can also search for in the url and find the ID or anchor . Comment : Maybe I am missing something but this solution actually breaks my website even more . I m pretty new to javascript so I m unable to find your error . And yes I remembered to change someLocation to the real id . : - If I could get something as quick as this to work I would . But is it bad practice to not have a more general solution Comment : What you mean by it breaks where does it go wrong I fixed the closing brackets . I hope you saw that . Comment : Ah I didn t see that fix . Yes the other links work now but the jumping one does not . I would use this function like img src images some icon.png title Some Page onclick javascript : loadPage pages somePage someLocationOnPage.php right Comment : break the quotes to get two parameters . and the .php part should go with the url . img src images some icon.png title Some Page onclick javascript : loadPage pages somePage.php someLocationOnPage EDIT : also remove the . Comment : IT WORKS Thanks so much :", "Question : I appreciate there are many questions on this topic and I suspect some are really close to what I want e.g . JQuery UI Tabs Causing Screen to Jump http : stackoverflow.com questions 243794 jquery-ui-tabs-causing-screen-to-jump .. . Stop jquery TABS from jumping scrolling up when clicked on http : stackoverflow.com questions 11094815 stop-jquery-tabs-from-jumping-scrolling-up-when-clicked-on .. . Jquery tabs : How do I stop the jump on click http : stackoverflow.com questions 12455997 jquery-tabs-how-do-i-stop-the-jump-on-click .. . .. . but I haven t found one that quite solves my problem.. . I have implemented jQuery Tabs with adding and removing similar to this : http : jqueryui.com tabs manipulation but with the content of each page pulled via Ajax similar to this : http : jqueryui.com tabs ajax . This all works fine apart from whenever I add a new tab the browser jumps to the top of the page . This jump only occurs when I add a new tab - if I click between the different tabs later it does not jump at all . I have tried using preventDefault and return false on the anchors but this doesn t seem to affect their behaviour . The URLs of the anchors are actual links without hashtags . What does work is setting the height of the tabs container to something very large . This allows me to open tabs without the jump occurring.. . but it doesn t seem a very elegant solution . I should point out that the tabs are all of different heights themselves so I can t really determine a fixed height . Is that all there is on the topic or is there something I might have missed Here is the code I am using largely copied and pasted from the jQuery documentation : Comment : Can you show your tab adding code .. . Answer : try this . Comment : Thank you . No joy I m afraid . :", "Question : I m trying to make an HTML button on the top of the page above a table add a new table entry and jump to the bottom of the page at the same time so that the new entry is visible . The button already adds the new entry like this .. . .. . onclick addrange .. . .. . What can I add to the button to make it jump to the bottom of the page in addition to the new entry all in one press Thanks . Comment : provide some html code Comment : What else would you need I just need to know if there is a function that will scroll to the bottom of the page that I can add alongside the addrange function . .. . Answer : you can try this code : - Comment : Worked Thanks Comment : cheers.. .", "Question : I am developing a website that loads different pages depending on what menu icon a user clicks . A friend and I wrote this javascript function : .. . .. . And the menu icons are coded like this : .. . .. . It works great except if trying to jump to a particular div id . For example .. . .. . Taking out the .scrollTo 0 0 doesn t solve the issue . I put that line in to ensure that the page is scrolled all the way up when changing pages Otherwise if you were in the middle of the page and clicked a menu icon the new page would display in the middle of the page . What have I missed How can I get the link-to jump to a div id Comment : First verify that the function is called . Use console.log or alert or such . Comment : Verified . Function is indeed being called . Comment : window .scrollTop +targetUrl.split 1 .split .php 0 .position . top extremly rough . Comment : Is this in-place of the line window.scrollTo 0 0 .. . Answer : First of all you should keep the window.scrollTo 0 0 in your code to keep the page go to top on every click of menu item . Secondly if on click of menu icon which is calling .. . .. . your intentions are to open somePage and scroll to the position where element id is someLocationOnPage.php then you should update your loadPage method to check for the part after . Comment : With this solution all the links work as expected.. . except the one that jumps to the . : Comment : So you means it s not jumping to that mentioned bookmark Comment : Correct . It behaves the same way as my original code .", "Question : null .. . Answer : I m trying to high jack an anchor link with tag .. . .. . The desired result is to page-jump to the anchor with the hash name reference and open the accordion to that item . I have managed to capture the click but not sure how I target the anchor in question . as you can see from the ul.accordian attempt to find the control . But nothing appears to be happening or errors reported . I ve attached the html below as well any help would be much appreciated . Comment : what you exactly want On click of .item do you want to open slide Comment : When clicking on the a href parents Jump to parents question a link this will jump to item on page and fire the next anchor with the opener class . As a result this opens the accordion of the item it has jumped to . Comment : can you some example on any other site", "Question : I was trying to make a div jump from a href FAQ FAQ a to a div id and could success easily but since I have a fixed link-to jump to I can t seem to find a way how to do that . Meaning I want a div or a href link-to jump to a url in the same page say a href http : www.mydomain.ask.html Ask a .. . .. . I know for sure that jumping from an anchor such as a href jump jump a to a div such as div id jump jump to point div works fine . However how about the opposite way does it work I mean jumping from div id to an anchor works Comment : if I didn t try it would why I ask then : Comment : I would recommend creating simple html file to test what you want to do . Comment : why don t you @Digitalsite try it then .. . Answer : if you have link-to go another with variable you can use with id sign", "Question : I would like to use anchor tags to scroll within a div on the webpage . However when I click on the anchor tag the entire page jumps to the anchor tag within the div . The content within the div should scroll without the body of the webpage autoscrolling . I ve been googling and trying to figure this out for weeks have not yet found an acceptable solution . It seems to be a really commonly asked question too . I know very little about javascript but from what I gather there seem to be two possible ways of accomplishing this : .. . .. . 1 . To make the body of the page scrollable only by mousewheel manually and not with anchor tags . This would apply to the body only and not other elements . .. . .. . -or- .. . .. . 2 . To scroll to the anchor tag within the div and cancel the process before it affects the body . .. . .. . A bonus would be if it did not add the anchor tag to the url . Here are some additional links to similar questions may have some ideas you could work with : seems promising could not get it to work Scrolling within a div without moving page http : stackoverflow.com questions 6347333 scrolling-within-a-div-without-moving-page .. . .. . uses event.preventDetfault or event.returnValue false may work for body after anchor link scroll to right http : js-unit-testing.com 2013 08 08 preventing-anchor-clicking-from-scrolling-to-the-top .. . .. . other ideas for similar problems How to prevent page scrolling when scrolling a DIV element http : stackoverflow.com questions 7600454 how-to-prevent-page-scrolling-when-scrolling-a-div-element .. . .. . How to go to anchor tag in scrollable div without having the whole browser jump down http : stackoverflow.com questions 1897573 how-to-go-to-anchor-tag-in-scrollable-div-without-having-the-whole-browser-jump .. . .. . How can I differentiate a manual scroll via mousewheel scrollbar from a Javascript jQuery scroll http : stackoverflow.com questions 2834667 how-can-i-differentiate-a-manual-scroll-via-mousewheel-scrollbar-from-a-javasc .. . .. . other approaches to similar question HTML anchor link with no scroll or jump http : stackoverflow.com questions 1218034 html-anchor-link-with-no-scroll-or-jump .. . .. . Here is a sample HTML and CSS with the relevant elements . You may resize the browser window so that there is a scrollbar for the main page to see the undesirable autoscroll effect : .. . .. . Here is the CSS .. . .. . Maybe you can gain some points for definitively answering this commonly asked question .. . Answer : I found this occurred because there was a parent of the element within which you have your href id of element . To fix this... . .. . .. . You could use fixed or relative . But this stops the body main page from scrolling on selection of href somewhere within a child element .", "Question : I was trying to make a div jump from a href FAQ FAQ a to a div id and could success easily but since I have a fixed link-to jump to I can t seem to find a way how to do that . Meaning I want a div or a href link-to jump to a url in the same page say a href http : www.mydomain.ask.html Ask a .. . .. . I know for sure that jumping from an anchor such as a href jump jump a to a div such as div id jump jump to point div works fine . However how about the opposite way does it work I mean jumping from div id to an anchor works Comment : if I didn t try it would why I ask then : Comment : I would recommend creating simple html file to test what you want to do . Comment : why don t you @Digitalsite try it then .. . Answer : As long as your anchor has an ID you can link-to a location in your view by clicking the div you will just need some javascript . Setting the window.location.hash value will put the focus of the view on the selected ID . Sample .. . .. . JSFiddle Example http : jsfiddle.net GP77J 2 Comment : ok great solution . This is what I did too . However what I want to do is jumping from the div id test1 to a href test1 not the normal way we know.. . Comment : just found out in your example that I have to click test to jump to the target div and then click the target div to go back to test anchor which is good . however I want only a jump from target div to test one way Comment : You do not have to use the exact example I provided . Comment : In regards to not using the ID to set the focus you still need to find the element in the DOM to set the focus . Using an element is the fastest way to search the DOM other searches such as finding anchor tags with a specific href value would impact performance . Comment : ok great to know . Thanks a lot . I will keep digging finding the best possible way without affecting the performance . Thanks", "Question : I would like to use anchor tags to scroll within a div on the webpage . However when I click on the anchor tag the entire page jumps to the anchor tag within the div . The content within the div should scroll without the body of the webpage autoscrolling . I ve been googling and trying to figure this out for weeks have not yet found an acceptable solution . It seems to be a really commonly asked question too . I know very little about javascript but from what I gather there seem to be two possible ways of accomplishing this : .. . .. . 1 . To make the body of the page scrollable only by mousewheel manually and not with anchor tags . This would apply to the body only and not other elements . .. . .. . -or- .. . .. . 2 . To scroll to the anchor tag within the div and cancel the process before it affects the body . .. . .. . A bonus would be if it did not add the anchor tag to the url . Here are some additional links to similar questions may have some ideas you could work with : seems promising could not get it to work Scrolling within a div without moving page http : stackoverflow.com questions 6347333 scrolling-within-a-div-without-moving-page .. . .. . uses event.preventDetfault or event.returnValue false may work for body after anchor link scroll to right http : js-unit-testing.com 2013 08 08 preventing-anchor-clicking-from-scrolling-to-the-top .. . .. . other ideas for similar problems How to prevent page scrolling when scrolling a DIV element http : stackoverflow.com questions 7600454 how-to-prevent-page-scrolling-when-scrolling-a-div-element .. . .. . How to go to anchor tag in scrollable div without having the whole browser jump down http : stackoverflow.com questions 1897573 how-to-go-to-anchor-tag-in-scrollable-div-without-having-the-whole-browser-jump .. . .. . How can I differentiate a manual scroll via mousewheel scrollbar from a Javascript jQuery scroll http : stackoverflow.com questions 2834667 how-can-i-differentiate-a-manual-scroll-via-mousewheel-scrollbar-from-a-javasc .. . .. . other approaches to similar question HTML anchor link with no scroll or jump http : stackoverflow.com questions 1218034 html-anchor-link-with-no-scroll-or-jump .. . .. . Here is a sample HTML and CSS with the relevant elements . You may resize the browser window so that there is a scrollbar for the main page to see the undesirable autoscroll effect : .. . .. . Here is the CSS .. . .. . Maybe you can gain some points for definitively answering this commonly asked question .. . Answer : You can use the scrollTop http : api.jquery.com scrollTop function from Jquery to position the scrollable div exactly how you want it . Here is a fiddle of it working http : jsfiddle.net fh940kjz .. . I used anchor tags to locate it but you can use anything with an ID . Comment : Interesting . Would this ScrollTop work for the html example It is two divs next to each-other with a div containing them and then a window div that only shows one of the side-by-side divs at a time . When the link in the left div is clicked it scrolls to the anchor in the right div . The only problem is that the main window also jumps to the anchor only what is in the div should scroll or the body could be locked . Is it possible to do this with only JavaScript Comment : It should work with straight javascript if you don t use anchors . It looks like in the JQuery source http : code.jquery.com jquery-1.11.3.js that they are using the Javascript scrollTo method .", "Question : I have a sticky nav that takes up about 80px worth of space at the top of the browser window when it catches . Part of the navigation contains a jump-to-section nav that takes the user to a section on the page that correlates with the link in the nav you know how this works . The problem is once the user clicks a jump-to link it sets the section at the top of the window which covers the name of the section with the sticky navigation just abruptly showing a title-less piece of content . Is there a way to offset the space taken up by the sticky nav so that the user can see the title of a section on nav click Ideally this would be a CSS fix . Suggestions .. . Answer : Add padding-top : 80px the height of your nav to the top of each section . If this messes up your design you can make it a margin and then have a negative margin-bottom : -80px at the bottom of the element above to keep the design congruent .", "Question : I am building my portfolio website for my photography business . I ve built the site so the portfolios scroll horizontally . This is what I have so far . http : www.dscottclarkphoto.com portfolio adventure adventure.html .. . .. . I would like to be able to include arrows that when clicked jump the viewer to the next photograph . I tried using what was demonstrated in this : jQuery : jump to next section http : stackoverflow.com questions 7906001 jquery-jump-to-next-section .. . .. . I saved the Javascript into it s own file named jump.js . I also tried saving the sample and it is not behaving correctly either . Are there any suggestions on how to make this work or a better method .. . Answer : In the link you posted they are using vertical-scrolling myEl .offset .top if you are using horizontal scrolling you should change that for myEl .offset .left . Didn t try it but it should be that . Also nothing to do with the question but it might help to improve the look of your page you might want to save the images as .png interlaced so they don t slide down as they are currently doing . Comment : Thank you . what do you mean by the images are sliding down Comment : They literally show up progressively from top to bottom that s because the way they were saved . You might want to re-save them as .png interlaced or .jpg progressive You won t see it because they are already cached on your browser.. . this will improve the look and UX a lot with little to no work .", "Question : I m building a simple glossary widget as part of a larger project for a client . The content of the glossary is enclosed within a scrollable div overflow : auto . Each letter has an anchor tag associated with it a b c etc . Above the scrollable div is a div which contains every letter of the alphabet . Clicking on one of these letters takes the user down to that letter s definitions in the scrollable div . This works but an unintended side effect is that the entire window jumps down to the anchor which is confusing and annoying to the user . Here is the widget stripped down a bit and with a bunch of br s to let you see what I mean . http : www.nitrohandsome.com clients topics glossary-widget .. . .. . I had tried a few different javascript ideas I cobbled together from some Googling but nothing was working so i just got rid of everything but the actual go to anchor code I m a pretty big JS newbie . So right now clicking on any of the letters executes this javascript function with the anchor tag passed to it : .. . .. . How can I pull this off so the overall window doesn t jump each time a link is clicked Thanks in advance Comment : I tested your example on IE8 FF 3.5 and Safari 4 on Windows . My screen height is 900px . The only time I noticed a jump problem was when my browser was less than the height of your widget and the widget got pushed off the screen . Is this the problem you are talking about Comment : Nevermind I see what you are talking about . The blank page was throwing me off . .. . Answer : Try to use IFrame instead of Div or create a specific function using ScrollBy . Comment : Hey thanks for the ideas It actually was originally an iframe but it had the same problem . I ll look into scrollby but can it only be passed numeric values The client may want to add or delete terms in the future so if the links were hardcoded to a certain y position it d run into some problems . Any thoughts Thanks again Comment : try to use findText", "Question : Previous problam solved @ use selectors in variable jquery http : stackoverflow.com questions 15380047 use-selectors-in-variable-jquery on same coe .. . .. . i have to made functionality like this http : www.biz.konicaminolta.com lineup index.html this is using a big jquery code i didn t understand .. . .. . and here is my jsfiddle http : jsfiddle.net Hg4zp 4 i have make the same functionality but when it is clicked the page jumps to that element i dont want page to jump i need some fadein and out .. . .. . and html .. . .. . i want to show popup on anchor click but dont want to page-jump scroll to that id i have given top : 10000px in fiddle for testing this issue because in my original page it moves to particular element .. . .. . full code on fiddle http : jsfiddle.net Hg4zp 4 and i want this functionality http : www.biz.konicaminolta.com lineup index.html Comment : well .. . and your question is This looks like a request to me .. . and you didn t even ask please .. . Comment : how to stop page-jump im my website .. . Answer : Try with this one : .. . .. . and adjust the top : 100000px to something lesser one like 50px Comment : Thanks it works i put top : 1000000px only for testing" ] }
[ "yes-answer-long", "yes-answer-short" ]
scroll
UNK_RELATION
pmd@java@168
pmd -- pmd scans source code and looks for potential problems like possible bugs dead-code suboptimal code overcomplicated expressions and duplicate code.pmd supports @placeholder javascript xml and many more .
{ "confidence": [ 107.55313110351562, 50.135643005371094, 49.140811920166016, 47.389461517333984, 47.320899963378906, 47.05686569213867, 47.02960968017578, 46.07442855834961, 44.84856414794922, 44.49506759643555, 44.25139617919922, 44.199485778808594, 43.761348724365234, 43.566009521484375, 43.05778503417969, 43.025638580322266, 42.564918518066406, 42.3876838684082, 42.178260803222656, 42.10966110229492, 42.03733825683594, 42.009613037109375, 41.81488037109375, 41.617431640625, 41.534122467041016, 41.156890869140625, 40.993858337402344, 40.76588439941406, 40.53775405883789, 40.51002883911133, 40.51002883911133, 40.51002883911133, 40.51002883911133, 40.284690856933594, 40.086246490478516, 39.82464599609375, 39.82464599609375, 39.82464599609375, 39.55580520629883, 39.51519775390625, 39.4769172668457, 39.4769172668457, 39.4769172668457, 39.224830627441406, 39.165870666503906, 39.0436897277832, 39.040283203125, 38.91768264770508, 38.7906608581543, 38.67146682739258, 38.3635139465332, 38.33145523071289, 38.32286834716797, 38.30433654785156, 37.977333068847656, 37.977333068847656, 37.977333068847656, 37.977333068847656, 37.977333068847656, 37.93609619140625, 37.93609619140625, 37.92697525024414, 37.784027099609375, 37.775634765625, 37.775634765625, 37.76579666137695, 37.76579666137695, 37.637481689453125, 37.544105529785156, 37.473976135253906, 37.368682861328125, 37.31501388549805, 37.275169372558594, 37.2318229675293, 37.20673370361328, 37.13739776611328, 37.12697982788086, 37.01865005493164, 37.01865005493164, 37.01865005493164, 37.01865005493164, 37.01865005493164, 37.01865005493164, 36.97870635986328, 36.95357894897461, 36.80485534667969, 36.80485534667969, 36.7891960144043, 36.78080368041992, 36.77338409423828, 36.58414840698242, 36.54927444458008, 36.54927444458008, 36.53303146362305, 36.491241455078125, 36.43651580810547, 36.43651580810547, 36.43651580810547, 36.43651580810547, 36.43651580810547 ], "content": [ "PMD scans Java source code and looks for potential problems like possible bugs dead-code suboptimal code overcomplicated expressions and duplicate code .", "Checkstyle and PMD only use source code .", "Well then either downgrade or edit the PMD source code .", "A lot of PMD checks are code-conventions .", "Btw the PMD list of bugs is here http : sourceforge.net p pmd bugs .", "I want to modify the source code of PMD but I don t know how to compile and use this modifying PMD with Eclipse as a plug-in .", "We are using the source code analyzer PMD in our Java project .", "I ve opened a ticket sourceforge.net p pmd bugs 1466 https : sourceforge.net p pmd bugs 1466", "PMD can generate XML output .", "No PMD Data in Project Reports http : i.stack.imgur.com 79LGV.png .. . .. . Figure 3 : No PMD Data found in Project Reports .. . .. . Regards .. . .. . UPDATE .. . .. . When I change the PMD section of the pom.xml file to the below snippet I obtain some CPD results via PMD but still nothing from PMD on code bugs .", "I m using PMD to generate some code quality report on a project .", "Here s the source code for CyclomaticComplexityRule http : pmd.github.io pmd-5.4.1 pmd-java xref net sourceforge pmd lang java rule codesize CyclomaticComplexityRule.html which inherits from StdCyclomaticComplexityRule http : pmd.github.io pmd-5.4.1 pmd-java xref net sourceforge pmd lang java rule codesize StdCyclomaticComplexityRule.html .", "I think it s currently not possible with pmd 4.2.6 and pmd 4.1.1 .", "PMD provides several ways to suppress-warnings : http : pmd.sourceforge.net pmd-5.2.3 usage suppressing.html .. . .. . via Annotations : @SuppressWarnings PMD .", "First PMD doesn t handle the NoClassDefFoundError similar to ClassNotFoundException - I ve created an issue for PMD here https : sourceforge.net p pmd bugs 1319 .", "I m analyzing my source code at build time using PMD https : maven.apache.org plugins maven-pmd-plugin maven-pmd-plugin : 3.2 which uses net.sourceforge.pmd : pmd : 5.1.2 under the hood .", "I also realize that the AST in PMD was more deceiving than the XML .", "sourceforge.net p pmd bugs 1383 https : sourceforge.net p pmd bugs 1383 +1", "You ll get rid of the PMD violation and your code will make more sense .", "Is it possible to use PMD to detect violations like this", "Is there any configuration in PMD to prevent it from identifying package statements and import statements as duplicate code", "I am using PMD in my Java project for code-review .", "@Ken Y-N Just upgraded from older pmd 4.2 to pmd 5.4.2 have a large number of class so not possible to rewrite the code .", "The latest PMD plugin is using PMD 4.3 .", "What is PMD", "PMD is seen to be rather more verbose .", "PMD has a rule for similar problems that you described : .. . .. . AvoidDuplicateLiterals http : pmd.sourceforge.net pmd-5.2.1 pmd-java rules java strings.html AvoidDuplicateLiterals - Code containing duplicate String literals can usually be improved by declaring the String as a constant field .", "Conventions Checkstyle .. . Bad practices PMD .. . Potential bugs FindBugs .. . .. . The project is built on Maven .", "What commandline do i have to use to get PMD to detect duplicate code", "I met a problem while using PMD to check my code errors .", "Eclipse has the PMD plugin installed and complains about this line of code .", "I added PMD to my Eclipse workspace and I m working on cleaning the code .", "PMD report NullAssignment of the following code what is the best practice to fix it", "The pmd-exclude.xml should look like this :", "The maven-pmd-plugin http : maven.apache.org plugins maven-pmd-plugin pmd-mojo.html by default skips nowadays empty reports property skipEmptyReport http : maven.apache.org plugins maven-pmd-plugin pmd-mojo.html skipEmptyReport .", "Does ruleset.xml contain PMD rules in format : pmd.sourceforge.net pmd-4.3 howtomakearuleset.html http : pmd.sourceforge.net pmd-4.3 howtomakearuleset.html", "See the maven-pmd-plugin documentation http : maven.apache.org plugins maven-pmd-plugin pmd-mojo.html rulesets .", "According to the notes for PMD 4.3 at sourceforge http : sourceforge.net projects pmd files pmd 4.3 this issue has been fixed .", "It is possible tu run a PMD analysis in a JUnit test .", "Is there a way to tell PMD to ignore checking parts of code for duplication", "Is there any support for this in a PMD ruleset", "No luck PMD is crazy", "PMD Meaning Detector recursion", "Create a feature-request at https : sourceforge.net p pmd bugs", "https : pmd.github.io pmd-5.4.2 pmd-java rules java strings.html ConsecutiveAppendsShouldReuse", "On the PMD project site http : pmd.sourceforge.net pmd-5.0.4 meaning.html you can find that they don t really know the meaning of the PMD letters .", "Source - http : pmd.sourceforge.net pmd-5.0.5 cpd-usage.html .", "We are looking for an option in flex-pmd-maven-plugin to skip the pmd execution temporarily using a command-line option .", "Is there a way to do it in the pmd xml file like by using violationSuppressXPath even if it s a java class", "I have tried using eclipse pmd plugin as well as pmd plugin by source forge .", "Here is some example code : .. . .. . PMD gives me the above mentioned rule violation at the marked spot in the code .", "I believe a key difference is that PMD works on source code while FindBugs works on compiled bytecode files .", "Sometimes I have the problem with one PMD check about my code .", "Maven can easily create websites with mvn site command but this tutorial shows how to use PMD for more helpful metrics on the source code .", "It s a bug of pdepend and pmd .", "I m new in using PMD .", "Added PMD plugin .", "In PMD you definitely can .", "I am new to PMD .", "I run PMD as part of Sonar .", "What would be the preferred solution of PMD", "The Plugin page tells me .. . .. . PMD supports custom ruleset file to configure goto settings - PMD and add the rule set files that are required .", "It has the static method PMD.doPMD configuration https : github.com pmd pmd blob pmd releases 5.5.0 pmd-core src main java net sourceforge pmd PMD.java L230 which starts the analysis .", "I would like to create an automated junit test that passes if my code meets the requirements specified by PMD and fails if it does not .", "They do it quite simply with a code like this : .. . .. . I ran PMD on my project and got the AssignmentInOperand violation on the while .. . line .", "The maven pmd plugin has a -Dpmd.skip true option .", "The flex-pmd plugin runs in the verify maven phase .", "When using PMD with Eclipse check Customizing PMD http : www.eclipsezone.com articles pmd howtocustomize .", "After a mvn clean package in the top-directory of the cloned sources from https : github.com pmd pmd you ll find the binary in the directory pmd-dist target .", "if you run your builds in Jenkins the Jenkins PMD plugin can take care of relating PMD warnings to source code there is no need to run another Maven plugin for this .", "Obviously on the Java side the free tools available include Findbugs compiled code-analysis and PMD static-code-analysis .", "After searching through the code of PMD on GitHub I think I can safely say that this is NOT supported at this point in time current version being PMD 5.5.0 .", "Without further configuring maven-pmd-plugin it uses by default these three PMD rulesets : java-basic http : pmd.sourceforge.net pmd-5.2.3 pmd-java rules java basic.html java-imports http : pmd.sourceforge.net pmd-5.2.3 pmd-java rules java imports.html java-unusedcode http : pmd.sourceforge.net pmd-5.2.3 pmd-java rules java unusedcode.html .", "When defining a PMD ruleset is it possible to exclude a source file from a specific rule", "Checkstyles may not have the capability to analyse the code while PMD offering many features to do so", "It is much more sensible to look at the RAW xml and trace it using XPath than following the examples in PMD doc .", "The standard ruleset file is .xml inside pmd-bin-x.x.x.zip .. . lib pmd-x.x.x.jar rulesets refer to http : pmd.sourceforge.net rules index.html .", "And this will help pmd.github.io pmd-5.4.1 usage running.html https : pmd.github.io pmd-5.4.1 usage running.html", "Did you read the PMD docs about suppression http : pmd.sourceforge.net pmd-4.3 suppressing.html", "@SreedharGS See Excluding files from a ruleset at pmd.sourceforge.net pmd-5.2.3 customizing http : pmd.sourceforge.net pmd-5.2.3 customizing howtomakearuleset.html", ".. . .. . hint : seems to be similar to : PMD exclude not working http : stackoverflow.com questions 15647771 pmd-exclude-not-working", "Additional explanations and examples can be found in the PMD documentation http : pmd.sourceforge.net pmd-5.0.5 howtomakearuleset.html Excluding files from a ruleset .", "PMD http : pmd.sourceforge.net pmd-5.0.0 tells me .. . .. . A switch with less than 3 branches is inefficient use a if-statement instead .", "PMD Details : .. . Plugin version- 4.0.5.v20141105-1906 .. . PMD version- 5.2.1", "I ve already tried the code that running PMD from java project but I do not know how to pass the selected file to PMD.run class which suppose to run the PMD .", "I want to tune the TooManyFields http : pmd.sourceforge.net pmd-4.3.0 rules codesize.html TooManyFields PMD rule so it doesn t count my injected services as field .", "I am trying to narrow down the PMD rules how can I exclude all REST methods which are annotated with @GET from PMD checks", "Enter the following : .. . .. . Name : PMD for Eclipse Update Site .. . .. . URL : https : sourceforge.net projects pmd files pmd-eclipse update-site .. . .. . and click OK . .. . .. . You should see PMD for Eclipse 4 .", "Let s say I have a block of code like this : .. . .. . Is there a Sonar Findbugs or PMD rule that will flag mappy as potentially null", "If possible with PMD is it possible using XPath rules or only Java", "This enables to exclude source directories from the PMD report and subsequent checks .", "Please take a look at the getting started with eclipse-pmd https : acanda.github.io eclipse-pmd getting-started.html page of the eclipse-pmd website .", "You should install the PMD plugin for eclipse pmd.sourceforge.net pmd-5.0.4 integrations.html eclipse http : pmd.sourceforge.net pmd-5.0.4 integrations.html eclipse", "PMD is what I find more people referring to .", "Using PMD 5.4.2 for JAVA code seen some violation related to Possible God Class like below : .. . .. . I don t want to suppress these warning .", "And this would be your file pmd-rulesets.xml .", "Why is PMD not working with Maven for me", "There is no data here though from PMD .", "The same issue is actually with XPath for PMD .", "We know that PMD is integrated with eclipse ." ] }
{ "confidence": [ 93.92317962646484, 93.68630981445312, 93.3097915649414, 91.36014556884766, 62.102508544921875, 56.60865020751953, 55.929054260253906, 54.90167999267578, 54.32572937011719, 54.1060791015625, 53.92698669433594, 53.69660949707031, 53.648643493652344, 53.263153076171875, 53.18865203857422, 52.99441909790039, 52.96241760253906, 52.26178741455078, 52.21808624267578, 52.21808624267578 ], "content": [ "Question : PMD http : pmd.sourceforge.net pmd-5.0.0 tells me .. . .. . A switch with less than 3 branches is inefficient use a if-statement instead . Why is that Why 3 How do they define efficiency Comment : What is PMD Comment : PMD scans Java source code and looks for potential problems like possible bugs dead-code suboptimal code overcomplicated expressions and duplicate code . Hover over the tags Comment : It should also scan itself for grammar . Less should be fewer . : Comment : Don t push your descriptivist grammar on me @MikeMcMahon I like my grammar like I like my glaciers : old frozen and moving as slowly as possible . Comment : obligatory premature-optimization is the root of all evil etc .. . Answer : Why is that Different sequences of instructions are used when the code is finally compiled to native-code by the JIT compiler . A switch is implemented by a sequence of native instructions that perform a indirect branch . The sequence typically loads an address from a table and then branches to that address . An if else is a implemented as instructions that evaluate the condition probably a compare instruction followed by a conditional branch instruction . Why 3 It is an empirical observation I assume based on analysing the generated native-code instructions and or benchmarking . Or possibly not . To be absolutely sure you would need to ask the author s of that PMD rule how they derived that number . How do they define efficiency Time taken to execute the instructions . .. . .. . I d personally take issue with this rule .. . or more precisely with the message . I think it should say that an if else statement is simpler and more readable than a switch with 2 cases . The efficiency issue is secondary and probably irrelevant .", "Question : PMD http : pmd.sourceforge.net pmd-5.0.0 tells me .. . .. . A switch with less than 3 branches is inefficient use a if-statement instead . Why is that Why 3 How do they define efficiency Comment : What is PMD Comment : PMD scans Java source code and looks for potential problems like possible bugs dead-code suboptimal code overcomplicated expressions and duplicate code . Hover over the tags Comment : It should also scan itself for grammar . Less should be fewer . : Comment : Don t push your descriptivist grammar on me @MikeMcMahon I like my grammar like I like my glaciers : old frozen and moving as slowly as possible . Comment : obligatory premature-optimization is the root of all evil etc .. . Answer : Because a switch-statement is compiled with two special JVM instructions that are lookupswitch and tableswitch . They are useful when working with a lot of cases but they cause an overhead when you have just few branches . An if else statement instead is compiled into typical je jne .. . chains which are faster but require many more comparisons when used in a long chain of branches . You can see the difference by looking at byte code in any case I wouldn t worry about these issues if anything could become a problem then JIT will take care of it . Practical example : .. . .. . is compiled into : .. . .. . While .. . .. . is compiled into Comment : Jack thank you . This is a wonderful answer . On a side note what did you use to view .class files Comment : It s a plugin for Eclipse if I remember correctly it should be this one : andrei.gmxhome.de bytecode index.html http : andrei.gmxhome.de bytecode index.html Comment : @JAM : I believe you can also use javap http : docs.oracle.com javase 1.5.0 docs tooldocs windows javap.html . Comment : And as we all know bytecode is the only thing that determines performance - the jit would never change the code to get better performance Another useless performance optimization Comment : I would say it s a very poor optimizer that doesn t optimize 2-branch switch into if given that if s performance is better .", "Question : PMD http : pmd.sourceforge.net pmd-5.0.0 tells me .. . .. . A switch with less than 3 branches is inefficient use a if-statement instead . Why is that Why 3 How do they define efficiency Comment : What is PMD Comment : PMD scans Java source code and looks for potential problems like possible bugs dead-code suboptimal code overcomplicated expressions and duplicate code . Hover over the tags Comment : It should also scan itself for grammar . Less should be fewer . : Comment : Don t push your descriptivist grammar on me @MikeMcMahon I like my grammar like I like my glaciers : old frozen and moving as slowly as possible . Comment : obligatory premature-optimization is the root of all evil etc .. . Answer : Although there are minor efficiency gains when using a switch compared to using an if-statement those gains would be negligible under most circumstances . And any source code scanner worth its salt would recognize that micro-optimizations http : stackoverflow.com a 3387765 836738 are secondary to code clarity . They are saying that an if-statement is both simpler to read and takes up fewer lines-of-code than a switch-statement if the switch is significantly short . From the PMD website http : pmd.sourceforge.net rules index.html : .. . .. . TooFewBranchesForASwitchStatement : Switch statements are indended to be used to support complex branching behaviour . Using a switch for only a few cases is ill-advised since switches are not as easy to understand as if-then statements . In these cases use theif-then statement to increase code-readability . Comment : Importance of clarity far exceeds any micro-optimizations . No doubt about that . Comment : The nice thing is that they state inefficient in the warning but they state that it is just related to readability in the documentation . Good coherency. .", "Question : PMD http : pmd.sourceforge.net pmd-5.0.0 tells me .. . .. . A switch with less than 3 branches is inefficient use a if-statement instead . Why is that Why 3 How do they define efficiency Comment : What is PMD Comment : PMD scans Java source code and looks for potential problems like possible bugs dead-code suboptimal code overcomplicated expressions and duplicate code . Hover over the tags Comment : It should also scan itself for grammar . Less should be fewer . : Comment : Don t push your descriptivist grammar on me @MikeMcMahon I like my grammar like I like my glaciers : old frozen and moving as slowly as possible . Comment : obligatory premature-optimization is the root of all evil etc .. . Answer : I believe it has to do with the way that a switch and an if else compiles down . Say it takes 5 computations to process a switch-statement . Say an if-statement takes two computations . Less than 3 options in your switch would equal 4 computations in ifs vs 5 in switches . However the overhead remains constant in a switch so if it has 3 choices ifs would be 3 2 processed vs 5 still for the switch . The gains when looking at millions of computations are extremely negligible . Its more a matter of this is the better way to do it rather than anything that might affect you . It would only do so on something that cycles on that function millions of times in a quite iteration .", "Question : I want to write a custom PMD rule that uses two AST nodes . My custom rule scans the source code to find mathematical operators . I want my rule to find more than one operators from these .. . .. . in the same expression . I have tried some solutions but they did not work for example : .. . .. . How to do that .. . Answer : I chose XPath instead of Java . Put this rule into your pmd ruleset configuration xml : .. . .. . But it s not a complete solution yet.. . I m looking into a possible pmd bug : looks like that an expression like 1+2-3+4 gets a single AdditiveExpression : + node instead of 3 distinct nodes with their respective operators so detecting an expression that uses just + and - or just and will not be detected . But it will detect expressions with mixed additive and multiplicative operators . I will update the answer if I figure this out but I hope the rule is of some use . Comment : Thaaaaaaanks aloooooot Hairy detecting expressions with mixed additive and multiplicative operators is what I need . I use this solution and it works : - Comment : I have to write more rules if I need more helping from you can I ask you Comment : No problem I follow pmd and other static-analysis related tags so next time you pose a question about it I ll see it . Comment : ok thanks again : - Comment : Here s a tutorial on how to write XPath checks : web.archive.org web 20150522015043 http : techtraits.com https : web.archive.org web 20150522015043 http : techtraits.com programming 2011 11 05 custom-pmd-rules-using-xpath", "Question : I am reading an interesting tutorial here : http : www.avajava.com tutorials lessons how-do-i-generate-pmd-and-cpd-reports-for-a-site.html page 1 .. . .. . This tutorial shows how to use Maven to run the open-source static-analysis tool PMD and to see the generated output on a Maven created website . Maven can easily create websites with mvn site command but this tutorial shows how to use PMD for more helpful metrics on the source code . The instructions were followed to the best of my ability . Here is my pom.xml file that came from reading the tutorial : .. . .. . When I run the command : mvn clean site I get a website built by Maven with a bunch of different pages but none of them show anything in regards to PMD . What am I missing here Why am I not seeing anything in regards to PMD in the generated website .. . .. . Also when I run mvn pmd : pmd there is a successful build but I do not obtain any helpful PMD metrics . I even coded in some unused variables and methods in one of my Java source files as illustrated in the above linked tutorial and there is no helpful output . The mvn pmd : pmd command does appear to create some files though . A couple are files of rules for the engine it looks like and the others are empty . Please see the screen-shots of this below : .. . .. . Files created with mvn pmd : pmd command http : i.stack.imgur.com Sisf3.png Figure 1 : Files created by pmd : pmd command .. . .. . empty file for pmd http : i.stack.imgur.com OeL7G.png .. . .. . Figure 2 : Empty pmd file - even though there are obvious errors in Java source file .. . .. . Does anyone out there know what is up Why is PMD not working with Maven for me Thanks for reading this . Also from what I have read around the Internet on PMD s website http : pmd.sourceforge.net pmd-5.1.1 mvn-plugin.html and Maven s website http : maven.apache.org plugins maven-pmd-plugin usage.html there should be some information in the Project Reports section . There is no data here though from PMD . Please see the below screen-shot . No PMD Data in Project Reports http : i.stack.imgur.com 79LGV.png .. . .. . Figure 3 : No PMD Data found in Project Reports .. . .. . Regards .. . .. . UPDATE .. . .. . When I change the PMD section of the pom.xml file to the below snippet I obtain some CPD results via PMD but still nothing from PMD on code bugs . I even coded in an NullPointerException and PMD said nothing even when issuing the mvn pmd : check command . In the snippet I changed the sourceEncoding tag to be utf-8 because everything I see in regards to this is utf-8 . I also changed the minimumTokens value to 1 to try to get more output from this plug-in . I also put this snippet in the build section to try and get results but still nothing.. . : .. . .. . Thanks for studying this.. . .. . Answer : The maven-pmd-plugin http : maven.apache.org plugins maven-pmd-plugin pmd-mojo.html by default skips nowadays empty reports property skipEmptyReport http : maven.apache.org plugins maven-pmd-plugin pmd-mojo.html skipEmptyReport . You ll need to set this to false to get in your site always a PMD CPD report : .. . .. . This applies for both PMD and CPD . I assume this is your problem as in Figure 2 you show there are no PMD violations detected pmd.xml file is empty . The property minimumTokens http : maven.apache.org plugins maven-pmd-plugin cpd-mojo.html minimumTokens configures CPD and defines how long a code snipped at a minimum must be to be declared as a duplicate . The lower the number the more duplicates are detected but the duplicates can also be much shorter and therefore maybe more often false positives . Without further configuring maven-pmd-plugin it uses by default these three PMD rulesets : java-basic http : pmd.sourceforge.net pmd-5.2.3 pmd-java rules java basic.html java-imports http : pmd.sourceforge.net pmd-5.2.3 pmd-java rules java imports.html java-unusedcode http : pmd.sourceforge.net pmd-5.2.3 pmd-java rules java unusedcode.html . See also property rulesets http : maven.apache.org plugins maven-pmd-plugin pmd-mojo.html rulesets . If you want to detect specific problems then you ll need to enable these rules . See also How to make a ruleset http : pmd.sourceforge.net pmd-5.2.3 customizing howtomakearuleset.html . Comment : Ah this worked . Thank-you for the help . : I added in some rules to trip up PMD and it did show it in the report Thank-you once again for this help with Maven and PMD . Awesome .", "Question : When defining a PMD ruleset is it possible to exclude a source file from a specific rule I want to do something like the following : .. . .. . Exclude only seems to be supported for rule names . Is there anything similar for source files Comment : I suppose you already know that you can add @SuppressWarnings PMD before a class to exclude that class from the checks . Comment : Yes but I think I would prefer to do it via rulesets . I guess I can split my pmd rulesets in two to allow me to have exclude some classes from running with certain ruleset . Comment : Example : I need to suppress Avoid duplicate imports warning in a particular class . I can not use @SuppressWarnings PMD for that warning . Comment : Intereseting. . Is there a way to exclude all the classes inside a package Let say i don t want to run PMD on my test classes located in test directory. . Comment : @SreedharGS See Excluding files from a ruleset at pmd.sourceforge.net pmd-5.2.3 customizing http : pmd.sourceforge.net pmd-5.2.3 customizing howtomakearuleset.html .. . Answer : Not without writing a custom rule that adds logic for excluding by file name . I think in your scenario the best approach is to run PMD in two passes - one with the larger set of rules against all the code . And one with the smaller set of rules against the code you want extra checks on . This does have the downside of generating two reports . But that is an easier problem to solve than the one you posed or than creating a custom rule . PMD can generate XML output . You can merge those programmatically and then call PMD s code to generate an HTML report at the end . Or you can just have two reports and be done right away . Comment : This is an outrageous flaw of PMD which nearly disqualifies it for use in larger enterprise environments . Comment : @Thomas : why An enterprise could have different rule sets . Or add NOPMD or @ SuppressWarnings . It s the rare rule that requires an exclusion by file . Comment : Well mostly because there are different kinds of files let s say test cases and production code . If you think of a Maven source folder structure http : maven.apache.org guides introduction introduction-to-the-standard-directory-layout.html the test cases are in src test java so I must exclude specific rules for files in these folders . The only way to do this in Eclipse is to have separate projects for the test cases . And I m not going to make 140 projects out of my 70 just to compensate a PMD shortcoming . Comment : @Thomas : Ah . I don t run PMD rules against my test cases . I agree it is a legitimate thing to want to do though .", "Question : I am using PMD in my Java project for code-review . Just want to know what the acronym P.M.D . stands for . I searched on Google but could not find anything . Does anyone know Comment : Please clarify your specific problem or add additional details to highlight exactly what you need . As it s currently written it is hard to tell exactly what you re asking . Comment : Do you mean you want to know what PMD stands for Comment : I was just trying to ask the full form of PMD . I know what it is..just want to know what it stands for .. . Answer : On the PMD project site http : pmd.sourceforge.net pmd-5.0.4 meaning.html you can find that they don t really know the meaning of the PMD letters . They just think the letters sound good together . You can find several backronyms to explain it on the PMD project site http : pmd.sourceforge.net pmd-5.0.4 meaning.html : .. . .. . Pretty Much Done .. . Project Mess Detector .. . Project Monitoring Directives .. . Project Meets Deadline .. . Programming Mistake Detector .. . Pounds Mistakes Dead .. . PMD Meaning Discovery recursion hooray Programs of Mass Destruction .. . Programming Meticulous coDe Comment : There we go a primary source . +1 Comment : @Anand maybe you should mark this answer as correct", "Question : There was a question comparing PMD and CheckStyle http : stackoverflow.com questions 184563 checkstyle-vs-pmd . However I can t find a nice breakdown on the differences similarities between PMD and FindBugs . I believe a key difference is that PMD works on source code while FindBugs works on compiled bytecode files . But in terms of capabilities should it be an either or choice or do they complement each other .. . Answer : PMD is .. . .. . famous .. . used widely in industry .. . you can add your rules in xml .. . gives you detailed analysis in Errors levels and warning levels .. . you can also scan your code for copy and paste lines . Duplicate code . This gives good idea about implementing java oops .", "Question : When defining a PMD ruleset is it possible to exclude a source file from a specific rule I want to do something like the following : .. . .. . Exclude only seems to be supported for rule names . Is there anything similar for source files Comment : I suppose you already know that you can add @SuppressWarnings PMD before a class to exclude that class from the checks . Comment : Yes but I think I would prefer to do it via rulesets . I guess I can split my pmd rulesets in two to allow me to have exclude some classes from running with certain ruleset . Comment : Example : I need to suppress Avoid duplicate imports warning in a particular class . I can not use @SuppressWarnings PMD for that warning . Comment : Intereseting. . Is there a way to exclude all the classes inside a package Let say i don t want to run PMD on my test classes located in test directory. . Comment : @SreedharGS See Excluding files from a ruleset at pmd.sourceforge.net pmd-5.2.3 customizing http : pmd.sourceforge.net pmd-5.2.3 customizing howtomakearuleset.html .. . Answer : It seem that PMD only support exclude files in RuleSet level . We have the same requirement that exclude files in Rule level . . Finally we write a customer wrapper lab and controller file traversal logic by ourself to solve this . But for normal PMD task. . We can make same rule together as a ruleSet and exclude it in ruleSet level . UPDATE : we found that extends net.sourceforge.pmd.lang.rule.XPathRule and add exclude file is simple . For Java Code Rule we can use the same way to exclude file in Rule definition . Comment : Could you write down more details on your UPDATE Actual code and configuration would be good .", "Question : We are working on a web project from scratch and are looking at the following static-code-analysis tools . Conventions Checkstyle .. . Bad practices PMD .. . Potential bugs FindBugs .. . .. . The project is built on Maven . Instead of using multiple tools for the purpose I was looking at a single flexible solution and came across SonarQube . Is it true that we can achieve the results from Checkstyle PMD and Findbugs with SonarQube .. . Answer : Sonar uses these 3 tools as plugins and aggregates the data from all three giving addition value by showing graphs and such from these tools . So they are complementary to sonar . Comment : yup sonar uses all three Comment : while this was true up to version 3.x Sonar 4.x is moving away from using at least PMD and CheckStyle in favor of its own internal Squid analyzer because it gives them more freedom to extend the ruleset and fix issues that have been plaguing these projects for a while . For instance they ve already deprecated more than 150 PMD rules and will eventually remove it entirely . Comment : Interesting post about the reason they deprecated those rules : sonarqube.org http : www.sonarqube.org already-158-checkstyle-and-pmd-rules-deprecated-by-sonarqube-java-rules .", "Question : We are working on a web project from scratch and are looking at the following static-code-analysis tools . Conventions Checkstyle .. . Bad practices PMD .. . Potential bugs FindBugs .. . .. . The project is built on Maven . Instead of using multiple tools for the purpose I was looking at a single flexible solution and came across SonarQube . Is it true that we can achieve the results from Checkstyle PMD and Findbugs with SonarQube .. . Answer : I would still use these tools in addition to sonar because they can fail the maven build when someone violates a rule . Where as sonar is more retrospective .", "Question : I d like to modify CPD to only spit out the Found a X line Y tokens duplication in the following files : .. . when generating a report i.e . suppress the source lines-of-code . I have the src files and attempted to modify SimpleRenderer.java in src net sourceforge pmd cpd by commenting out .. . .. . However the report has not changed . I m a bit of a Java novice so keep that in mind . Do I need to rebuild the pmd-4.2.x in Eclipse somehow .. . Answer : There are different ways to achieve this : .. . .. . 1 . Without modifying PMD CPD at all by using egrep . You can e.g . post-filter the report : .. . .. . bin run.sh cpd --minimum-tokens 100 --files src --encoding UTF-8 .. . egrep Found a Starting at line .. . .. . .. . This would output now only the lines which start with Found a or Starting at line . 2 . Modifying PMD CPD to adjust the report format . I would however suggest to implement this modified report format as a separate format e.g . naming it text without sources rather than changing the default format . You would then call CPD with bin run.sh cpd --format text without sources .. . . In that case you ll need to build PMD from sources . PMD uses Maven http : maven.apache.org to build you can use eclipse during development - but the package is built with maven . After a mvn clean package in the top-directory of the cloned sources from https : github.com pmd pmd you ll find the binary in the directory pmd-dist target . Look at how the reports are integrated in CPDConfiguration.java https : github.com pmd pmd blob master pmd-core src main java net sourceforge pmd cpd CPDConfiguration.java L162 - you can add your own version of the SimpleRenderer . 3 . Create a feature-request at https : sourceforge.net p pmd bugs Comment : Having thought about it I would actually like to spit out data in the form pathname number of duplicate lines by changing the source code format to rpt.append .append mark.getTokenSrcID .append match.getLineCount .append PMD.EOL but that requires the second option you gave . mvn clean package produces a 1KB jar but I m not sure how to execute the run.sh cpd script so that it actually spits out this new format . Any help Comment : Nevermind I got it working Thanks for your help", "Question : null .. . Answer : I have a PMD ruleset that contains the following rules with properties specified so that I ignore any violations for equals and hashCode methods automatically generated by Eclipse . Ideally I would like to share the properties across the rules to avoid duplication . Especially since I plan on adding the same properties for the various cyclomatic-complexity rules . Is there any support for this in a PMD ruleset Comment : AFAIK that is currently not possible . You would have to solve it outside of PMD e.g . write a script that generates the PMD config file . Comment : @Thomas that is the conclusion I was coming to . I ve opened a ticket sourceforge.net p pmd bugs 1466 https : sourceforge.net p pmd bugs 1466", "Question : I have to check some voilations like this .. . .. . ie . Here there should not MyComapany hard-code in expression or condition checking . which rule of CodePro do this . .. . Answer : PMD has a rule for similar problems that you described : .. . .. . AvoidDuplicateLiterals http : pmd.sourceforge.net pmd-5.2.1 pmd-java rules java strings.html AvoidDuplicateLiterals - Code containing duplicate String literals can usually be improved by declaring the String as a constant field .", "Question : We are introducing static-analysis tools into the build-system for our Java product . We are using Maven2 so Checkstyle http : checkstyle.sourceforge.net and PMD http : pmd.sourceforge.net integration come for free . However it looks like there is a large overlap in functionality between these two tools in terms of enforcing basic style rules . Is there a benefit from utilizing both of these I don t want to maintain 2 tools if one will work . If we choose one which one should we use and why We are also planning on using FindBugs . Are there other static-analysis tools we should look at Update : Consensus seems to be that PMD is preferred over CheckStyle . I don t see a solid reason to use both and I don t want to maintain 2 sets of rule files so we will probably aim for PMD exclusively . We ll also be bringing in FindBugs and perhaps eventually Macker to enforce architectural rules . .. . Answer : If we choose one which one should we use and why These tools are not competing but are complementary and should be used simultaneously . The convention type Checkstyle is the glue that enables people to work together and to free up their creativity instead of spending time and energy at understanding inconsistent code . Checkstyle examples : .. . .. . Is there javadoc on public methods Is the project following Sun naming-conventions Is the code written with a consistent format while PMD reminds you bad practices : .. . .. . Catching an exception without doing anything .. . Having dead-code .. . Too many complex methods .. . Direct use of implementations instead of interfaces .. . Implementing the hashcode method without the not equals Object object method .. . .. . source : http : www.sonarsource.org what-makes-checkstyle-pmd-findbugs-and-macker-complementary Comment : I agree that Checkstyle more focus on code format and forcing developer to follow Code standard but it also could detect a lot of bad practices take a look here http : sevntu-checkstyle.github.com sevntu.checkstyle and extension of Checkstyle is more easy for development but I do agree that it have limitations and will never overcome PMD and FindBug .", "Question : I want to use custom rulesets with the PMDPlugin https : plugins.jetbrains.com plugin id 1137 in IntelliJ 2016.1 on Windows . The Plugin page tells me .. . .. . PMD supports custom ruleset file to configure goto settings - PMD and add the rule set files that are required . but i can t find any setting to configure the PMDPlugin I m using version 1.7.7 . In fact when i m searching for PMD the only item listed in the search results of the settings menu is the Plugin itself . And under Tools - Run PMD the Custom Rules are greyed out . I found on this http : fr33kk0mpu73r.blogspot.de 2016 03 pmdplugin-custom-rules.html page a possible solution but it doesn t worked for me . And if it would i would like to change the rulesets for different projects and i don t want to modify the IDEA rules for each . Also i found a solution to set PMD as an external tool but i like how other plugins e.g . Checkstyle-IDEA integrate into the IDE . I also checked the QA-Plug with the PMD extension but there you can just select the settings and don t specify a custom ruleset . Thank s for your help Comment : And also the Confluence page https : confluence.jetbrains.com display CONTEST PMDPlugin of the plugin says PMD supports custom ruleset file where the user can group together or add his own rules . This plugin supports such rule sets . Go to settings - PMD and add the rule set files that are required . Now menu items will appear under Tools - PMD - Custom for the rulesets added and they can be run . .. . Answer : I think you are looking in the wrong place . Go to File Settings Other Settings PMD and there should be a + sign like below : .. . .. . enter image description here http : i.stack.imgur.com 5gQVD.jpg .. . .. . From there you can add your own custom rulesets .XML files . Comment : It would be great to have this but unfortunately this settings doesn t appear Which version of the plugin and the IDE you are using Comment : I use IDEA 14.1.6 and PMDPlugin 1.7.7 . Which IDEA version do you use Comment : As written above 2016.1 under Windows 7 Comment : You are right . I ve just installed 2016.1 to test and it does not work as expected . It is probably possible to add it as an external tool but I believe it will be too much hassle . The easiest solution I found was simply using QAPlug - PMD and it DOES allow custom rulesets . Just go to Tools QAPlug Analyze Code from there select Run With Chosen Profile click on the dots and on the next screen use the plus sign to create a new profile and import the rulesets you want to use . Comment : Ok thanks for spending the time", "Question : We know that PMD is integrated with eclipse . And i want to customize it . say suppose i want all variables to start with small letter or say i want all method name to be more than 8 characters or so on . is it possible to do that And does anyone know what PMD stands for .. . Answer : You can write new Rules with PMD . In your case new XPath Rules http : pmd.sourceforge.net xpathruletutorial.html would be adequate to quickly examine the AST Abstract Syntax Tree and perform the kind of detection you need . alt text http : pmd.sourceforge.net images designer screenshot.png .. . .. . So you can declare new ruleset http : pmd.sourceforge.net howtomakearuleset.html and integrate them in your eclipse http : pmd-eclipse.sourceforge.net along with your PMD plugin . .. . .. . Note : PMD stands for many things http : pmd.sourceforge.net meaning.html .. . .. . We ve been trying to find the meaning of the letters PMD - because frankly we don t really know . We just think the letters sound good together . Pretty Much Done .. . Project Mess Detector .. . Project Monitoring Directives .. . Project Meets Deadline .. . Programming Mistake Detector .. . Pounds Mistakes Dead .. . PMD Meaning Discovery recursion hooray Programs of Mass Destruction .. . Programming Meticulous coDe .. . A Chaotic Metal rock band name http : perso.wanadoo.fr vachementbien PMDnews.htm Comment : may i know full form of pmd Comment : @gurukulki : I ma not sure what you mean by full form but if it is what does P.M.D . stands for you can see it here : pmd.sourceforge.net meaning.html http : pmd.sourceforge.net meaning.html Comment : thanks. . ya it is what does pmd stands for Comment : Pretty Meaningless Description lol : in US they could probably patent the idea", "Question : We are working on a web project from scratch and are looking at the following static-code-analysis tools . Conventions Checkstyle .. . Bad practices PMD .. . Potential bugs FindBugs .. . .. . The project is built on Maven . Instead of using multiple tools for the purpose I was looking at a single flexible solution and came across SonarQube . Is it true that we can achieve the results from Checkstyle PMD and Findbugs with SonarQube .. . Answer : Yes and no . In addition to the other answers . Sonar is currently on the way to deprecate PMD checkstyle and findbugs and use their own technology for that called SSLR . They do it because they don t want to spend their time fixing upgrading or waiting on it those libraries e.g . for Java 8 which for example uses outdated libraries . They also got a new set of plugins for your personal IDE called SonarLint http : www.sonarlint.org index.html .", "Question : We are working on a web project from scratch and are looking at the following static-code-analysis tools . Conventions Checkstyle .. . Bad practices PMD .. . Potential bugs FindBugs .. . .. . The project is built on Maven . Instead of using multiple tools for the purpose I was looking at a single flexible solution and came across SonarQube . Is it true that we can achieve the results from Checkstyle PMD and Findbugs with SonarQube .. . Answer : Sonar is great but if you want to use the mentioned tools separately and still have nice graphs you can use the Analysis Collector Plugin http : wiki.jenkins-ci.org display JENKINS Analysis+Collector+Plugin as part of your Jenkins CI build . A slight advantage of this is that you can check in your PMD Findbugs Checkstyle configuration into your SCM and have it integrated into your Maven build rather than relying on a separate Sonar server ." ] }
[ "yes-answer-long", "yes-answer-short" ]
java
UNK_RELATION
backtrack-linux@debian@67
backtrack-linux -- backtrack is a linux distribution based on the @placeholder .
{ "confidence": [ 50.38526153564453, 48.749000549316406, 46.18190002441406, 45.72917175292969, 43.34752655029297, 42.964298248291016, 42.87920379638672, 42.87920379638672, 42.70925521850586, 41.328033447265625, 40.525665283203125, 38.0592041015625, 38.0592041015625, 38.0592041015625, 38.0592041015625, 37.283687591552734, 37.283687591552734, 36.72463607788086, 36.422935485839844, 36.422935485839844, 36.422935485839844, 34.461830139160156, 34.461830139160156, 34.461830139160156, 34.39832305908203, 34.39715576171875, 34.25817108154297, 32.62190628051758, 32.62190628051758, 32.62190628051758, 32.305137634277344, 31.93185806274414, 31.792770385742188, 31.197025299072266, 30.660797119140625, 30.29559326171875, 30.29559326171875, 29.37337303161621, 29.326305389404297, 29.326305389404297, 29.326305389404297, 28.886646270751953, 28.522382736206055, 28.477054595947266, 28.33448600769043, 28.33448600769043, 28.33448600769043, 27.730445861816406, 27.690040588378906, 27.169729232788086, 26.886117935180664, 26.515945434570312, 26.515945434570312, 26.497461318969727, 26.37940216064453, 26.37940216064453, 26.37940216064453, 26.37940216064453, 25.728931427001953, 25.728931427001953, 25.067852020263672, 24.925010681152344, 24.925010681152344, 24.925010681152344, 24.925010681152344, 24.74313735961914, 23.57207489013672, 22.913055419921875, 22.782028198242188, 22.782028198242188, 22.782028198242188, 20.87688446044922, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.66278648376465, 18.4066219329834, 16.196321487426758, 16.196321487426758, 16.196321487426758, 16.196321487426758, 16.196321487426758, 16.196321487426758, 16.196321487426758, 16.196321487426758, 16.196321487426758 ], "content": [ "Backtrack is a linux versions you don t need any .dll files", "I m not familiar with backtrack-linux doesn t it have any kind of package management", "Yes you re right I m often confused between Backtrack based on Ubuntu which is kind of based on Debian and backtrack Kali based on Debian", "however after two days searching on the internet the only way to use backtrack on usb is use the latest version of backtrack kali-linux https : www.kali.org I knew that when this message appreared cannot load a ramdisk with an older kernel image that means the computer hardware Does not match with the backtrack version .", "How to change my settings in VMware workstation or Backtrack", "Installed Xampp in Backtrack 5 r3 .", "I m running Win8.1 Backtrack .", "Backtrack 5 r3 .. . 2 .", "You re installing a very old PostgreSQL version and seem to be installing it on a bit of a boutique distribution backtrack-linux that quite likely has broken packages .", "Backtrack R3 Gnome 32bit .. . 3 .", "sda attached scsi disk where backtrack freezes and wont response .", "There s some good tutorials on the internet on how to use it check the backtrack forums", "is there a working box for backtrack 5 release 3 bt5r3 that is working with vagrant", "Were you ever able to make a Backtrack 5 box", "BackTrack 5R3 has a 32-bit GNOME VMware image for download grab that .", "I downloaded the ISO from backtrack-linux.org .", "Have you seen GRUB menu of Backtrack", "I am unable to create a wordlist in Backtrack by using the following command .. . .. . gives error .. . .. . What could be the possible reason for failure", "Backtrack represents the password in ASCII as dots but I ve tried that and it naturally didn t work .", "it s getting really messy and frustrating trying to install backtrack operating-system .", "I have seen videos of how to install backtrack ubuntu on android phone .", "Erase your usb-flash-drive and write Backtrack image to it again but with UnetBootIn .", "Do not try to install Backtrack 5 if don t know what GRUB is .", "I have also developed a node script to backtrack or crack the above key .", "In Window7 Ultimate 32-bit I run Backtrack 5 R3 in VMware workstation and connect via Wi-Fi with a TP-LINK wireless network adapter .", "Then i get a menu Backtrack live CD with options from which i chose Backtrack Text- Default boot text mode following a tutorial this http : backtracktutorials.com how-to-install-backtrack-5 .. . .. . But am constantly getting the same error message for all 3 images : .. . .. . Have no idea why this is happening first i thought may be it is because the image is for 32-bit windows and i have 64 bit operating-system so i downloaded the 64 bit backtrack r3 image but unfortunately it is showing the same .", "Does anyone know where I could download Backtrack any version for my Raspberry Pi as a .img file", "I believe that s another question if the repository you are using is not working then maybe you should contact Backtrack maintainers", "I have installed backtrack 5 r3 in my 16GB usb-drive in persistent mode .", "Now I want to take a boot of backtrack in my Android phone via OTG .", "Steps : .. . .. . OS : Backtrack Linux 5 .. . .. . Start Kismet on wlan0 .. . .. . Run the following command to convert .pcapdump to .txt through tshark .. . .. . tshark -r path Kismet.pcapdump log.txt .. . .. . Read log.txt for IP -- This shows all the student IPs But need to get the URL visitd by those IP too .", "i am trying to use backtrack5 on my virtualbox and set my adapter to bridged so that backtrack can have connection to the internet .", "I had tried to run backtrack 5 r3 from usb and i faced this problem at the end of the black screen : --- end trace ... . --- .. . .. . kernel panic - not syncing : attempted to kill init", "Anyway 100 way to make Backtrack like most of current Linux distros to work on UEFI is to turn UEFI to legacy mode BIOS though you have to unninstall Windows 8 - .. . .. . I would not give lot of hopes to that because Backtrack 5 is based on Ubuntu 10.04 which is way too old - earliest Ubuntu supporting UEFI is 12.04 .", "I used Linuxlive usb creator and backtrack 5 r3 gnome 32-bit .", "Backtrack R3 Gnome 64bit .. . .. . Am operating with 64 bit windows-8 operating-system and i have vmware 7.0.0 workstation installed .", "What i do is click on new virtual-machine specify the location of backtrack image set other things and start the virtual-machine .", "This side shows some alternative fonts to use with linux : http : mondaybynoon.com 2007 04 02 linux-font-equivalents-to-popular-web-typefaces", "I researched on the internet but I couldn t find something to fix that kind of problem and I tried your post as well but there is no apt-get install php5-gd in backtrack 5r3 .", "i ve tried to make the box myself but i had no luck because the vagrant docs about making the boxes is not informative.. . .. . .. . also this repo https : github.com hornos vagrant-backtrack-r3 doesn t describe how to get it running", "I had once a quite similar problem upgarde interrupted because battery died which was resolved when I upgraded my release from 13.10 to 14.04 .. . but it was on ubuntu not backtrack .", "Good Morning.If you are using backtrack 5 r3 in VMware means the wifi adapter will not be shown to your system as wlan because vmware will not take the wifi.So i searched in the internet for this problem and found a solution that we can use wifi adapter available in market where it can be bought and connected to your laptop and go to backtrack give ifconfig command to see the adapter in ur backtrack.But I have not installed like this.I have seen the video for this problem .", "Is it because Lucida Sans Unicode is already available in Windows but not in Linux", "I think linux installation is compatible with my device .", "Problem is that I cant use localhost on backtrack apache was running I write localhost on browser and it is open a page which I put to var ww... .", "You can install latest Ubuntu that can run on UEFI with SecureBoot not sure it s easy and enjoy all of the tools from Backtrack repositories .", "I have tried it also with some ms-dos ISO files I found and all of them act the same way as backtrack .", "I have this custom made site using Jekyll : http : madhur.github.com .. . .. . When I view this site under Backtrack Linux - Google Chrome 13 I see the main font as Sans Serif - Regular .. . .. . I have specified this under CSS file .. . .. . The same site under Windows 7 - Google Chrome 13 I see the font as Lucida Sans Unicode .. . .. . What is the reason for this discrepancy", "enter image description here http : i.stack.imgur.com YPgUV.jpg Installing Google Chrome On Backtrack 5r3 .. . .. . but i m getting error dpkg : need an action option .. . .. . now this error", "In Kali Linux go to Applications Kali Linux Exploitation Tools Password Attack Online Attack .", "First you would need a linux installation compatible with your device hardware .", "It seems you have installed Kali linux .", "I m running Kali Linux and I m using Metasploit .", "My Laptop model is HP Notebook 2000 2d28tu i have install Backtrack 5 R3 but Wi-Fi is not work so which driver i have install or solution to other way to this about.I have many try to solve this problem but not found proper solution", "Yes Lucida isn t available in Linux so the browser fallback to Sans Serif - Regular .", "Lakshay see this : stackoverflow.com questions 2538635 http : stackoverflow.com questions 2538635 possible-to-use-a-dll-on-linux", "No.. . Tedious work and in the end it didn t work properly so i m trying kali-linux but the vagrant image is not downloading properly", "Or could I install it over my operating-system now via bash Kali Linux", "Here is my wget command that I used at backtrack wget --recursive --level 2 --no-clobber --user-agent Mozilla --html-extension --convert-links http : ..... . -P var Thanks in advance .", "I have successfully run backtrack from the VM thingy that linuxlive has with all of the usb stuff and It works fine but it is really slow as I have too many windows processes running at the same time .", "view page linuxforums.org forum coffee-lounge http : www.linuxforums.org forum coffee-lounge 37811-does-linux-use-dlls.html 5D .", "Can you please suggest that i can use on linux", "I have Linux Backtrack5 running as guest operating-system in IOS .", "So does this above problem can be easily solved by kali-linux .", "I created a bash script to add My Scripts Bash Scripts to the default PATH of linux .", "@Shadur yes it had package management....and to install a httpd apache linux system need APR preinstalled .", "Im new to stackowerflow as well as apache and im sorry if i have placed this thread in a wrong place. . .. . .. . Can somebody please help me to avoid internal server error htaccess apache2ctl backtrack .. . .. . What i wanted to do was to add these lines to htaccess. . My htaccess and webserve is working fine without these lines. . but i need to add them to the htaccess .. . .. . as soon as i enter above lines it gives me this error when i refresh web .. . .. . Can somebody kindly give some advice please", "And bactrack is ubuntu based .", "i ve just found the solution should install bumblebee virtualgl linux-headers and mesa-utils .", "Try A live linux-distro with pyrit just to see if there is something wrong with your ubuntu install", "If it was on purpose - you kinda need to learn bash and linux basics first before you proceed .", "Also out of curiosity : why are you trying to run a distribution specialized for penetration-testing as a server or desktop system", "I always see this sentence : .. . .. . The connection for the USB device Ralink 802.11 n WlAN was unsuccesful .", "The device is currently in use .", "Why", "No free space left for crunch to print the entire word list", "Welcome to SO", "Can you elaborate on your answer it s little more than restating the problem from OP .", "How to update or install the sound driver in backtrack5r3 is the same way we do in ubuntu like to install some thing we write sudo-apt get insatall or the syntax is change anybody please help me out.I am running the os in vmware-workstation and i have problem with sound its not working .", "I think you are sound is not working.let me help you are you want to know some syntax .", "No i only want to configure sound problem later on i will learn more", "ok fine than follow my answer", "yeah sure i will because i am looking for it", "Ok follow the link and your problem will be solved .", "http : www.backtrack-linux.org forums showthread.php t 54103", "I tried to reinstall it but nothing changed .", "I have formatted usb to fat32 and have used unetbootin .", "Welcome to SO : Please don t use an image moreover a photo to post your shell output but edit your question and copy-paste your output inside it .", "ok i will thanks alot .", "this problem can exist on many computers not all of them .", "so here s what i did to get it working : .. . .. . here s the link where i found the solution : nvidia optimus bumblebee http : www.linux.org threads nvidia-optimus-on-linux.4415 .. . .. . hope this could help someone else too.. .", "I am designing a software to record only the URL visited by students while giving exam .", "So I somehow need to know which IP is visiting which site .", "I will have a list of all the IPs of students .", "I just need a way to find out what sites they are visiting .", "For this I tried Kismet and was able to generate the .pcapdump file which has the details of all the packets .", "The network is open and unsecured so I was able to get the list of all the IPs but couldn t see the URL they visited .", "Is kismet the right way to go", "I have to automate this whole thing so I cannot use Wireshark and manually convert the files so I choose Kismet .", "I need to be able to generate alert or some other activity as soon as a URL like www.google.com is visited by any of the IP in the database ." ] }
{ "confidence": [ 54.470741271972656, 52.319820404052734, 49.73305892944336, 47.8790397644043, 47.19258117675781, 45.962581634521484, 45.63904571533203, 45.409271240234375, 45.33478546142578, 45.28446960449219, 43.2829475402832, 42.88475799560547, 42.87150192260742, 40.25095748901367, 40.205543518066406, 37.72245788574219, 36.10868835449219, 36.08285903930664, 36.08285903930664, 36.08285903930664 ], "content": [ "Question : I had tried to run backtrack 5 r3 from usb and i faced this problem at the end of the black screen : --- end trace ... . --- .. . .. . kernel panic - not syncing : attempted to kill init sda attached scsi disk where backtrack freezes and wont response . I tried to reinstall it but nothing changed . I have formatted usb to fat32 and have used unetbootin . Comment : Welcome to SO : Please don t use an image moreover a photo to post your shell output but edit your question and copy-paste your output inside it . Comment : ok i will thanks alot . .. . Answer : however after two days searching on the internet the only way to use backtrack on usb is use the latest version of backtrack kali-linux https : www.kali.org I knew that when this message appreared cannot load a ramdisk with an older kernel image that means the computer hardware Does not match with the backtrack version . this problem can exist on many computers not all of them .", "Question : null .. . Answer : I have installed backtrack 5 r3 in my 16GB usb-drive in persistent mode . Now I want to take a boot of backtrack in my Android phone via OTG . Can I do that Any ideas how it can be done Note : I have already installed BT in my USB . Comment : No for two reasons . First you would need a linux installation compatible with your device hardware . Second you would need a bootloader willing to boot from a USB mass storage device which few if indeed any android phones normally have . Lastly this is off topic as it is not a development question . Comment : I think linux installation is compatible with my device . I have seen videos of how to install backtrack ubuntu on android phone . If anyone can edit bootloader or develop new upgraded bootloader then why can t it be done", "Question : I have a problem when resizing an image on php it says install gd library . I researched on the internet but I couldn t find something to fix that kind of problem and I tried your post as well but there is no apt-get install php5-gd in backtrack 5r3 . Comment : What does phpinfo says about gd Is jpeg support enabled You will need this to resize the images . .. . Answer : You need to enable the gd2.dll in your php.ini Comment : Backtrack is a linux versions you don t need any .dll files Comment : view page linuxforums.org forum coffee-lounge http : www.linuxforums.org forum coffee-lounge 37811-does-linux-use-dlls.html 5D . Comment : Lakshay see this : stackoverflow.com questions 2538635 http : stackoverflow.com questions 2538635 possible-to-use-a-dll-on-linux Comment : I placed php gd2.dll in php.ini . When I check php configuration I could not see gd library install . I also downloaded a zip file libgd-2.1.0-alpha1 and tried to install it shows a file path backup gdlib libgd-2.1.0-alpha1 in PHP Environment . Still I faced same problem .", "Question : I have this custom made site using Jekyll : http : madhur.github.com .. . .. . When I view this site under Backtrack Linux - Google Chrome 13 I see the main font as Sans Serif - Regular .. . .. . I have specified this under CSS file .. . .. . The same site under Windows 7 - Google Chrome 13 I see the font as Lucida Sans Unicode .. . .. . What is the reason for this discrepancy Is it because Lucida Sans Unicode is already available in Windows but not in Linux .. . Answer : Yes Lucida isn t available in Linux so the browser fallback to Sans Serif - Regular . This side shows some alternative fonts to use with linux : http : mondaybynoon.com 2007 04 02 linux-font-equivalents-to-popular-web-typefaces", "Question : is there a working box for backtrack 5 release 3 bt5r3 that is working with vagrant or a tutorial on how to make the box to work with vagrant i ve tried to make the box myself but i had no luck because the vagrant docs about making the boxes is not informative.. . .. . .. . also this repo https : github.com hornos vagrant-backtrack-r3 doesn t describe how to get it running or if that it s working or not if anybody had luck installing a working bt5r3 version on vagrant please share with us . if anybody has a working script to install bt5r3 tools on vagrant precise64 box please share with us . Comment : Were you ever able to make a Backtrack 5 box Comment : No.. . Tedious work and in the end it didn t work properly so i m trying kali-linux but the vagrant image is not downloading properly Comment : I also encountered similar problems . I had the .vmwarevm file but vagrant would not allow me to convert it to a .box . Comment : If you managed to make it please add the steps or upload it somewhere .. . Answer : BackTrack 5R3 has a 32-bit GNOME VMware image for download grab that . Convert it using free VMware OVF Tool latest is v3.5.0 I think to OVF OVA and then import it into VirtualBox . You can even directly attach the vmdk images to a newly created vbox VM and see if it boots up if so configure the as per the Vagrant base box package guide http : docs-v1.vagrantup.com v1 docs base boxes.html .. . .. . Once done use vagrant package to export the BT 5R3 VM to a vagrant .box file . For example : vagrant package --base vbox vm name or uuid --output path to bt5r3.box Comment : that is not an easy way.. . specially the base box package guide.. . will try it and see what i ll get", "Question : null .. . Answer : When i am trying to install apache server it showed the following error on . configure .. . .. . . So i tried to upgrade to apr-1.4.6.I downloaded the tarball and extracted it . Also make got the following error .. . .. . still i proceeded for make install .. . .. . On make install i got the following error .. . .. . Any help How to solve this out I need to upgrade from apache 2.2.4 to apache 2.4.4 . Any alternative suggestions are welcome Comment : You ve cut off all of the information required to figure out what s failing with your compile . : You need to tell us at least the libtool command that make tried to run and any other context before the error from make . Comment : I m not familiar with backtrack-linux doesn t it have any kind of package management Comment : .. . In fact it does -- apt-get . Also out of curiosity : why are you trying to run a distribution specialized for penetration-testing as a server or desktop system Comment : @Shadur yes it had package management....and to install a httpd apache linux system need APR preinstalled . Comment : So use the package manager to install apache 2.4 and APR .", "Question : it s getting really messy and frustrating trying to install backtrack operating-system . I have downloaded 3 images . There are : .. . .. . 1 . Backtrack 5 r3 .. . 2 . Backtrack R3 Gnome 32bit .. . 3 . Backtrack R3 Gnome 64bit .. . .. . Am operating with 64 bit windows-8 operating-system and i have vmware 7.0.0 workstation installed . What i do is click on new virtual-machine specify the location of backtrack image set other things and start the virtual-machine . Starts fine . Then i get a menu Backtrack live CD with options from which i chose Backtrack Text- Default boot text mode following a tutorial this http : backtracktutorials.com how-to-install-backtrack-5 .. . .. . But am constantly getting the same error message for all 3 images : .. . .. . Have no idea why this is happening first i thought may be it is because the image is for 32-bit windows and i have 64 bit operating-system so i downloaded the 64 bit backtrack r3 image but unfortunately it is showing the same . Help me with this error please .. . Answer : Use Vmware workstation 9 and the issue would be resolved", "Question : Does anyone know where I could download Backtrack any version for my Raspberry Pi as a .img file Or could I install it over my operating-system now via bash Kali Linux .. . Answer : I don t write a tutorial for this.. . I read following thread and I definitely believe you have a good answer here : .. . Tutorial1 https : www.raspberrypi.org forums viewtopic.php f 36 t 45205 Tutorial2 http : www.r00tsec.com 2013 04 howto-installing-kali-in-raspberry-pi.html .. . .. . I hope this will help you .. . .. . Best regards .. . .. . Daniel", "Question : null .. . Answer : In Window7 Ultimate 32-bit I run Backtrack 5 R3 in VMware workstation and connect via Wi-Fi with a TP-LINK wireless network adapter . I always see this sentence : .. . .. . The connection for the USB device Ralink 802.11 n WlAN was unsuccesful . The device is currently in use . Why How to change my settings in VMware workstation or Backtrack", "Question : null .. . Answer : I ve installed postgres but when I try to install it s header-files I get the following error : .. . .. . Thats when I run apt-get install libpq-dev . I ve already done apt-get install postgresql and libpq5 would not update . says it s already at newest edition Comment : The error msg says libpq5 is dependent upon 8.4.8-0ubuntu0.10.04 but the version you re installing is for 8.4.12-0ubuntu10.04 . Did you install the correct version of PostgresSQL Comment : You re installing a very old PostgreSQL version and seem to be installing it on a bit of a boutique distribution backtrack-linux that quite likely has broken packages . Consider using something a bit more commonplace if you re not comfortable wrangling apt .", "Question : My Laptop model is HP Notebook 2000 2d28tu i have install Backtrack 5 R3 but Wi-Fi is not work so which driver i have install or solution to other way to this about.I have many try to solve this problem but not found proper solution .. . Answer : Good Morning.If you are using backtrack 5 r3 in VMware means the wifi adapter will not be shown to your system as wlan because vmware will not take the wifi.So i searched in the internet for this problem and found a solution that we can use wifi adapter available in market where it can be bought and connected to your laptop and go to backtrack give ifconfig command to see the adapter in ur backtrack.But I have not installed like this.I have seen the video for this problem .", "Question : I was using the apt-get upgrade command when the battery of my laptop died . It told me to use dpkg --configure -a and I did . I also ran the commands apt-get install -f apt-get autoremove and used apt-get upgrade again But these are the errors I am getting : .. . .. . for apt-get upgrade after I had already run dpkg --configure -a : .. . .. . This is the end part as the entire output is huge . This is the ouput for apt-get autoremove : .. . .. . This is the output for dpkg --configure -a when i ran it again : .. . .. . The output for apt-get install -f : .. . .. . I would like to fix these . I did try reading up this problem but they all asked to use these commands and it didn t help . .. . Answer : Mmmmh .. . maybe try this : .. . .. . First : .. . .. . etc .. . .. . .. . Then if it s still not working maybe this : .. . .. . or .. . .. . or maybe : .. . .. . corresponding to : .. . .. . se-toolkit .. . w3af .. . subterfuge .. . .. . .. . .. . What about dist-upgrades I had once a quite similar problem upgarde interrupted because battery died which was resolved when I upgraded my release from 13.10 to 14.04 .. . but it was on ubuntu not backtrack . Comment : Dist upgrade gave the same errors . I ll try the other suggestions Comment : And bactrack is ubuntu based . It just uses different tools Comment : Yes you re right I m often confused between Backtrack based on Ubuntu which is kind of based on Debian and backtrack Kali based on Debian Comment : Even I d have to google that haha Comment : sudo dpkg -P --force-all package seems to have worked . Not getting those errors anymore . How do i know if something I might need wasn t removed", "Question : First off sorry for my english it is not very good . I have a Toshiba satellite c885d running windows-8.1 . I have a lexar 4 gigabyte usb flashdrive . It says on the back : LJDS50-4GB . I used Linuxlive usb creator and backtrack 5 r3 gnome 32-bit . I downloaded the ISO from backtrack-linux.org . When I put my usb into my computer hold f12 and power it on it takes me to the boot menu where it gives me 4 options to boot from . after each one there is a little bit of text . except after usb is blank . and then at the bottom is two more options one taking you to the menu that you can also access by pressing f2 durring startup . If I hit enter when usb is selected it takes me to a black screen that says two words something like checking usb but I forgot . I will put in an edit that will contain a picture and the exact text . then after 2 seconds it says failed and then launches windows . PLEASE PLEASE PLEASE help me out . I tried researching a solution to the problem none of which worked . I have successfully run backtrack from the VM thingy that linuxlive has with all of the usb stuff and It works fine but it is really slow as I have too many windows processes running at the same time . If anyone can diagnose me with a problem awesome . If you can give me a solution stupendous . edit : it says checking media and then failed .. . .. . images : boot menue http : i.stack.imgur.com h16qu.jpg .. . .. . failed screen http : i.stack.imgur.com CXanm.jpg Comment : Have you seen GRUB menu of Backtrack Comment : I have heard of grub but I don t really know what it is but mostly whether or not it would be useful in my case . Comment : GRUB is a bootloader . It boots your OS . It s a first thing you should see after BIOS UEFI . If you don t see GRUB menu then you are unable to boot . So tell me have you seen this menu http : 4.bp.blogspot.com -mVG176bOiyk T3 VtGQitYI AAAAAAAAABQ -Vmwi31nfSg s1600 bt+boot.jpg Comment : No i haven t . I cant even get near that step . .. . Answer : Ok after some discussion in question comments I suspect that the problem is in your install image . If you can t see GRUB menu then you are unable to enter bootloader on your USB drive . It might be several things causing your problem with common denominator - UEFI : .. . .. . 1 . You have written your install image incorrectly and UEFI is not recognizing it . 2 . You have written your install image correctly but that image is not capable to run on UEFI - see discussion here http : www.backtrack-linux.org forums showthread.php t 46801 . Anyway 100 way to make Backtrack like most of current Linux distros to work on UEFI is to turn UEFI to legacy mode BIOS though you have to unninstall Windows 8 - .. . .. . I would not give lot of hopes to that because Backtrack 5 is based on Ubuntu 10.04 which is way too old - earliest Ubuntu supporting UEFI is 12.04 . I can recommend a few things that might help : .. . .. . 1 . Erase your usb-flash-drive and write Backtrack image to it again but with UnetBootIn . There is an official tutorial http : www.backtrack-linux.org tutorials usb-live-install for that . 2 . Do not try to install Backtrack 5 if don t know what GRUB is . You can install latest Ubuntu that can run on UEFI with SecureBoot not sure it s easy and enjoy all of the tools from Backtrack repositories . Good Luck and have a lot of fun Comment : Well apparently I need 5.8 gigabytes to install Ubuntu so that doesn t work with my USB but either way I can put the files on USB through unetbooten but still nothing happens . I have tried it also with some ms-dos ISO files I found and all of them act the same way as backtrack . Comment : I apologize for my stupidity jeeze I was ethis dumb . I know have grown greatly in knowledge as this is simple as 123 now . I just had to disable secure boot enable CSM booting and set my boot order . Also ignore my stupid question with the 5.8 gigabytes . I though I was installing it onto a usb-drive while ubuntu iso is only 1.somethin gigs . Comment : No problem - Everybody s here to help each other .", "Question : Well I ve recovered a WEP Wi-Fi password using Aircrack-ng and it says the password is 00 : 00 : 00 : 00 : 00 in hex which is five times null . Backtrack represents the password in ASCII as dots but I ve tried that and it naturally didn t work . How do I enter that I m running Win8.1 Backtrack . I ve googled that null on Win is alt + 255 but that didn t work for me . Any ideas are nice . .. . Answer : So I ve managed to do it . I ve typed alt + 255 in CMD which seems to be null code and then I right clicked on the cmd window copied everything pated in notepad++ and selected just the char I wanted .", "Question : I am unable to create a wordlist in Backtrack by using the following command .. . .. . gives error .. . .. . What could be the possible reason for failure .. . Answer : No free space left for crunch to print the entire word list Comment : Welcome to SO Can you elaborate on your answer it s little more than restating the problem from OP .", "Question : Installed Xampp in Backtrack 5 r3 . I wanted to use Damn Vulnerable Web App through it . But after copying DVWA files to local host i.e XAMPP when i try to access by going to 120.0.0.1 dvwa its showing 403 error . I got a .htaccess file in DVWA folder . I saw below codes . please help . .. . Answer : Add allow from your IP of your BT machine .. . .. . Example : .. . .. . allow from 192.168.0.0 16", "Question : I need a help on cracking backtracking the hash key in URL . The URL will be like www.example.com key xxxxxxxxxxxxxxx . The hash-key URL has totally 16 character and each character is alpha numeric . So I need to crack the above hash key pattern . I have also developed a node script to backtrack or crack the above key . but on the 700000 turn the system hangs . So does this above problem can be easily solved by kali-linux . Or is there any way to sort my problem . .. . Answer : you can use curl and any scripting-language to request the url s If I m understanding your question you just want a rainbow script to give you all the possible answers to the key . In Kali Linux go to Applications Kali Linux Exploitation Tools Password Attack Online Attack . Burp suite comes to mind since I am familiar with that tool . A rainbow attack can easily be configured with burp suite or OWASP . Other tools will also do the trick . hope that helps.. . Comment : Will it work like a champ . my concern is how long it take to find the exact key from the total 16 character each character might be number alphabet or symbols like bold - bold . i have create a node script for for this purpose.but i fail s after 50k routine . So bit confused now . please help me on this .", "Question : enter image description here http : i.stack.imgur.com YPgUV.jpg Installing Google Chrome On Backtrack 5r3 .. . .. . but i m getting error dpkg : need an action option .. . .. . now this error .. . Answer : I had this error even using -i . Then I tried using --install and it worked . sudo dpkg --install google-chrome-stable current i386.deb", "Question : enter image description here http : i.stack.imgur.com YPgUV.jpg Installing Google Chrome On Backtrack 5r3 .. . .. . but i m getting error dpkg : need an action option .. . .. . now this error .. . Answer : please correct your command dpkg -i google-chrome-stable current i386.deb You need to provide -i instead of .i option Comment : thnx buddy let me try this", "Question : enter image description here http : i.stack.imgur.com YPgUV.jpg Installing Google Chrome On Backtrack 5r3 .. . .. . but i m getting error dpkg : need an action option .. . .. . now this error .. . Answer : Today I had the same problem when following a tutorial on how to install chrome . The problem was that I was copying a different character set from the tutorial which caused confusion in the hyphen from the syntax ." ] }
[ "yes-answer-long", "yes-answer-short" ]
debian
UNK_RELATION
argonaut@scala@170
argonaut -- argonaut is a json library for scala providing a rich library for parsing printing and manipulation as well as convenient codecs for translation to and from @placeholder data types .
{ "confidence": [ 55.596519470214844, 55.37803649902344, 50.11376190185547, 47.09592819213867, 47.09592819213867, 46.79906463623047, 46.20994567871094, 46.17981719970703, 45.95130157470703, 44.637962341308594, 44.54553985595703, 44.54035949707031, 44.26948928833008, 43.49263000488281, 43.117759704589844, 43.00810241699219, 42.81391143798828, 42.3544921875, 42.33675765991211, 42.119911193847656, 42.090641021728516, 42.090641021728516, 42.090641021728516, 41.86276626586914, 41.72781753540039, 41.6685791015625, 41.53022003173828, 41.14457702636719, 40.85831832885742, 40.582481384277344, 40.49005126953125, 40.364192962646484, 40.34297180175781, 39.92298889160156, 39.55065155029297, 39.228271484375, 38.772361755371094, 38.1962890625, 37.628509521484375, 37.50182342529297, 37.50182342529297, 37.50182342529297, 37.04591369628906, 37.04591369628906, 37.04591369628906, 37.04591369628906, 37.04591369628906, 36.734153747558594, 36.35648727416992, 36.2144660949707, 35.900577545166016, 35.900577545166016, 35.82587432861328, 35.7304573059082, 35.56395721435547, 35.2906608581543, 34.30265426635742, 34.30265426635742, 34.13186264038086, 34.13186264038086, 34.13186264038086, 34.13186264038086, 34.05830383300781, 33.89328384399414, 33.84458923339844, 33.842140197753906, 33.139404296875, 33.06582260131836, 32.98652648925781, 32.810523986816406, 32.58457946777344, 32.57620620727539, 32.57620620727539, 32.57620620727539, 32.57620620727539, 32.57620620727539, 32.57620620727539, 32.57620620727539, 32.57620620727539, 32.57620620727539, 32.57620620727539, 32.083831787109375, 31.92339324951172, 31.567096710205078, 31.430870056152344, 31.430870056152344, 31.430870056152344, 31.084075927734375, 30.492557525634766, 30.245037078857422, 29.840648651123047, 29.840648651123047, 29.813806533813477, 29.11172866821289, 27.985889434814453, 27.125818252563477, 26.91493034362793 ], "content": [ "I m trying to parse json with Scala and Argonaut .", "You can see some examples here : github.com argonaut-io argonaut tree master argonaut src test https : github.com argonaut-io argonaut tree master argonaut src test scala argonaut example", "I m using Argonaut for the JSON decoding .", "I m using argonaut to parse json to case classes .", "I m using Argonaut to parse JSON strings .", "Play s JSON library provides a lazyRead method for this kind of situation but I m not sure there s anything comparable in Argonaut .", "https : github.com dwhjames argonaut-spray .. . .. . this library seems to be what you want .", "I have defined EncodeJson argonaut codecs for both classes mentioned above .", "I m using Argonaut to parse objects from a remote JSON provider .", "Is it possible using Argonaut", "Argonaut consciously http : mth.io slides argonaut 18 takes the Haskell approach by private ing case classes and providing data constructors manually .", "And value 0.6 converts to 0.6000000238418579 by Argonaut .", "The docs http : argonaut.io doc parsing for argonaut are fairly comprehensive in this regard .", "Using argonaut is a side-tangent .", "I need to create this json object using scala and argonaut : .. . .. . with scala i m create this object : .. . .. . But the json generated is this : .. . .. . Can help please", "I don t really use argonaut I use play-json with spray .", "What version of argonaut are you using", "As of Argonaut 6.1-M5 you can use macros to automatically derive codecs from case classes like so :", "Have been following the example for Implicit JSON conversion with Scala http : lollyrock.com articles scala-implicit-conversion .. . .. . This question is similar to : Encoding nested classes using scala argonaut http : stackoverflow.com questions 22675722 encoding-nested-classes-using-scala-argonaut .. . .. . The difference being an additional layer s of nesting .", "Is there a way to do this in Argonaut", "How do you know that it s argonaut problem", "argonaut-shapeless has a different opinion on Option .", "Is this a Scalaz and Argonaut incompatibility issue or is it something else", "I am trying to convert a list of objects to json using argonaut .", "Possible duplicate of decode and encode with argonaut http : stackoverflow.com questions 35460608 decode-and-encode-with-argonaut", "Argonaut naturally converts Tuples into Arrays .", "But at a glance it seems like there needs to be an argonaut support trait import pulled in for your implicit codecs to convert to spray s unmarshaller similar thing is required for play-json .", "Is there any way I can convert a list of the above types to json using argonaut", "and you need to sign the argonaut data-access agreement to get an account .", "Would you mind depending on argonaut.io http : argonaut.io + github.com alexarchambault argonaut-shapeless https : github.com alexarchambault argonaut-shapeless", "Argonaut has a deepmerge method on the Json type which does exactly that .", "But if it doesn t argonaut will report that video section is not provided .", "Given an object of type Any and its TypeTag how can Argonaut Shapeless be used to create JSON of it", "I had to move codecs to respective companion objects or i could have put the Argonaut ones in a lower priority context .", "JsonString in Argonaut is simply a type alias for String but numbers are slightly more complicated because there is no core Scala type that can perfectly represent numbers in JSON .", "I m trying to decode json in refract https : github.com refractproject refract-spec -style with argonaut .", "Is there a clever way to tell argonaut how to encode it the right way", "I would suggest you to create a Parameter trait extend the classes with it and write a serializer for Parameter that checks all the types with pattern-matching : .. . .. . Note : I m using play-json library you should adapt it to argonaut .", "I am trying to change the implementation of this function from using plays json library like so .. . .. . to use argonaut like so .. . .. . but I get .. . .. . Cannot write an instance of argonaut.Json to HTTP response .", "I would like to encode to json a field of type List E using argonaut lib .", "Actually you need a body parser that parses the request body using argonaut instead of play-json .", "I am able to easily parse complex JSON return objects with Argonaut on this type of endpoint .", "I kinda worked around this one using Argonaut directly .", "I can t seem to figure out how your code integrates with argonaut .", "I guess thats the penalty for stepping out of the framework and using argonaut .", "as defined by argonaut then you have to create a custom instance of the EncodeJson type class .", "Have you seen Argonaut docs http : argonaut.io doc", "I m trying this simple example from the Argonaut quickstart : .. . .. . I m getting a compilation error on casecodec3 .", "I don t use Argonaut but use spray-json and suspect solution can be similar .", "With argonaut http : argonaut.io I can generate some JSON as : .. . .. . But it will generate json with reversed order : .. . .. . Actually I want it to be : .. . .. . Is there any way to do that", "I haven t used argonaut but I guess the problem here is a general issue .", "I had only glanced over argonaut but never used it .", "How can an extension method be written to remove all keys with a null value from an Argonaut Json object : .. . .. . I tried this : .. . .. . but it only seems to be removing keys with null values at the top level of the Json object.. .", "Reading the documentation for lenses Argonaut I had the impression that you should always define the kind of JSON data type that you expect .", "In Scala algebraic-data-types are encoded as sealed one-level type hierarchies .", "It s also worth noting that both circe https : github.com travisbrown circe and argonaut-shapeless https : github.com alexarchambault argonaut-shapeless provide generic codec derivation mechanisms for sealed trait hierarchies that use discriminators .", "I cloned the argonaut and scalaz repos and grepped the source and I only see that in example code .", "I had defined a custom singleton object named Argonaut which introduced a name conflict that caused the problem .", "I m using Rapture JSON https : github.com propensive rapture blob dev doc json.md with Argonaut backend can change that if necessary .", "I have a case class and companion-object : .. . .. . I want to use Argonaut to parse some JSON and return a Person OR some errors as a list .", "For example I have following code : .. . .. . If I use Argonaut instead of play-json lib how should I write the implicit converter", "For example I have following code : .. . .. . How should I write the code like Reads and Writes using Argonaut instead of Play json", "Suppose I have such json .. . .. . and such case class .. . .. . In play-json I could write the reads like this : .. . .. . I m looking for a equivalent way of decoding only the sha of parent in argonaut circe but I haven t found any .", "Take argonaut for example in some of our projects when there is the need to handle JSON people will use argonaut for that and hardcoding the fields like : .. . .. . If there is a big case class the list will be very long : .. . .. . My question is why do we need to hardcode them rathar than get the field by reflection", "You can see that the problem I mentioned with Haskell encoding exists with Argonaut as well .", "Unfortunately I don t have links to any of those except for a couple - this answer http : stackoverflow.com questions 25222215 scala-type-based-list-partitioning 25223200 25223200 by Travis Brown and Argonaut http : argonaut.io a purely-functional JSON library for Scala .", "I am searching for the decode and encode withs argonauts but I did not understand well .can you explain to me the fact of using argonaut .", "I am passing from SprayJsonSupport to argonaut based on this example https : github.com spray spray blob release 1.3 examples spray-client simple-spray-client src main scala spray examples Main.scala .", "In the above solution argonaut expects a list to construct a json array jArray so I had to accept anything that s traversable and convert it to a list .", "If your imports are in order then that should just work : .. . .. . In the REPL make sure to enter paste mode .. . .. . You don t see the source in github because the source is generated for example GeneratedCodecJsons.scala as defined in the build here https : github.com argonaut-io argonaut blob master project Boilerplate.scala", "You ll need to be authorized via OAuth in order to get this data back .. . .. . EDIT : Updated to reflect that non-availability is due to lack of OAuth authentication not Argonaut intention", "In the Argonaut DecodeJson trait there is a method for chaining together decoders so that the first succeeding decoder is chosen .", "The numeric type in Argonaut is JsonNumber so the type of the first argument passed to mod needs to be JsonNumber JsonNumber .", "Are you willing to use the Monocle https : github.com julien-truffaut Monocle lenses that Argonaut provides instead of the Scalaz lenses", "@FintahH It s a real REPL session but with Argonaut 6.1 which uses a different Monocle version with a slightly different package arrangement .", "If not I might submit a PR to argonaut for the DecodeJson DecodeJson A instance and see if anyone is interested .", "Both arrows are handled by argonaut but it s the first arrow that s overridable through EncodeJson .", "I m having a hard time slogging through the Argonaut documentation so I figured I d just ask for a simple example .", "Have you checked this out stackoverflow.com questions 29596564 http : stackoverflow.com questions 29596564 scalaz-validation-with-argonaut", "Working through the APIs I cannot find a way to deal with this problem using Argonaut .", "There is also a helpful example in the QuickStart http : argonaut.io doc quickstart documentation on the Argonaut website .", "Neither circe nor Argonaut keeps track of which fields have been read in JSON objects so you can just ignore the extra url field just as in Play .", "I know how to do json parsing using play-json library for play application .", "I m going to answer with the current milestone of argonaut-shapeless 1.0.0-M1 which has had relevant additions since the 0.3.1 version .", "I am open to use argnaut for this particular requirement if argonaut is going to offer elegant efficient solution to the problem at hand .", "would you mind sharing more detail on how can this be achieved using argonaut", "@Reactormonk : just added argonaut tag to the question - if you can share your answer .", "You can do this pretty nicely with the new-ish Monocle https : github.com julien-truffaut Monocle support in Argonaut I m using Argonaut master here since the 6.1 milestones are still on Monocle 0.5 : .. . .. . And then : .. . .. . The operators look horrible at first but you get used to them and the composed pieces read pretty naturally .", "I have a Scala project that uses a bunch of Java code for example this Java source : .. . .. . I then have a bunch of Scala case classes that I serialise to and from JSON using Argonaut like this : .. . .. . Fine now I want to write a Scala case class that uses a Java enum like so : .. . .. . This will yield a compilation error because there is no implicit codec for the Category enum .", "Use some HTTP client library to get the data and then parse it with some JSON library .", "EDIT : I will gladly accept as an answer any alternative approach to decoding more-than-2-wide subtype hierarchies using Argonaut .", "With this kind of erasure Any val I doubt Argonaut could find an appropriate instance of the Encoder typeclass indeed pretty sure it won t .", "Is it possible to deep merge a JSON Structure using lift JSON argonaut etc .. . .. . I am attempting to deep merge a new attribute instance : PQRSTUW into metrics tags structure .. . .. . to yield .. . .. . Is this possible", "Sum Types encapsulate values and distances the codecs from the types being used for return values .", "I have a type Wf which is .. . .. . I have the following implicit function defining an argonaut decoder .. . .. . here is the json I am trying to decode .. . .. . if I do .. . .. . I get the expected some Wf .. . .. . if I do .. . .. . I get Nil .", "So far I ve tried spray-json and argonaut and I wind up with way more boilerplate than my simple usage scenario would justify : .. . .. . For argonaut I couldn t even figure out how to match the type field since DecodeResult has no filter method : .. . .. . Is there another lib that can handle this better or is there some feature in one of these libs I ve overlooked that would significantly reduce the boilerplate", "I need parse some JSON into Scala instance or into error JSON ." ] }
{ "confidence": [ 77.97219848632812, 76.3465576171875, 73.91492462158203, 71.56121063232422, 64.37959289550781, 64.19364166259766, 63.34575271606445, 62.87104034423828, 60.86419677734375, 60.68831253051758, 60.66520690917969, 60.05836486816406, 58.873268127441406, 57.49290084838867, 55.4229850769043, 54.177574157714844, 54.09207534790039, 54.0794677734375, 53.66423034667969, 53.6553840637207 ], "content": [ "Question : null .. . Answer : I would like to use the public API of guildWars2 and decode and encode some informations . I am searching for the decode and encode withs argonauts but I did not understand well .can you explain to me the fact of using argonaut . thanks Comment : Have you seen Argonaut docs http : argonaut.io doc Specially the docs about codecs http : argonaut.io doc codec Comment : Ok I will see the documentation but I want an example of application . Comment : You can see some examples here : github.com argonaut-io argonaut tree master argonaut src test https : github.com argonaut-io argonaut tree master argonaut src test scala argonaut example Comment : how can I consume a public rest API and access to its resources Comment : @imen Don t mix concerns if you don t have to . Use some HTTP client library to get the data and then parse it with some JSON library .", "Question : I need to create this json object using scala and argonaut : .. . .. . with scala i m create this object : .. . .. . But the json generated is this : .. . .. . Can help please .. . Answer : The JSON generated contains an Array but you want a Map instead . In order to find out where you have gone wrong you should investigate the Scala types you have created before the JSON encoding . Your code can be refactored to the following : .. . .. . where tuple is of type Tuple3 Map String Map String String Map String Map String String Map String Map String String . Argonaut naturally converts Tuples into Arrays . In order to get the JSON you want you need to change the Tuple into a Map : .. . .. . Where the final answer is : .. . .. . A side note : you may find it easier to construct your data with case classes and then write Codecs http : argonaut.io doc codec to encode them instead . I find case classes easier to reason about than Maps of Maps of Maps . As of Argonaut 6.1-M5 you can use macros to automatically derive codecs from case classes like so : Comment : Thanks this works fine I try to implement Codecs for easy manage data .", "Question : I am trying to convert a list of objects to json using argonaut . The list contains a list of validation errors of varying type . For example it can contain an instance of MissingParameter or InvalidParameter or any other type . I have defined EncodeJson argonaut codecs for both classes mentioned above . Is there any way I can convert a list of the above types to json using argonaut I mean can I achieve the following .. . Answer : I haven t used argonaut but I guess the problem here is a general issue . The type of the list here is List Product with Serializable . And the compiler won t know how to serialize it to Json . I would suggest you to create a Parameter trait extend the classes with it and write a serializer for Parameter that checks all the types with pattern-matching : .. . .. . Note : I m using play-json library you should adapt it to argonaut .", "Question : I am passing from SprayJsonSupport to argonaut based on this example https : github.com spray spray blob release 1.3 examples spray-client simple-spray-client src main scala spray examples Main.scala . After some code modification : .. . .. . I got this error .. . .. . Error : 41 42 not enough arguments for method unmarshal : implicit evidence 1 : spray.httpx.unmarshalling.FromResponseUnmarshaller GoogleApiResult spray.http.HttpResponse GoogleApiResult . Unspecified value parameter evidence 1 . val pipeline sendReceive unmarshal GoogleApiResult .. . .. . I take a look at the unmarshall method : .. . .. . How can I add the implicit parameter and why I did not got such error whith the sprayJsonSupport The hole code : .. . Answer : I don t really use argonaut I use play-json with spray . But at a glance it seems like there needs to be an argonaut support trait import pulled in for your implicit codecs to convert to spray s unmarshaller similar thing is required for play-json . https : github.com dwhjames argonaut-spray .. . .. . this library seems to be what you want . Your implicits and imports look fine pulling in the library should solve your problem .", "Question : I know how to do json parsing using play-json library for play application . For example I have following code : .. . .. . How should I write the code like Reads and Writes using Argonaut instead of Play json .. . Answer : May be this is what you are looking for Actually you need a body parser that parses the request body using argonaut instead of play-json . Hope this helps .", "Question : null .. . Answer : I am new into Spray and Scala . I m currently working with the public REST API of Guild Wars 2 . I would like to consume some resources like gathering all sell and buy orders on the trading post of an item named Bolt of Damask . I m using Argonaut for the JSON decoding . Could anyone please give me some pointers on how I could achieve this Thanks a lot . Comment : Have you checked Argonaut s documentation on parsing argonaut.io doc parsing http : argonaut.io doc parsing Comment : Possible duplicate of decode and encode with argonaut http : stackoverflow.com questions 35460608 decode-and-encode-with-argonaut Comment : I would like to extract the id of an item given its name in this URL : api.gw2tp.com 1 bulk items-names.json quot http : api.gw2tp.com 1 bulk items-names.json quot . how can I proceed", "Question : I m using Argonaut to parse objects from a remote JSON provider . The API has two types of endpoints one is a traditional REST request at a URL and the response of a single JSON object . I am able to easily parse complex JSON return objects with Argonaut on this type of endpoint . My problem is with the provider s streaming endpoint which returns random JSON objects from a bounded set of JSON for a given endpoint . The objects are returned in the order they occur on the site and any one of about twenty different objects could be returned at any time . Working through the APIs I cannot find a way to deal with this problem using Argonaut . The APIs all seem to require type parameterization which is difficult in an environment where the type of the next object is impossible to predict . One option is to dispatch to different codecs based on the first few characters in each block of JSON but this undermines the goal of sending a JSON string to the parser and getting an object in return . The best I have been able to find so far is to have all of the top level case classes extend an empty trait : .. . .. . Unfortunately ModelSubclassA and ModelSubclassB both have several associations to other case classes and while this example compiles it fails at runtime when these subtypes are attempted to be parsed . In all there will be several dozen case classes that form the hierarchy of returned data . I have also tried building this with a for-comprehension but no luck there either . Can anyone advise of better patterns here UPDATE .. . .. . The following seems to have a more scalable pattern but the types are not cooperating : .. . .. . Error : 10 17 type mismatch found : argonaut.DecodeResult ModelSubclassB required : argonaut.DecodeResult Product with Serializable with Model Note : ModelSubclassB : Product with Serializable with Model but class DecodeResult is invariant in type A . You may wish to define A as +A instead . SLS 4.5 c.as ModelSubclassB .asInstanceOf DecodeResult Model .. . .. . So I started looking at the source and realized the definition of DecodeResult had changed to include the +A as suggested by the error in version 6.2-M1 . Upgrading to that version unfortunately turned all the Model subclass codecs into ambiguous implicits though which makes sense . Ugh.. . .. . Answer : The answer to this requires two pieces : .. . .. . 1 . Sum Types encapsulate values and distances the codecs from the types being used for return values . In the example above the Model trait is used by the codecs for resolution of implicits . If it s also used as a return-type recursive definitions are introduced that the compiler cannot resolve unambiguously . 2 . Once the sum types are used it s simple for a client to accept these types and use an extractor in a match to get to the real value within .", "Question : I am trying to convert a list of objects to json using argonaut . The list contains a list of validation errors of varying type . For example it can contain an instance of MissingParameter or InvalidParameter or any other type . I have defined EncodeJson argonaut codecs for both classes mentioned above . Is there any way I can convert a list of the above types to json using argonaut I mean can I achieve the following .. . Answer : The solution by Feyyaz seems to be the best solution possible . Just to avoid pattern-matching every possible subclass I am defining a contract in the parent so every subclass must provide an encoder . Not sure if it s perfect but it does what I expect . I hope it helps someone who is looking for a similar solution . In the above solution argonaut expects a list to construct a json array jArray so I had to accept anything that s traversable and convert it to a list . I am not sure if I can improve that part . And a test case Make sure to import the package where the above code resides so that the implicit json value will be available on the list :", "Question : I m trying to encode decode following case class .. . .. . using the following code : .. . .. . with argonaut but I m getting the following compiler error : .. . .. . Obviously the compiler doesn t know how to handle encoding of List Person because it s used inside the definition of how to encode Person . Is there a clever way to tell argonaut how to encode it the right way Update : Thanks to Travis : It s compiling now but it s not working . leads to an infinite recursion and a stack-overflow trying to decode .. . .. . results in .. . .. . Is this approach to decode this nested json even valid Do I have to tackle it completely different Or is just another small piece of code missing .. . Answer : You re very close you just need to specify the type explicitly : .. . .. . Just as Scala won t allow you to write a recursive method without an explicit result type it won t find the implicit being defined inside the definition without one . Not sure how clever that is but it works . Comment : Thanks Travis It s compiling now but still not working . I m facing a stackoverflow when trying to decode a nested structure . I updated my question accordingly . Comment : Oh right . Play s JSON library provides a lazyRead method for this kind of situation but I m not sure there s anything comparable in Argonaut . Might be worth a question on the mailing list or GitHub .", "Question : I know how to do json parsing using play-json library for play application . For example I have following code : .. . .. . How should I write the code like Reads and Writes using Argonaut instead of Play json .. . Answer : The docs http : argonaut.io doc parsing for argonaut are fairly comprehensive in this regard . You need to generate a Codec with .. . .. . And then use decodeValidation to get a Validation object back . Comment : You didn t get my question . I want to write some code to confirm to Play s Writeable and Readable type . I am not asking about validate actually . Comment : Could you give some background on what and more importantly why you are trying to do what you are", "Question : we are using Play framework 2.3.4 . From one of the APIs we make a web service call to a third party service - structure of the returned response is dynamic and may change . Only sub-structure that s static within the response JSON is a particular element and nesting inside it . for e.g . we don t know how the response structure is going to look like but ONLY thing we know is that there will be buckets nested elements somewhere in the response and as you can see there are other nested buckets inside a top level buckets element . also please note that structure inside buckets array is also not clear and if there will be another sub bucket it s definite that sub bucket must be somewhere inside parent bucket - so that pattern is consistent . what s the best way to parse such recursive structure and populate following Bucket class recursively First I was thinking to .. . .. . but that will not bring bring buckets recursively and not right way to traverse . Any ideas Comment : Would you mind depending on argonaut.io http : argonaut.io + github.com alexarchambault argonaut-shapeless https : github.com alexarchambault argonaut-shapeless Comment : @Reactormonk : although I would have preferred to stay with play-json given we already have play-json heavily used elsewhere in the project . I am open to use argnaut for this particular requirement if argonaut is going to offer elegant efficient solution to the problem at hand . I had only glanced over argonaut but never used it . would you mind sharing more detail on how can this be achieved using argonaut Comment : @Reactormonk : just added argonaut tag to the question - if you can share your answer . Comment : Using argonaut is a side-tangent . You just want to recursively build your data structure right Write a recursive method . Comment : @RexKerr : sure . my question is not around how to write a recursive method but how to look for buckets recursively using JsPath playframework.com documentation 2.2.x api scala https : www.playframework.com documentation 2.2.x api scala index.html play.api.libs.json.JsPath - where I don t have knowledge of path upfront . .. . Answer : Parse recursively . Something like this not tested :", "Question : I m using argonaut to parse json to case classes . Json : .. . .. . Scala : .. . .. . The code can t be compiled the error is : .. . .. . How to fix it so I can parse [email protected] [email protected] to a Seq [email protected] [email protected] .. . Answer : The arguments to casecodec2 are functions so if you need to perform an operation like this on the parsed JSON you can do it there : .. . .. . Or if you really only need the decoder : .. . .. . casecodecN is made for convenient use with case class constructors and extractors but it s much more flexible than just that .", "Question : we are using Play framework 2.3.4 . From one of the APIs we make a web service call to a third party service - structure of the returned response is dynamic and may change . Only sub-structure that s static within the response JSON is a particular element and nesting inside it . for e.g . we don t know how the response structure is going to look like but ONLY thing we know is that there will be buckets nested elements somewhere in the response and as you can see there are other nested buckets inside a top level buckets element . also please note that structure inside buckets array is also not clear and if there will be another sub bucket it s definite that sub bucket must be somewhere inside parent bucket - so that pattern is consistent . what s the best way to parse such recursive structure and populate following Bucket class recursively First I was thinking to .. . .. . but that will not bring bring buckets recursively and not right way to traverse . Any ideas Comment : Would you mind depending on argonaut.io http : argonaut.io + github.com alexarchambault argonaut-shapeless https : github.com alexarchambault argonaut-shapeless Comment : @Reactormonk : although I would have preferred to stay with play-json given we already have play-json heavily used elsewhere in the project . I am open to use argnaut for this particular requirement if argonaut is going to offer elegant efficient solution to the problem at hand . I had only glanced over argonaut but never used it . would you mind sharing more detail on how can this be achieved using argonaut Comment : @Reactormonk : just added argonaut tag to the question - if you can share your answer . Comment : Using argonaut is a side-tangent . You just want to recursively build your data structure right Write a recursive method . Comment : @RexKerr : sure . my question is not around how to write a recursive method but how to look for buckets recursively using JsPath playframework.com documentation 2.2.x api scala https : www.playframework.com documentation 2.2.x api scala index.html play.api.libs.json.JsPath - where I don t have knowledge of path upfront . .. . Answer : To make a Reads T for a recursive type T https : www.playframework.com documentation 2.5.x ScalaJsonCombinators Recursive-Types you have to .. . .. . define it as a lazy val .. . use lazyRead where you need recursive parsing .. . and manually pass to it the Reads T object or its derivative . Of course you have to know what paths exactly the buckets element may appear at and also account for it missing from any of those . You can use orElse to try several paths . For your definition of Bucket the Reads may look like this : .. . .. . You can simplify it a bit by extracting the common part to a function e.g . : .. . .. . This example doesn t account for possible merging of several buckets arrays at different paths inside a single bucket . So if you need that functionality I believe you d have to define and use a play.api.libs.functional.Monoid instance for Reads List T or somehow combine the existing monoid instances for JsArray .", "Question : null .. . Answer : I know how to do json parsing using play-json library for play application . For example I have following code : .. . .. . If I use Argonaut instead of play-json lib how should I write the implicit converter Comment : Refer to my answer here : stackoverflow.com a 34363319 2110188 http : stackoverflow.com a 34363319 2110188", "Question : null .. . Answer : I need parse some JSON into Scala instance or into error JSON . For example if I have next JSON : user : us password : pass and I have constraint that user shouldn t be less than 3 . And then I should get next error JSON : user : us error user : Username length shouldn t be less than 3 password : pass .. . .. . But for JSON user : user password : pass I should get some Scala instanse like User user pass . Is it possible using Argonaut Comment : Why not parse first and validate afterwards Comment : @RexKerr it is no mater wich order will be . I need a way to append error messages to original object like a fields as error fieldname . I m novice in Scala so I will appreciate any example of how to do it . Comment : Have you checked this out stackoverflow.com questions 29596564 http : stackoverflow.com questions 29596564 scalaz-validation-with-argonaut Comment : @mfirry It is not what i want . I need to map errors to json fileds .", "Question : What is wrong with the MainClassEncodeJson method below Have been following the example for Implicit JSON conversion with Scala http : lollyrock.com articles scala-implicit-conversion .. . .. . This question is similar to : Encoding nested classes using scala argonaut http : stackoverflow.com questions 22675722 encoding-nested-classes-using-scala-argonaut .. . .. . The difference being an additional layer s of nesting . Am getting the following error from the compiler : .. . .. . Cannot resolve reference EncodeJson with such signature .. . .. . Thanks for in advance . Have included the Encoder and Decoder for completeness .. . .. . Comment : I m not quite sure on how to change it to make it work but I think the problem is in the definition of addresses : addresses : m.hat.nxt.addresses . This should be an array of address objects . .. . Answer : Using version 6.1 with Scalaz 7.1.x I got the following to compile using the CodecJson http : argonaut.io doc codec and casecodecN functions . My build.sbt looks like this : .. . .. . By using this way of defining the encode decode - when using simple case classes to embody JSON object literals - I think we end up with simpler code to maintain due to improved readability and reduction of moving parts it s all declarative as opposed to following the for-comprehension logic . I also find it is a more composable definition of the problem so I can start out small without worrying about what wraps inner case classes . You will need to put the CodecJson implicits in order of need i.e . define the inner case class codec implicits before outer ones that use them or you will get compile-time warnings . There is also a helpful example in the QuickStart http : argonaut.io doc quickstart documentation on the Argonaut website . Comment : implicit val mainClassCodec : CodecJson MainClass casecodec3 MainClass.apply MainClass.unapply txid hat version bot time locktime Would also be needed right Comment : Yes the code block should scroll down . It has this definition : implicit val mainClassCodec : CodecJson MainClass casecodec6 MainClass.apply MainClass.unapply txid hat version bot time locktime", "Question : null .. . Answer : I have a Scala project that uses a bunch of Java code for example this Java source : .. . .. . I then have a bunch of Scala case classes that I serialise to and from JSON using Argonaut like this : .. . .. . Fine now I want to write a Scala case class that uses a Java enum like so : .. . .. . This will yield a compilation error because there is no implicit codec for the Category enum . I guess I could write my own codec specifically for dealing with the Category enum by doing something like this : .. . .. . But I want to know if there is a way to write a single codec that will automatically handle any Java enum .", "Question : In Scala algebraic-data-types are encoded as sealed one-level type hierarchies . Example : .. . .. . With case class es and case object s Scala generates a bunch of things like equals hashCode unapply used by pattern-matching etc that brings us many of the key properties and features of traditional ADTs . There is one key difference though In Scala data constructors have their own types . Compare the following two for example Copied from the respective REPLs . .. . .. . I have always considered the Scala variation to be on the advantageous side . After all there is no loss of type information . AppendIf Int for instance is a subtype of Positioning Int . In fact you get an additional compile-time invariant about the value . Could we call this a limited version of dependent typing This can be put to good use Once you know what data constructor was used to create a value the corresponding type can be propagated through rest of the flow to add more type safety . For example Play JSON which uses this Scala encoding will only allow you to extract fields from JsObject not from any arbitrary JsValue . In Haskell fields would probably have type JsValue - Set String JsValue . Which means it will fail at runtime for a JsArray etc . This problem also manifests in the form of well known partial record accessors . The view that Scala s treatment of data constructors is wrong has been expressed numerous times on Twitter mailing lists IRC SO etc . Unfortunately I don t have links to any of those except for a couple - this answer http : stackoverflow.com questions 25222215 scala-type-based-list-partitioning 25223200 25223200 by Travis Brown and Argonaut http : argonaut.io a purely-functional JSON library for Scala . Argonaut consciously http : mth.io slides argonaut 18 takes the Haskell approach by private ing case classes and providing data constructors manually . You can see that the problem I mentioned with Haskell encoding exists with Argonaut as well . Except it uses Option to indicate partiality . I have been pondering this for quite some time but still do not understand what makes Scala s encoding wrong . Sure it hampers type-inference at times but that does not seem like a strong enough reason to decree it wrong . What am I missing Comment : @missingfaktor Oh . Well you can do that in Haskell with GADTs and phantom types so you know . Comment : +1 great question . I m not sure how I feel about representing the because Haskell side since I often do use constructor types in Scala . For me the preference against is largely a matter of parsimony and the type-inference problems can actually be fairly annoying but I definitely wouldn t advocate being fundamentalist about the issue . Comment : You were speculating on how Haskell would handle the json example . Two popular json libraries are json http : hackage.haskell.org package json and aeson http : hackage.haskell.org package aeson . Both treat objects and arrays as separate types that get wrapped into a sum type . Functions that might handle various json values take the sum type as an argument and apply pattern-matching . Comment : Syntax-directedness is the property where looking at the syntax of a fragment of code alone is sufficient to know which typing judgement is involved . So if you see syntax a b you know that you re dealing with a pair.. . until you add subtyping since now you could be dealing with typing judgements of any supertype . Section 23.1 here : cs.cmu.edu rwh plbook book.pdf https : www.cs.cmu.edu rwh plbook book.pdf Comment : Note that Haskell does have subtyping.. . but it s of a really limited form it only occurs on quantified variables with respect to the typeclass dictionaries available the active constraints . Universally quantified types can always add more type constraints and existentially quantified types can always add fewer constraints . So really restricted .. . Answer : To the best of my knowledge there are two reasons why Scala s idiomatic encoding of case classes can be bad : type-inference and type specificity . The former is a matter of syntactic convenience while the latter is a matter of increased scope of reasoning . The subtyping issue is relatively easy to illustrate : .. . .. . The type of x turns out to be Some Int which is probably not what you wanted . You can generate similar issues in other more problematic areas : .. . .. . The type of xs is List Case1 . This is basically guaranteed to be not what you want . In order to get around this issue containers like List need to be covariant in their type-parameter . Unfortunately covariance introduces a whole bucket of issues and in fact degrades the soundness of certain constructs e.g . Scalaz compromises on its Monad type and several monad-transformers by allowing covariant containers despite the fact that it is unsound to do so . So encoding ADTs in this fashion has a somewhat viral effect on your code . Not only do you need to deal with subtyping in the ADT itself but every container you ever write needs to take into account the fact that you re landing on subtypes of your ADT at inopportune moments . The second reason not to encode your ADTs using public case classes is to avoid cluttering up your type space with non-types . From a certain perspective ADT cases are not really types : they are data . If you reason about ADTs in this fashion which is not wrong then having first-class types for each of your ADT cases increases the set of things you need to carry in your mind to reason about your code . For example consider the ADT algebra from above . If you want to reason about code which uses this ADT you need to be constantly thinking about well what if this type is Case1 That just not a question anyone really needs to ask since Case1 is data . It s a tag for a particular coproduct case . That s all . Personally I don t care much about any of the above . I mean the unsoundness issues with covariance are real but I generally just prefer to make my containers invariant and instruct my users to suck it up and annotate your types . It s inconvenient and it s dumb but I find it preferable to the alternative which is a lot of boilerplate folds and lower-case data constructors . As a wildcard a third potential disadvantage to this sort of type specificity is it encourages or rather allows a more object-oriented style where you put case-specific functions on the individual ADT types . I think there is very little question that mixing your metaphors case classes vs subtype polymorphism in this way is a recipe for bad . However whether or not this outcome is the fault of typed cases is sort of an open question . Comment : I agree with the first point but the second one isn t very compelling . In my experience similar to @missingfaktor s examples I found the opposite to be true . Knowing the type of a coproduct case allows me to ignore the other cases . Consider also the case of singleton types like 1.type which are desired in libraries like shapeless for the extra guarantees they provide . Comment : I guess that happens anyway even if it represents a type or not . You still have to deal with that case in the end . Comment : How is the third point not basically OOP is bad What s wrong with multi-paradigm programming that mixes the best features of ADTs and OOP Comment : @RexKerr I think even if you excise the OOP is bad you still have the metaphor mixing is awkward bit . Comment : Well let s phrase it this way . When would I ever want my data to not know how to perform the most natural computations on itself Why would I want my data wrapped twice when it can be wrapped once", "Question : null .. . Answer : How can an extension method be written to remove all keys with a null value from an Argonaut Json object : .. . .. . I tried this : .. . .. . but it only seems to be removing keys with null values at the top level of the Json object.. . Comment : My understanding of that library is that you have to explicitly define how many levels of nesting you want the lenses to drill into . Comment : You need to recurse into the nodes to do that .", "Question : I m trying to decode json in refract https : github.com refractproject refract-spec -style with argonaut . Scastie : http : scastie.org 15196 .. . .. . Error : Attempt to decode value on failed cursor . : .-- meta .. . .. . I don t see why it wouldn t work everything on meta is optional even Meta itself . Sample JSON : .. . .. . Code so far : .. . Answer : argonaut-shapeless has a different opinion on Option . After manually specifying the decoders for case classes with Option it works as expected ." ] }
[ "yes-answer-long", "yes-answer-short" ]
scala
UNK_RELATION
webdna@scripting@35
webdna -- webdna is a server-side @placeholder interpreted-language with an embedded database system specifically designed for the world wide web .
{ "confidence": [], "content": [] }
{ "confidence": [], "content": [] }
[ "yes-answer-long", "yes-answer-short" ]
scripting
UNK_RELATION
pdoc@python@94
pdoc -- pdoc - a simple command-line tool and library to auto generate api documentation for @placeholder libraries .
{ "confidence": [ 53.34847640991211, 44.09983825683594, 43.90742492675781, 43.67073440551758, 42.43638610839844, 37.57233810424805, 37.57233810424805, 32.31013870239258, 31.88060760498047, 29.84315299987793, 21.22518539428711, 20.700729370117188, 19.082435607910156, 18.784780502319336, 18.772247314453125, 16.661136627197266, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355 ], "content": [ "What is pdoc", "i m using python-2.7 and trying to gather documentation for our testing project using pdoc .", "I run such command : .. . .. . and get such answer : .. . .. . pdoc can t import the function from other modules in our regression.. .", "I am using pdoc function : .. . .. . But according to documentation on http : pdoc.burntsushi.net pdoc pdoc.html I am unable to find out how to export html separated from css .", "wiki.python.org moin DocumentationTools https : wiki.python.org moin DocumentationTools pdoc is a replacement for epydoc .", "I read on the internet that I need to change the PDOC tag to EBOK but I don t know how to do this with kindlegen .", "What happens if you try to tell pdoc to use reStructuredText the same way you would tell epydoc", "pdoc is located here : D : dev Python27 Scripts the regression project here : C : views md LDB RegressionTests v03.1 laptop mts Tests LDB Regression Tests We are using proboscis for our tests and i m trying to create html documentation for the separate group of tests a separate python file in my case .", "I m trying to generate documentation using pdoc where my docstrings look like this : .. . .. . I found this question : How to preserve line-breaks when generating python docs using sphinx http : stackoverflow.com questions 7033239 how-to-preserve-line-breaks-when-generating-python-docs-using-sphinx but the suggestion of prefixing each line with did not work for me it just showed up like this .. . .. . any ideas short of using n at the end of every line", "The structure of our project looks like this : .. . .. . Of course there are lots of other packages but im not sure if it makes sense to describe all the structure now .. . .. . The import part of the check capabilities encoding problems.py looks like this : .. . .. . How can i point to pdoc where to look for the functions of other modules", "I am trying to generate a .mobi file with kindlegen .", "-- Also what happens if you move the first line up a line e.g .", "Moving the first line up does nothing for the subsequent lines .", "Oh Your documentation isn t in strict restructured text format.. . it d be : param : an integer and : param : a string .", "What can I do in order to generate a mobi file with my CSS style not calibre style and detected as an ebook in my Kindle device", "thank you", "I compile the ebook and the .mobi file is generated but when I copy the file to my kindle device it doesn t appear at the list of books .", "If I click in the All of the content option in the kindle s device menu the book appears with the string Personal .", "In order to do this I tried to convert the mobi file generated with kindlegen into mobi format with Calibre software and changing the tag .", "With this solution the Kindle device detects correctly the new mobi file as an ebook instead of a personal file but the problem there is that Calibre modifies the CSS format of the original ebook and there are some changes in the final presentation of the ebook .", "Thanks a lot .", "If you don t have error messages from the kindlegen phase then you re getting a valid mobi file .", "In the case of a valid mobi file this Q is probably best suited for the superuser or ebooks stackexchange .", "Also. .", "I believe Calibre has a way to use your own CSS .", "ebooks.stackexchange.com http : ebooks.stackexchange.com", "Thank you @Paulb .", "I didn t know about the existence of these stackexchange places .", "I am a .. .", "That s the style recommended by PEP 257 https : www.python.org dev peps pep-0257 so most tools that do docstring parsing should understand it .", "Ahh -- I see .", "Thanks .", "e.g .", "add docformat restructuredtext en http : epydoc.sourceforge.net othermarkup.html at the top of the module", "same result as before", "And if that doesn t work with the docformat above you could try the epydoc format : @type param1 : int newline @param param1 : Somthing about the integer here . -- Of course you maybe already know this since you re trying to find a way to preserve newlines -- But I figured I d point it out just in case ." ] }
{ "confidence": [ 62.922279357910156, 58.435176849365234, 57.582359313964844, 41.487060546875 ], "content": [ "Question : null .. . Answer : i m using python-2.7 and trying to gather documentation for our testing project using pdoc . pdoc is located here : D : dev Python27 Scripts the regression project here : C : views md LDB RegressionTests v03.1 laptop mts Tests LDB Regression Tests We are using proboscis for our tests and i m trying to create html documentation for the separate group of tests a separate python file in my case . I run such command : .. . .. . and get such answer : .. . .. . pdoc can t import the function from other modules in our regression.. . The structure of our project looks like this : .. . .. . Of course there are lots of other packages but im not sure if it makes sense to describe all the structure now .. . .. . The import part of the check capabilities encoding problems.py looks like this : .. . .. . How can i point to pdoc where to look for the functions of other modules thank you", "Question : null .. . Answer : I m trying to generate documentation using pdoc where my docstrings look like this : .. . .. . I found this question : How to preserve line-breaks when generating python docs using sphinx http : stackoverflow.com questions 7033239 how-to-preserve-line-breaks-when-generating-python-docs-using-sphinx but the suggestion of prefixing each line with did not work for me it just showed up like this .. . .. . any ideas short of using n at the end of every line Comment : What is pdoc -- Also what happens if you move the first line up a line e.g . I am a .. . That s the style recommended by PEP 257 https : www.python.org dev peps pep-0257 so most tools that do docstring parsing should understand it . Comment : wiki.python.org moin DocumentationTools https : wiki.python.org moin DocumentationTools pdoc is a replacement for epydoc . Moving the first line up does nothing for the subsequent lines . Comment : Ahh -- I see . Thanks . What happens if you try to tell pdoc to use reStructuredText the same way you would tell epydoc e.g . add docformat restructuredtext en http : epydoc.sourceforge.net othermarkup.html at the top of the module Comment : same result as before Comment : Oh Your documentation isn t in strict restructured text format.. . it d be : param : an integer and : param : a string . And if that doesn t work with the docformat above you could try the epydoc format : @type param1 : int newline @param param1 : Somthing about the integer here . -- Of course you maybe already know this since you re trying to find a way to preserve newlines -- But I figured I d point it out just in case .", "Question : null .. . Answer : I am using pdoc function : .. . .. . But according to documentation on http : pdoc.burntsushi.net pdoc pdoc.html I am unable to find out how to export html separated from css .", "Question : null .. . Answer : I am trying to generate a .mobi file with kindlegen . I compile the ebook and the .mobi file is generated but when I copy the file to my kindle device it doesn t appear at the list of books . If I click in the All of the content option in the kindle s device menu the book appears with the string Personal . I read on the internet that I need to change the PDOC tag to EBOK but I don t know how to do this with kindlegen . In order to do this I tried to convert the mobi file generated with kindlegen into mobi format with Calibre software and changing the tag . With this solution the Kindle device detects correctly the new mobi file as an ebook instead of a personal file but the problem there is that Calibre modifies the CSS format of the original ebook and there are some changes in the final presentation of the ebook . What can I do in order to generate a mobi file with my CSS style not calibre style and detected as an ebook in my Kindle device Thanks a lot . Comment : If you don t have error messages from the kindlegen phase then you re getting a valid mobi file . In the case of a valid mobi file this Q is probably best suited for the superuser or ebooks stackexchange . Also. . I believe Calibre has a way to use your own CSS . Comment : ebooks.stackexchange.com http : ebooks.stackexchange.com Comment : Thank you @Paulb . I didn t know about the existence of these stackexchange places ." ] }
[ "yes-answer-long", "yes-answer-short" ]
python
UNK_RELATION
directoryservices@s@92
directoryservices -- system.directoryservices is the .net library used to access microsoft @placeholder active-directory which holds information about users groups computers permissions and more .
{ "confidence": [ 42.77132797241211, 35.453094482421875, 33.5421257019043, 33.411537170410156, 33.13385772705078, 32.510536193847656, 29.424964904785156, 29.390243530273438, 29.25640869140625, 28.76424789428711, 27.269489288330078, 27.071887969970703, 26.930580139160156, 26.370540618896484, 26.268959045410156, 25.803756713867188, 25.65432357788086, 25.49456024169922, 25.354698181152344, 24.940582275390625, 24.883831024169922, 24.673812866210938, 24.6719970703125, 24.63722801208496, 24.629924774169922, 24.593517303466797, 24.318157196044922, 24.157052993774414, 23.986732482910156, 23.65530014038086, 23.60141944885254, 23.57067108154297, 23.388660430908203, 23.36150360107422, 23.234783172607422, 23.201271057128906, 23.151086807250977, 23.136348724365234, 23.064342498779297, 23.005687713623047, 22.87765884399414, 22.811912536621094, 22.582908630371094, 22.582908630371094, 22.512123107910156, 22.434585571289062, 22.355735778808594, 22.283845901489258, 22.259864807128906, 22.139598846435547, 22.123722076416016, 22.099365234375, 21.8436279296875, 21.8436279296875, 21.830562591552734, 21.735593795776367, 21.704605102539062, 21.702136993408203, 21.66840171813965, 21.66840171813965, 21.5816650390625, 21.531463623046875, 21.519908905029297, 21.463775634765625, 21.463775634765625, 21.463775634765625, 21.3396053314209, 21.30682373046875, 21.30682373046875, 21.250892639160156, 21.14902687072754, 20.905517578125, 20.851062774658203, 20.47441864013672, 20.42584228515625, 20.32632827758789, 20.32632827758789, 20.32632827758789, 20.32632827758789, 20.232379913330078, 20.232379913330078, 20.218074798583984, 20.18163299560547, 20.155269622802734, 19.98370361328125, 19.928550720214844, 19.796955108642578, 19.740219116210938, 19.464462280273438, 19.410953521728516, 19.334505081176758, 19.334505081176758, 19.334505081176758, 19.26736068725586, 19.13921356201172, 19.116329193115234, 19.082168579101562, 19.05147933959961, 19.05147933959961 ], "content": [ "Get-ADComputer or DirectoryServices .NET Class when trying to connect to AD and pull all computers users and groups from a Domain .", "We are using System.DirectoryServices for Microsoft Active Directory OpenLDAP running on Linux and eDirectiry without any problem .", "I m trying to create a new user on my development active-directory server using .NET System.DirectoryServices namespace .", "Connection and binding with .NET Api DirectoryServices not working .", "I have an application which has certain functionality secured by performing an Active Directory lookup via DirectoryServices .", "Use the DirectoryServices library.. .", "It s used to call Active Directory .", "The MSDN documentation on DirectoryEntry http : msdn.microsoft.com en-us library system.directoryservices.directoryentry.aspx also clearly states : The DirectoryEntry class encapsulates a node or object in the Active Directory Domain Services hierarchy . - System.DirectoryServices is really geared towards Active Directory - it doesn t really support anything else .", "I m trying to set the group type for a new Active Directory Entry via VB.NET and DirectoryServices to create a distribution list .", "The call to System.DirectoryServices is actually just querying Active Directory using LDAP to get the userprincipal object .", "I checked that there exists an OU in the active-directory and I have enough permissions .", "Now my issue is with when I trying to use .NET APi and to use System.DirectoryServices or System.DirectoryServices.Protocols it is not connecting or binding .", "I want to get all the active-directory groups in which a particular user is a member .", "The image is showing you grant access to Active Directory security principals to ADLDS .", "I can access DirectoryServices just fine but not Account Management .", "Using System.DirectoryServices i.e .", "The ActiveDirectory cmdlets are far far more intuitive than using System.DirectoryServices however you may lose some of the control that System.DirectoryServices offers .", "I need to create a procedure to retrieve an AD groups Notes field .. . .. . Is it possible to get Group Notes from Active Directory", "This means using the DirectoryServices API .", "I ve a local installation of an Active directory lightweight directory service on a WIN7 machine which is domain joined .", "The more properties are included in this collection the more round trips to Active Directory are necessary to retrieve them .", "I think that the standard way is to use System.DirectoryServices not System.DirectoryServices.Protocol .", "Users can be added to groups .", "I wanted to add-in the System.DirectoryServices namespace so to my web.config I added : .. . .. . and to my Default.aspx.vb I added : .. . .. . Imports System.DirectoryServices .. . .. . I checked that the System.DirectoryServices is referenced in the Website - Add Reference - .NET menu option .", "Recently I ve been implementing custom ExtendedUserPrincipal class similar to sample here http : blogs.msdn.com b kaevans archive 2012 04 11 querying-active-directory-using-principal-extensions-in-system-directoryservices-accountmanagement.aspx .", "I am using System.DirectoryServices.AccountManagement.dll to deal with Active Directory to get all the users in the Domain Users group .", "The issue is often that the context for which the Active Directory calls is made is under a user that does not have permissions also can happen when identity impersonate true in ASP.NET due to the fact that the users token is a secondary token that cannot be used when authenticating against another server from : http : bit.ly 1753RjA .", "In which case a possible permissions issue", "For more information see the Code Access Security in ASP.NET 4 Applications http : msdn.microsoft.com en-us library dd984947.aspx topic in MSDN Library .", "If you have a desktop app then use the System.DirectoryServices namespace .", "I assume the DirectoryServices namespace does it but I can t find the method that does it .", "Ran the tests ten times each and using DirectoryServices was about 3 times faster every time .", "How to add ForeignSecurityPrincipals to Active Directory Lightweight Directory Services AD LDS", "Almost certainly it s because your Application Pool identity does not have permission to access Active Directory .", "Note that I have used a combination of a SqlMembershipProvider and the System.DirectoryServices space together in some apps .", "I know how to create OU s groups and users and I know how to add users to groups .", ".. . For example the System.DirectoryServices namespace is not supported .", "Is there a way to set the PermittedWorkstations or set the computers restrictions os the users adding the computers that he is able to logon - like this image http : i.stack.imgur.com tu2Kp.png", "Not just Active Directory but NDS and WinNT as well .", "Does anyone know how to get StartTLS working with System.DirectoryServices", "Using System.DirectoryServices one can get the highestCommittedUSN this way : .. . .. . However I need to get this information from a remote ADLDS using System.DirectoryServices.Protocols which does not leverage ADSI .", "I don t have access to modify anything in AD aside from the permissions I ve been granted to modify the groups designated to have users added removed from them .", "Having worked with DirectoryServices previously I found the exceptions to be pretty verbose and useful .", "I ve noticed an interesting behavior when trying to connect to edirectory using DirectoryServices .", "Then I will create some users and add them to the groups .", "Is it generally acceptable to mix calls to System.DirectoryServices with calls to System.DirectoryServices.AccountManagement", "I have code similar to the above that searches Active Directory for user information using PrincipalContext class .", "Active Directory limits the number of objects returned by query in order to not overload the directory the limit is something like 1000 objects .", "I have a need to write a .NET application which will query Active Directory while running in Windows PE http : technet.microsoft.com en-us library cc766093 28v ws.10 29.aspx on a computer which is not yet a member of the domain .", "Here s a great Active Directory programming quick reference : .. . .. . Howto : Almost Everything In Active Directory via C http : www.codeproject.com Articles 18102 Howto-Almost-Everything-In-Active-Directory-via-C .. . .. . See the password reset code near the end .", "This is the code that I used to pull information from our dev edirectory but I ve noticed that it s retrieving information from our production Active Directory from what I ve read DirectorySearcher can be used on edir as well : .. . .. . I know it s hitting production because jsmith doesn t exist in dev .", "Read all about it here : .. . .. . Managing Directory Security Principals in the .NET Framework 3.5 http : msdn.microsoft.com en-us magazine cc135979.aspx .. . MSDN docs on System.DirectoryServices.AccountManagement http : msdn.microsoft.com en-us library system.directoryservices.accountmanagement.aspx .. . .. . Basically you can define a domain context and easily find users and or groups in AD : .. . .. . The new S.DS.AM makes it really easy to play around with users and groups in AD", "I m writing some code that involves Active Directory .", "Can I query the Active Directory or LDAP server for this", "What directory service are you trying to access", "see stackoverflow.com questions 12608971 http : stackoverflow.com questions 12608971 net-4-5-bug-in-userprincipal-findbyidentity-system-directoryservices-accountma rq 1", "And I feel more confident that the code will be adaptable to future requirements than code using the ADSI-based System.DirectoryServices .", "I also discovered an interesting thing about a difference in how using a using block with a DirectoryServices resource vs a DataContext as noted in the code snippet below .", "Is there actually nowadays any superior method s in DirectoryServices which I should be using", "I have decided to use WMI instead of DirectoryServices which seems to work perfectly :", "If you have a LDAP connection with a username and password to connect to Active Directory here is the code I used to connect properly :", "I have been working on adding Active Directory functionality to an already existing ASP.NET website following this guide by Microsoft : http : support.microsoft.com kb 326340 .", "In a nutshell make sure all code to access Active Directory is inside that using block and the exception should be fixed one the service app is deployed to the server .", "I notice there are several different namespaces classes for accessing Active Directory .", "our code uses the old dlls to get Active Directory data System.DirectoryServices.DirectoryEntry .", "the code uses the current Active Directory server of the server that host the application .", "In an ASP.NET 4 application I have existing code to access a user s Active Directory information potentially under Windows Authentication or FBA like this : .. . .. . It has always worked fine for me on my LAN .", "This code probably dates from .NET 1 2 when perhaps System.DirectoryServices had less in it it came from some MS example for using ADSI somewhere .", "It doesn t look like System.DirectoryServices has a nice .NET wrapper for it so you will need to read the attribute using something like DirectoryEntry .", "The following code allows me to extract the entire Global Address List from DirectoryServices .", "In MSDN : System.DirectoryServices Namespace http : msdn.microsoft.com en-us library system.directoryservices 28v vs.71 29.aspx it looks like I only have to change LDAP : to NDS : so is it really this easy : .. . .. . or do if have to keep some other things in mind", "There should be an LdapException inside the PrincipleServerDownException with more information about the nature of the failure .", "The service account may have different domain permissions etc which we don t want deployed to other users .", "For example : .. . .. . http : serverfault.com questions 49405 command-line-to-list-users-in-a-windows-active-directory-group http : serverfault.com questions 49405 command-line-to-list-users-in-a-windows-active-directory-group 5D .. . .. . Another approach - usage of managed sub-domains BUT i think it s harder and i m not sure that all unmanaged resources will be freed .", "However this is System.DirectoryServices we re talking about.. . so any kind of funky bad strangeness is possible", "I am trying to determine if a user is a member of an Active Directory AD group for an internal ASP.NET 4.0 application .", "I ve tested the code against both and OpenLDAP server and Active Directory but neither works .", "Scenario : Active Directory username search should return results against a search item i.e .", "In other words every call to it does an additional call to active-directory every time it is called .", "I too have a long running service using plugins and appdomains and am having a memory leak due to using directoryservices .", "possible duplicate of Error on publishing : System.DirectoryServices.DirectoryServicesCOMException http : stackoverflow.com questions 9181435 error-on-publishing-system-directoryservices-directoryservicescomexception", "The following example is from the Code Project article Almost Everything In Active Directory via C http : www.codeproject.com KB system everythingInAD.aspx 27 : .. . .. . Just call the Groups method with the Distinguished Name http : technet.microsoft.com en-us library cc977992.aspx for the user and pass in the bool flag to indicate if you want to include nested child groups memberships in your resulting ArrayList : .. . .. . If you need to do any serious level of Active Directory programming in .NET I highly recommend bookmarking reviewing the Code Project article I mentioned above .", "So this https : stackoverflow.com questions 1722398 error-0x80005000-and-directoryservices question is closely related but my permissions are setup correctly and the code works 99 of the time and will continue to run after an application-pool restart .", "How would I go about doing that in .Net", "If using .NET 3.5 or later you might consider this answer : stackoverflow.com questions 1066131 http : stackoverflow.com questions 1066131 how-to-programaticly-change-active-directory-password", "And then GetGroups will give you the Groups to which that user belongs .", "I ran my script against a domain with 50k computer objects 30k groups and 120k users .", "The real answer was to use System.DirectoryServices.Protocols and avoid the inherent memory-leaks in both System.DirectoryServices and System.DirectoryService.AccountManagement .", "The problem lies in the way DirectoryServices caches the schema if it attempts to load a custom attribute any attribute not familiar to DirectoryServices via the domain its connected to hotfix specifically for Windows 8 2012 .. . .. . Its actually documented in a KB article http : support.microsoft.com kb 2802148 that also includes the hotfix that should solve your problem if you haven t solved it already", "Actually it simply turned out to be that I can set permissions on ad lds directory objects without adding to the ForeignSecuritypPrinciaps container.. .", "I clicked on the System.DirectoryServices option in that dialogue box but nothing appears to happen at that point .", "The assembly that I am trying to deploy to SQL Server contains a reference to System.DirectoryServices .", "was not found in the SQL catalog . .. . .. . What are the correct steps for registering System.DirectoryServices on SQL Server", "I only ask because your requirements may be better served using the DirectoryServices namespace and the DirectorySearcher with an LDAP Filter as something like : objectclass user memberOf CN Domain Users dc company dc com", "I m intrigued by the fact that all the data is transmitted over the wire so the directory definitely has no permissions issues here but my C code is unable to extract the values out of it :", "Here is some sample code : .. . .. . Other groups work fine but when the group is Domain Users the value of the Enabled property is false for all users .", "There s a part of it which should answer your question : Determining User Group Membership in Active Directory http : en.csharp-online.net User Management with Active Directory E2 80 94Determining User Group Membership in Active Directory and ADAM", "In our company we have a project which should use Novell eDirectory with .net applications .", "But as per requirement we specifically need .net API to connect not with Novell Api which is not working ." ] }
{ "confidence": [ 48.922237396240234, 45.927669525146484, 45.59953308105469, 44.32486343383789, 43.79389953613281, 41.172115325927734, 40.34674835205078, 40.3240852355957, 39.667015075683594, 39.66389465332031, 39.63522720336914, 37.87665939331055, 36.52197265625, 36.29020690917969, 36.043148040771484, 35.86832046508789, 35.770118713378906, 35.7430419921875, 35.44611358642578, 35.39181900024414 ], "content": [ "Question : null .. . Answer : In an ASP.NET 4 application I have existing code to access a user s Active Directory information potentially under Windows Authentication or FBA like this : .. . .. . It has always worked fine for me on my LAN . But I get no feedback from customer sites other than it works . I now note a post like http : www.justskins.com forums directoryentry-nativeobject-slow-with-203410.html implying this COM way of going via DirectoryEntry.NativeObject might be inefficient or ill-advised On the other hand I see here LDAP search using DirectoryServices.Protocols slow http : stackoverflow.com questions 16890091 ldap-search-using-directoryservices-protocols-slow implying it is OK This code probably dates from .NET 1 2 when perhaps System.DirectoryServices had less in it it came from some MS example for using ADSI somewhere . In a word : I don t want to change the code just for the sake of it but will if faster . Is there actually nowadays any superior method s in DirectoryServices which I should be using", "Question : In our company we have a project which should use Novell eDirectory with .net applications . I have tried Novell Api http : www.novell.com coolsolutions feature 11204.html to connect between .NET applications . It is working fine . But as per requirement we specifically need .net API to connect not with Novell Api which is not working . Connection and binding with .NET Api DirectoryServices not working . Our Novell eDirectory is installed with following credentials : .. . .. . 1 . IP address : 10.0.x.xx witsxxx.companyname.com .. . .. . 2 . Tree : SXXXX .. . .. . 3 . New Tree Context : WIxxxK01-NDS.OU STATE.O ORG .. . .. . 4 . ADMIN Context is : ou STATE o ORG .. . .. . 5 . admin : admin .. . .. . 6 . password : admin .. . .. . I used Novell Api and used following code .. . .. . This is binding correctly and searching can be done . Now my issue is with when I trying to use .NET APi and to use System.DirectoryServices or System.DirectoryServices.Protocols it is not connecting or binding . I can t even test the following DirectoryEntry.Exists method . It is going to exception . It is saying Server is not operational or Local error occurred etc . I don t know what is happening with directory path . I tried .. . .. . All are going to exceptions . Could you please help me to solve this How should be the userDN for DirectoryEntry I used System.DirectoryServices.Protocols.LdapConnection too with LdapDirectoryIdentifier and System.Net.NetworkCredential but no result . Only same exceptions . I appreciate your valuable time and help . Thanks Binu Comment : As far as I remember I never got this to work properly . The MSDN documentation on DirectoryEntry http : msdn.microsoft.com en-us library system.directoryservices.directoryentry.aspx also clearly states : The DirectoryEntry class encapsulates a node or object in the Active Directory Domain Services hierarchy . - System.DirectoryServices is really geared towards Active Directory - it doesn t really support anything else . So either keep using the native Novell API or then you need to look into low-level raw LDAP S.DS.Protocols Comment : Maybe this article on CodeProject http : www.codeproject.com Articles 19097 eDirectory-Authentication-using-LdapConnection-and can be used as a starting point - or this post on social.msdn.com http : social.msdn.microsoft.com Forums sk netfxbcl thread bb145883-5f00-47f7-a7b7-1f2d09f4bf53 Comment : I tried the following code also with raw LDAP S.DS.Protocols but got exceptions . try LdapDirectoryIdentifier lid new LdapDirectoryIdentifier 10.0.x.xx 389 System.Net.NetworkCredential cred new System.Net.NetworkCredential cn admin cn witsxxx-NDS o ORG string.Empty using System.DirectoryServices.Protocols.LdapConnection lconn new System.DirectoryServices.Protocols.LdapConnection lid lconn.Bind cred .. . Answer : To diagnose your LDAP connection error get access to the eDirectory server from the admins and use iMonitor serverIP : 8028 nds and select Dstrace in Dstrace clear all tabs and enable LDAP tracing then do your bind see what happens on the LDAP side to see if there is a more descriptive error there . Or if you even get far enough to bind and make a connection .", "Question : I have a really simple question . What is better to use AD Module ie . Get-ADComputer or DirectoryServices .NET Class when trying to connect to AD and pull all computers users and groups from a Domain . Or does it not matter at all The key factors I judge on for which method to use are : .. . .. . 1 . Which method s scripts will run faster 2 . Which puts less load on the network AD .. . 3 . What limitations may each method have I know that the AD Module is only installed default on Win Server 2008 R2 and later so that is a down side obviously given on an older server the module isn t installed by default . But in today s world that really shouldn t be much of a problem given there aren t a lot of environments with all servers older than 2008 R2 . All I am trying to do is extract to a .csv all User objects and some important fields attributes all Computer objects and all Group objects . So basically searching the AD objects and looping through each result row and then saving to a table to export to .csv . Comment : I am not sure if this is too broad or not . If nothing else it could really depend on what you are doing and the data you are trying to return . Simple queries would be more terse and readable with the activedirectory module . IIRC the .net ones will almost always be faster but I have nothing to back that up . Comment : All i am trying to do is extract to a .csv all User objects and some important fields attributes all Computer objects and all Group objects . So basically searching the AD objects and looping through each result row and then saving to a table to export to .csv . Comment : You can write sample code for both of them and measure their execution-time with Measure-Object .. . Answer : The ActiveDirectory cmdlets are far far more intuitive than using System.DirectoryServices however you may lose some of the control that System.DirectoryServices offers . For most cases especially for people new to PowerShell I would recommend using the ActiveDirectory cmdlets . As far as speed like @sodawillow suggested you can measure the execution-time of each and then use the fastest . I could give you anecdotes but they would not be representative of everyone s experiences . Comment : thanks this is a great answer . Could you please provide your insights thoughts opinion though You said I could give you anecdotes.. . . I would be very interested in your experience regardless of whether it can be generally agreed to or accepted . Comment : @TrackABill.com - I ran some simple tests retrieving all user objects on a domain using both methods . Tens of thousands of objects . Ran the tests ten times each and using DirectoryServices was about 3 times faster every time . Don t take that as proof . That s just how it was for me in this case . Recommend running your own tests if speed is a big deal for you . For me unless speed is crucial I would still stick with the AD cmdlets for ease of use and readability . Comment : Thanks This helps a lot . Really appreciate it . One last question.. . I ran my script against a domain with 50k computer objects 30k groups and 120k users . Is it normal that it would take about an hour to run Thanks Comment : It really depends on the script . I would recommend opening a new question for that .", "Question : I am porting an old 3 2-bit COM component that was written in VB6 for the purpose of reading and writing to an Active Directory server . The new solution will be in C and will use SQL CLR user functions . The assembly that I am trying to deploy to SQL Server contains a reference to System.DirectoryServices . The project does compile without any errors but I am unable to deploy the assembly to the SQL Server because of the following error : .. . .. . Error : Assembly system.directoryservices version 2.0.0.0 culture neutral publickeytoken b03f5f7f11d50a3a . was not found in the SQL catalog . .. . .. . What are the correct steps for registering System.DirectoryServices on SQL Server .. . Answer : Does that article here help New SQLCLR-approved assembly in SP1 http : www.sqlskills.com blogs bobb post New-SQLCLR-approved-assembly-in-SP1.aspx .. . .. . People often ask about the set of base-class library assemblies that can be safely used in SQLCLR . It usually takes the form can I use assembly System.XYZ.dll in SQLCLR procedural code or why do I get assembly System.XYZ.dll is not found when I try and catalog my own assembly that calls this one The ones is hear mentioned most frequently is System.DirectoryServices.dll Active Directory support or System.Management.dll WMI support or System.Remoting.dll et al . The only way you use these is to run CREATE ASSEMBLY on them yourself which involves using PERMISSION SET UNSAFE . And cataloging all the dependencies . Not for the faint of heart . Also - SQL Server CLR doesn t support every imagineable assembly - find lists here : .. . .. . for SQL Server 2005 SQL-CLR http : msdn.microsoft.com en-us library ms403279 28SQL.90 29.aspx .. . for SQL Server 2008 SQL-CLR http : msdn.microsoft.com en-us library ms403279.aspx .. . .. . One note from that second MSDN article : .. . .. . Unsupported Libraries .. . .. . Unsupported libraries can still be called from your managed stored-procedures triggers user-defined functions user-defined types and user-defined aggregates . The unsupported library must first be registered in the SQL Server database using the CREATE ASSEMBLY statement before it can be used in your code . Any unsupported library that is registered and run on the server should be reviewed and tested for security and reliability . .. . For example the System.DirectoryServices namespace is not supported . You must register the System.DirectoryServices.dll assembly with UNSAFE permissions before you can call it from your code . The UNSAFE permission is necessary because classes in the System.DirectoryServices namespace do not meet the requirements for SAFE or EXTERNAL ACCESS . For more information see CLR Integration Programming Model Restrictions and CLR Integration Code Access Security .", "Question : I have been working on adding Active Directory functionality to an already existing ASP.NET website following this guide by Microsoft : http : support.microsoft.com kb 326340 . It s been a long process but what I m stuck on now is not being able to access the AccountManagement class to use certain functions such as GetGroup . I can access DirectoryServices just fine but not Account Management . When I use the following code to test the reference : .. . .. . I get this error : BC30456 : AccountManagement is not a member of DirectoryServices . I have already added this assembly tag to the web.config page : .. . .. . Also I am importing both namespaces : .. . .. . And this is my version info that shows on the error page : .. . .. . Version Information : Microsoft .NET Framework Version : 4.0.30319 ASP.NET Version : 4.0.30319.34237 .. . .. . I m editing this website in VS 2010 . What am I missing and how can I get AccountManagement added here Am I not importing it properly or is there somewhere I can check to see if there is a missing .dll Thank you so much for your help .. . Answer : Although you re importing both namespaces in the markup you only reference System.DirectoryServices.dll . The AccountManagement part is in a separate dll . Add another reference to web.config : Comment : Thank you I didn t think that reference could be added there but I hadn t checked the Add Reference.. . option since updating the site to using ASP.NET 4.0 . Comment : The line of code can now get as far as the GetGroups Before triggering this error now : BC30469 : Reference to a non-shared member requires an object-reference . Comment : @justanotherguy you are calling GetGroups as-if it were a static method and static in C means the same as shared in VB.Net . However it is an instance method so you ll need a Principal object before you can call this method . And in fact because Principal is abstract the object will have to be an instance of a non-abstract subclass e.g . UserPrincipal . And then GetGroups will give you the Groups to which that user belongs .", "Question : I checked this http : stackoverflow.com questions 90572 how-to-get-ad-user-groups-for-user-in-asp-net post already . But it doesn t answer my question . I want to get all the active-directory groups in which a particular user is a member . I ve written the following code . But I m not able to proceed further as I don t know how to give the filter and how to access the properties . Any ideas Comment : Okie . I learnt from here - eggheadcafe.com software aspnet 30375857 http : www.eggheadcafe.com software aspnet 30375857 directory-searcher-not-returning-all-groups.aspx that memberOf wont return Primary Groups of a user . But I can get the primaryGroupID which gives the RID of the group using which I need to get the AD group . Any ideas how to do it Comment : Please check my newly posted answer . Your current approach doesn t work very well . If the user is assigned to an Universal Group in another forest the Universal Group won t show up in the memberOf attribute .. . Answer : You should use System.DirectoryServices.AccountManagement http : msdn.microsoft.com en-us library system.directoryservices.accountmanagement.aspx PHPSESSID ev0v34i8u80gkmn37sd8r65363 . It s much easier . Here is a nice code project article http : www.codeproject.com Articles 38344 Using-System-DirectoryServices-AccountManagement giving you an overview on all the classes in this DLL . As you pointed out your current approach doesn t find out the primary group . Actually it s much worse than you thought . There are some more cases that it doesn t work like the domain local group from another domain . You can check here http : msdn.microsoft.com en-us library ms677943 v vs.85 .aspx for details . Here is how the code looks like if you switch to use System.DirectoryServices.AccountManagement . The following code can find the immediate groups this user assigned to which includes the primary group .", "Question : I am trying to connect to an edirectory 8.8 server running LDAP . How would I go about doing that in .Net Can I still use the classes in System.DirectoryService such as DirectoryEntry and DirectorySearcher or are they AD specific Do I need to specify the Connection String any differently I am trying something like the code below but it doesn t seem to work.. . .. . .. . Any ideas .. . Answer : I am trying to connect to an edirectory 8.8 server running LDAP . How would I go about doing that in .Net Can I still use the classes in System.DirectoryService such as DirectoryEntry and DirectorySearcher or are they AD specific We are using System.DirectoryServices for Microsoft Active Directory OpenLDAP running on Linux and eDirectiry without any problem . So the answer is yes you can use these classes to access eDir . Do I need to specify the Connection String any differently Yes you are . When passing to DirectoryEntry a string starting with LDAP : you need to conform to the LDAP syntax which is very different than URI syntax . I recommend you to use an LDAP browser google it there are many free downloads in order to get the correct path to the root object otherwise you will spend time on trying to figure out the correct object types .", "Question : I am porting an old 3 2-bit COM component that was written in VB6 for the purpose of reading and writing to an Active Directory server . The new solution will be in C and will use SQL CLR user functions . The assembly that I am trying to deploy to SQL Server contains a reference to System.DirectoryServices . The project does compile without any errors but I am unable to deploy the assembly to the SQL Server because of the following error : .. . .. . Error : Assembly system.directoryservices version 2.0.0.0 culture neutral publickeytoken b03f5f7f11d50a3a . was not found in the SQL catalog . .. . .. . What are the correct steps for registering System.DirectoryServices on SQL Server .. . Answer : The information provided from other answers led me to the solution . Here are the steps I came up with for future reference : .. . .. . The first time I ran the statement above I got the following error : .. . .. . CREATE ASSEMBLY for assembly System.DirectoryServices failed because assembly System.DirectoryServices is not authorized for PERMISSION SET UNSAFE . The assembly is authorized when either of the following is true : the database owner DBO has UNSAFE ASSEMBLY permission and the database has the TRUSTWORTHY database property on or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with UNSAFE ASSEMBLY permission . In order to get the CREATE ASSEMBLY statement to execute without error I had to first turn TRUSTWORTHY ON as follows : .. . .. . Once TRUSTWORTHY is turned ON the command executed without error but it did present this scary sounding warning : .. . .. . Warning : The Microsoft .NET Framework assembly system.directoryservices version 2.0.0.0 culture neutral publickeytoken b03f5f7f11d50a3a processorarchitecture msil . you are registering is not fully tested in the SQL Server hosted environment and is not supported . In the future if you upgrade or service this assembly or the .NET Framework your CLR integration routine may stop working . Please refer SQL Server Books Online for more details . With System.DirectoryServices properly registered in SQL Server I am now able to deploy register the dependent custom SQL CLR assembly without any problems .", "Question : I have a really simple question . What is better to use AD Module ie . Get-ADComputer or DirectoryServices .NET Class when trying to connect to AD and pull all computers users and groups from a Domain . Or does it not matter at all The key factors I judge on for which method to use are : .. . .. . 1 . Which method s scripts will run faster 2 . Which puts less load on the network AD .. . 3 . What limitations may each method have I know that the AD Module is only installed default on Win Server 2008 R2 and later so that is a down side obviously given on an older server the module isn t installed by default . But in today s world that really shouldn t be much of a problem given there aren t a lot of environments with all servers older than 2008 R2 . All I am trying to do is extract to a .csv all User objects and some important fields attributes all Computer objects and all Group objects . So basically searching the AD objects and looping through each result row and then saving to a table to export to .csv . Comment : I am not sure if this is too broad or not . If nothing else it could really depend on what you are doing and the data you are trying to return . Simple queries would be more terse and readable with the activedirectory module . IIRC the .net ones will almost always be faster but I have nothing to back that up . Comment : All i am trying to do is extract to a .csv all User objects and some important fields attributes all Computer objects and all Group objects . So basically searching the AD objects and looping through each result row and then saving to a table to export to .csv . Comment : You can write sample code for both of them and measure their execution-time with Measure-Object .. . Answer : I add your last comment to the question because it just discribes a small tool which is present on Windows Servers from a long time . Csvde.exe https : technet.microsoft.com en-us library cc732101.aspx use a syntax very close to Ldifde.exe and it allow you to extract Active-Directory object using the LDAP query syntax https : msdn.microsoft.com en-us library aa746475 v vs.85 .aspx . As far as I understand these tools are powered by ADSI . You can have a look to this http : stackoverflow.com a 31422105 608772 answer .", "Question : I checked this http : stackoverflow.com questions 90572 how-to-get-ad-user-groups-for-user-in-asp-net post already . But it doesn t answer my question . I want to get all the active-directory groups in which a particular user is a member . I ve written the following code . But I m not able to proceed further as I don t know how to give the filter and how to access the properties . Any ideas Comment : Okie . I learnt from here - eggheadcafe.com software aspnet 30375857 http : www.eggheadcafe.com software aspnet 30375857 directory-searcher-not-returning-all-groups.aspx that memberOf wont return Primary Groups of a user . But I can get the primaryGroupID which gives the RID of the group using which I need to get the AD group . Any ideas how to do it Comment : Please check my newly posted answer . Your current approach doesn t work very well . If the user is assigned to an Universal Group in another forest the Universal Group won t show up in the memberOf attribute .. . Answer : The following example is from the Code Project article Almost Everything In Active Directory via C http : www.codeproject.com KB system everythingInAD.aspx 27 : .. . .. . Just call the Groups method with the Distinguished Name http : technet.microsoft.com en-us library cc977992.aspx for the user and pass in the bool flag to indicate if you want to include nested child groups memberships in your resulting ArrayList : .. . .. . If you need to do any serious level of Active Directory programming in .NET I highly recommend bookmarking reviewing the Code Project article I mentioned above . Comment : Okie . I ve recursive found the parent groups . But still two groups or folders Domain Users is not coming in the list . But if I check the memberOf tab it is there . Domain users is a builtin group right Am I missing something here", "Question : I m trying to set the group type for a new Active Directory Entry via VB.NET and DirectoryServices to create a distribution list . How do I access the ADS GROUP TYPE enumerations Specifically I m after ADS GROUP TYPE GLOBAL GROUP . .. . Answer : I don t think I can access the enumerations via .NET so instead I created the specific constant I needed . For what it s worth here s my code : .. . .. . .. . Const ADS GROUP TYPE GLOBAL GROUP As Object H2 .. . adNewGroup.Properties groupType .Value ADS GROUP TYPE GLOBAL GROUP .. . .. . .. . Refactoring welcome", "Question : I checked this http : stackoverflow.com questions 90572 how-to-get-ad-user-groups-for-user-in-asp-net post already . But it doesn t answer my question . I want to get all the active-directory groups in which a particular user is a member . I ve written the following code . But I m not able to proceed further as I don t know how to give the filter and how to access the properties . Any ideas Comment : Okie . I learnt from here - eggheadcafe.com software aspnet 30375857 http : www.eggheadcafe.com software aspnet 30375857 directory-searcher-not-returning-all-groups.aspx that memberOf wont return Primary Groups of a user . But I can get the primaryGroupID which gives the RID of the group using which I need to get the AD group . Any ideas how to do it Comment : Please check my newly posted answer . Your current approach doesn t work very well . If the user is assigned to an Universal Group in another forest the Universal Group won t show up in the memberOf attribute .. . Answer : I can suggest you to read this article about Users Management http : en.csharp-online.net User Management with Active Directory . There s a part of it which should answer your question : Determining User Group Membership in Active Directory http : en.csharp-online.net User Management with Active Directory E2 80 94Determining User Group Membership in Active Directory and ADAM Comment : Thanks for the link . It helped a lot .", "Question : I m trying to connect to an LDAP server which requires StartTLS but having no luck - whenever I use either the SessionOptions.StartTransportLayerSecurity . . or set SessionOptions.SecureSocketLayer to true I get exceptions . Here s the code I m using : .. . .. . The resulting exception is TlsOperationException : An unspecified error occurred which happens when invoking the StartTransportLayerSecurity method . I ve tested the code against both and OpenLDAP server and Active Directory but neither works . Does anyone know how to get StartTLS working with System.DirectoryServices Comment : Could you please specify the specific versions of OpenLDAP Active Directory and especially the operating systems for both client and server involved here to narrow down the scope There used to be a fair amount of subtle LDAP stack incompatibilities in the wild which could still apply to the potentially legacy scenario your customer might be using . Comment : Hi Steffen info was OpenLDAP 2.4.18 FreeBSD for server and client was a Windows Server 2008 r2 machine client code is hosted in an ASP.Net application .Net Framework 3.5 SP1 . Searching a bit further on the version of LDAP led me to some blog posts on the topic including : pongo15.wordpress.com 2009 12 18 http : pongo15.wordpress.com 2009 12 18 on-getting-openldap-and-windows-ldap-to-interop - which helped me get to the bottom of the issue . I m going to try and encourage user to move up to latest OpenLDAP as I assume this issue is probably fixed in later versions their version is really old released Sun 6 Sep 2009 Comment : Thanks for the follow up information which will help later readers regarding issues like this +1 I ve updated my answer http : stackoverflow.com posts 9020311 revisions accordingly .. . Answer : Please read this topic : Binding over a TLS SSL Encrypted Connection http : msdn.microsoft.com en-us library bb332056.aspx sdspintro topic6 binding .. . .. . Example 19 . Binding to an ADAM instance on secure port 50001 using Basic authentication and SSL TLS .. . .. . And the next example show How to use TLS to authenticate and perform a task", "Question : I m trying to create a new user on my development active-directory server using .NET System.DirectoryServices namespace . I try using the following code : .. . .. . I also tried committing using .. . .. . before I call the Invoke to set the password . I always get a TargetInvocationException wrapping : .. . .. . The exception is always only thrown when I call .. . .. . If I call newUser.CommitChanges before I try to call Invoke with SetPassword the new user is created on the domain . I can then go manually to the AD machine and set the same password with no problems so it s not a problem with the password string being against the rules . I ve notice many post online about this but found no solution . I think it might have something to do with the fact that the machine running the code is not a member in the domain . Although the user TESTDOM Administrator is a member of the : administrators domain admins schema admin and enterprise admins groups on the TESTDOM domain . Notice that I can t use System.DirectoryServices.AccountManagement namespace as I m working with .NET 2 Any ideas on what can I do to solve this I am desperate .. . Answer : OK I got it working : .. . .. . ldapPath should include the full DN of the user we re trying to change so it should look something like :", "Question : The following code allows me to extract the entire Global Address List from DirectoryServices . The code is functional in that it gives me what I need . The problem is that it takes about 20 seconds to return 1000 objects . Is there anything that I can do to speed this up Comment : Maybe a profiler can identify the bottlenecks .. . Answer : It turns out that GetDirectoryEntry is the problem . Apparently using it is very resource intensive because it allows you to actually update the Directory entry after retrieving it . In other words every call to it does an additional call to active-directory every time it is called . I just need to access read the properties not update them so I rewrote the method without GetDirectoryEntry . It now returns the entire global address list instantly . The code that solved my problem is below .", "Question : I am using System.DirectoryServices.AccountManagement.dll to deal with Active Directory to get all the users in the Domain Users group . This is returning all the users in the domain but I need to get just the enabled ones . Here is some sample code : .. . .. . Other groups work fine but when the group is Domain Users the value of the Enabled property is false for all users . This makes it impossible to distinguish between enabled and disabled users without doing a further query for each user . Comment : Do you only need the account name Is there a requirement to use the AccountManagement namespace Do you do anything with the UserPrincipal object other than store the name I only ask because your requirements may be better served using the DirectoryServices namespace and the DirectorySearcher with an LDAP Filter as something like : objectclass user memberOf CN Domain Users dc company dc com userAccountControl : 1.2.840.113556.1.4.803 : 2 Which would return all users in that group that are enabled . Comment : randcd : I would prefer to use the AM namespace since it provides a very clean API . I could certainly use LDAP but then everything becomes much more complicated especially in the case where users are only a member of Domain Users because it s their primary group since it s not listed in memberOf in that case . .. . Answer : UserPrinciple objects have a bool Enabled property for this . http : msdn.microsoft.com en-us library system.directoryservices.accountmanagement.userprincipal properties.aspx Comment : This does not solve the problem since the Enabled property doesn t seem to be populated properly when the group being queried is Domain Users", "Question : I ve noticed an interesting behavior when trying to connect to edirectory using DirectoryServices . This is the code that I used to pull information from our dev edirectory but I ve noticed that it s retrieving information from our production Active Directory from what I ve read DirectorySearcher can be used on edir as well : .. . .. . I know it s hitting production because jsmith doesn t exist in dev . Another thing I noticed was that the attributes that were returned are AD attributes like memberOf etc . What finally got it to work was using System.DirectoryServices.Protocols : .. . .. . I ve done some research but I couldn t figure out why it would have been routing the DirectorySearcher to prod even though I explicitly specified the IP address and the username The dev server is on a different domain from my local machine and I m running the code on my local machine . Could it be possible that since my machine is on the same domain as prod it s defaulting to the prod Active Directory and just ignoring the devIP that I m passing it .. . Answer : The same root cause with the following : .. . .. . Check if the DirectoryEntry is valid in DirectorySearcher http : stackoverflow.com questions 25653667 check-if-the-directoryentry-is-valid-in-directorysearcher 27131661 27131661 .. . .. . The constructor you used DirectorySearcher string is actually expecting the filter but not the search root path .", "Question : How to add ForeignSecurityPrincipals to Active Directory Lightweight Directory Services AD LDS i.e . bringing AD security principals users as well as computer accounts to AD LDS Any script ps cmdlet tool Adding AD security princials as ForeingSecurtyPrinciaps to AD LDS using ADSI edit .. . .. . I know I can bring them by making them members of administrators readers users i.e . in order to define roles for the AD users as readers users administrators the foreign security principals need to be added - which makes sense - so ADSI edit is automatically adding the SIDs to foregin security principals container please see the attached image adding ad security principals as one of the members to ad lds using ad lds http : i.stack.imgur.com 3501R.png .. . .. . Question what are different ways of doing it other than assigning roles using adsi edit : .. . .. . But I am wondering is there a way without making the security principal as member of one of the roles especially I don t want to do this way for computer accounts - as they are not categorized as administrators or users or roles - default in AD LDS schema . I think I can extend the schema so that my AD LDS instance understands computer accounts and then add the computers there . Just curious if there is another way to do it any other tool or PS script will also do as well as I am pretty sure there are number of directory services admin tools .. . .. . Regards . .. . Answer : Actually it simply turned out to be that I can set permissions on ad lds directory objects without adding to the ForeignSecuritypPrinciaps container.. . So I just set perms based on sid few examples are below http : greatit.wordpress.com 2012 08 13 dsacls-and-built-in-groups .. . .. . Examples which grant generic all full control on AD LDS obect : .. . .. . dscals myadldsserver : port cn testadldsobect cn test cn com g sid : GA .. . .. . dsacls DN g domain username : GA .. . .. . dsacls DN g domain machinename : GA .. . .. . Regards .", "Question : I notice there are several different namespaces classes for accessing Active Directory . What are the differences between using the following System.DirectoryServices.AccountManagement .. . System.DirectoryServices.ActiveDirectory .. . System.Web.Security.ActiveDirectoryMembershipProvider .. . Answer : The items under AccountManagement deal with working with various LDAP type data stores . Not just Active Directory but NDS and WinNT as well . If you know your backing store is LDAP compliant or may switch between various LDAP stores then this is probably the best to use . The ActiveDirectory namespace is specifically for AD . Usually you only care to use this if you are going to stay strictly within an AD environment . The ActiveDirectoryMembershipProvider has a slightly different focus . This is usually used by Web Apps as one of the membership providers . Other membership providers include the SqlMembershipProvider or even custom ones that you might create . This is used when your backing store might be AD but could also be changed to use SQL server or some other random store in the future . .. . .. . In summary it all boils down to how your app currently functions and how it might grow in the future . If you have a desktop app then use the System.DirectoryServices namespace . If you have a web app that might be deployed into unknown environments use the membership providers . Note that I have used a combination of a SqlMembershipProvider and the System.DirectoryServices space together in some apps . Specifically to authenticate into an LDAP store AD NDS while authorization stays in my app .", "Question : I m trying to set the group type for a new Active Directory Entry via VB.NET and DirectoryServices to create a distribution list . How do I access the ADS GROUP TYPE enumerations Specifically I m after ADS GROUP TYPE GLOBAL GROUP . .. . Answer : You re correct you can t actually get access to the enumerations . Just a wee nitpick this constant doesn t need to be an object you can make it an int32 - .. . .. . Const ADS GROUP TYPE GLOBAL GROUP As Object H2" ] }
[ "yes-answer-long", "yes-answer-short" ]
s
UNK_RELATION
starcounter@transactional-database@63
starcounter -- starcounter is a memory centric acid compliant @placeholder optimized for modern cpus .
{ "confidence": [ 52.56018829345703, 52.010719299316406, 49.44230651855469, 49.41946792602539, 43.33317565917969, 42.545654296875, 39.77803039550781, 39.77803039550781, 39.77803039550781, 39.77803039550781, 39.63743209838867, 39.63743209838867, 39.63743209838867, 38.542076110839844, 38.542076110839844, 37.78091049194336, 37.06075668334961, 37.06075668334961, 36.70660400390625, 34.98926544189453, 34.98926544189453, 34.98926544189453, 34.98926544189453, 33.423973083496094, 33.423973083496094, 32.27199172973633, 32.27199172973633, 32.27199172973633, 32.05843734741211, 32.05843734741211, 32.05843734741211, 30.822486877441406, 30.558521270751953, 29.860027313232422, 28.77580451965332, 28.77580451965332, 23.669361114501953, 21.07306480407715, 21.07306480407715, 17.473800659179688, 17.473800659179688, 17.473800659179688, 16.89704132080078, 16.89704132080078, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445, 16.882036209106445 ], "content": [ "What is the best practice for this in Starcounter", "EDIT2 .. . .. . Starcounter implements https : github.com Starcounter Starcounter wiki SQL-Comparison-Predicates operator IS which allows to check if an object belongs-to the given type .", "There is a ticket https : github.com Starcounter Starcounter issues 2742 in Starcounter s issue tracker about this .", "Horizontal scaling in Starcounter .. . .. . Normally you do not scale a Starcounter node .", "So what trick makes StarCounter work", "Starcounter s InvoiceDemo shows how to use the MAX aggregate function to implement incremental value : github.com Starcounter InvoiceDemo blob master src InvoiceDemo2 https : github.com Starcounter InvoiceDemo blob master src InvoiceDemo2 InvoicePage.json.cs L18", "I have been reading about a database named Starcounter .", "To go above that you need to add more Starcounter nodes .", "So a better alternative is to use the additional Starcounter nodes as gateway servers .", "Starcounter is talking about speed while CAP NoSQL are talking about scalability .", "Implementation of operator IS NOT is missing which I found after I tested it in the latest version of Starcounter .", "Starcounter does not provide auto-incremented user ids and I doubt it will due to different reasons .", "In Starcounter you can setup multiple-domains in the ReverseProxies configuration section of the scnetworkgateway.xml file .", "I m trying out the Starcounter Beta and I would like to create LogSources .", "The syntax used is related with the DBMS that I am using namely Starcounter .", "I don t have any ORM layer because I am using Starcounter http : starcounter.io and I can t query the DB from the unit-testing project because Starcounter doesn t allow me to forcing me to create an auxiliary project within the main project where the Starcounter DB is located .", "I have Starcounter installed on my laptop i7 mobile .", "PS : More info about starcounter here : http : starcounter.io", "So the answer to the question is : It is not possible to select objects of a base-class without selecting objects of children classes using SQL in current version of Starcounter .", "Starcounter makes data CA and wants you to only use AP when you really have to .", "Scaling consistent data .. . .. . I m sure there are other approaches but Starcounter works by hosting the database image in RAM .", "This might sound like a short amount of time but it is enough to accumulate thousands of request if you decided you need to scale Starcounter .", "Starcounter can be useful if their transaction rate is much greater than your web page hit rate .", "Starcounter allocates counter-based object-identity http : starcounter.io guides database object-identity so it is similar to auto-increment id but for all objects records in the database .", "Say for example I have a something like this declared in Starcounter .. . .. . I have a page listing one row from the DB with an update button with PuppetJS and all working fine .", "Note that in this case all Starcounter processes and Visual Studio if used should be run in elevated mode .", "I have a fully operational starcounter fusion of a C VM and a DBMS project which I had to port into another machine .", "Another approach is to create new empty Starcounter project and add source code files to it .", "I can imagine that StarCounter is fast but the claim that NoSql needs to drop consistency to keep up seems a little bit strange to me .", "They can be used to partition data but then you lose consistency and Starcounter is not designed for partitioning so it is less elegant than solutions such as Volt DB .", "While LMAX and Starcounter operate rather differently they both utilise the fact that you can exploit the hardware in a single PC to drive extreme loads .", "@rsy You are correct my comment was in reference to what I mistook for a suggestion to do Starcounter object access on a thread pool thread .", "I did it by going into : .. . .. . File - New - Project from existing code .. . .. . In the following window I chose Visual C as the project type and then I specified where the folder with the files was along with the output type which can only be one of three : .. . .. . Console Application .. . Windows Application .. . Class Library .. . .. . But nothing in this window allow me to choose the imported application as being a starcounter application .. . And after the project is imported in the using Starcounter import I keep getting the error the type or namespace name Starcounter could not be found .", "I have seen no built-in support in Starcounter to do site bindings for example in the same way Internet Information Server where you can route calls to a specific site depending on domain-name used as per the picture below .", "Making the shared-everything node faster by doing less .. . .. . The use of the database as a heap for the programming language instead of a remote system for serialization and deserialization is a trick that Starcounter calls VMDBMS .", "If I understand correct then StarCounter basically works by the same prinicple as LMAX stripping out all boilerplate to other servers and only then only care about the core and thereby enabling a single machine to handle very large loads .", "When record is allocated in memory .", "When you hear somebody claim that they have a scale-out ACID database be cautious .", "Necessity is the mother of most invention and the need for ACID has produced some pretty mind blowing solutions .", "This means that moving memory is the overshadowing bottleneck of total throughput for a consistent database .", "This is often referred to as the memory wall wikipedia has some useful information .", "Instead of treating the database as a RAM database the database is treated as primary memory .", "You can compare this if you want to the way laggards kept trying to invent the perpetual machine for years after modern theoretical physics should reasonably have put a stop to it .", "Some comfort in the gloom .. . .. . If you do the math you find that a single PC has instructions to spare on each human being living on Earth for each second it is running google on modern CPU and MIPS .", "I have a search-form .", "Search key is a url get parameter the url looks like this : http : localhost : 8080 launcher search query SearchStringGoesHere .. . .. . Special characters are encoded in url so when a user inputs + into the search field url looks like this : http : localhost : 8080 launcher search query 2b .. . .. . On the server-side query variable has value 25252b the question is how to get user s original value which is + .", "One of the solutions is to use System.Web.HttpUtility.UrlDecode searchString https : msdn.microsoft.com en-us library adwtk1fy v vs.110 .aspx .", "For example 2b 2b would be converted to ++ string .", "Lets assume we have the non abstract base-class A which has a specialized class B . I now want to make a query that only returns instances of A not B .", "Can this be achieved", "I assume you already have a query which returns A and B - might be worth posting your work so-far .", "Yes I had a much more complex environment which I simplified into A and B", "However the check include children and thus does not help .", "The filter has to be implemented in C during iteration over the query result .", "An example of application which filters out objects of B : .. . .. . The result-of the program execution the first time will be :", "I already had a C filter so I ll just stick with that for now .", "Thanks", "@k rus Couldn t you use WHERE CAST a AS B IS NULL", "@MartinT rnwall Thank you for suggestion .", "I believe it should work .", "Needs to be tested .", "For example considering the Sample App at http : starcounter.io tutorials 1-introduction-to-part-1 InvoiceDemo .. . .. . Following Database objects are declared .. . .. . If I want to make sure I know the order of Invoice Rows that has been added I would in standard SQL DB just use an Auto Increment ID .", "Can you elaborate on your question", "What kind of order are you interested", "Do you need to serialise invoice rows creation", "You can us ObjectID ObjectNo for an order of the records .", "I need to be sure I can sort the rows in order by creation so yes I need to serialise .", "Unfortunately the documentation is a bit light about the ObjectNo whatever it will always generate a new highest number or can reuse old deleted id s .", "Also what would happen in a restore scenario where log files are used to restore the db will the ObectNo still be properly sequential", "For example : .. . .. . 1 .", "Such functionality requires centralised counter and serialisation of requests to it .", "This is a performance issue .", "2 .", "Serialisation order depends on internal implementation and not necessary meet expectations of an application developer .", "An example of when it is no obvious what order means and expected by application : .. . .. . I need to be sure I can sort the rows in order by creation .. . .. . Creation time can mean : .. . .. . 1 .", "When record is inserted and committed .", "3 .", "When user submitted a request which leads to create the record .", "4 .", "When a handler was invoked which creates the record .", "Since records can be added simultaneously in different transactions the order of them can differ significantly between the options .", "Only application developer knows which order is meant and how it will affect user-experience UX .", "However it is important to remember : .. . .. . 1 .", "There are scenarios when group of ids can be pre-allocated so the incremental order becomes broken .", "For example replicator scenario .", "It is not necessary that the order is the same as the developer expects which is discussed above .", "Slight improvements in the allocator implementation or in the full-stack framework can produce different order than before in some occasions .", "This can break UX .", "The allocation scheme of the object-identity is very likely to be changed in future for performance reason .", "Thus proceedings of object-identity number will not correspond to proceedings in time .", "Because of the last point using Starcounter s object-identity for ordering record by the creation time is not good idea .", "I guess auto-incremented ids in other databases have similar problems .", "So using them is not so safe if UX should be preserved or significant changes might be met in future and usually cannot be foreseen .", "My opinion is that the order is application specific and should be implemented in the application logic .", "I see several ways : .. . .. . 1 .", "Use timestamp field to identify time ordering and the object-identity for ordering records with the same timestamp in deterministic way since it is guaranteed that object-identity is always the same for the same record ." ] }
{ "confidence": [ 57.869842529296875, 55.51728057861328, 53.93135452270508, 51.72004699707031, 48.88398742675781, 48.85215759277344, 47.93726348876953, 47.307010650634766, 44.081668853759766, 38.99079132080078, 37.81355285644531, 36.84305191040039, 17.690574645996094, 11.422459602355957 ], "content": [ "Question : Lets assume we have the non abstract base-class A which has a specialized class B . I now want to make a query that only returns instances of A not B . Can this be achieved Comment : I assume you already have a query which returns A and B - might be worth posting your work so-far . Comment : Yes I had a much more complex environment which I simplified into A and B .. . Answer : EDIT2 .. . .. . Starcounter implements https : github.com Starcounter Starcounter wiki SQL-Comparison-Predicates operator IS which allows to check if an object belongs-to the given type . However the check include children and thus does not help . Implementation of operator IS NOT is missing which I found after I tested it in the latest version of Starcounter . There is a ticket https : github.com Starcounter Starcounter issues 2742 in Starcounter s issue tracker about this . So the answer to the question is : It is not possible to select objects of a base-class without selecting objects of children classes using SQL in current version of Starcounter . The filter has to be implemented in C during iteration over the query result . An example of application which filters out objects of B : .. . .. . The result-of the program execution the first time will be : Comment : I already had a C filter so I ll just stick with that for now . Thanks Comment : @k rus Couldn t you use WHERE CAST a AS B IS NULL Comment : @MartinT rnwall Thank you for suggestion . I believe it should work . Needs to be tested .", "Question : I have been reading about a database named Starcounter . It makes a claim that it can handle loads that a NoSql -database only can handle without dropping consistency . As far as I understand the CAP-theorem if you keep consistency you lose availability or partition tolerance . So what trick makes StarCounter work I can imagine that StarCounter is fast but the claim that NoSql needs to drop consistency to keep up seems a little bit strange to me . Can anyone please explain Thanks in advance Roland Comment : Starcounter makes data CA and wants you to only use AP when you really have to . .. . Answer : The short answer .. . .. . The CAP theorem aka Brewers theorem cannot be beaten for a single piece of information like a consistent database . If you have a horizontally scaled database you won t get consistency and performance . This conclusion comes from the laws of physics and can be deducted from Brewers theorem and Einsteins theories of relativity . You need to scale-in up not out . Not very cloudy but as the enemies of Galileo would probably confess if they were alive today nature does a poor job at honouring human fashion . Scaling consistent data .. . .. . I m sure there are other approaches but Starcounter works by hosting the database image in RAM . Instead of moving database data to the application code parts of the application code is moved to the database . Only data in the final response gets moved from the original place in RAM memory where the data was in the first place . This makes most of the data stay put even if there are millions of requests processed every second . The downside is that the database needs to know the programming language of your application logic . The upside however is obvious if you have ever tried to serve millions of HTTP requests sec each requiring extensive database access . .. . .. . A more thourough answer .. . .. . The question is a good one . It is no wonder you find it strange as it was only a few years back that CAP was proven turned into a theorem . Many developers are as disappointed as a kid would be when theoretical physicist tells him to stop looking for the perpetual motion machine because it cannot work . We still want the scale-out consistent database don t we The CAP theorem .. . .. . The CAP theorem gives that any piece of information cannot have consistency C availability A and partition tolerance P . It applies to a unit of information such as a database . You can of course have independent pieces of information that operates differently . One piece could be AP another could be CA and a third could be CP . You just cant have the same information being CAP . The problem with the impossibility of the P in a consistent and available database results in how a scaled-out database MUST do signalling between the nodes . The conclusion must be that even in a hundred years from now CAP gives that a single piece of consistent data will have to live on hardware interconnected using hard wires or light beams . The problem with the P in CAP .. . .. . The problem lies in performance if you apply horizontal-scaling to an available consistent database . A good performance was the very reason to do horizontally scaling in the first place this is a very bad thing . As every node needs communicate with the other nodes whenever there is database access to achieve consistency and given the fact that signalling is ultimately limited by the speed of light you are left with sad but true fact that database scientist as well as CPU scientists are not just being stubborn for failing to see scale-out as a a magical silver bullet . It will not happen because it cannot happen however parts of your database could be placed in a AP set so remember we are talking about consistent data here . Adding the theories of Einstein to the CAP theorem and the small box wins of the cloudy data-center for consistent data . Perpetual machines and CAP .. . .. . The state of things in the database community is a little bit like the state of perpetual motion machines when horse and carriage was the way to get to work . Without any theoretical evidence against it the patent offices granted hundreds of patents for impossible perpetual machines . Today we may laugh at this but we have a similar situations in the database industry with consistent scale-out databases . When you hear somebody claim that they have a scale-out ACID database be cautious . It was only after the dot com crash mathematicians at MIT proved Brewer right at the CAP theorem was officially born so the hunt for the impossible has unfortunately not died off just yet . You can compare this if you want to the way laggards kept trying to invent the perpetual machine for years after modern theoretical physics should reasonably have put a stop to it . Old habits die hard my apologies to anyone on Stack overflow still making drawings of bearings and arms moving ad finitum on their own accord - I don t mean to be offensive . CAP and performance .. . .. . All is not lost however . Not all pieces of information needs to be consistent . Not all pieces needs to scale-out . You just have the accept Brewers theorem and make the best out of it . For applications such as Facebook consistency is dropped . This is okay as data is entered once and then is manipulated by a single users . Still we can experience the side effects in everyday Facebook usage such as things popping in and out of existence for a while . However in most business applications data needs to be correct . The sum of all accounts in your bookkeeping needs to amount to zero . Your stock inventory must equal to 8 if you sold 2 out of 10 items even if there are multiple users buying from the same stock . The problem with scaling out available data is that you have to make do without partition tolerance . This fancy word simply means that you have to signal between the nodes in your cloud at all times . And as it takes light a few nanoseconds to travel a single meter this becomes impossible without making your scale-out result in less performance rather than more performance . Of course this is only true for consistent data . The implications of this has been known by the engineers of Intel AMD Oracle et . al for a long time . It is not their scientist haven t heard of scale-out . It is just that they have come to accept the world as Einstein described it . Some comfort in the gloom .. . .. . If you do the math you find that a single PC has instructions to spare on each human being living on Earth for each second it is running google on modern CPU and MIPS . If you do some more math like taking the total turnover of Amazon.com you can find it at wwww.nasdaq.com divided by the price of an average book you will find that the total number of sales transactions can fit in RAM of a single modern PC . The cool thing is that the number of items customers orders products etc . occupies the same amount of space in 2012 as it did in 1950 . Images video and audio has increased in size but numeric and textual information does not grow per item . Sure the number of transactions grows but not in the same phase as computer power grows . So the logical solution is to scale out read-only and AP data and scale-in up business data . Scale-in instead of scale-out .. . .. . Database engines and business logic running in a VM like the Java VM or the .NET CLR typically use fairly effective machine code . This means that moving memory is the overshadowing bottleneck of total throughput for a consistent database . This is often referred to as the memory wall wikipedia has some useful information . The trick is to transfer code to the database image instead of data from the database image to the code if using a MVC or a MVVM pattern . This means that the consuming code executes in the same address space as the database image and that data is never moved and the disk is merely securing transactions and images . Data can stay in the original database image and does not have to be copied into the memory of the application . Instead of treating the database as a RAM database the database is treated as primary memory . Everything stays put . Only data that is part of the final user response is moved out of the database image . For a large scale applications with hundreds of millions of simultaneous users this typically amounts to only a few million requests per second something that a single PC has no problem with handling given that the HTTP packaging is done on gateway servers . Fortunately such servers scales out beautifully as they don t need to share data . As it turns out the disk is fast at sequential writes so a raided disk can persist terabytes or changes every minute . Horizontal scaling in Starcounter .. . .. . Normally you do not scale a Starcounter node . It scales-in rather than out . This works well for a few million simultaneous users . To go above that you need to add more Starcounter nodes . They can be used to partition data but then you lose consistency and Starcounter is not designed for partitioning so it is less elegant than solutions such as Volt DB . So a better alternative is to use the additional Starcounter nodes as gateway servers . These servers simple accumulates all incoming HTTP requests for a millisecond at a time . This might sound like a short amount of time but it is enough to accumulate thousands of request if you decided you need to scale Starcounter . The batch of requests are then sent to the ZLATAN node Zero LATency Atomicity Node a thousand times a second . Each such batch can contain thousands of requests . In this way a few hundred million user sessions can be served by a single ZLATAN node . Although you can have several ZLATAN nodes there is only one active ZLATAN node at a time . This is how the CAP theorem is honored . To go above that you need to consider the same tradeoff as Facebook and others . Another important note is that the ZLATAN node does not serve applications with data . Instead the applications controller code is run by the ZLATAN node . The cost of serializing deserializing and sending data to an application is far greater than to process the controller logic cycles . I.e . the code is sent to the database instead of the other way around a traditional approach is that the applications asks for data or sends data . Making the shared-everything node faster by doing less .. . .. . The use of the database as a heap for the programming language instead of a remote system for serialization and deserialization is a trick that Starcounter calls VMDBMS . If the database is in RAM you should not move data from one place in RAM to another place in RAM which is the case with most RAM databases . Comment : If I understand correct then StarCounter basically works by the same prinicple as LMAX stripping out all boilerplate to other servers and only then only care about the core and thereby enabling a single machine to handle very large loads . Of course there are other stuff too but as a basic principle Comment : While LMAX and Starcounter operate rather differently they both utilise the fact that you can exploit the hardware in a single PC to drive extreme loads . The typical web stack today is a poor benchmark in what is possible . Necessity is the mother of most invention and the need for ACID has produced some pretty mind blowing solutions .", "Question : I have seen no built-in support in Starcounter to do site bindings for example in the same way Internet Information Server where you can route calls to a specific site depending on domain-name used as per the picture below . Is there any recommended way to how to work do this enter image description here http : i.stack.imgur.com ANumX.png .. . Answer : In Starcounter you can setup multiple-domains in the ReverseProxies configuration section of the scnetworkgateway.xml file . Example : .. . .. . Read more on starcounter.io http : starcounter.io - Reverse proxy functionality http : starcounter.io guides network networkgateway reverse-proxy-functionality .", "Question : I have been reading about a database named Starcounter . It makes a claim that it can handle loads that a NoSql -database only can handle without dropping consistency . As far as I understand the CAP-theorem if you keep consistency you lose availability or partition tolerance . So what trick makes StarCounter work I can imagine that StarCounter is fast but the claim that NoSql needs to drop consistency to keep up seems a little bit strange to me . Can anyone please explain Thanks in advance Roland Comment : Starcounter makes data CA and wants you to only use AP when you really have to . .. . Answer : There is no trick . Starcounter is talking about speed while CAP NoSQL are talking about scalability . There is a trade-off between features+scalability vs speed . Sometimes it s OK to ignore scalability if you can prove there are bottlenecks elsewhere . For instance a new startup shouldn t worry about their website scaling to a million users they should worry about getting their first hundred users . Does anyone remember how often Twitter was down in the early days Starcounter can be useful if their transaction rate is much greater than your web page hit rate . On the other hand I don t trust anyone who lumps all NoSQL Databases together . The various NoSQL databases are more different than alike . They have radically different architectures and properties . Some of them scale to thousands of nodes some of them don t scale beyond one node . Sometimes adding scalability slows you down . Sometimes removing features speeds you up . http : strata.oreilly.com 2010 12 strata-gems-mysql-handlersocket.html", "Question : I have Starcounter installed on my laptop i7 mobile . Checking the logfile I found that I had several messages like this : .. . .. . Memory manager unable to acquire the SE MANAGE VOLUME NAME privilege . Applying slow backup routine .. . .. . Why does this happen If this affects the performance is there some way I can improve the installation to avoid this problem or is this something that will only occur outside a server installation .. . Answer : Memory manager unable to acquire the SE MANAGE VOLUME NAME privilege . Applying slow backup routine .. . .. . This is a warning message . It means that the backup will slow . It happens if the code host sccode.exe is run in not elevated mode without Administrative privilege which is normal case for Personal server and development-environment . This message will show performance problem in the case of running System server i.e . in production . The message should not appear if sccode.exe process runs in elevated mode . Note that in this case all Starcounter processes and Visual Studio if used should be run in elevated mode .", "Question : I have a fully operational starcounter fusion of a C VM and a DBMS project which I had to port into another machine . I did it by going into : .. . .. . File - New - Project from existing code .. . .. . In the following window I chose Visual C as the project type and then I specified where the folder with the files was along with the output type which can only be one of three : .. . .. . Console Application .. . Windows Application .. . Class Library .. . .. . But nothing in this window allow me to choose the imported application as being a starcounter application .. . And after the project is imported in the using Starcounter import I keep getting the error the type or namespace name Starcounter could not be found . Any idea on what am I doing wrong I am using Visual Studio 2013 ultimate PS : More info about starcounter here : http : starcounter.io .. . Answer : Starcounter s project templates are only available for new empty projects and not avaialble for new projects from existing code . To continue development on another machine move entire project i.e . source code together with project and solution files to new machine and just open the project . It works well if the same version of Visual Studio is used . You can also test if it will work with a later version of Visual Studio which will require to convert project . Another approach is to create new empty Starcounter project and add source code files to it . It is important to add both typed json files with code-behind files . Comment : So easy.. . Moving the entire project did the trick for me . Thank you so much", "Question : For example considering the Sample App at http : starcounter.io tutorials 1-introduction-to-part-1 InvoiceDemo .. . .. . Following Database objects are declared .. . .. . If I want to make sure I know the order of Invoice Rows that has been added I would in standard SQL DB just use an Auto Increment ID . What is the best practice for this in Starcounter Comment : Can you elaborate on your question What kind of order are you interested Do you need to serialise invoice rows creation You can us ObjectID ObjectNo for an order of the records . Comment : I need to be sure I can sort the rows in order by creation so yes I need to serialise . Unfortunately the documentation is a bit light about the ObjectNo whatever it will always generate a new highest number or can reuse old deleted id s . Also what would happen in a restore scenario where log files are used to restore the db will the ObectNo still be properly sequential .. . Answer : Starcounter does not provide auto-incremented user ids and I doubt it will due to different reasons . For example : .. . .. . 1 . Such functionality requires centralised counter and serialisation of requests to it . This is a performance issue . 2 . Serialisation order depends on internal implementation and not necessary meet expectations of an application developer . An example of when it is no obvious what order means and expected by application : .. . .. . I need to be sure I can sort the rows in order by creation .. . .. . Creation time can mean : .. . .. . 1 . When record is inserted and committed . 2 . When record is allocated in memory . 3 . When user submitted a request which leads to create the record . 4 . When a handler was invoked which creates the record . Since records can be added simultaneously in different transactions the order of them can differ significantly between the options . Only application developer knows which order is meant and how it will affect user-experience UX . Starcounter allocates counter-based object-identity http : starcounter.io guides database object-identity so it is similar to auto-increment id but for all objects records in the database . However it is important to remember : .. . .. . 1 . There are scenarios when group of ids can be pre-allocated so the incremental order becomes broken . For example replicator scenario . 2 . It is not necessary that the order is the same as the developer expects which is discussed above . 3 . Slight improvements in the allocator implementation or in the full-stack framework can produce different order than before in some occasions . This can break UX . 4 . The allocation scheme of the object-identity is very likely to be changed in future for performance reason . Thus proceedings of object-identity number will not correspond to proceedings in time . Because of the last point using Starcounter s object-identity for ordering record by the creation time is not good idea . I guess auto-incremented ids in other databases have similar problems . So using them is not so safe if UX should be preserved or significant changes might be met in future and usually cannot be foreseen . My opinion is that the order is application specific and should be implemented in the application logic . I see several ways : .. . .. . 1 . Use timestamp field to identify time ordering and the object-identity for ordering records with the same timestamp in deterministic way since it is guaranteed that object-identity is always the same for the same record . 2 . EDIT Have a shared counter object outside database . You will need to implement serialisation to it through locks or else . For example sync bool compare-and-swap or Interlocked.Increment https : msdn.microsoft.com en-us library dd78zt0c v vs.110 .aspx can be used which is atomic operation and no locks required but it is cache unfriendly . Note that it is important to access it outside re-triable transaction scope i.e . with snapshot isolation . However using it in such transaction will still work but counter will be increased on each retry . 3 . Use database object to store the counter . The main problem is that it will be too many conflicts on high-load due to optimistic-concurrency . 4 . EDIT As suggested by @warpech : obtain highest existing id e.g . SELECT MAX InvoiceRowNo FROM InvoiceRow and increment it . Add unique constraint by creating unique-index http : starcounter.io guides sql indexes to avoid the same ids in the case of concurrency . In the case of concurrent increment conflict between transactions will happen and one of the transactions will be retried while the other will succeed . Note that on high-load the conflict might happen often and some unlucky request will be delayed considerably or will never pass thru . Comment : Starcounter s InvoiceDemo shows how to use the MAX aggregate function to implement incremental value : github.com Starcounter InvoiceDemo blob master src InvoiceDemo2 https : github.com Starcounter InvoiceDemo blob master src InvoiceDemo2 InvoicePage.json.cs L18 Comment : @warpech Thanks for suggestion . The example does not guarantee the unique InvoiceNo in the case of simultaneous requests . Adding unique-index will help but will require to add try-catch block on constraint violation .", "Question : null .. . Answer : I need to implement several unit tests that assert about the correction of some methods that update the database DB . I don t have any ORM layer because I am using Starcounter http : starcounter.io and I can t query the DB from the unit-testing project because Starcounter doesn t allow me to forcing me to create an auxiliary project within the main project where the Starcounter DB is located . Therefore whenever I need to query the DB for testing I have to asynchronously invoke an HTTP handler in the auxiliary project do all the DB stuff there and return a string with the outcome . Some of the methods I m testing do extensive changes in the DB and I don t think it is a good practice to return massive strings that will still have to be parsed in the unit-testing project . So I am thinking about doing several queries to the DB in another asynchronous call asserting whether its state corresponds to the expected state and return just a value that will allow me to understand if the DB state is not the expected and give me a clue about what went wrong . Is this the approach I should follow to properly unit test my application PS : I am using C and Xunit but I think this question also applies to Java and other unit-testing frameworks .", "Question : Say for example I have a something like this declared in Starcounter .. . .. . I have a page listing one row from the DB with an update button with PuppetJS and all working fine . If I change the value from another session or directly in the DB is there anyway to directly update the values to any client who are active by pushing the new values to the clients Edit : I added following to my TestPage.json.cs file : .. . .. . This push updates directly to other sessions nicely . Still wonder if there is some better way to do this . .. . Answer : The code that you ve presented in your edit is exactly the way to go : .. . .. . What it does is : .. . .. . commit changes to db .. . for every running session check if that session has a TestPage instance attached to it .. . if the above is positive revaluate the bound data and send patches if required .. . .. . More about pushing changes over WebSocket can be found here : http : starcounter.io guides web sessions .", "Question : In c I have to ensure that a certain block of code in a handler will only be executed after several threads finish . Those threads are invoked from a method that is called in the same handler immediately before the aforementioned block of code . The syntax used is related with the DBMS that I am using namely Starcounter . This is for unit-testing purposes so I can t do any changes in the startMethod . Any ideas on how I can solve this problem Comment : Does dbSession.RunAsync return a Task Comment : No it is void Comment : I would call dbSession.RunSync wrapped in Task.Run collect those Tasks and wait for them with Task.WaitAll Comment : I d suggest looking into thread parallelism : msdn.microsoft.com en-us library dd537609 v vs.110 .aspx https : msdn.microsoft.com en-us library dd537609 v vs.110 .aspx Comment : @rsy You are correct my comment was in reference to what I mistook for a suggestion to do Starcounter object access on a thread pool thread . The accepted answer looks like a reasonable approach I think . But I see no way of achieving what you re asking for without modifying startMethod at all . .. . Answer : startMethod is fire and forget because async Tasks are nt collected in DbSession.RunAsync . Without modifying this method there is no reference to the started Task s to wait for . If this method could be modified one could wrap a sync call DbSession.Sync if such is defined in a Task and wait for those tasks . Comment : thx @displayName Comment : I can t make any modifications in the startMethod . As I have written in the question after the code this is for unit-testing purposes and that s precisely the method I am supposed to test . Comment : The startMethod is fire and forget if it can t be altered : there is just nothing to wait for . Comment : I have been discussing this in the office and seems you are right @Mikey . So feel free to edit your answer stating also this limitation you ve mentioned which is related to my question and I will gladly mark it as solved tomorrow after going through the problem one more time : Comment : i have added the explanation and thx", "Question : I m trying out the Starcounter Beta and I would like to create LogSources . I did find the class Starcounter.LogSources which has the property Hosting of type Starcounter.Logging.LogSource . But I don t understand how to define my own log source any help is appreciated . .. . Answer : Sorry the documentation wasn t enough in this case it s one of the things we are really working on to improve . The Starcounter.LogSources class is just a single place we keep a few well-known log sources like SQL and Hosting that you mentioned . These are normally just used by the database engine . To create and start logging with your own source it s as easy as : .. . .. . Just make sure you ve referenced the Starcounter.Logging assembly . Comment : Ok I didn t notice the new assembly .", "Question : For example considering the Sample App at http : starcounter.io tutorials 1-introduction-to-part-1 InvoiceDemo .. . .. . Following Database objects are declared .. . .. . If I want to make sure I know the order of Invoice Rows that has been added I would in standard SQL DB just use an Auto Increment ID . What is the best practice for this in Starcounter Comment : Can you elaborate on your question What kind of order are you interested Do you need to serialise invoice rows creation You can us ObjectID ObjectNo for an order of the records . Comment : I need to be sure I can sort the rows in order by creation so yes I need to serialise . Unfortunately the documentation is a bit light about the ObjectNo whatever it will always generate a new highest number or can reuse old deleted id s . Also what would happen in a restore scenario where log files are used to restore the db will the ObectNo still be properly sequential .. . Answer : If it s only for sorting and not a real eg . receipt with rules around it perhaps seqno I would suggest that you add a DateTime to the object for filtering sorting . If thats not good enough create a singletonclass that perhaps selects the highest know SeqNo from the DB at startup then use this singleton to get increment the counter or if you re lazy select it every single time . If you want to be 100 sure they re unique even if you delete items let the seqno config be persistent so that the last used SeqNo always is saved even if you delete the latest entries . Not sure how ObjectID is managed in SC but I think using them for anything but a unique identifier is probably a bad thing . Probably you will get OID n-1 OID n but you shouldn t rely on it.. .", "Question : I have a search-form . Search key is a url get parameter the url looks like this : http : localhost : 8080 launcher search query SearchStringGoesHere .. . .. . Special characters are encoded in url so when a user inputs + into the search field url looks like this : http : localhost : 8080 launcher search query 2b .. . .. . On the server-side query variable has value 25252b the question is how to get user s original value which is + . .. . Answer : One of the solutions is to use System.Web.HttpUtility.UrlDecode searchString https : msdn.microsoft.com en-us library adwtk1fy v vs.110 .aspx . For example 2b 2b would be converted to ++ string .", "Question : In the following example I got a warning that Item class was not found . The Batch class was fine even though it was located in the same namespace . Did Batch work due to that it was attached in the code-behind QueueModel : Json Is this by design or should it be more consistent .. . Answer : If the database classes lives in the same namespace as your Json derived-class then you only need to specify the class name . If there is a code-behind class a partial class then you do not need to specify the DataType property in the json-by-example file . So it needs to be provided either in the .json file or in the optional code-behind class . person-viewmodel.json : .. . .. . person-viewmodel.json.cs : .. . .. . So if you only use the json-by-example file no code-behind you will need to provide the bound database type : .. . .. . person-message.json : Comment : Are there some pros and cons regarding where to define the data types I see all provided examples have the Items definition after the Items model but does it matter where the definition is located in the file Could I have all datatype defintions collected in the top Comment : It does not matter where you put them ." ] }
[ "yes-answer-long", "yes-answer-short" ]
transactional-database
UNK_RELATION
jquery-globalization@globalization@84
jquery-globalization -- jquery-globalize former jquery-global is a library for the @placeholder of strings dates and numbers currencies formatting and parsing for different cultures in javascript.it enables you to add globalization support to your javascript applications .
{ "confidence": [ 70.69843292236328, 67.83912658691406, 66.0166244506836, 59.656620025634766, 57.025840759277344, 56.41387176513672, 56.326961517333984, 55.06510925292969, 54.813018798828125, 53.92540740966797, 52.91434860229492, 51.90781784057617, 51.40563201904297, 51.312740325927734, 50.95374298095703, 49.833858489990234, 48.87224197387695, 48.50353240966797, 48.389739990234375, 48.0508918762207, 47.804927825927734, 47.523033142089844, 46.16897201538086, 45.33637619018555, 44.43050765991211, 44.35809326171875, 44.1013069152832, 43.9236946105957, 43.65714645385742, 42.92381286621094, 42.68946838378906, 42.628360748291016, 42.414306640625, 42.414306640625, 41.99310302734375, 41.81338119506836, 41.10288619995117, 41.082481384277344, 40.87310791015625, 40.68656539916992, 40.54957580566406, 40.475467681884766, 40.34342956542969, 39.98490524291992, 39.01585388183594, 38.922698974609375, 38.061309814453125, 37.91000747680664, 37.86483383178711, 37.723243713378906, 37.570556640625, 36.92485427856445, 36.77971649169922, 36.77971649169922, 36.27946853637695, 36.220088958740234, 36.142032623291016, 36.109130859375, 35.40613555908203, 35.03278732299805, 34.96657180786133, 34.68736267089844, 34.55967712402344, 34.28129196166992, 33.863975524902344, 32.9044189453125, 32.570125579833984, 32.243263244628906, 32.18952560424805, 31.827964782714844, 31.702640533447266, 31.627105712890625, 31.552509307861328, 31.45327377319336, 31.28203582763672, 30.910968780517578, 30.758316040039062, 30.62683868408203, 30.597251892089844, 29.99459457397461, 29.389774322509766, 29.365896224975586, 29.345638275146484, 29.218055725097656, 29.0753173828125, 28.91455078125, 28.891803741455078, 28.437164306640625, 28.350318908691406, 28.177459716796875, 28.177032470703125, 28.021514892578125, 28.01577377319336, 27.74364471435547, 27.74364471435547, 27.016258239746094, 26.9459228515625, 26.866561889648438, 26.866561889648438, 26.726242065429688 ], "content": [ "1- Get the Globalization library for jQuery .", "I believed that Globalization jQuery plugin GitHub https : github.com jquery-globalize will provide this functionality for formatting numbers and dates in given culture out-of-the-box but it seems it do not .", "Jquery Globalization works great .", "I think the solution is using the JQuery Globalization library .", "The jQuery globalization plugin from Microsoft has been accepted as a offical jQuery plugin a couple of years ago http : blog.jquery.com 2010 10 04 new-official-jquery-plugins-provide-templating-data-linking-and-globalization .. . .. . You can find the latest version here along with examples : https : github.com jquery-globalize .", "Did you download the jquery-globalization here", "We are using jquery and its plugin globalization .", "I try to use the jQuery Globalization plugin in order to fix the comma problem with jquery unobstructive client validation .", "I am using the jQuery Globalize https : github.com jquery-globalize library which uses cldr for internationalization .", "And Where is the link for latest version of Microsoft Jquery Globalization plugin", "Globalize provides functionality for displaying dates for different cultures .", "Using the JQuery globalization plugin I want to format numbers to use as many decimals needed to represent the correct value .", "I m using jQuery Globalize https : github.com jquery-globalize with Node.js .", "github.com jquery-globalize https : github.com jquery-globalize", "I have come across Globalization former jQuery plugin and it looks quite promising .", "I m trying to use the jQuery Globalize plugin http : github.com jquery-globalize .", "I m developing an ASP.NET MVC 3 app that uses both jQuery Globalization https : github.com jquery jquery-global and jQuery UI Slider http : jqueryui.com demos slider .", "The problem was related with the jQuery Validation Globalize Library version .", "I am using jQuery Globalize https : github.com jquery-globalize plugin along with jQuery validation .", "I am using the Globalize jQuery plugin to have globalization correct number and date formats on the client-side in my MVC website .", "While there is not an equivelant format specifier jQuery Globalize Date Formatting https : github.com jquery-globalize date-formatting the same format can be accomplished by verbose for clarity :", "Refer to the Globalize documentation : github.com jquery-globalize core https : github.com jquery-globalize core I believe this is referring to your other question .", "Therefore you ll have to change your code to use the non-jquery Globalization plugin .", "Have you seen this SO question http : stackoverflow.com questions 9204855 cant-get-the-jquery-globalization-to-work", "I am using MVC4.0 and Jquery globalization plugin from Microsift http : www.scottgu.com blogposts jQueryGlobalizationDemos.zip which i got from http : weblogs.asp.net scottgu archive 2010 06 10 jquery-globalization-plugin-from-microsoft.aspx .", "DateJS supports less cultures and only Date Time formatting parsing and manipulating as well as time zones conversion unsupported by Globalize .", "You need to install jquery-globalization and then handle the load of the file with the Culture you need .", "IU can t get the client-server side validation to actually accept the globalization using jQuery .", "On the other hand take a look at Globalize https : github.com jquery-globalize .", "I want to add support for the General Date Time Format to jQuery Globalize as it s the default format for outputting a DateTime as a string in .NET .", "Looking at the culture definition syntax https : github.com jquery-globalize defining-culture-information there is simply no provision for displaying different currencies using a given locale .", "I downloaded this jquery-globalize package will aids me with validation of dates from different locale .", "www.datejs.com http : www.datejs.com vs . https : github.com jquery-globalize .", "All I knew is Jquery globalize supports more culture than datejs .", "I installed it through NuGet.. . then downloaded the cultures files from there github.com jquery-globalize", "I am trying to Globalize https : github.com jquery-globalize .", "WIP implementation at https : github.com jquery-globalize pull 447 .", "Examples of what i want : .. . .. . 1.12 - 1.12 .. . 1.123 - 1.123 .. . 1 - 1 .. . .. . Link to library : https : github.com jquery-globalize", "Using jquery-globalize how can I either retrieve an array of localized strings or get one of those strings from a number range", "Located here https : github.com jquery-globalize readme .. . .. . You must get the lastest script", "How to handle dates with different cultures i.e how can i use common javascript code to handle dates for all cultures .", "I ve submitted an issue to globalize https : github.com jquery-globalize issues on the hunch that others might make the same assumptions and a slight change to documentation could clarify - it s here : jquery-globalize 610 https : github.com jquery-globalize issues 610 .", "We re working the support for non-gregorian calendars at : .. . .. . https : github.com jquery-globalize issues 320 .", "I am trying to do this with jquery-globalization plugin but it fails in the browser client script error indexOf .. . .. . I used to use the jquery calculation plugin like this : .. . .. . and it worked but I m changing to jquery-globalization because of some i18n options it has and would like to use just one of those two plugins rather than both of them on the same site .", "Like you would do with the calendar.ui cultures of JQuery calendars .", "I m checking into Jquery now javascript Globalize -- it s intricate but very detailed with several dialects for each language .", "I would like to avoid using to write javascript with jquery myself for the validation .", "Globalize supports more than just Date Time formatting and Parsing different Calendar systems with automatic conversion in the related field number currency percentage formatting translating strings checking if given language is written Right-To-Left .", "The object to call the library is no more .global or anything like that but Globalize .", "I then have to use jQuery Globalization to show the correct value in the UI this way : .. . .. . It works at least.. . .. . .. . My question is : .. . .. . Is there a better or standard way of doing this", "edit updated : perhaps the value is null sometimes : .. . .. . Looking at the source code to the globalization parseFloat function the first thing it does with the first argument which indeed must be a string not a jQuery object is call .indexOf .", "I have a solution that works fine for all sorts of globalization cultures until I use dot .", "Added the globalization attribute on the web.config file .", "ASP .NET MVC DateTime globalization .", "Something like this probably : link http : demos.kendoui.com web globalization index.html", "The only documented way https : github.com jquery-globalize currency-formatting to modify the currency symbol in Globalize is to change the numberFormat.currency.symbol property of a given culture in this case the fr-FR culture .", "The GitHub page https : github.com jquery-globalize extend documents the addCultureInfo function but I ve been able to get this working with such a deep path : .. . .. . calendars standard patterns .", "I wrote this up in the following blog post in case that s helpful : .. . .. . http : icanmakethiswork.blogspot.co.uk 2012 09 globalize-and-jquery-validate.html .. . .. . My blog post features a link-to this script jquery.validate.globalize.js which forces jQuery Validate to use Globalize for number date-range parsing .", "So if Globalize is global i.e .", "I started by following the advice in Scott Hanselman s blog on this topic - you can read about this here : .. . .. . http : www.hanselman.com blog GlobalizationInternationalizationAndLocalizationInASPNETMVC3JavaScriptAndJQueryPart1.aspx .. . .. . I had to make some changes to use Globalize instead of jQuery Global now jQuery Global is dead .", "Have Globalize display dates that are calculated with DateJS .", "EDIT .. . .. . After having take a look to mplungjan comment I would to know if it is possible to use the I18N format dictionary coming from the globalization plugin into the jquery masked input plugin .", "Is in the Web.config globalization culture en-CA uiCulture auto .", "And to I18N the client we are using this plugin https : github.com nikgraf jquery-global .", "Since I want to have the ability to validate the input in another language formats in this particular context it s German with the decimal number format of 0 75 whereas in the US it would be 0.75 I ve added the following lines jQuery Globalization PlugIn http : weblogs.asp.net scottgu archive 2010 06 10 jquery-globalization-plugin-from-microsoft.aspx AFTER the previously mentioned jquery.validate.min.js and jquery.validate.unobtrusive.min.js .", "Using val on jquery object works fine .", "So after reading the documentation https : github.com jquery-globalize parseDate I added a reference to the following script .", "I think the intended usage is to use Grunt http : gruntjs.com to package the cultures you need along with the Globalize code itself .", "Before you can use any of the Globalize functions you have to load the correct cldr-data and pass it to Globalize .", "Edit : .. . .. . Using the links in the answer below I solved the problem using the Globalize plugin https : github.com jquery-globalize : .. . .. . Of course I had to add a reference to the Globalize plugin in the page and also a reference to the culture that I wanted to use all available on the plugin s site .", ".. . .. . I can install JQuery plugins .", "I am using the library http : github.com nje jquery-glob as a tool to display currency and dates etc according to user wishes .", "@met.lord - this article is a bit better and describes globalization of unobtrusive-validation .", "What i tried : using the Globalization plugin setting Globalize.culture property and hoping that Globalize.format Globalize.parseFloat 1.2435677777 10 en-US will format the value with the desired decimal separator .", "I have a jquery currency input and I am using this code : .. . .. . The input works perfectly as it shows the number as a number with the or sign depending on globalize .", "If you don t need to do math on dates it might be that the server and APIs take care of it but need to display internationalized dates use Globalize .", "I suppose you can use the Globalization plugin to validate a specific culture - just check it out .", "The answer is to use jQuery UI s Datepicker http : jqueryui.com datepicker .", "I don t know javascript or jquery good enough to tell you any workarounds .", "Global Globalize through window.Globalize . http : jsfiddle.net ambiguous 7ta9d .", "This will make the globalize functions to work with the culture .", "is that issue in globalize", "I am trying out some globalization in an asp.net mvc2 application but can t get it to work fully .", "For whatever reason I had to change my globalize reference from : .. . .. . script src @Url.Content Scripts globalize globalize.js type text javascript script .. . .. . to .. . .. . And that solved my problem .", "I have the globalize.js file and I want to force the dateformat to dd mm yyyy at a global level somewhere so then all jquery validation and datepicker etc .", "the article references an old version of globalization but in my answer you will see the new name to use", "I have corrected this behaviour in my Globalize fork https : github.com erethnor globalize which was as simple as removing that toLocaleString iirc .", "I am developing the mobile app with multilanguage support using phonegap and jquery.I am using Jquery i18n for multi language support .", "If you d like to support all cultures with a single require : .. . .. . should do the trick .", "The limitation is in the way the jQuery Slider receives the value .", "Could you perhaps provide some details on how to add and package cultures with Grunt and then I will accept your answer", "Is there a way to check if this initialization has already happened and Globalize is ready for use", "Shall I need separate implementation for client-side specific strings using jquery and resource file for server-side messages .", "I am using Asp.Net Mvc3 and the unobtrusive jquery validation .", "Followed the example shown in the site https : code.google.com p jquery-i18n-properties .", "You should use the Globalize NPM package https : npmjs.org package globalize if you re not doing that already .", "There is no date notation that is shared by all cultures .", "The reason this is happening is that jquery.validate and jquery.glob uses a function called format if validate is added after glob then the validate.format function is called which breaks globalization .", "The script I use to load Globalization : .. . .. . On the View I use unobtrusive-validation : .. . .. . To load all the libraries I use the Shared Layout file :", "I want to set the locale for my javascript to be brazil so my jquery unobtrusive-validation would give errors if user enter period ." ] }
{ "confidence": [ 80.44117736816406, 79.15997314453125, 79.15997314453125, 76.81410217285156, 73.67236328125, 73.42037200927734, 73.22103118896484, 72.40476989746094, 69.2315902709961, 68.50409698486328, 68.20745849609375, 66.6597900390625, 66.62881469726562, 66.05891418457031, 64.55328369140625, 64.549560546875, 64.25531768798828, 64.25021362304688, 62.949031829833984, 61.826202392578125 ], "content": [ "Question : I am setting up a multilingual site that deals with currencies . I want to be able to display correct currency formats based on the selected language . The server-side PHP stuff is a doddle . Using a combination of PHPs NumberFormatter and strftime I have been able to format currencies and dates correctly . There is however a requirement to have the same degree of formatting done client-side with javascript . I have come across Globalization former jQuery plugin and it looks quite promising . If I want to display a dollar value in American English I can do something like this : .. . .. . and this will output : .. . .. . While doing : .. . .. . outputs : .. . .. . which looks perfect . however I have a need to output multiple currencies . So if I have fr-FR selected as my preferred culture how can I output say a dollar value like so : .. . .. . so that the format is French but the value is American Dollar . I have looked but not found anyway to pass a currency symbol as an argument . .. . Answer : The only documented way https : github.com jquery-globalize currency-formatting to modify the currency symbol in Globalize is to change the numberFormat.currency.symbol property of a given culture in this case the fr-FR culture . This will kind of do what you want but it s not a very elegant solution and you would need to manually build a table of correct symbols for each locale and write another method to swap them out . n.b . It is possible to pass a third argument to Globalize.format with a different locale identifier but this just formats the number using that locale s cultural settings . Looking at the culture definition syntax https : github.com jquery-globalize defining-culture-information there is simply no provision for displaying different currencies using a given locale . If you were to look elsewhere the dojo currency http : dojotoolkit.org api dojo currency module in the Dojo Toolkit does do exactly what you need using data from the Unicode Common Locale Data Repository http : en.wikipedia.org wiki CLDR to determine how to represent various currencies in different locales . So you can set your locale to fr write currency.format 3899.888 currency : USD and it will output the currency in USD in the correct format for the French locale . Comment : thanks for your feedback Not what I wanted to hear but very detailed and informative none the less . +1 for pointing to the Dojo solution .", "Question : I am trying to convert a float from one culture to another and seems nothing i found online was working for me . The problem is : .. . .. . 1 . I have a parameter coming from external resource web service in a specific culture . 2 . the result is send to an MVC application and VALIDATED depending on the current culture settings . this means i have to somehow convert from the static culture en-US to whatever is selected ON THE CLIENT before the data is sent to the server for processing so all the data from the client is on one culture . I believed that Globalization jQuery plugin GitHub https : github.com jquery-globalize will provide this functionality for formatting numbers and dates in given culture out-of-the-box but it seems it do not . What i tried : using the Globalization plugin setting Globalize.culture property and hoping that Globalize.format Globalize.parseFloat 1.2435677777 10 en-US will format the value with the desired decimal separator . However it seems it does not worked for me . If anyone can point what i did wrong and give a better working example - will be great . .. . Answer : As the Globalize.format function always returns a . decimal separator as far as i understood there is a little hacky solution but at least it works . The point is at replacing the neutral decimal separator with that for the current culture", "Question : I am trying to convert a float from one culture to another and seems nothing i found online was working for me . The problem is : .. . .. . 1 . I have a parameter coming from external resource web service in a specific culture . 2 . the result is send to an MVC application and VALIDATED depending on the current culture settings . this means i have to somehow convert from the static culture en-US to whatever is selected ON THE CLIENT before the data is sent to the server for processing so all the data from the client is on one culture . I believed that Globalization jQuery plugin GitHub https : github.com jquery-globalize will provide this functionality for formatting numbers and dates in given culture out-of-the-box but it seems it do not . What i tried : using the Globalization plugin setting Globalize.culture property and hoping that Globalize.format Globalize.parseFloat 1.2435677777 10 en-US will format the value with the desired decimal separator . However it seems it does not worked for me . If anyone can point what i did wrong and give a better working example - will be great . .. . Answer : Works for me if i specify a format for the format function . Gives : 1 24", "Question : I try to use the jQuery Globalization plugin in order to fix the comma problem with jquery unobstructive client validation . However i tried many many solutions and there no good solution to fix this . I am on a non-english localization computer and this is important that my customers enter a decimal value like 123 66 and not 123.66 . ASP.NET validation tell me that the price must be a number meh are you serious lol .. . .. . I am getting this javascript error when i try to do the fix . Here my code . Layout.cshtml .. . .. . glob.fix.js .. . .. . I can t understand. . it should work since i added Scripts globalize.js . Any idea or you might have a bette solution for having client validation work and lets me enter comma as decimal values Comment : Thank you for the range validator code .. . Answer : I found the way to finally get rid of the decimal problem with comma seperator Here a picture of the result No more validation problems . enter image description here http : i.stack.imgur.com l2zPU.png .. . .. . The steps to the fix . 1- Get the Globalization library for jQuery . Located here https : github.com jquery-globalize readme .. . .. . You must get the lastest script Also i found some answers out there that was outdated . The object to call the library is no more .global or anything like that but Globalize . 2- Include the scripts in your project . You must add them after jquery.validation stuff . 3- Replace some methods of the validator . This will override the methods for number and range validation which was causing problems . Globalize.parseFloat This will actually replace anything that contains to . if you selected a culture that require it . After this. . You must add . This will make the globalize functions to work with the culture . The complete code look like.. . Comment : You can mark our own answer as the accepted answer . Merci : - Comment : Thanks . I did : Comment : Where are the Globalize.js file located in the github url", "Question : I am using MVC4.0 and Jquery globalization plugin from Microsift http : www.scottgu.com blogposts jQueryGlobalizationDemos.zip which i got from http : weblogs.asp.net scottgu archive 2010 06 10 jquery-globalization-plugin-from-microsoft.aspx . This plugin i am using for amount formating e.g .. . .. . This plugin is working fine when i am giving reference to glob.js and glob.all.js files directly on page View but when i am giving reference to same files on master page its crashing in Jquery.validate.js file . I am getting error as replace function is undefined . Please help me . And Where is the link for latest version of Microsoft Jquery Globalization plugin Thanks in Advance .. . Answer : The jQuery globalization plugin from Microsoft has been accepted as a offical jQuery plugin a couple of years ago http : blog.jquery.com 2010 10 04 new-official-jquery-plugins-provide-templating-data-linking-and-globalization .. . .. . You can find the latest version here along with examples : https : github.com jquery-globalize . A more complete example of your code is needed to see why you get the error you get . Try to show it on http : jsfiddle.net maybee", "Question : null .. . Answer : Using the JQuery globalization plugin I want to format numbers to use as many decimals needed to represent the correct value . Also i want the format to use as few decimals as possible . For example the following example yields 56.12 .. . .. . i want it to yield 56.123456 .. . .. . Am i missing some kind of format option or other alternative Examples of what i want : .. . .. . 1.12 - 1.12 .. . 1.123 - 1.123 .. . 1 - 1 .. . .. . Link to library : https : github.com jquery-globalize", "Question : In my class I have the property : .. . .. . Which renders 31 12 2012 12 : 00 : 00 AM by default with the culture set to en-CA and 12 31 2012 12 : 00 : 00 AM if the culture is en-US . The JQuery validation works fine in en-US but in en-CA complains about The field Date must be a date . I think the solution is using the JQuery Globalization library . I just don t know how to do it for this General Date Long Time G Format Specifier http : msdn.microsoft.com en-us library az4se3k1.aspx GeneralDateLongTime ASP.Net renders . Any ideas The field Date must be a date http : i.stack.imgur.com F3Oze.png Comment : How are you setting the culture en-US en-CA Comment : Thanks for the interest @LenielMacaferi . Is in the Web.config globalization culture en-CA uiCulture auto . .. . Answer : The General Long time G Format Specifier http : msdn.microsoft.com en-us library az4se3k1.aspx GeneralDateLongTime format specifier represents a combination of the short date d and long time T patterns separated by a space . While there is not an equivelant format specifier jQuery Globalize Date Formatting https : github.com jquery-globalize date-formatting the same format can be accomplished by verbose for clarity :", "Question : I am setting up a multilingual site that deals with currencies . I want to be able to display correct currency formats based on the selected language . The server-side PHP stuff is a doddle . Using a combination of PHPs NumberFormatter and strftime I have been able to format currencies and dates correctly . There is however a requirement to have the same degree of formatting done client-side with javascript . I have come across Globalization former jQuery plugin and it looks quite promising . If I want to display a dollar value in American English I can do something like this : .. . .. . and this will output : .. . .. . While doing : .. . .. . outputs : .. . .. . which looks perfect . however I have a need to output multiple currencies . So if I have fr-FR selected as my preferred culture how can I output say a dollar value like so : .. . .. . so that the format is French but the value is American Dollar . I have looked but not found anyway to pass a currency symbol as an argument . .. . Answer : I had the same problem in the end I just replaced the default currency symbol on the output with the symbol I wanted to display . It s a bit primitive but it keeps the formatting correct for the locale with the currency symbol you want . Here is the fiddle http : jsfiddle.net mjJLb 1", "Question : How to handle dates with different cultures i.e how can i use common javascript code to handle dates for all cultures . For example - .. . .. . In the above code how i can make generic code instead of changing date-format for different cultures . Thanks in advance .. . Answer : To be honest your question is not very clear . From the context I deduce you want to let users enter the date in their native format and use Globalize to somehow automatically detect what the format will be and apply appropriate parsing method . If that is what you are after it can t be done . You already know about differences in formatting for various countries . To make matters worse there could be long or short format used unfortunately Globalize does not support the concept of default format available in .Net by calling DateTime s ToString g . That means that you may have things like 2012-10-31 31.10.12 and 31 pa dziernika 2012 which are all more or less valid Polish date formats . I hope now you realize that allowing free-form input is not a good idea . So what to do instead The answer is to use jQuery UI s Datepicker http : jqueryui.com datepicker . It could be fairly easy localized all you have to do is to add valid regional script : .. . .. . Then to get JavaScript s Date object you call Datepicker s getDate method : .. . .. . That s it . BTW . Datepicker allows for converting dates entered by end user if you attach it to the text field . But of course it will be the format specified by regional script.. .", "Question : I m having a problem working with Cultures MVC3 and Data Annotations . I defined a table STORES on a spanish database COLLATION is set for LATIN GENERAL some of the fields are defined in SQL as DECIMAL 18 2 NOT NULL . On my MVC3 Application I already set culture for es-ES on the web.config file . Also I am using all my views strongly-typed . If I use DataAnnotations for validations it would automatically add the Required field and The field must be a number validations . That would be perfect except for one thing : .. . .. . The field must be a number validation is forcing me to use dot . as decimal separator instead of comma . So I don t know how to change it nor how to translate this error message . Then I thought I might force the user to use dot instead of comma with jquery ugly-solution . So I did it just to make some tests and the result was that it allowed me to pass the validations and created perfectly the object in database . But here comes the weird when I m editting that same object it s shown on my same strongly typed form with comma as a decimal separator instead of dot . So what s the problem That the user can t never submit an edition of the object . What am I doing wrong 1 . Added the proper collation to the database . 2 . Added the globalization attribute on the web.config file . 3 . I even tried this MVC 3 jQuery Validation globalizing of number decimal field http : stackoverflow.com questions 5199835 mvc-3-jquery-validation-globalizing-of-number-decimal-field with no success.. . Which is the proper way to do this Thanks Comment : Is the problem occuring client-side or server-side ie does a postback occur before the validation error Comment : Client Side . No postback . The validation error is javascripted . I assume it has to do with how jquery deals with decimal separators . Comment : Old question but this did the trick for me : stackoverflow.com questions 5199835 http : stackoverflow.com questions 5199835 mvc-3-jquery-validation-globalizing-of-number-decimal-field .. . Answer : Well you can either turn off client-side validation or apply some hacks such as this : .. . .. . http : blog.brainnovative.com 2010 12 globalizing-aspnet-mvc-unobtrusive.html Comment : I tried the hack of your link step by step as it is but I get the javascript error : TypeError : Cannot read property es-ES of undefined ...did it work for you Comment : @met.lord - it looks like things have changed a bit so you ll have to adapt . Did you download the jquery-globalization here github.com jquery-globalize https : github.com jquery-globalize Comment : I installed it through NuGet.. . then downloaded the cultures files from there github.com jquery-globalize Comment : @met.lord - this article is a bit better and describes globalization of unobtrusive-validation . afana.me post aspnet-mvc-internationalization-part-2.aspx http : afana.me post aspnet-mvc-internationalization-part-2.aspx Comment : Tried everything then realized some of the methods changed name . So I managed to keep the logic and tried with the new methods but didn t succeed on having the unobtrusive-validation working properly on spanish.. .", "Question : Jquery Globalization works great . You can format a currency doing something like this : .. . .. . Is possible to reverse the formatting to be able to edit the value back keeping the culture format .. . Answer : The Globalize plugin provides parseInt and parseFloat methods that you can use : Comment : Yes I tried that but it converts the value back to javascript language and it doesn t support culture anymore . For example in ro Romanian culture 10000.25 10.000 25 and if i Globalize.parseFloat 10.000 25 it returns 10000.25 instead of 10000 25 Comment : Sorry i am new to stackoverflow and i didn t knew that Entery key submits the form : Comment : I m not sure I understand . parseFloat returns a number not a string so it does not make sense for the returned value to use anything other than the language s decimal separator . . Comment : On a text input i have the value 100.000 25 lei Globalize.format 100000.25 c . When user focuses on that input i want to allow him to edit the value but remove the currency symbol --- the new value should be 100000 25 which respects the culture s currency format . This is just for displaying purposes . Something like this probably : link http : demos.kendoui.com web globalization index.html", "Question : null .. . Answer : I am using the Globalize jQuery plugin to have globalization correct number and date formats on the client-side in my MVC website . So I have downloaded that plugin and included the following javascript files after the validation js files themselves I have tried putting the Globalize file before as well without any luck : .. . .. . But when run the application I get the error : Globalize.addCultureInfo is not a function .. . .. . I cannot figure out what the reason is . Please help with this one .", "Question : Could someone list the pros and cons of using one over the other . www.datejs.com http : www.datejs.com vs . https : github.com jquery-globalize . All I knew is Jquery globalize supports more culture than datejs . Comment : Have you considered using neither and just using a single format that is recognised by everyone i.e . internationalisation universally understood foramt vs mulit-nationalisation trying to create a format for every possible situation . For example 9 August 2011 is commonly used by 95 of the world s popluation the other 5 will not be confused whereas 9 8 2011 may well confuse them both . The ISO format 2011 8 9 is unambiguous . .. . Answer : Globalize supports more than just Date Time formatting and Parsing different Calendar systems with automatic conversion in the related field number currency percentage formatting translating strings checking if given language is written Right-To-Left . It is fairly well-written and supports more than 350 culture . The project is quite active . DateJS supports less cultures and only Date Time formatting parsing and manipulating as well as time zones conversion unsupported by Globalize . The project is less active and the last snapshot is rather old and marked as Alpha version . It seems like Joda Time equivalent for JavaScript and it really seems nice but.. . .. . Fortunately as Ben said you can combine them together .", "Question : I m developing an ASP.NET MVC 3 app that uses both jQuery Globalization https : github.com jquery jquery-global and jQuery UI Slider http : jqueryui.com demos slider . I m localizing this app to Portuguese from Brazil pt-BR and it also supports English . The problem is that when I change the language to Portuguese all Model float values come delimited by a comma like 7 7 . I then try to set the Slider initial value but it only accepts the value with a dot . like 7.7 . To overcome such situation I m doing this : .. . .. . FormatValue is an extension method : .. . .. . You see that I have to replace the comma delimiter with a dot delimiter so that I can set the jQuery Slider value . I then have to use jQuery Globalization to show the correct value in the UI this way : .. . .. . It works at least.. . .. . .. . My question is : .. . .. . Is there a better or standard way of doing this The thing is that the Model values are coming the way they should that is as I switched the culture to pt-BR the numbers come delimited . This is correct in my point of view . The limitation is in the way the jQuery Slider receives the value . Just to complement : if I tried to pass the values the way they come from the @Model I d have something like this that obviously would break because the parameters values are themselves separated by commas : .. . Answer : Your slider accepts InvariantCulture values so you need to provide such . Just modify your method : .. . .. . BTW . ParseValue is not the best name here as no parsing going on . FormatValue would sound better . BTW . Your original method won t work correctly for some cultures might not be visible for small values but for greater than i.e . 100 bad things could happen . If you need a dot as floating-point always use InvariantCulture . Comment : : Thanks for letting me know about the ToString CultureInfo.InvariantCulture . It worked . I also thought about the greater values you mentioned and the problem that could arise . About the method name : I changed it . I didn t notice the name I had given to the method because I was trying to make this code work . : D", "Question : Could someone list the pros and cons of using one over the other . www.datejs.com http : www.datejs.com vs . https : github.com jquery-globalize . All I knew is Jquery globalize supports more culture than datejs . Comment : Have you considered using neither and just using a single format that is recognised by everyone i.e . internationalisation universally understood foramt vs mulit-nationalisation trying to create a format for every possible situation . For example 9 August 2011 is commonly used by 95 of the world s popluation the other 5 will not be confused whereas 9 8 2011 may well confuse them both . The ISO format 2011 8 9 is unambiguous . .. . Answer : You can use both of them together . DateJS makes it much more convenient to do math on date objects and also provides some functionality for displaying dates . Globalize provides functionality for displaying dates for different cultures . If you need to do math on dates and to display internationalized dates use both . Have Globalize display dates that are calculated with DateJS . If you just need to do math on dates and display dates in a format readable by most Internet users use DateJS . If you don t need to do math on dates it might be that the server and APIs take care of it but need to display internationalized dates use Globalize .", "Question : I try to use the jQuery Globalization plugin in order to fix the comma problem with jquery unobstructive client validation . However i tried many many solutions and there no good solution to fix this . I am on a non-english localization computer and this is important that my customers enter a decimal value like 123 66 and not 123.66 . ASP.NET validation tell me that the price must be a number meh are you serious lol .. . .. . I am getting this javascript error when i try to do the fix . Here my code . Layout.cshtml .. . .. . glob.fix.js .. . .. . I can t understand. . it should work since i added Scripts globalize.js . Any idea or you might have a bette solution for having client validation work and lets me enter comma as decimal values Comment : Thank you for the range validator code .. . Answer : For whatever reason I had to change my globalize reference from : .. . .. . script src @Url.Content Scripts globalize globalize.js type text javascript script .. . .. . to .. . .. . And that solved my problem . Went crazy for 30min until I got it to work . If anybody can explain why I will appreaciate .", "Question : I am using Asp.Net Mvc3 and the unobtrusive jquery validation . I d like to have my dates validation localized I mean jquery is validating my date as being MM dd yyyy but I would like it to be dd MM yyyy . I m trying to use the jQuery Globalize plugin http : github.com jquery-globalize . I added references to the scripts globalize.js and globalize.culture.pt-BR.js and when my page loads I m running the follwing script : .. . .. . The jQuery UI plugin works as charm but the validation doesn t . What else am I missing Edit : .. . .. . Using the links in the answer below I solved the problem using the Globalize plugin https : github.com jquery-globalize : .. . .. . Of course I had to add a reference to the Globalize plugin in the page and also a reference to the culture that I wanted to use all available on the plugin s site . After that is just a small piece of JavaScript code . Comment : If you have the time please update your question with the solution you give at brodie s answer . It would be really useful to have it here instead of hidden in the comments : thanks Comment : Just did what you asked . : .. . Answer : I ve been doing similar myself recently . I started by following the advice in Scott Hanselman s blog on this topic - you can read about this here : .. . .. . http : www.hanselman.com blog GlobalizationInternationalizationAndLocalizationInASPNETMVC3JavaScriptAndJQueryPart1.aspx .. . .. . I had to make some changes to use Globalize instead of jQuery Global now jQuery Global is dead . I wrote this up in the following blog post in case that s helpful : .. . .. . http : icanmakethiswork.blogspot.co.uk 2012 09 globalize-and-jquery-validate.html .. . .. . My blog post features a link-to this script jquery.validate.globalize.js which forces jQuery Validate to use Globalize for number date-range parsing . The date part of this is the part that should probably solve your issue : .. . .. . https : raw.github.com gist 3651751 68cbccd0fdd4725a8d6fd1b5568bb33d27fb1eff jquery.validate.globalize.js", "Question : I am trying to validate local decimal numbers Portuguese - pt-PT but I get a console error in the Browser : .. . .. . In Portugal the decimal separator is the so a valid decimal number here is 10 21 . The script I use to load Globalization : .. . .. . On the View I use unobtrusive-validation : .. . .. . To load all the libraries I use the Shared Layout file : Comment : Have you seen this SO question http : stackoverflow.com questions 9204855 cant-get-the-jquery-globalization-to-work In the accepted answer it states that you need to put the globalize scripts after the validation ones which your code doesn t . It also shows some other things that need to be done to make this work . Have you tried those steps Comment : Hi Thanks . I have tested it but it seems an old version because I get from the beginning the error Uncaught TypeError : Globalize.addCultureInfo is not a function on the lasted version of Globalize Comment : And where-in your code is that error coming from Comment : From the globalize.cultures.pt-PT.js file I added to try the SO question you suggested Comment : @Becuzz I found the problem please check my answer . .. . Answer : The problem was related with the jQuery Validation Globalize Library version . I was using the version 1.0.1 that was still using the parseFloat method . This method is not available anymore with Globalize v1.0.0 it has been replaced with the method Globalize.parseNumber . After updating to version 1.1.0 everything started to work properly .", "Question : I m very new to Visual Studio 2015 so I apologize if this is a dumb question . I downloaded this jquery-globalize package will aids me with validation of dates from different locale . I have no idea what the scripts are for or how they are use . Are they like classes where we can use help methods I have created method which is used to create new users in my MVC4 with Entity Framework database . Right now it s based in US which is MM DD YYYY but I want it to be DD MM YYYY .. . .. . Views User Create.cshtml Snippet of code .. . .. . This is what my script folder looks like after I installed my globalization package . Script folder image http : i.stack.imgur.com ebOBY.png .. . Answer : ASP .NET MVC DateTime globalization . The field Date must be a date . http : stackoverflow.com questions 31287971 asp-net-mvc-datetime-globalization-the-field-date-must-be-a-date .. . .. . Had the exact same problem so take a look at the answer and hopefully it helps", "Question : I m using jQuery Globalize https : github.com jquery-globalize with Node.js . They have a package.json file so I can simply use it as a module and require it . However it doesn t load all cultures by default . I was wondering what the proper way to load a culture would be I could go and do something like .. . .. . and load the file directly but that doesn t seem too elegant . Is there a proper way to do this .. . Answer : If you d like to support all cultures with a single require : .. . .. . should do the trick ." ] }
[ "yes-answer-long", "yes-answer-short" ]
globalization
UNK_RELATION
rodbc@cran@64
rodbc -- rodbc provides an odbc database interface for r .the @placeholder package provides access to any open database connectivity odbc accessible database .
{ "confidence": [ 76.49372863769531, 63.71969985961914, 61.8526725769043, 56.968631744384766, 55.98995590209961, 55.00727844238281, 54.834442138671875, 51.931907653808594, 50.91740417480469, 50.75193786621094, 49.04214859008789, 49.04214859008789, 48.35514450073242, 47.34759521484375, 46.94901657104492, 46.05921173095703, 45.99940490722656, 45.67940139770508, 45.585269927978516, 45.41352844238281, 44.83277893066406, 44.709022521972656, 44.66053771972656, 44.43275451660156, 44.43275451660156, 44.16447067260742, 43.877723693847656, 43.80495834350586, 43.58839797973633, 43.45762634277344, 43.45762634277344, 43.0323486328125, 43.0323486328125, 42.942222595214844, 42.910972595214844, 42.592166900634766, 42.569419860839844, 42.468841552734375, 42.34122848510742, 42.33734130859375, 42.2691535949707, 42.2691535949707, 42.2691535949707, 41.655517578125, 41.28343200683594, 40.893489837646484, 40.7938232421875, 40.50861358642578, 40.02915954589844, 40.01475143432617, 40.01475143432617, 40.014678955078125, 40.014678955078125, 39.94869613647461, 39.64260482788086, 39.64260482788086, 39.538116455078125, 39.49104690551758, 39.49104690551758, 39.49104690551758, 39.338417053222656, 38.884647369384766, 38.623741149902344, 38.597557067871094, 38.47218322753906, 38.47218322753906, 38.32904815673828, 38.32904815673828, 38.123931884765625, 38.066673278808594, 37.80961990356445, 37.726463317871094, 37.25105285644531, 37.22974395751953, 37.06175231933594, 37.06175231933594, 37.06175231933594, 37.06175231933594, 37.06175231933594, 36.77534484863281, 36.704864501953125, 36.34698486328125, 36.092864990234375, 36.04289245605469, 35.94123077392578, 35.71017074584961, 35.705047607421875, 35.51368713378906, 35.51368713378906, 35.51368713378906, 35.30323791503906, 35.26939392089844, 35.26807403564453, 35.1198616027832, 34.82175827026367, 34.811180114746094, 34.811180114746094, 34.811180114746094 ], "content": [ "The vignette of RODBC https : cran.r-project.org web packages RODBC vignettes RODBC.pdf states that .. . .. . Package RODBC implements ODBC database connectivity .", "For reference from the R Data Import Export manual http : cran.r-project.org doc manuals R-data.html with my highlighting : .. . .. . 4.3.2 Package RODBC .. . .. . Package RODBC on CRAN provides an interface to database sources supporting an ODBC interface .", "I have established ODBC connectivity and am using the RODBC package in R as my working environment .", "RODBC runs on Unix Linux Windows and Mac OS X and almost all database systems provide support for ODBC .", "R version : .. . .. . I m trying to use the RODBC package to connect to an MS Access database .", "With functionality from the RODBC package I have successfully created an ODBC but receive error messages when I try to query the database .", "I am learning how to use the RODBC package to export dataframes into a Microsift Access database .", "I m using a MySQL database for my back-end and driving some reporting automation through R and interfacing the database using RODBC and sqlQuery .. . command to interface .", "I am using RODBC package in R to import export data frames from SQL Server database .", "It might be a problem with the ODBC driver rather than RODBC itself .", "I am trying to insert a data.frame in the MySQL database using RODBC .", "I have already connected to a MySQL database sucessfully by using RODBC library .", "What I found was that RODBC wants to retrieve the ODBC catalog data for the table column names and types before it will write to the table .", "Should I use RODBC or any other package", "I m trying to get some data from an Impala database using the sqlQuery function from the RODBC package .", "I m using RODBC 1.3-10 with MySQL ODBC driver version 5.2 and it works for me .", "RODBC is the main library in R to import data from a database into R . RODBC seems to have the ability of guess the datatype of the column which I find it particularly annoying .", "I was able to connect R to Teradata using RODBC package .", "Anyway once I installed unixODBC and the libs and development package I was able to install RODBC with no difficulty again using sudo R and then install.packages RODBC .", "Currently using R-3.2.5 and RODBC-1.3.13 on ubuntu .", "It seems that the RODBC interface has a problem to return the result to the R console .", "I have been using the odbcConnect function from the RODBC package to establish a connection to a database .", "The problem appears to be in your SQL syntax not anything inherent with R or the RODBC package .", "For the Microsoft ODBC Driver 11 for SQL Server on Linux with RODBC version 1.3-7 in R version 3.0.1 none of the above answers worked .", ".. . .. . In my case I was running 64bit R 2.15.0 RODBC 1.3-5 and the Actual ODBC Oracle driver on OS X Lion .", "I am trying to connect to an Oracle database using RODBC within R . I am able to connect to the database but I am not retrieving any data except the column headings .", "I am trying to connect to R using RODBC .", "The raw vector being returned through RODBC did not match what was in the SQL database .", "We had a similar issue trying to get R to access an Oracle database from a 64-bit Linux box using the following tools : 64-bit R RODBC unixODBC Oracle Instant Client .", "Using the command .. . .. . sqlQuery .. . .. . from package RODBC is translated to .", "Installing the RODBC package on Ubuntu is a bit of a kludge .", "I rely on RODBC connection for a lot of my work and after the upgrade it throws the error : .. . .. . 1 : In odbcDriverConnect con .. . : RODBC ERROR : Could not SQLDriverConnect .. . 2 : In odbcDriverConnect con .. . : ODBC connection failed error .", "Issue : RODBC falsely returning zero rows .. . .. . Situation : .. . .. . I m using RODBC to connect to a DSN I created using a commercial DB s ODBC driver OSI Soft s PI Historian Time Series DB if you re curious .", "Can you run the SQL query directly on the database and not through ODBC", "I get 50 warnings : .. . .. . I have read quite a few posts to help me understand what I need to install : .. . .. . R RODBC package under Ubuntu http : stackoverflow.com questions 26306670 r-rodbc-package-under-ubuntu .. . .. . Particularly this : .. . .. . Trying to connect to an ODBC server using RODBC in ubuntu http : stackoverflow.com questions 11084173 trying-to-connect-to-an-odbc-server-using-rodbc-in-ubuntu .. . .. . I wondered if there is something easier I can do before trying to install the freeTDS drivers in the answer to the question above .", "I launched the ODBC Data Source Administrator and changed the default database and selected the desired database and it worked .", "install.packages RODBC type source", "I m getting a new error which I ve never gotten before when connecting from R to a GreenPlum PostgreSQL database using RODBC .", "I ve loaded RODBC with library RODBC but still have no luck .", "Is there any way to pass a variable defined within R to the sqlQuery function within the RODBC package", "My goal is to connect to a MS SQL Server Database on another machine via RODBC .", "To connect with my sql-server and obtain data from a database I use RODBC .", "I just read about the RODBC function which is supposedly useful for accessing a database but I have difficulty setting it up .", "The answer seems to be that RODBC cannot access two different databases in a single query using sqlQuery .. . because the connection channel is database-specific .", "Can you connect to the database using ODBC from some other environment like VBA or MS Access", "we hit to an error with RODBC and SqlSave command .", "Related to several http : stackoverflow.com questions 17204235 rodbc-error-error-in-sqlsavedataconnection-dataframeinput-tablename-tablen other http : stackoverflow.com questions 14882754 how-to-use-sqlsave-function-with-existing-table-in-r rq 1 questions http : stackoverflow.com questions 23913616 rodbc-sqlsave-table-creation-problems on the RODBC package I m having problems using RODBC : : sqlSave to write to a table on a SQL Server database .", "I am trying to do a simple query of a DB2 database using the RODBC package in R myQuery -sqlQuery channel paste0 .. . One of the columns is a Varchar of length 3000 .", "I am able to connect to the database using RODBC execute a query and receive results in a data.frame .", "RODBC does not support this .", "using RODBC or otherwise .", "I m trying to write a table from R into SQL using RODBC .", "I m using SQL Server RODBC 1.3-6 and R 3.0.0 .", "When we have to setup ODBC connections in Windows I needed to select the database in the Administrative Tools - MySQL ODBC Connector option alongwith the id and password .", "Warning in install.packages : installation of package RODBC had non-zero exit status", "I wonder if there is query length limitation for sqlQuery function from RODBC package", "See RODBC to connect to SQL Server on Mavericks http : stackoverflow.com questions 23419243 rodbc-to-connect-to-sql-server-on-mavericks .. . .. . RODBC isn t really supported on OSX .", "I have a MySQL table that I am acessing from R using the package RODBC .", "When I perform this same query from management studio it completes successfully but not from R using the RODBC package .", "On a sidenote : In R You can check which DSNs can be found by using the command odbcDataSources of the RODBC package .", "These are the options that I know of using RODBC .", "I think RODBC needs some type of drivers to connect with Access databases .", "I am using the RODBC package to query for results in my SQL server .", "The RODBC docs were not all that clear to me", "I am running R on unix and I am using the RODBC package to connect to MS SQL server .", "I am trying to connect to an Vertica DB from R using RODBC package .", "Possible duplicate of RODBC sqlSave table creation problems http : stackoverflow.com questions 23913616 rodbc-sqlsave-table-creation-problems", "If you go to the RODBC http : cran.r-project.org web packages RODBC index.html site you ll notice that the binaries are not available for Mavericks .", "Send the file to the database via query RODBC .. . .. . Ideally I d like to combine steps 1 and 2 above by simply write the png image to a binary connection .", "But I got .. . .. . RODBC ERROR : state 08001 code 17 message Microsoft ODBC SQL Server Driver DBNETLIB SQL Server does not exist or access denied .", "Eventually I may see if I can improve the RODBC code in this area .", "Please don t blame R or RODBC for Microsoft s bugs http : support.microsoft.com kb 257819 .. . .. . .. . However due to a bug in the ODBC driver specifying the Rows to Scan MaxScanRows setting currently has no effect .", "I am trying to update a SQL table using sqlSave function of RODBC package in R . Data is present in a data frame .", "Obviously a possible solution would be to change my ODBC solution to the specified database but it seems there should be a better method .", "I ve found RODBC to be a real pain in the Ubuntu .", "I couldn t find anything in the documentation of RODBC .", "But frankly I prefer the brew method now for RODBC .", "I wouldn t use RODBC for excel file .", "Below is what I have using RODBC .", "When installing the R package RODBC in RStudio on OS X Yosemite I get the following error : .. . .. . This is a common error and indicates that ODBC drivers haven t been installed iODBC headers aren t included in OS 10.9 hence the separate install required .", "I was following this http : rprogramming.net connect-to-ms-access-in-r guide to connect to the Access DB with RODBC and -- while I can open this database in Access itself -- I get the following error from R : .. . .. . So I found this http : stackoverflow.com questions 13070706 how-to-connect-r-with-access-database-in-64-bit-window solution and gave it a try : .. . .. . but as you can see there were some pretty serious warnings .", "BTW : I m using R 2.10.1 RODBC 1.3.2 unixODBC 2.3.0 with Oracle 10.2.0.4 on Linux 64 bit .", "I am trying to load some data into R from an Access database .", "so my issue is considered to be a bug for RODBC", "http : r.789695.n4.nabble.com RODBC-results-from-stored-procedure-td897462.html .. . .. . Thanks .. . .. . Here is the R example :", "Normally you should be able to download an ODBC driver from Stack Builder like you do for a JDBC driver : under the heading database drivers you have a postgresql ODBC as well .", "I use odbcConnectAccess2007 in RODBC and don t have any issues connecting to Access databases when using 64-bit windows .", "I am trying to run a SQL query with multiple joins using RODBC .", "I m using RODBC with MySQL OOBC driver version 5.1", "Just that when RStudio builds RODBC it can t find them .", "why I can t open this Access 2013 database with odbcConnectAccess", "I prefer direct database driver where available over ODBC but there is no reason why it shouldn t work as 64-bit Linux merrily plays along .", "NOTE : when I had the repo version of unixODBC installed RODBC would install just fine using the install.packages RODBC command in R . However after I installed unixODBC 2.3.0 from source the RODBC install would fail because of a dependency issue and I had to install RODBC from source using the guide posted here http : carlo-hamalainen.net blog 2012 05 11 r-makeflags-rpath-and-building-packages .", "@Joshua HY000 -268 OSI PI ODBC PI Syntax error at offset 8 token - 2 RODBC ERROR : Could not SQLExecDirect SELECT tag time status value FROM piinterp", "So I tried using RODBC : : sqlSave to accomplish this .", "Is there a maximum length of a value in a R data frame or a maximum length of a field that can be pulled using RODBC", "I am trying to connect R to Teradata and am not sure what the input items are to the RODBC : : odbcDriverConnect .", "I was trying to use RODBC which works on a 32-bit machine R EXCEL but is not working on a 64-bit system ." ] }
{ "confidence": [ 100.17129516601562, 81.29169464111328, 80.59175109863281, 79.86285400390625, 77.29563903808594, 76.54884338378906, 76.4846420288086, 76.28426361083984, 75.9215087890625, 74.5656509399414, 74.29597473144531, 73.18018341064453, 73.17017364501953, 72.63935852050781, 71.92951965332031, 71.48558044433594, 70.47086334228516, 70.26603698730469, 70.09193420410156, 69.85289764404297 ], "content": [ "Question : Installing the RODBC package on Ubuntu is a bit of a kludge . First I learned to install the following : .. . .. . That wasn t good enough as the package was still looking for header-files . I solved this issue by : .. . .. . Good RODBC installed properly on the Ubuntu machine . But when I try to run the following script : .. . .. . I get an error thrown that function odbcConnectExcel not found . I checked the case of each letter making sure it was not a simple typo . Nope . Then I ran this same script on a Windows R installation file path different of course and the script works . Any idea of why Ubuntu R installation cannot find the odbcConnectExcel function and how I can get this to work .. . Answer : That functionality is available where Excel is available . In other words : not on Ubuntu . For reference from the R Data Import Export manual http : cran.r-project.org doc manuals R-data.html with my highlighting : .. . .. . 4.3.2 Package RODBC .. . .. . Package RODBC on CRAN provides an interface to database sources supporting an ODBC interface . This is very widely available and allows the same R code to access different database systems . RODBC runs on Unix Linux Windows and Mac OS X and almost all database systems provide support for ODBC . We have tested Microsoft SQL Server Access MySQL PostgreSQL Oracle and IBM DB2 on Windows and MySQL Oracle PostgreSQL and SQLite on Linux . .. . ODBC is a client-server system and we have happily connected to a DBMS running on a Unix server from a Windows client and vice versa . .. . On Windows ODBC support is normally installed and current versions are available from http : www.microsoft.com data odbc as part of MDAC . On Unix Linux you will need an ODBC Driver Manager such as unixODBC http : www.unixODBC.org or iOBDC http : www.iODBC.org : this is pre-installed in Mac OS X and an installed driver for your database system . .. . Windows provides drivers not just for DBMSs but also for Excel .xls spreadsheets DBase .dbf files and even text-files . The named applications do not need to be installed . Which file formats are supported depends on the the versions of the drivers . There are versions for Excel 2007 and Access 2007 go to http : download.microsoft.com and search for Office ODBC which will lead to AccessDatabaseEngine.exe the 2007 Office System Driver . Comment : Well of course that explains it very well . Rats . Comment : I believe there are packages that read Excel files using Perl and I would suspect they would work in Ubuntu . Comment : Correct . And on Debian Ubuntu you get the oldest one of these via apt-get install r-cran-gdata and it will work for the older .xls format at least . Comment : thanks Josh I ll look into that . Comment : I gave the name of it . If you need xlsx there is a package on CRAN . There is also no reason to un-accept this question which I answered with a clear well because -", "Question : I am trying to load some data into R from an Access database . All of the instructions I can find say to use odbcConnectAccess file.mdb but I cannot seem to load this function . Has it been replaced or renamed Is there another way to do this I ve loaded RODBC with library RODBC but still have no luck . Thank you Comment : What platform are you on I think RODBC needs some type of drivers to connect with Access databases . Those may or may not be available outside Windows . .. . Answer : If you re using on a Mac I ve found success using Actual Technologies http : www.actualtech.com drivers to connect to Access databases . If you ve already set up the ODBC connection using ODBC Source Administrator on Windows or ODBC Administrator on a Mac the rest is fairly straightforward . There is also an option to supply a password in odbcConnect but I ve set up the connection with the password included .", "Question : Issue : RODBC falsely returning zero rows .. . .. . Situation : .. . .. . I m using RODBC to connect to a DSN I created using a commercial DB s ODBC driver OSI Soft s PI Historian Time Series DB if you re curious . Now if I query I get zero rows . With BelieveNRows FALSE these all still show zero results even though it should return 120 rows . What else can I try .. . .. . Proof that there should be many rows : .. . .. . In Excel or Command Prompt .. . .. . With results.. . Both in R and in Excel if I query for a tag that doesn t exist say tag aeeEEEEE11 it correctly returns zero rows . .. . .. . Additional Info .. . .. . SQL Tables .. . .. . ODBC info .. . .. . My session info : Comment : Are any data returned if you omit the WHERE clause entirely Comment : I d give you 10 up votes for a concise descriptive and well thought out problem . I m sure you d rather have an answer but I can t help you there . Safe to assume there is no difference in running the table info commands for piinterp Can you verify that a RODBC select statement does return rows remove your where clause to help isolate whether it s an issue with the filter in your query vs a generic issue getting data out Comment : @Joshua HY000 -268 OSI PI ODBC PI Syntax error at offset 8 token - 2 RODBC ERROR : Could not SQLExecDirect SELECT tag time status value FROM piinterp Comment : @billinkc . I don t know if it s possible to return rows w o a WHERE clause for this RDMBS . But either way I m positive that there should be rows returned for this query as there are from the cmd prompt as well as in Excel . FYI - is my question that unclear I thought it was alright but I ll edit to see what I can do . Comment : I would try the following . Can you run the SQL query directly on the database and not through ODBC Can you run a trivial query through ODBC like SELECT 0 as n Can you connect to the database using ODBC from some other environment like VBA or MS Access .. . Answer : 1 . Test if the ODBC driver works correctly . Each ODBC driver should provide simple means to test the connection . Also try to connect to the ODBC source using MS Office Access Excel.. . or Open Office . 2 . If the above works then go to R and try the simplest query possible like select 1 your query isn t the simplest as darcken noted You have to try really the simplest query to be sure . 3 . If it doesn t work try to call odbcGetErrMsg function after each RODBC function-call after connect after query .. . .", "Question : I m trying to use .. . .. . to connect remote database server sql-server-2008 . But I got .. . .. . RODBC ERROR : state 08001 code 17 message Microsoft ODBC SQL Server Driver DBNETLIB SQL Server does not exist or access denied . error . Any idea I can use .. . .. . to connect my local database server sql-server-2008 . .. . Answer : For the Microsoft ODBC Driver 11 for SQL Server on Linux with RODBC version 1.3-7 in R version 3.0.1 none of the above answers worked . What did work however was the following : .. . .. . put in the relevant IP address database name etc . . In case of a trusted connection : .. . .. . trusted connection will only listen to yes or no and not to true and false", "Question : I m running R 2.15.2 on a Red Hat Linux 6 server . My goal is to connect to a MS SQL Server Database on another machine via RODBC . I did my research and downloaded and installed the linux version of the MS SQL ODBC driver from the microsoft support website http : www.microsoft.com en-us download details.aspx id 28160 . I to had build unixODBC version 2.3.0 from source because it is required by the windows driver and is not in the RHL repos yet the repo version is 2.2.14 . Anyhow after a bit of work I finally got the driver installed and configured properly and I can connect successfully to the SQL Server database via an isql command : .. . .. . so I know I have my odbc.ini and odbcinst.ini files properly set up . However when I try to access the ODBC connection from within R the following happens : .. . .. . Here s the result-of the odbcDataSources command in R : .. . .. . I have been doing some research and I think the solution though I could be wrong may have something to do with properly configuring the ODBC environment-variables so that RODBC knows where to go to find odbc.ini . Based on my research I found the following environment-variables that may be relevant : ODBCINI ODBCSYSINI ODBC ROOT ODBC INCLUDE and ODBC LIBS . I have a reasonable idea of what these should be set to but I m not sure how to set them permanently and so that RODBC can recognize where to find the appropriate files . Can anyone shed some light on this for me I m not sure I properly understand how environment-variables work in linux and particularly why isql has no trouble connecting but RODBC can t even find the driver data source . NOTE : when I had the repo version of unixODBC installed RODBC would install just fine using the install.packages RODBC command in R . However after I installed unixODBC 2.3.0 from source the RODBC install would fail because of a dependency issue and I had to install RODBC from source using the guide posted here http : carlo-hamalainen.net blog 2012 05 11 r-makeflags-rpath-and-building-packages . Is it possible I failed to configure ODBC properly to begin with and that s why I m having troubles now Comment : Even in windows I found the odbcDriverConnect statement to be finicky so much so that I never got it to work . Instead I use odbcConnect odbc dsn entry uid username . I know that ubuntu has a odbc manager that looks a lot like the one windows has but haven t done much with it to give more help especially in red hat . Also I had more success with setting up the DB as both a user and system dsn in the odbc manager . .. . Answer : Wow I thought I was the only person working on this kind of stuff . I had to solve the same problem and found the best solution was to use rjdbc . This is much easier to configure as ODBC on linux or osx was very spotty . RJDBC performance is great as it uses the native ms sql-server jar to execute the query . Here is an example right out of one of our scripts . You just need to download the sqljdbc4.jar from microsoft and then install.package RJDBC into your environment . I realized you are trying to get ODBC to work and I did get it to work on osx but I gave up due to time for linux . Comment : Thank you so much JDBC was so much simpler than ODBC", "Question : Issue : RODBC falsely returning zero rows .. . .. . Situation : .. . .. . I m using RODBC to connect to a DSN I created using a commercial DB s ODBC driver OSI Soft s PI Historian Time Series DB if you re curious . Now if I query I get zero rows . With BelieveNRows FALSE these all still show zero results even though it should return 120 rows . What else can I try .. . .. . Proof that there should be many rows : .. . .. . In Excel or Command Prompt .. . .. . With results.. . Both in R and in Excel if I query for a tag that doesn t exist say tag aeeEEEEE11 it correctly returns zero rows . .. . .. . Additional Info .. . .. . SQL Tables .. . .. . ODBC info .. . .. . My session info : Comment : Are any data returned if you omit the WHERE clause entirely Comment : I d give you 10 up votes for a concise descriptive and well thought out problem . I m sure you d rather have an answer but I can t help you there . Safe to assume there is no difference in running the table info commands for piinterp Can you verify that a RODBC select statement does return rows remove your where clause to help isolate whether it s an issue with the filter in your query vs a generic issue getting data out Comment : @Joshua HY000 -268 OSI PI ODBC PI Syntax error at offset 8 token - 2 RODBC ERROR : Could not SQLExecDirect SELECT tag time status value FROM piinterp Comment : @billinkc . I don t know if it s possible to return rows w o a WHERE clause for this RDMBS . But either way I m positive that there should be rows returned for this query as there are from the cmd prompt as well as in Excel . FYI - is my question that unclear I thought it was alright but I ll edit to see what I can do . Comment : I would try the following . Can you run the SQL query directly on the database and not through ODBC Can you run a trivial query through ODBC like SELECT 0 as n Can you connect to the database using ODBC from some other environment like VBA or MS Access .. . Answer : I think you need to rule out that your actually connecting to the database-table first by getting SELECT FROM MYTABLE to work within R . If you can t get this working then something is wrong with your setup drivers . Once you are sure that you can actually query the database-table within R then progressively make your query more complex and try to isolate where the issue is . One thing to try might be double on your equality conditions . I ve tried using a bunch of databases sql-server mysql sqlite within R and the performance has been poor with all of them . Imo your better off querying the database natively dumping to text then reading the file into R . Comment : The simplest query possible looks like SELECT FROM piinterp WHERE time DATE -1h . And this returns zero rows . You simply can t query this DB without time DATE . I ve tried many other equally valid query variations which worked in Excel through the ODBC but return zero rows in R . I m 100 sure all valid queries are returning zero rows in R . Comment : As I said in my comment above try a simple query like SELECT 0 as n . It doesn t get any simpler . If that doesn t work then you know it is something with the driver . If it does then there is something wrong with your query . Comment : As I said in my comment above a query like SELECT 0 as n is not possible in this database . You simply have to specify a table name and date-range in every query for this time-series database .", "Question : I am using 32-bit R with RStudio to try and connect to an .accdb file . I have 32-bit MS Access running on my machine . R version : .. . .. . I m trying to use the RODBC package to connect to an MS Access database . I cannot use odbcConnectAccess location of database.accdb to connect to a database provided by a client . This particular database was created with Access 2013 . When I try to connect I get a variety of warning messages : .. . .. . Interestingly I can use odbcConnectAccess2007 to connect successfully to databases that were created with Access 2010 however when I try to use odbcConnectAccess to connect to those same databases I get the same errors above . A Google search of the Error : state 01000 code 1 message above suggests that this page https : support.microsoft.com en-us kb 295297 may be helpful but even after following the steps to alter the HKEY LOCAL MACHINE does not work . While I originally thought that this question was promising http : stackoverflow.com questions 26244425 general-error-unable-to-open-registry-key-temporary-volatile-from-access the warning message there relates to ACE DSN while the error messages I m seeing relate to Jet DSN . I cannot open the databases I m trying to access with RODBC with my version of Access as the databases were created with Access 2013 and I have Access 2010 installed . Can anyone help me trouble shoot why I can t open this database with odbcConnectAccess Comment : Have you tried opening the Access 2013 database using your copy of Access 2010 What happens when you do Also have you tried opening that database in R using odbcConnectAccess2007 instead of odbcConnectAccess Comment : I get an error message that says Unrecognized database format database location.accdb . Comment : Have you tried opening that database in R using odbcConnectAccess2007 instead of odbcConnectAccess Comment : Yes . I get the same errors as in my original question . Comment : There is fundamentally no difference between Access 2007-2016 files as they all use same format . Certain UI features may differ even table elements but R connects to the ACE engine and not GUI . The unrecognized database format suggests corruption . Try creating a new Access .accdb and import all objects . .. . Answer : why I can t open this Access 2013 database with odbcConnectAccess I m fairly certain that .. . .. . is simply shorthand for .. . .. . i.e . the older Jet ODBC driver and .. . .. . is simply shorthand for .. . .. . i.e . the newer ACE ODBC driver . The older Jet driver cannot work with .accdb files so odbcConnectAccess2007 would be required . If that throws an Unrecognized database format error then it s likely that the database file is damaged .", "Question : I m running R 2.15.2 on a Red Hat Linux 6 server . My goal is to connect to a MS SQL Server Database on another machine via RODBC . I did my research and downloaded and installed the linux version of the MS SQL ODBC driver from the microsoft support website http : www.microsoft.com en-us download details.aspx id 28160 . I to had build unixODBC version 2.3.0 from source because it is required by the windows driver and is not in the RHL repos yet the repo version is 2.2.14 . Anyhow after a bit of work I finally got the driver installed and configured properly and I can connect successfully to the SQL Server database via an isql command : .. . .. . so I know I have my odbc.ini and odbcinst.ini files properly set up . However when I try to access the ODBC connection from within R the following happens : .. . .. . Here s the result-of the odbcDataSources command in R : .. . .. . I have been doing some research and I think the solution though I could be wrong may have something to do with properly configuring the ODBC environment-variables so that RODBC knows where to go to find odbc.ini . Based on my research I found the following environment-variables that may be relevant : ODBCINI ODBCSYSINI ODBC ROOT ODBC INCLUDE and ODBC LIBS . I have a reasonable idea of what these should be set to but I m not sure how to set them permanently and so that RODBC can recognize where to find the appropriate files . Can anyone shed some light on this for me I m not sure I properly understand how environment-variables work in linux and particularly why isql has no trouble connecting but RODBC can t even find the driver data source . NOTE : when I had the repo version of unixODBC installed RODBC would install just fine using the install.packages RODBC command in R . However after I installed unixODBC 2.3.0 from source the RODBC install would fail because of a dependency issue and I had to install RODBC from source using the guide posted here http : carlo-hamalainen.net blog 2012 05 11 r-makeflags-rpath-and-building-packages . Is it possible I failed to configure ODBC properly to begin with and that s why I m having troubles now Comment : Even in windows I found the odbcDriverConnect statement to be finicky so much so that I never got it to work . Instead I use odbcConnect odbc dsn entry uid username . I know that ubuntu has a odbc manager that looks a lot like the one windows has but haven t done much with it to give more help especially in red hat . Also I had more success with setting up the DB as both a user and system dsn in the odbc manager . .. . Answer : It can t find the driver because you didn t specify it I don t understand how the DSN stuff is supposed to work either but this works for me in a similar situation : .. . .. . It needs to be exact of course . And replace SQL Server with whatever driver you have . It s the tricky part . The servername is the same thing that comes up in Management Studio in the dropdown probably test in your case . isql must automatically use the correct driver . i.e . for MySQL it might be : .. . .. . I just search for mysql odbc connection-string and not anything R specific . Comment : This worked for me I had the same issue", "Question : I m running R 2.15.2 on a Red Hat Linux 6 server . My goal is to connect to a MS SQL Server Database on another machine via RODBC . I did my research and downloaded and installed the linux version of the MS SQL ODBC driver from the microsoft support website http : www.microsoft.com en-us download details.aspx id 28160 . I to had build unixODBC version 2.3.0 from source because it is required by the windows driver and is not in the RHL repos yet the repo version is 2.2.14 . Anyhow after a bit of work I finally got the driver installed and configured properly and I can connect successfully to the SQL Server database via an isql command : .. . .. . so I know I have my odbc.ini and odbcinst.ini files properly set up . However when I try to access the ODBC connection from within R the following happens : .. . .. . Here s the result-of the odbcDataSources command in R : .. . .. . I have been doing some research and I think the solution though I could be wrong may have something to do with properly configuring the ODBC environment-variables so that RODBC knows where to go to find odbc.ini . Based on my research I found the following environment-variables that may be relevant : ODBCINI ODBCSYSINI ODBC ROOT ODBC INCLUDE and ODBC LIBS . I have a reasonable idea of what these should be set to but I m not sure how to set them permanently and so that RODBC can recognize where to find the appropriate files . Can anyone shed some light on this for me I m not sure I properly understand how environment-variables work in linux and particularly why isql has no trouble connecting but RODBC can t even find the driver data source . NOTE : when I had the repo version of unixODBC installed RODBC would install just fine using the install.packages RODBC command in R . However after I installed unixODBC 2.3.0 from source the RODBC install would fail because of a dependency issue and I had to install RODBC from source using the guide posted here http : carlo-hamalainen.net blog 2012 05 11 r-makeflags-rpath-and-building-packages . Is it possible I failed to configure ODBC properly to begin with and that s why I m having troubles now Comment : Even in windows I found the odbcDriverConnect statement to be finicky so much so that I never got it to work . Instead I use odbcConnect odbc dsn entry uid username . I know that ubuntu has a odbc manager that looks a lot like the one windows has but haven t done much with it to give more help especially in red hat . Also I had more success with setting up the DB as both a user and system dsn in the odbc manager . .. . Answer : In Ubuntu Server I set like this .. . .. . .. . .. . Edit .bash-profile .. . .. . nano .bash-profile .. . .. . Add this .. . .. . export ODBCINI usr local etc odbc.ini export ODBCSYSINI usr local etc .. . .. . .. . .. . Then RODBC work nice .", "Question : Issue : RODBC falsely returning zero rows .. . .. . Situation : .. . .. . I m using RODBC to connect to a DSN I created using a commercial DB s ODBC driver OSI Soft s PI Historian Time Series DB if you re curious . Now if I query I get zero rows . With BelieveNRows FALSE these all still show zero results even though it should return 120 rows . What else can I try .. . .. . Proof that there should be many rows : .. . .. . In Excel or Command Prompt .. . .. . With results.. . Both in R and in Excel if I query for a tag that doesn t exist say tag aeeEEEEE11 it correctly returns zero rows . .. . .. . Additional Info .. . .. . SQL Tables .. . .. . ODBC info .. . .. . My session info : Comment : Are any data returned if you omit the WHERE clause entirely Comment : I d give you 10 up votes for a concise descriptive and well thought out problem . I m sure you d rather have an answer but I can t help you there . Safe to assume there is no difference in running the table info commands for piinterp Can you verify that a RODBC select statement does return rows remove your where clause to help isolate whether it s an issue with the filter in your query vs a generic issue getting data out Comment : @Joshua HY000 -268 OSI PI ODBC PI Syntax error at offset 8 token - 2 RODBC ERROR : Could not SQLExecDirect SELECT tag time status value FROM piinterp Comment : @billinkc . I don t know if it s possible to return rows w o a WHERE clause for this RDMBS . But either way I m positive that there should be rows returned for this query as there are from the cmd prompt as well as in Excel . FYI - is my question that unclear I thought it was alright but I ll edit to see what I can do . Comment : I would try the following . Can you run the SQL query directly on the database and not through ODBC Can you run a trivial query through ODBC like SELECT 0 as n Can you connect to the database using ODBC from some other environment like VBA or MS Access .. . Answer : It turns out that all I needed to do was to set rows at time 1 in addition to believeNRows FALSE while setting up my ODBC connection . Comment : Thank you very much for your answer . I ran into the same baffling issue and you just saved me a lot of time . Comment : Glad to help . I m curious were you working with the PI Historian ODBC or some other finicky ODBC Comment : The believeNRows FALSE also seems to be needed by the SQLite driver .", "Question : I am trying to connect R to Teradata and am not sure what the input items are to the RODBC : : odbcDriverConnect . There is a teradataR package but it is only used with R versions 3 and under which I neither have nor want to switch to . Below is a list of the input parameters to get ODBCDriverConnect to work . Connection I believe is most important . I need to get an address for a driver that I don t even know if I have . This is what I need most help with . How do I get a driver for Teradata to connect to R IT at my work is not sure how to do this . Also if anyone knows of another way to connect Teradata to R some other package please let me know . Thank you for your help .. . Answer : I was able to connect R to Teradata using RODBC package . Here is how to do it if you are working on a pc and have a Teradata driver . Set up DSN : .. . .. . 1 Go to : control panel- administrative tools - Data Sources ODBC - User DSN tab - click add- select Teradata driver or whatever driver you will be using . ie . could be sql and press finish . 2 A box will pop-up that needs to be filled in . The following fields need to be filled : .. . .. . Name : Can be any name you would like . I chose TeraDataRConnection for example . Name or IP address DBC name or address : Mine for example is : Databasename.companyname.com . I looked to see how Microsoft access was connected to the database and in doing that found the DBC address . USERNAME : username that you use to connect to database . Password : password use to connect to databases if you don t put your password in here you will have to manually type it into R every time you connect . In R : .. . .. . Download RODBC package .. . .. . library RODBC .. . .. . ch odbcConnect TeraDataRConnection uid USERNAME HERE pwd PASSWORD HERE .. . .. . If you want to confim you are connected you can type in this code to see the tables : .. . .. . ListOfTables sqlTables ch tableType TABLE .. . .. . That s it", "Question : Issue : RODBC falsely returning zero rows .. . .. . Situation : .. . .. . I m using RODBC to connect to a DSN I created using a commercial DB s ODBC driver OSI Soft s PI Historian Time Series DB if you re curious . Now if I query I get zero rows . With BelieveNRows FALSE these all still show zero results even though it should return 120 rows . What else can I try .. . .. . Proof that there should be many rows : .. . .. . In Excel or Command Prompt .. . .. . With results.. . Both in R and in Excel if I query for a tag that doesn t exist say tag aeeEEEEE11 it correctly returns zero rows . .. . .. . Additional Info .. . .. . SQL Tables .. . .. . ODBC info .. . .. . My session info : Comment : Are any data returned if you omit the WHERE clause entirely Comment : I d give you 10 up votes for a concise descriptive and well thought out problem . I m sure you d rather have an answer but I can t help you there . Safe to assume there is no difference in running the table info commands for piinterp Can you verify that a RODBC select statement does return rows remove your where clause to help isolate whether it s an issue with the filter in your query vs a generic issue getting data out Comment : @Joshua HY000 -268 OSI PI ODBC PI Syntax error at offset 8 token - 2 RODBC ERROR : Could not SQLExecDirect SELECT tag time status value FROM piinterp Comment : @billinkc . I don t know if it s possible to return rows w o a WHERE clause for this RDMBS . But either way I m positive that there should be rows returned for this query as there are from the cmd prompt as well as in Excel . FYI - is my question that unclear I thought it was alright but I ll edit to see what I can do . Comment : I would try the following . Can you run the SQL query directly on the database and not through ODBC Can you run a trivial query through ODBC like SELECT 0 as n Can you connect to the database using ODBC from some other environment like VBA or MS Access .. . Answer : I had the same problem and fixed it by adding rows at time 1 to the odbcConnect call . From the odbcConnect help : .. . .. . Several errors which have been reported as bugs in RODBC 1.3-0 which were in fact ODBC driver errors that can be circumvented by setting rows at time 1 and the warning under that argument has always been there . The drivers involved have been third-party Oracle drivers and old SQL Server drivers . .. . .. . In my case I was running 64bit R 2.15.0 RODBC 1.3-5 and the Actual ODBC Oracle driver on OS X Lion . Comment : Thanks Klaas It turns out that you and Dirk were BOTH right . The combination of rows at time 1 and believeNRows FALSE is what did the trick here .", "Question : i am trying to install RODBC with the commadn R CMD INSTALL -l my local path RODBC.tar.gz and it wont find sql.h and sqlext.h ..how do i pass the include and lib paths to this command Comment : You should be asking yourself what other information people might need to give you an accurate answer . Comment : Have you installed the package s that contain those header-files .. . Answer : I had a similar problem recently while trying to install RODBC on an instance of Centos 5.8 x64 . Instead of using R CMD install I just did sudo R then installed the package inside R - but I was still having the same problem . I resolved this by installing the following packages using yum : .. . .. . Those last two are necessary because I was interfacing with an MSSQL server which requires TDS . Anyway once I installed unixODBC and the libs and development package I was able to install RODBC with no difficulty again using sudo R and then install.packages RODBC . The only other thing to do is install the correct drivers libraries for ODBC which is what mysql-connector-odbc is . You will need to configure unixODBC to meet your needs but the documentation is pretty solid so I don t think you ll have too much difficulty .", "Question : Issue : RODBC falsely returning zero rows .. . .. . Situation : .. . .. . I m using RODBC to connect to a DSN I created using a commercial DB s ODBC driver OSI Soft s PI Historian Time Series DB if you re curious . Now if I query I get zero rows . With BelieveNRows FALSE these all still show zero results even though it should return 120 rows . What else can I try .. . .. . Proof that there should be many rows : .. . .. . In Excel or Command Prompt .. . .. . With results.. . Both in R and in Excel if I query for a tag that doesn t exist say tag aeeEEEEE11 it correctly returns zero rows . .. . .. . Additional Info .. . .. . SQL Tables .. . .. . ODBC info .. . .. . My session info : Comment : Are any data returned if you omit the WHERE clause entirely Comment : I d give you 10 up votes for a concise descriptive and well thought out problem . I m sure you d rather have an answer but I can t help you there . Safe to assume there is no difference in running the table info commands for piinterp Can you verify that a RODBC select statement does return rows remove your where clause to help isolate whether it s an issue with the filter in your query vs a generic issue getting data out Comment : @Joshua HY000 -268 OSI PI ODBC PI Syntax error at offset 8 token - 2 RODBC ERROR : Could not SQLExecDirect SELECT tag time status value FROM piinterp Comment : @billinkc . I don t know if it s possible to return rows w o a WHERE clause for this RDMBS . But either way I m positive that there should be rows returned for this query as there are from the cmd prompt as well as in Excel . FYI - is my question that unclear I thought it was alright but I ll edit to see what I can do . Comment : I would try the following . Can you run the SQL query directly on the database and not through ODBC Can you run a trivial query through ODBC like SELECT 0 as n Can you connect to the database using ODBC from some other environment like VBA or MS Access .. . Answer : Try adding .. . .. . to the query . This is an issue that has come up with a few of the drivers which report a wrong size on the result set . Comment : Hey Dirk unfortunately sqlQuery piconn sqlStr believeNRows FALSE still returns zero rows . As does sqlQuery piconn sqlStr believeNRows FALSE max 0 that I ve seen others have success with though for Oracle . Comment : It turns out that I needed to add believeNRows FALSE and also rows at time 1 . Thanks Dirk .", "Question : I m trying to use .. . .. . to connect remote database server sql-server-2008 . But I got .. . .. . RODBC ERROR : state 08001 code 17 message Microsoft ODBC SQL Server Driver DBNETLIB SQL Server does not exist or access denied . error . Any idea I can use .. . .. . to connect my local database server sql-server-2008 . .. . Answer : 1.Connet to MySQL .. . .. . a if Mysql is installed in your system if not install it . b download the RMySQL IN R .. . .. . library RMySQL .. . .. . drv dbDriver MySQL 5.0.1 .. . .. . make sure MySQL version is correct . con dbConnect drv host localhost dbname test user root pass root .. . .. . use local host or use the server i.e ip-address .. . .. . use the required database name user name and password .. . .. . album dbGetQuery con statement select from table .. . .. . run required query .. . .. . close con .. . .. . 2.Another way to connect database .. . .. . a first install any database like MySQL Oracle SQL Server .. . .. . b install the ODBC connector for database .. . .. . library Rodbc .. . .. . channel - odbcConnect test uid ripley pwd secret .. . .. . test is the connection name of odbc conector which user has to set manualy .. . .. . user can find this in Administrator tool .. . .. . res - sqlFetch ch table name .. . .. . A table can be retrieved as a data frame .. . .. . res -sqlQuery channel paste select query .. . .. . part of the with condition one table can be retrieved as a data frame .. . .. . sqlSave channel dataframe .. . .. . to save a dataframe to the database dont use res - something like this .. . .. . like user can use .. . .. . sqlCopy sqlDrop .. . .. . sqlTables .. . .. . close channel .. . .. . always close the connection", "Question : RODBC error in Revolution R 64bit on winxp64 bit connected to Oracle using a 64bit ODBC driver thru a DSN .. . .. . I am able to connect but get an error when I query for stuff also the below works .. . .. . but what if I dont know the rowsize max 1 before hand .. . .. . Thanks Arun .. . Answer : Dirk is right -- RODBC doesn t support 64-bit drivers for Oracle at least not as of a few months ago . You may be out of luck . We had a similar issue trying to get R to access an Oracle database from a 64-bit Linux box using the following tools : 64-bit R RODBC unixODBC Oracle Instant Client . I asked the R-sig-db list including the package author Prof . Ripley about this and there was no conclusive answer . I then asked Revolution if they would be willing to solve the problem if we were to purchase licenses from them at 5-figures year and they said no . My company is now trying to minimize use of R to areas where it is best suited . We will be using other tools web-services JVM-based systems to access the database and sharing data with R only when necessary . The underlying problem is that very few major users of R also use Oracle . R is primarily used by academics Excel MySQL finance types Postgres and more cutting-edge analytics teams . Oracle is used by old businesses that value reliability over innovation the exact opposite of what most R uses are looking for . So this explains why support for Oracle has fallen away in my view .", "Question : I m trying to use .. . .. . to connect remote database server sql-server-2008 . But I got .. . .. . RODBC ERROR : state 08001 code 17 message Microsoft ODBC SQL Server Driver DBNETLIB SQL Server does not exist or access denied . error . Any idea I can use .. . .. . to connect my local database server sql-server-2008 . .. . Answer : The correct syntax should be : .. . .. . If you use Windows Authentication method : .. . .. . Slash seems like an escape character escaping slash works .", "Question : I am querying tables in SQL server using RODBC in R : .. . .. . Example : .. . .. . This works fine but if I try to use the WHERE clause on a column containing strings I can t get it to work .. . .. . Example : .. . .. . I have tried various things e.g : .. . .. . None of this have worked . I am getting the following error message : 42000 102 Microsoft ODBC Driver 11 for SQL Server SQL Server Incorrect syntax near London . Any suggestions Comment : Have you tried putting the placeholder in double quotes e.g . s Comment : Hi @joran thanks for your suggestion . I did try that and I get the following errors : 1 42S22 207 Microsoft ODBC Driver 11 for SQL Server SQL Server Invalid column name London . 2 RODBC ERROR : Could not SQLExecDirect SELECT Time n FROM DataTable n WHERE place name London n ORDER BY Time .. . Answer : In case anybody else is interested I found a solution . I installed the RODBCext package which provides support for parameterized queries . I used the following code : .. . .. . Here is a some good information on the use of RODBCext : RODBCext https : cran.rproject.org web packages RODBCext vignettes Parameterized SQL queries.html", "Question : This is my first time connecting to Vertica . I have already connected to a MySQL database sucessfully by using RODBC library . I have the database setup in vertica and I installed the windows 64-bit ODBC driver from https : my.vertica.com download-community-edition .. . .. . When I tried to connect to vertica using R I get the below error : .. . .. . Can someone tell me how to fix this Or is there any other ways to connect to vertica using R .. . Answer : You have to use double slash in the classPath arguement in JDBC function . for example .. . .. . worked for me while just copying and pasting the route failed .", "Question : I am using RODBC package in R to import export data frames from SQL Server database . While there is no problem in importing . I dont know how to export the contents of a data frame into an existing SQL table . I am trying to use sqlQuery function available in the package but I am not sure how to insert multiple records in the table . A sample on how to insert the rows will be helpful I have ensured that columns of my table and data frame are same . .. . Answer : I would like to add upon Yan s answer . Before you use sqlSave function make sure you change your default database to the right database where your table are . Especially if you want to write to an existing table see here : https : andersspur.wordpress.com 2013 11 26 connect-r-to-sql-server-2012-and-14 for how to set up ODBC connection and how to change default database . After that you can use these to dump data to sql : .. . .. . specificDB odbcConnect dsn name you set up in ODBC uid pwd .. . .. . sqlSave specificDB output to sql tablename a table in specificDB rownames F append T .. . .. . close specificDB .. . .. . It is slow . be patient ." ] }
[ "yes-answer-long", "yes-answer-short" ]
cran
UNK_RELATION
sciruby@scientific-computing@35
sciruby -- sciruby is a tools for @placeholder in ruby .
{ "confidence": [ 52.5572395324707, 49.85993194580078, 49.85993194580078, 46.90704345703125, 46.90704345703125, 46.90704345703125, 46.433231353759766, 46.433231353759766, 45.207725524902344, 45.207725524902344, 45.122833251953125, 43.23246765136719, 41.92207336425781, 41.284820556640625, 41.284820556640625, 38.331932067871094, 38.272789001464844, 36.570980072021484, 35.26628875732422, 33.403343200683594, 32.99281692504883, 31.26734161376953, 29.971050262451172, 27.520673751831055, 26.339195251464844, 26.339195251464844, 26.339195251464844, 25.426483154296875, 24.014989852905273, 24.014989852905273, 24.014989852905273, 22.592525482177734, 22.592525482177734, 22.592525482177734, 19.26957130432129, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 17.898910522460938, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 14.94602108001709, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934, 12.970763206481934 ], "content": [ "I am completely noob in SciRuby .", "For the first time I am using SciRuby .", "I don t see output for my SciRuby code .", "It seems sciruby-full needs lots of native libraries .", "I mean I am using SciRuby .", "I was installing SciRuby in my macbook OSX .", "Another option is the Distribution https : github.com sciruby distribution gem under SciRuby http : sciruby.com .", "Have you tried opening an issue in the tracker github.com SciRuby nmatrix issues http : github.com SciRuby nmatrix issues", "I also have an open github issue https : github.com SciRuby sciruby issues 45 issue but had no success in installation process .", "I had this similar issues when installing SciRuby in another Ubuntu laptop which was fixed here http : stackoverflow.com questions 35961227 failed-to-install-sciruby .", "There are instructions in the wiki github.com SciRuby nmatrix wiki http : github.com SciRuby nmatrix wiki .", "You might try the Developer Guide github.com SciRuby nmatrix wiki NMatrix-Developer-Guide https : github.com SciRuby nmatrix wiki NMatrix-Developer-Guide .", "In short you might try checking out this person s branch : github.com SciRuby nmatrix pull 494 https : github.com SciRuby nmatrix pull 494 .", "I am following this video https : youtu.be ZxjqsIluM88 to get an overview of how to use SciRuby and plot graphs charts etc .", "Thanks to John Wood for the reply https : groups.google.com d msg sciruby-dev pVAKXOFUU3A uT8j IpJGQAJ", "I am trying to install SciRuby on my Ubuntu 14.04 machine but installation failed .", "can you please look @ this error too : stackoverflow.com questions 36048416 http : stackoverflow.com questions 36048416 atlas-issues-installing-sciruby-full", "I am listing all the gems here from SciRuby website .. . .. . Visualization : rubyvis plotrb .. . .. . Statistics and Probability : statsample distribution .. . .. . Numeric : minimization integration nmatrix .. . .. . Installation for every gem is quite simple as you would have guessed .. . .. . I would suggest visit SciRuby https : github.com SciRuby on Github read about every gem there and install them with there dependencies", "I have gcc6.1 installed on OS X via brew when I tried to install sciruby-full on my Mac always got this Error : .. . .. . My ruby and OS X is always the newest : Ruby 2.2.2 on updated Yosemite .", "Hello using the gem specific-install i am running the command : gem specific-install -l github.com SciRuby nmatrix.git https : github.com SciRuby nmatrix.git this installs the gem but the error shows up exactly same as before starting with u int8 int has not been declared .", "When I create new Ruby 2.2.3 notebook .", "The link there on top says : localhost : 8888 notebooks untitled1.ipnyb kernel name ruby", "I found some docs here http : sciruby.com nmatrix docs and the code repos on github here https : github.com SciRuby nmatrix and so far have been using the source code as the docs .", "When I go to localhost : 8888 and I create new notebooks from right drop down Ruby 2.2.3 .. . .. . I am in home dir .. . .. .", "I use this to generate random normal data in ruby and it s really good .", "Is there a scientific library in JavaScript that can generate probability distributions like this library in Ruby", "Hence I was looking into which appropriate ruby objects this data type will map into .", "Update .. . .. . I found this forum post about ruby algorithms http : www.ruby-forum.com topic 104729 which led me to rsruby https : github.com alexgutteridge rsruby an R Ruby bridge but that seems like too much .", "http : stackoverflow.com questions 4550758 generate-array-of-numbers-that-fit-to-a-probability-distribution-in-ruby", "I am trying to write ruby interfaces to a piece scientific computation library I wrote .", "There is the native ruby array type but I also found out the more mathematically powerful Nmatrix type .", "I recently came across croupier https : github.com xuanxu croupier a ruby gem that aims to generate numbers according to a variety of statistical distributions .", "http : rb-gsl.rubyforge.org .. . .. . For more details on the use cases see this related question : Generate Array of Numbers that fit to a Probability Distribution in Ruby", "Why not make an API wrapper around Ruby GSL by using say Sinatra then call that API from your browser using jQuery.ajax .", "First figure out when you want to start for example now : .. . .. . Find out when the end of your interval should be say 1 week later : .. . .. . Ruby uses this algorithm http : en.wikipedia.org wiki Mersenne twister to generate random numbers .", "notebook https : cloud.githubusercontent.com assets 8083613 13724906 2ef179b8-e8ba-11e5-94b7-86a899d8b167.png .. . .. . Then at first it says Kernel connecting and then dead kernel message pops up again and again within gap of few seconds .", "Nothing happens and the commands I am writing seems to have no effect .", "Please get this issue solved thanks a lot .", "kernel https : cloud.githubusercontent.com assets 8083613 13724918 5edebb72-e8ba-11e5-90c7-421d35b93be4.png", "It was Ivan s answer that tipped me off .", "In addition to declaring the iruby and nyaplot gems you need to declare the appropriate ZeroMQ interface .", "So in your Gemfile .. . .. . Alternatively if you re working on a project with a gemspec you need the following two lines in the spec : .. . .. . And also one for nyaplot if that s what you re using .", "Try to add a file named Gemfile into the folder which you re using to run iruby with the following contents :", "it doesn t work either .", "It creates Untitled.ipynb ......That s related to Python", "Have you installed bundler", "@SameerDeshmukh yes i typed bundler and its has bond mimemagic multi json nyaplot bundler iruby gems .", "I think you don t have rbczmq installed .", "One of the lines in the stack-trace says so .", "@SameerDeshmukh may be python notebook is creating problem for me", "See the second picture I have posted .", "Its a Firefox web browser screenshot .", "I expected to see output .. . .. .", "expected output http : i.stack.imgur.com Ck7Zp.png .. . .. . but I am getting output like the one in below screenshot .. . .. .", "output I get http : i.stack.imgur.com erMqT.png .. . .. . Code : .. . .. . Logs :", "can you try running on Chrome", "I think there is some issue with using http which firefox seems to be rejecting .", "@SameerDeshmukh I tried in Chromium same results", "fixed the issue for me .", "By looking at the errors I am sure there some C C++ compilation problem .", "Any help would be appreciated", "Run the steps. .", "you mean iruby notebook", "yeah iruby notebook .", "how do i install iruby notebook with pip3", "pip3 install ipython-notebook is this command working", "Shouldn t I be using iruby notebook instead of ipython-notebook", "Can you try to install the individual gem that you re looking for and see if it works", "@SameerDeshmukh I am new to all this .", "What all gems would I need to plot graphs", "Let me know .", "I would install them manually", "@SameerDeshmukh but as you said I did installed these gems gems install pry-doc awesome print gnuplot rubyvis nyaplot iruby", "You need nyaplot or gnuplotrb for plotting .", "Regarding the error it s most probably that you need atlas and lapack installed .", "As suggested by Sameer Deshmukh .. . .. . Install the gems what you wish to use .", "Say I have 100 records and I want to mock out the created at date so it fits on some curve .", "Is there a library to do that or what formula could I use", "I think this is along the same track : .. . .. . Generate Random Numbers with Probabilistic Distribution http : stackoverflow.com questions 3109670 generate-random-numbers-with-probabilistic-distribution .. . .. . I don t know much about how they are classified in mathematics but I m looking at things like : .. . .. . bell curve .. . logarithmic typical biology evolution curve", ".. . .. . .. . Just looking for some formulas in code so I can say this : .. . .. . Given 100 records a timespan of 1.week and an interval of 12.hours .. . set created at for each record such that it fits roughly to curve .. . .. . Thanks so much", "Update 2 .. . .. . I wrote this little snippet trying out the gsl library getting there.. . .. . .. . Generate test data in Rails where created at falls along a Statistical Distribution http : snippets.dzone.com posts show 12793", "You can generate UNIX timestamps which are really just integers .", "It is almost uniform .", "Then generate random numbers between the two : .. . .. . Then convert that back to a date : .. . .. . .. . .. . This looks promising as well : http : rb-gsl.rubyforge.org files rdoc randist rdoc.html .. . .. . And this too : http : rb-gsl.rubyforge.org files rdoc rng rdoc.html", "but that won t fit a particular distribution", "true - but it is a start", "already here looking for specific curves thanks", "see the added links above - they look helpful", "hardcore that gsl library looks like it s it", "thanks man", "I have yet to try it but it sounds quite promising .", "From wiki http : en.wikipedia.org wiki Random number generation Generation from a probability distribution : .. . .. . There are a couple of methods to generate a random number based on a probability-density function .", "These methods involve transforming a uniform random number in some way .", "Because of this these methods work equally well in generating both pseudo-random and true random numbers .", ".. . One method called the inversion method http : en.wikipedia.org wiki Inverse transform sampling involves integrating up to an area greater than or equal to the random number which should be generated between 0 and 1 for proper distributions .", ".. . A second method called the acceptance-rejection method http : en.wikipedia.org wiki Rejection sampling involves choosing an x and y value and testing whether the function of x is greater than the y value .", "If it is the x value is accepted .", "Otherwise the x value is rejected and the algorithm tries again .", "The first method is the one used in the accepted answer in your SO linked question : Generate Random Numbers with Probabilistic Distribution http : stackoverflow.com questions 3109670 generate-random-numbers-with-probabilistic-distribution" ] }
{ "confidence": [ 65.33250427246094, 62.685142517089844, 62.44757843017578, 59.548336029052734, 57.122859954833984, 56.67422866821289, 56.2514533996582, 54.343658447265625, 50.93122863769531, 47.1551399230957, 27.13570213317871, 25.954891204833984, 24.82013702392578, 22.036897659301758 ], "content": [ "Question : I am completely noob in SciRuby . For the first time I am using SciRuby . I am following this video https : youtu.be ZxjqsIluM88 to get an overview of how to use SciRuby and plot graphs charts etc . When I go to localhost : 8888 and I create new notebooks from right drop down Ruby 2.2.3 .. . .. . I am in home dir .. . .. . notebook https : cloud.githubusercontent.com assets 8083613 13724906 2ef179b8-e8ba-11e5-94b7-86a899d8b167.png .. . .. . Then at first it says Kernel connecting and then dead kernel message pops up again and again within gap of few seconds . Nothing happens and the commands I am writing seems to have no effect . Please get this issue solved thanks a lot . kernel https : cloud.githubusercontent.com assets 8083613 13724918 5edebb72-e8ba-11e5-90c7-421d35b93be4.png .. . Answer : It was Ivan s answer that tipped me off . In addition to declaring the iruby and nyaplot gems you need to declare the appropriate ZeroMQ interface . So in your Gemfile .. . .. . Alternatively if you re working on a project with a gemspec you need the following two lines in the spec : .. . .. . And also one for nyaplot if that s what you re using . Comment : can you please look @ this error too : stackoverflow.com questions 36048416 http : stackoverflow.com questions 36048416 atlas-issues-installing-sciruby-full", "Question : null .. . Answer : I am trying to write ruby interfaces to a piece scientific computation library I wrote . This library itself uses other open-source libraries like OpenCV boost etc . The primary data structure my library operates on and that is being returned by my library is an n-dimensional array type . Hence I was looking into which appropriate ruby objects this data type will map into . There is the native ruby array type but I also found out the more mathematically powerful Nmatrix type . Can someone point me to the documentation for the C C++ api for nmatrix Googling around for the C api docs did not help . I found some docs here http : sciruby.com nmatrix docs and the code repos on github here https : github.com SciRuby nmatrix and so far have been using the source code as the docs . A few examples would be nice too . Comment : You might try the Developer Guide github.com SciRuby nmatrix wiki NMatrix-Developer-Guide https : github.com SciRuby nmatrix wiki NMatrix-Developer-Guide . The truth however is that much of the C C++ API hasn t been exposed since no one s requested it . Have you tried opening an issue in the tracker github.com SciRuby nmatrix issues http : github.com SciRuby nmatrix issues Comment : Yep exactly what John said . We never had someone asking for these so we directed our efforts elsewhere : But please open an issue and we ll be happy to help you with whatever you need regarding the C C++ API", "Question : I am completely noob in SciRuby . For the first time I am using SciRuby . I am following this video https : youtu.be ZxjqsIluM88 to get an overview of how to use SciRuby and plot graphs charts etc . When I go to localhost : 8888 and I create new notebooks from right drop down Ruby 2.2.3 .. . .. . I am in home dir .. . .. . notebook https : cloud.githubusercontent.com assets 8083613 13724906 2ef179b8-e8ba-11e5-94b7-86a899d8b167.png .. . .. . Then at first it says Kernel connecting and then dead kernel message pops up again and again within gap of few seconds . Nothing happens and the commands I am writing seems to have no effect . Please get this issue solved thanks a lot . kernel https : cloud.githubusercontent.com assets 8083613 13724918 5edebb72-e8ba-11e5-90c7-421d35b93be4.png .. . Answer : Try to add a file named Gemfile into the folder which you re using to run iruby with the following contents : Comment : it doesn t work either . When I create new Ruby 2.2.3 notebook . It creates Untitled.ipynb ......That s related to Python Comment : Have you installed bundler Comment : @SameerDeshmukh yes i typed bundler and its has bond mimemagic multi json nyaplot bundler iruby gems . Comment : I think you don t have rbczmq installed . One of the lines in the stack-trace says so . Comment : @SameerDeshmukh may be python notebook is creating problem for me See the second picture I have posted . Its a Firefox web browser screenshot . The link there on top says : localhost : 8888 notebooks untitled1.ipnyb kernel name ruby", "Question : I have gcc6.1 installed on OS X via brew when I tried to install sciruby-full on my Mac always got this Error : .. . .. . My ruby and OS X is always the newest : Ruby 2.2.2 on updated Yosemite . .. . Answer : From your error message : .. . .. . extconf.rb : 144 : in : You need a version of g++ which supports -std c++0x or -std c++11 . If you re on a Mac and using Homebrew we recommend using mac-brew-gcc.sh to install a more recent g++ . RuntimeError Comment : I have the newest gcc installed is that enough Comment : Probably not if it s just the system gcc . You most likely need a brewed gcc . Comment : @Dr.JohnnyMohawk Actually it s brewed newest one . Seems it doesn t matter though it s not fully installed the main part of IRuby Notebook just works . Comment : Do a g++ --version and a gcc --version . It s likely that you need to create a symlink from the brewed version to usr bin gcc and usr bin g++ . There are instructions in the wiki github.com SciRuby nmatrix wiki http : github.com SciRuby nmatrix wiki .", "Question : I am trying to install SciRuby on my Ubuntu 14.04 machine but installation failed . I also have an open github issue https : github.com SciRuby sciruby issues 45 issue but had no success in installation process . By looking at the errors I am sure there some C C++ compilation problem . Any help would be appreciated .. . Answer : It seems sciruby-full needs lots of native libraries . Run the steps. . Comment : you mean iruby notebook Comment : yeah iruby notebook . Comment : how do i install iruby notebook with pip3 Comment : pip3 install ipython-notebook is this command working Comment : I mean I am using SciRuby . Shouldn t I be using iruby notebook instead of ipython-notebook", "Question : I was installing SciRuby in my macbook OSX . I had this similar issues when installing SciRuby in another Ubuntu laptop which was fixed here http : stackoverflow.com questions 35961227 failed-to-install-sciruby . Comment : Can you try to install the individual gem that you re looking for and see if it works Comment : @SameerDeshmukh I am new to all this . What all gems would I need to plot graphs Let me know . I would install them manually Comment : @SameerDeshmukh but as you said I did installed these gems gems install pry-doc awesome print gnuplot rubyvis nyaplot iruby Comment : You need nyaplot or gnuplotrb for plotting . Comment : Regarding the error it s most probably that you need atlas and lapack installed . .. . Answer : As suggested by Sameer Deshmukh .. . .. . Install the gems what you wish to use . I am listing all the gems here from SciRuby website .. . .. . Visualization : rubyvis plotrb .. . .. . Statistics and Probability : statsample distribution .. . .. . Numeric : minimization integration nmatrix .. . .. . Installation for every gem is quite simple as you would have guessed .. . .. . I would suggest visit SciRuby https : github.com SciRuby on Github read about every gem there and install them with there dependencies", "Question : I have gcc6.1 installed on OS X via brew when I tried to install sciruby-full on my Mac always got this Error : .. . .. . My ruby and OS X is always the newest : Ruby 2.2.2 on updated Yosemite . .. . Answer : Do the following using homebrew .. . .. . if this does not work try gcc47 or gcc46 . Note : It make take a while to build . gcc is quite large . Comment : I have gcc49 installed with Homebrew . Is that fine", "Question : I don t see output for my SciRuby code . I expected to see output .. . .. . expected output http : i.stack.imgur.com Ck7Zp.png .. . .. . but I am getting output like the one in below screenshot .. . .. . output I get http : i.stack.imgur.com erMqT.png .. . .. . Code : .. . .. . Logs : Comment : can you try running on Chrome I think there is some issue with using http which firefox seems to be rejecting . Comment : @SameerDeshmukh I tried in Chromium same results .. . Answer : fixed the issue for me . Thanks to John Wood for the reply https : groups.google.com d msg sciruby-dev pVAKXOFUU3A uT8j IpJGQAJ", "Question : Say I have 100 records and I want to mock out the created at date so it fits on some curve . Is there a library to do that or what formula could I use I think this is along the same track : .. . .. . Generate Random Numbers with Probabilistic Distribution http : stackoverflow.com questions 3109670 generate-random-numbers-with-probabilistic-distribution .. . .. . I don t know much about how they are classified in mathematics but I m looking at things like : .. . .. . bell curve .. . logarithmic typical biology evolution curve .. . .. . .. . Just looking for some formulas in code so I can say this : .. . .. . Given 100 records a timespan of 1.week and an interval of 12.hours .. . set created at for each record such that it fits roughly to curve .. . .. . Thanks so much Update .. . .. . I found this forum post about ruby algorithms http : www.ruby-forum.com topic 104729 which led me to rsruby https : github.com alexgutteridge rsruby an R Ruby bridge but that seems like too much . Update 2 .. . .. . I wrote this little snippet trying out the gsl library getting there.. . .. . .. . Generate test data in Rails where created at falls along a Statistical Distribution http : snippets.dzone.com posts show 12793 .. . Answer : Another option is the Distribution https : github.com sciruby distribution gem under SciRuby http : sciruby.com . You can generate normal numbers by : .. . .. . There are RNGs for various other distributions as well .", "Question : null .. . Answer : I am trying to install the nmatrix gem . i have the gcc compiler installed : .. . .. . then I have the following error on install : .. . .. . Would be really great to try out this library Any ideas how to make the install succesful thanks Comment : Hi @Thrabbit . There s a pull request in right now for fixing Windows compilation . In short you might try checking out this person s branch : github.com SciRuby nmatrix pull 494 https : github.com SciRuby nmatrix pull 494 . We ll try to get it merged ASAP and release a new gem version . Comment : @Dr.JohnnyMohawk . Thanks looking forward to the merge Comment : Okay we ve merged the patch but we can t do a release yet for various reasons . I suggest cloning from github and installing the gem that way instead for now . Comment : @Dr.JohnnyMohawk . Hello using the gem specific-install i am running the command : gem specific-install -l github.com SciRuby nmatrix.git https : github.com SciRuby nmatrix.git this installs the gem but the error shows up exactly same as before starting with u int8 int has not been declared . Am I cloning from the wrong source thanks again . Comment : I ve never used specific-install . I usually just do a git-clone then cd into the directory and do bundle exec rake -T for a list of rake tasks you can run which include installing .", "Question : Is there a scientific library in JavaScript that can generate probability distributions like this library in Ruby http : rb-gsl.rubyforge.org .. . .. . For more details on the use cases see this related question : Generate Array of Numbers that fit to a Probability Distribution in Ruby http : stackoverflow.com questions 4550758 generate-array-of-numbers-that-fit-to-a-probability-distribution-in-ruby Comment : There s jstat http : www.jstat.org not much documentation questionable code if you were to ask for my opinion - Comment : Why not make an API wrapper around Ruby GSL by using say Sinatra then call that API from your browser using jQuery.ajax . .. . Answer : From what I ve been reading some R defectors are moving toward a library called Julia http : julialang.org . It s been ported to Javascript here https : github.com JuliaLang julia blob master test perf perf.js by the makers of Julia themselves and it looks quite promising . The Julia Language http : julialang.org Comment : Also read this interesting write-up : The Best Statistical Programming Language is Javascript http : www.r-bloggers.com the-best-statistical-programming-language-is- E2 80 A6javascript", "Question : Say I have 100 records and I want to mock out the created at date so it fits on some curve . Is there a library to do that or what formula could I use I think this is along the same track : .. . .. . Generate Random Numbers with Probabilistic Distribution http : stackoverflow.com questions 3109670 generate-random-numbers-with-probabilistic-distribution .. . .. . I don t know much about how they are classified in mathematics but I m looking at things like : .. . .. . bell curve .. . logarithmic typical biology evolution curve .. . .. . .. . Just looking for some formulas in code so I can say this : .. . .. . Given 100 records a timespan of 1.week and an interval of 12.hours .. . set created at for each record such that it fits roughly to curve .. . .. . Thanks so much Update .. . .. . I found this forum post about ruby algorithms http : www.ruby-forum.com topic 104729 which led me to rsruby https : github.com alexgutteridge rsruby an R Ruby bridge but that seems like too much . Update 2 .. . .. . I wrote this little snippet trying out the gsl library getting there.. . .. . .. . Generate test data in Rails where created at falls along a Statistical Distribution http : snippets.dzone.com posts show 12793 .. . Answer : I recently came across croupier https : github.com xuanxu croupier a ruby gem that aims to generate numbers according to a variety of statistical distributions . I have yet to try it but it sounds quite promising . Comment : I use this to generate random normal data in ruby and it s really good .", "Question : Say I have 100 records and I want to mock out the created at date so it fits on some curve . Is there a library to do that or what formula could I use I think this is along the same track : .. . .. . Generate Random Numbers with Probabilistic Distribution http : stackoverflow.com questions 3109670 generate-random-numbers-with-probabilistic-distribution .. . .. . I don t know much about how they are classified in mathematics but I m looking at things like : .. . .. . bell curve .. . logarithmic typical biology evolution curve .. . .. . .. . Just looking for some formulas in code so I can say this : .. . .. . Given 100 records a timespan of 1.week and an interval of 12.hours .. . set created at for each record such that it fits roughly to curve .. . .. . Thanks so much Update .. . .. . I found this forum post about ruby algorithms http : www.ruby-forum.com topic 104729 which led me to rsruby https : github.com alexgutteridge rsruby an R Ruby bridge but that seems like too much . Update 2 .. . .. . I wrote this little snippet trying out the gsl library getting there.. . .. . .. . Generate test data in Rails where created at falls along a Statistical Distribution http : snippets.dzone.com posts show 12793 .. . Answer : You can generate UNIX timestamps which are really just integers . First figure out when you want to start for example now : .. . .. . Find out when the end of your interval should be say 1 week later : .. . .. . Ruby uses this algorithm http : en.wikipedia.org wiki Mersenne twister to generate random numbers . It is almost uniform . Then generate random numbers between the two : .. . .. . Then convert that back to a date : .. . .. . .. . .. . This looks promising as well : http : rb-gsl.rubyforge.org files rdoc randist rdoc.html .. . .. . And this too : http : rb-gsl.rubyforge.org files rdoc rng rdoc.html Comment : but that won t fit a particular distribution Comment : true - but it is a start Comment : already here looking for specific curves thanks Comment : see the added links above - they look helpful Comment : hardcore that gsl library looks like it s it thanks man", "Question : Say I have 100 records and I want to mock out the created at date so it fits on some curve . Is there a library to do that or what formula could I use I think this is along the same track : .. . .. . Generate Random Numbers with Probabilistic Distribution http : stackoverflow.com questions 3109670 generate-random-numbers-with-probabilistic-distribution .. . .. . I don t know much about how they are classified in mathematics but I m looking at things like : .. . .. . bell curve .. . logarithmic typical biology evolution curve .. . .. . .. . Just looking for some formulas in code so I can say this : .. . .. . Given 100 records a timespan of 1.week and an interval of 12.hours .. . set created at for each record such that it fits roughly to curve .. . .. . Thanks so much Update .. . .. . I found this forum post about ruby algorithms http : www.ruby-forum.com topic 104729 which led me to rsruby https : github.com alexgutteridge rsruby an R Ruby bridge but that seems like too much . Update 2 .. . .. . I wrote this little snippet trying out the gsl library getting there.. . .. . .. . Generate test data in Rails where created at falls along a Statistical Distribution http : snippets.dzone.com posts show 12793 .. . Answer : From wiki http : en.wikipedia.org wiki Random number generation Generation from a probability distribution : .. . .. . There are a couple of methods to generate a random number based on a probability-density function . These methods involve transforming a uniform random number in some way . Because of this these methods work equally well in generating both pseudo-random and true random numbers . .. . One method called the inversion method http : en.wikipedia.org wiki Inverse transform sampling involves integrating up to an area greater than or equal to the random number which should be generated between 0 and 1 for proper distributions . .. . A second method called the acceptance-rejection method http : en.wikipedia.org wiki Rejection sampling involves choosing an x and y value and testing whether the function of x is greater than the y value . If it is the x value is accepted . Otherwise the x value is rejected and the algorithm tries again . The first method is the one used in the accepted answer in your SO linked question : Generate Random Numbers with Probabilistic Distribution http : stackoverflow.com questions 3109670 generate-random-numbers-with-probabilistic-distribution" ] }
[ "yes-answer-long", "yes-answer-short" ]
scientific-computing
UNK_RELATION
fortran95@fortran@96
fortran95 -- fortran 95 is a minor revision mostly to resolve some outstanding issues from the @placeholder 90 standard .
{ "confidence": [ 47.5301513671875, 43.537696838378906, 43.32897186279297, 41.99908447265625, 38.98111343383789, 37.89302062988281, 36.45378875732422, 34.90140151977539, 34.110321044921875, 33.756263732910156, 33.329097747802734, 32.9066276550293, 32.36422348022461, 32.03520965576172, 32.03520965576172, 31.804306030273438, 31.790485382080078, 31.65329933166504, 31.62950897216797, 31.22439956665039, 31.196924209594727, 31.029747009277344, 30.535877227783203, 30.535877227783203, 30.496597290039062, 29.868698120117188, 29.703950881958008, 28.99526023864746, 28.57044792175293, 28.392135620117188, 28.351747512817383, 28.25250816345215, 28.20056915283203, 27.430633544921875, 27.199626922607422, 27.197668075561523, 27.16596221923828, 27.14461326599121, 27.03183364868164, 27.03183364868164, 27.03183364868164, 26.956573486328125, 26.88395118713379, 26.563758850097656, 26.193805694580078, 26.02604866027832, 25.921247482299805, 25.921247482299805, 25.659839630126953, 25.105812072753906, 25.025146484375, 24.65519142150879, 24.65519142150879, 24.64189338684082, 24.570594787597656, 24.48743438720703, 24.358470916748047, 24.200326919555664, 24.00442123413086, 23.6724853515625, 23.663877487182617, 23.624664306640625, 23.624664306640625, 23.46027374267578, 23.44043731689453, 22.977521896362305, 22.96215057373047, 22.96215057373047, 22.96215057373047, 22.96215057373047, 22.781055450439453, 22.698583602905273, 22.402297973632812, 22.287452697753906, 22.287452697753906, 22.287452697753906, 21.994768142700195, 21.986675262451172, 21.986675262451172, 21.972900390625, 21.972900390625, 21.844619750976562, 21.805694580078125, 21.679744720458984, 21.564453125, 21.51764678955078, 21.509361267089844, 21.509361267089844, 21.42353630065918, 21.389177322387695, 21.345991134643555, 21.345991134643555, 21.345745086669922, 21.293487548828125, 21.10453987121582, 20.9847354888916, 20.9847354888916, 20.881099700927734, 20.859189987182617, 20.803483963012695 ], "content": [ "True - I missed the tag for the Fortran 90 standard .", "Is there a way I can implement in standard Fortran 90 95", "They were introduced as part of Fortran 95 minor extension to Fortran 90 mostly for the purpose of optimization when code vectorization was a major thing in HPC .", "Possible duplicate of Is there a standard way to check for Infinite and NaN in Fortran 90 95", "What compiler is Fortran 90 but not Fortran 95 compliant", "There is no standards-compliant way of defining either of these quasi-numbers in Fortran 90 95 .", "http : stackoverflow.com questions 17389958 is-there-a-standard-way-to-check-for-infinite-and-nan-in-fortran-90-95", "With extremely few exceptions FORTRAN 77 is a subset of Fortran 90 95 2003 2008 .", "I am looking for a library for dealing with sparse matrices in fortran 90 95 .", "I am coding in Fortran 95 .", "Neither is there a standards-compliant way of checking for infinities or NaNs in Fortran 90 95 nor can there be a standards-compliant way .", "Does fortran95 not use the IEEE754 standard by default", "Do you really require Fortran 90 or 95 or do you allow Fortran 2003 the automatic re-allocation the answers use is from Fortran 2003 and is very useful .", "+1 but I am restricted to fortran 95", "There s no intrinsic or such in Fortran 95 that helps you .", "Notice the number of people subscribing to fortran http : stackoverflow.com questions tagged fortran and to fortran95 http : stackoverflow.com questions tagged fortran95 and you want more people to see your question don t you", "Both are possible prefer Fortran 90 95 but need to deal with loops and indices as @roygvib presented his answer .", "Read stackoverflow.com questions 838310 fortran-90-kind-parameter http : stackoverflow.com questions 838310 fortran-90-kind-parameter", "For example that you cannot use Fortran 2008 but only Fortran 90 .", "With a few exceptions valid Fortran 77 programs are valid Fortran 95 programs .", "Even Fortran 95 is very superseded .", "I have some code like the below in Fortran 90 : .. . .. . I am getting the errors : .. . .. . I am trying to convert some older fortran code to more modern fortran 90 .", "I ve been trying to find a standards-compliant way to check for Infinite and NaN values in Fortran 90 95 but it proved harder than I thought .", "Also notice that the question was really mainly interested about what to do when IEEE ARITHMETIC is not available and asks how to do that using Fortran 90 95 .", "Just very badly written Fortran 95 programs .", "It is convenient to compile the FORTRAN 77 first into an object file and then use the fortran command that compiles the Fortran 95 to link everything .", "How do I get the contents of a directory in Fortran 95", "By Fortran 95 do you mean that you cannot use anything from later standards TRs F2003 F2008 etc .", "len trim goes back to Fortran 90 http : dx.doi.org 10.1145 2701654.2701655", "fortran95", "Its not guaranteed in Fortran 90 .", "According to that document there should be a fortran 95 interface to the library .", "See answers to this question about how to use KIND properly : Fortran 90 kind parameter http : stackoverflow.com questions 838310 fortran-90-kind-parameter .", "In Fortran there are two standard ways to return a result from a function .", "Compiling the FORTRAN 77 and Fortran 90 59 2003 2008 source with the same compiler should produce compatible object modules .", "I am new to C++ with some training using fortran95 .", "Also due to restrictions outside of my control I am required to adhere to the Fortran 95 standard or earlier no F2003 F2008 extensions .", "Did you really intend to avoid that and only use Fortran 95", "The second form standardized in Fortran 90 is through a result variable .", "My question is what was the rationale of the Fortran 90 committee for introducing result variables", "I don t know if you can do this in Fortran 90 .", "The f95 f2003 and f2008 values specify strict conformance to the Fortran 95 Fortran 2003 and Fortran 2008 standards respectively errors are given for all extensions beyond the relevant language standard and warnings are given for the Fortran 77 features that are permitted but obsolescent in later standards .", "I am attempting to replicate some Python code in Fortran 90 to make it work within a larger Fortran project I am contributing to .", "Otherwise see Reading a character string of unknown length http : stackoverflow.com q 14765382 1234550 for Fortran 95 possibilities .", "Do I need to define an interface for recursive Fortran95 and above subroutines", "The standard Fortran string is fixed length padded on the right with blanks .", "The first one is easy in Fortran 95 - you use non-advancing input .", "To progressively read a record in Fortran 95 use non-advancing input .", "The versions like fortran95 http : stackoverflow.com questions tagged fortran95 are only to specify the version in version specific questions and they are only used in addition to the main tag .", "Fortran has it because fortran has it .", "I would like to be able to share a FORTRAN 95 module without sharing its source code .", "Currently I m compiling fortran95 source codes on mac using gfortran 6.1 .", "I decided to learn the fortran95 language reason why is not important .", "I am using FORTRAN 95 using Silverfrost Plato where I am trying to make real double precision variables .", "With the interfaces in your Fortan 90 95 2003 2008 code the compiler will use compatible calling conventions .", "Therefore the suggested fortran 2008 standard features are unfortunately not available to me .", "F95 it being a minor revision of the language often goes under F90 .", "Current Intel Fortran issues an error for this code .", "In Fortran 95 the initialization expressions constant expressions were a lot stricter than they are now .", "Consider the following short program Fortran95 : .. . .. . I tried running this with Fortran compilers gfortran 4.8.2 and Absoft Pro Fortran 13.0.0 mac and I get the following result : .. . .. . update : Also tried gfortran 4.4.7 linux with the same result .", "With the addition of pointers and data types in Fortran95 it appears that there is no technical limitation in making any subprogram a function and keeping subroutines just for legacy .", "I have downloaded a Fortran 90 95 adaptive mesh refinment library Paramesh http : www.physics.drexel.edu olson paramesh-doc Users manual amr.html and now I m trying to compile an example program that came with it .", "I also found a library called sparsekit : .. . .. . http : people.sc.fsu.edu jburkardt f src sparsekit sparsekit.html .. . .. . Anyone got any experience with either one of these two or any other sparse-matrix library for fortran 90 95", "The Fortran of that era Fortran IV only vaguely resembles the Fortran of today .", "If you don t like that feature of fortran then don t use fortran .", "I have been tasked with writing a Fortran 95 program that will read character input from a file and then to start with simply spit it back out again .", "There is no concept of a directory in Fortran as such .", "Fortran is imperative-programming language .", "Fortran isn t Haskell .", "References are to Fortran 2008 .", "I am kind of getting the impression that the fortran 95 sparse blas specification isn t really implemented anywhere", "From what code you have I guess you have some but very little working knowledge of Fortran .", "Trying to write some fortran code calling some MINPACK routines just new to fortran .", "I m writing a code with Fortran 90 and now I need to use the special functions in amos Fotran 77 library http : www.netlib.org amos .", "My question is : how can I combine them and use them in my Fortran 90 program and how to compile them correctly", "Say I want to parse the following string : .. . .. . Compute the sum of integer and integer in Fortran 90 of which I have no way of telling how large the integer will be .", "It is however nonconstructive as 99 people still thinks of them as useful and doesn t dream of throwing them out actually even if they wished they couldn t - fortran Standard demands it .", "The Fortran standard imposes a limit on the length of line that compilers are required to deal with these days it s 132 characters .", "The latest Fortran standard gives a very similar operation as an example in the documentation of the pack function .", "Either way adding the generic fortran http : stackoverflow.com questions tagged fortran would enhance this question s visibility .", "Recall that fortran IV and fortran 77 at least were strictly call-by-reference languages .", "Luckily this thread comes up quite high on google when searching fortran 90 sparse-matrix library now .", "Do we still need subroutines in Fortran programming due to some feature that subroutines have and functions don t", "Gfortran 4.6 has partial support of it fortranwiki.org fortran show Fortran+2008+status http : fortranwiki.org fortran show Fortran+2008+status and gcc.gnu.org onlinedocs gfortran Fortran-2008-status.html http : gcc.gnu.org onlinedocs gfortran Fortran-2008-status.html that claims support for do concurrent in newest gfortran .", "However in Fortran I don t understand how to split the interface from the implementation in Fortran without maintaining two copies of the module interface .", "I m using gfortran s 95+ extensions .", "In Fortran the void return-type does not exist .", "However in Fortran almost all numeric vars are signed .", "But in different languages not in Fortran .", "Specifically I am trying to convert some code that recursively identifies upstream paths in a binary-tree such as in the following example : .. . .. . This tree is represented and traversed by : .. . .. . Is it possible to implement anything like this in Fortran 90", "In Fortran 95 and later because it is a local non-saved variable var1 will be deallocated every time execution of the foo procedure ends .", "The automatic deallocation of local non-saved allocatables upon exit of procedures was added in Fortran 95 to avoid memory-leaks .", "If you have a look at this link fortranwiki.org fortran show Fortran+2008+status http : fortranwiki.org fortran show Fortran+2008+status only Cray has that feature implemented as of november 2014 .", "The difference stems from the fact that you cannot call functions like in other languages in Fortran .", "You have the tag fortran95 are you restricted to that or would you also use newer features", "Always use tag fortran http : stackoverflow.com questions tagged fortran and only add the version when necessary to distinguish that your question is specific .", "If yours doesn t yet you can mock one up yourself there s a good example on the fortran wiki http : fortranwiki.org fortran show newunit .", "Always use tag fortran http : stackoverflow.com questions tagged fortran .", "Check out this http : stackoverflow.com questions 14296787 fortran-95-array-must-have-constant-shape-error answer for more details .", "Something is wrong beyond just FORTRAN ." ] }
{ "confidence": [ 61.59257888793945, 46.827335357666016, 46.396366119384766, 43.964725494384766, 43.964725494384766, 43.28569793701172, 42.099212646484375, 40.32093048095703, 40.060813903808594, 39.911376953125, 39.489906311035156, 38.90593719482422, 38.90593719482422, 38.5897216796875, 37.586544036865234, 37.44602584838867, 37.40928268432617, 36.050010681152344, 35.8480110168457, 35.47419738769531 ], "content": [ "Question : Say I have the below code : .. . .. . will the variable var1 get allocated twice I guess YES . If it is allocated for each call will the memory allocated during the first call becomes free .. . Answer : var1 will attempt to be allocated every time the ALLOCATE statement is executed i.e . every time the foo procedure is called . Under the rules of Fortran 90 only the allocation status of foo becomes undefined when the procedure ends . A variable with undefined allocation status is rendered unusable - you cannot legally re-allocate in a subsequent call of the procedure . In Fortran 95 and later because it is a local non-saved variable var1 will be deallocated every time execution of the foo procedure ends . Comment : The automatic deallocation of local non-saved allocatables upon exit of procedures was added in Fortran 95 to avoid memory-leaks . Comment : fortran95 I m using fortran90 . So does the behavior change Comment : Its not guaranteed in Fortran 90 . What compiler is Fortran 90 but not Fortran 95 compliant Comment : If in double Fortran 90 you can add explicit deallocate statements at the end of procedures . Comment : True - I missed the tag for the Fortran 90 standard .", "Question : Currently I m compiling fortran95 source codes on mac using gfortran 6.1 . I was wondering if I can run FORTRAN 77 source codes using the same . If not any suggestions Comment : With a few exceptions valid Fortran 77 programs are valid Fortran 95 programs . Just very badly written Fortran 95 programs . .. . Answer : Its working if I use .. . .. . gfortran old fortran.f -o a.out Comment : So what did you do in the first place that didnt work a.out is the default so you dont even need that . Comment : @agentp I wa using old fortran.f77 as suggested in the previous answer .", "Question : I ve been trying to find a standards-compliant way to check for Infinite and NaN values in Fortran 90 95 but it proved harder than I thought . I tried to manually create Inf and NaN variables using the binary representation described in IEEE 754 but I found no such functionality . I am aware of the intrinsic ieee arithmetic module in Fortran 2003 with the ieee is nan and ieee is finite intrinsic functions . However it s not supported by all the compilers notably gfortran http : gcc.gnu.org bugzilla show bug.cgi id 29383 as of version 4.9 . Defining infinity and NaN at the beginning like pinf 1 . 0 and nan 0 . 0 seems hackish to me and IMHO can raise some building problems - for example if some compilers check this in compile-time one would have to provide a special flag . Is there a way I can implement in standard Fortran 90 95 and isnan Comment : gnu fortran 4.10 fixes this https : gcc.gnu.org bugzilla show bug.cgi id 29383 c16 Comment : GCC 5 and more recent do support IEEE ARITHMETIC but support of older versions is still an issue and will continue to be for a long time . .. . Answer : No . Neither is there a standards-compliant way of checking for infinities or NaNs in Fortran 90 95 nor can there be a standards-compliant way . There is no standards-compliant way of defining either of these quasi-numbers in Fortran 90 95 . Comment : Well in the scope of the IEEE Floating Point standard that is .", "Question : I ve been trying to find a standards-compliant way to check for Infinite and NaN values in Fortran 90 95 but it proved harder than I thought . I tried to manually create Inf and NaN variables using the binary representation described in IEEE 754 but I found no such functionality . I am aware of the intrinsic ieee arithmetic module in Fortran 2003 with the ieee is nan and ieee is finite intrinsic functions . However it s not supported by all the compilers notably gfortran http : gcc.gnu.org bugzilla show bug.cgi id 29383 as of version 4.9 . Defining infinity and NaN at the beginning like pinf 1 . 0 and nan 0 . 0 seems hackish to me and IMHO can raise some building problems - for example if some compilers check this in compile-time one would have to provide a special flag . Is there a way I can implement in standard Fortran 90 95 and isnan Comment : gnu fortran 4.10 fixes this https : gcc.gnu.org bugzilla show bug.cgi id 29383 c16 Comment : GCC 5 and more recent do support IEEE ARITHMETIC but support of older versions is still an issue and will continue to be for a long time . .. . Answer : I don t have enough rep to comment so I ll answer regarding Rick Thompson s suggestion for testing infinity . This will also be true if A is a very large floating-point number and 1 is below the precision of A . A simple test : .. . .. . outputs :", "Question : I ve been trying to find a standards-compliant way to check for Infinite and NaN values in Fortran 90 95 but it proved harder than I thought . I tried to manually create Inf and NaN variables using the binary representation described in IEEE 754 but I found no such functionality . I am aware of the intrinsic ieee arithmetic module in Fortran 2003 with the ieee is nan and ieee is finite intrinsic functions . However it s not supported by all the compilers notably gfortran http : gcc.gnu.org bugzilla show bug.cgi id 29383 as of version 4.9 . Defining infinity and NaN at the beginning like pinf 1 . 0 and nan 0 . 0 seems hackish to me and IMHO can raise some building problems - for example if some compilers check this in compile-time one would have to provide a special flag . Is there a way I can implement in standard Fortran 90 95 and isnan Comment : gnu fortran 4.10 fixes this https : gcc.gnu.org bugzilla show bug.cgi id 29383 c16 Comment : GCC 5 and more recent do support IEEE ARITHMETIC but support of older versions is still an issue and will continue to be for a long time . .. . Answer : For Inf it seems to work that if A-1 .eq . A is true then A is Inf Comment : Maybe you might want to elaborate a bit more .", "Question : I ve been trying to find a standards-compliant way to check for Infinite and NaN values in Fortran 90 95 but it proved harder than I thought . I tried to manually create Inf and NaN variables using the binary representation described in IEEE 754 but I found no such functionality . I am aware of the intrinsic ieee arithmetic module in Fortran 2003 with the ieee is nan and ieee is finite intrinsic functions . However it s not supported by all the compilers notably gfortran http : gcc.gnu.org bugzilla show bug.cgi id 29383 as of version 4.9 . Defining infinity and NaN at the beginning like pinf 1 . 0 and nan 0 . 0 seems hackish to me and IMHO can raise some building problems - for example if some compilers check this in compile-time one would have to provide a special flag . Is there a way I can implement in standard Fortran 90 95 and isnan Comment : gnu fortran 4.10 fixes this https : gcc.gnu.org bugzilla show bug.cgi id 29383 c16 Comment : GCC 5 and more recent do support IEEE ARITHMETIC but support of older versions is still an issue and will continue to be for a long time . .. . Answer : I have used : .. . .. . This will print Got a problem for number 0.0D0 1.0D0 0.0D0 0.0D0 0.0D0 SQRT -2.0D0 and also for overflows and underflows such as number EXP 1.0D800 or number EXP -1.0D800 . Notice that generally things like number EXP 1.0D-800 will just set number 1.0 and produce a warning at compilation time but the program will print We are OK which I find acceptable . OL . Comment : The question asks for NotANumber but your exampletests for finiteness . It will also catch +Inf and -Inf as false positives . Also notice that the question was really mainly interested about what to do when IEEE ARITHMETIC is not available and asks how to do that using Fortran 90 95 . Comment : In addition to Vladimir F s concerns there s no guarantee that even with ieee arithmetic that ieee support datatype test is true . If it isn t it is not permitted to consider ieee is finite test . Comment : I was bit too harsh the question does also ask for an equivalent of IEEE IS FINITE . But the point is that the OP knows it exists but asks for an alternative .", "Question : Let s have an array A : : .. . .. . defined by several loops over m j k .. . .. . and now I want to select subset of A : : such that their values are negative and store them into array B : unknown length yet i.e . Since max1 and max2 are very large numbers I don t want to allocate B : of the length max1 max2 but exactly of the length that A : : contains negative values . Also I don t want to go through complicated loops over m j and k again . Thank you . Comment : Do you really require Fortran 90 or 95 or do you allow Fortran 2003 the automatic re-allocation the answers use is from Fortran 2003 and is very useful . Comment : Both are possible prefer Fortran 90 95 but need to deal with loops and indices as @roygvib presented his answer . .. . Answer : This is fairly straightforward : .. . .. . will pack the negative elements of a into the rank-1 array b . With a recent compiler b will be automatically allocated to the correct size during the assignment . The latest Fortran standard gives a very similar operation as an example in the documentation of the pack function .", "Question : Currently I m compiling fortran95 source codes on mac using gfortran 6.1 . I was wondering if I can run FORTRAN 77 source codes using the same . If not any suggestions Comment : With a few exceptions valid Fortran 77 programs are valid Fortran 95 programs . Just very badly written Fortran 95 programs . .. . Answer : You do not mention what error you encountered during the compilation process . See this link https : gcc.gnu.org onlinedocs gfortran Fortran-Dialect-Options.html . Specifically : .. . .. . where std may be one of f95 f2003 f2008 gnu or legacy . The .. . .. . Default value for std is gnu . From the same page : The legacy value is equivalent but without the warnings for obsolete extensions and may be useful for old non-standard programs . The f95 f2003 and f2008 values specify strict conformance to the Fortran 95 Fortran 2003 and Fortran 2008 standards respectively errors are given for all extensions beyond the relevant language standard and warnings are given for the Fortran 77 features that are permitted but obsolescent in later standards . For example if you have a file old fortran.f77 to compile you could do : .. . .. . where -o a.out gives you the executable a.out . I have used an older version of this compiler successfully without using this option . You may get some warnings though . First try : .. . .. . EDIT : After looking at comments below by OP it looks like a different issue may be involved . It might be that either your installation is faulty which is possible or your LD LIBRARY PATH is messed up . I think your linker ld in your path is 32bit and the object file that was created by your compiler might have been 64 bit . Just a hunch . Can you post the output of .. . .. . suppose that returns : path to ld . Then take that output and do .. . .. . Can you post the output of both commands as comment Comment : Thanks . I m very new to fortran programming so don t know much technical words now . Will wait for more details . Comment : I tried both ways got same error . ld : warning : ignoring file epi.f77 file was built for unsupported file-format which is not the architecture being linked x86-64 : epi.f77 Undefined symbols for architecture x86-64 : main referenced from : implicit entry start for main executable ld : symbol s not found for architecture x86-64 collect2 : error : ld returned 1 exit status Comment : try creating a small Hello World program and compile it . If it succeeds then you have a problem elsewhere . Can you tell us how you are compiling epi.F77 what is the output of file epi.F77 Comment : I tried hello world and got the following error . ld : warning : ignoring file hello.f77 file was built for unsupported file-format 0x20 0x70 0x72 0x6F 0x67 0x72 0x61 0x6D 0x20 0x6D 0x61 0x69 0x6E 0x0A 0x0A 0x63 which is not the architecture being linked x86-64 : hello.f77 Undefined symbols for architecture x86-64 : main referenced from : implicit entry start for main executable ld : symbol s not found for architecture x86-64 collect2 : error : ld returned 1 exit status Comment : I have updated my answer . Can you post the result", "Question : I m writing a code with Fortran 90 and now I need to use the special functions in amos Fotran 77 library http : www.netlib.org amos . Now I found a module interface for those routines https : github.com certik fortran-utils blob master src amos.f90 . My question is : how can I combine them and use them in my Fortran 90 program and how to compile them correctly I have been struggling for this for one whole day and still could not figure it out . Thanks EDIT : .. . .. . The following is my test code : .. . .. . It seems I could not get the correct answer no matter how . I tried to convert the ZBESI.f Fortran77 code to Fortran90 code by hand . But the code is so long and it was a disaster . Comment : Please show a sample of the code you are struggling with . Also explain exactly what is not working : Compilation error Linking problem Comment : This should be very straightforward . Something is wrong beyond just FORTRAN . More details will help . Comment : it should be straightforward to throw some debugging write statements into ZBESI to see why its throwing that error . .. . Answer : With extremely few exceptions FORTRAN 77 is a subset of Fortran 90 95 2003 2008 . And in practice compilers still support the obsolete features . Compiling the FORTRAN 77 and Fortran 90 59 2003 2008 source with the same compiler should produce compatible object modules . You will likely have to compile the two language versions separately since different compiler-options will probably be necessary e.g . for fixed and free-form source layout . With the interfaces in your Fortan 90 95 2003 2008 code the compiler will use compatible calling conventions . What specific problems are you having Do you need to know the compiler-options for FORTRAN 77 What compiler are you using EDIT : You have to compile the module before the source code that uses it . It is convenient to compile the FORTRAN 77 first into an object file and then use the fortran command that compiles the Fortran 95 to link everything . So try : Comment : I m using Intel compiler . Now my code compiles fine by something like : ifort set precisions.f90 ZBESI.f amos.f90 test ZBESI.f90 . As long as I put the files in right order everything compiles fine . But the output result seems to be wrong . I m not sure if this is due to the code itself or the compiling issue . I updated my test code in my original question . Thanks", "Question : I have downloaded a Fortran 90 95 adaptive mesh refinment library Paramesh http : www.physics.drexel.edu olson paramesh-doc Users manual amr.html and now I m trying to compile an example program that came with it . In the process I modified the Makefile to use gfortran instead of the Intel Fortran compiler . In the library code there is a module containing this snippet : .. . .. . Elsewhere there is .. . .. . which is causing this error http : stackoverflow.com questions 14296787 fortran-95-array-must-have-constant-shape-error : .. . .. . Would that code work if compiled using another compiler I know that with standard Fortran or at least the one used by gfortran requires that integer variables which are used to denote array sizes should have the parameter keyword attached to them . Is that not the case for other Fortran compilers Do other compiler include non-standard features such as this .. . Answer : Current Intel Fortran issues an error for this code . The standard language requires that non-allocatable non-pointer arrays declared in the specification part of a module or main program or block data or submodule and arrays used in a few other places must have constant array bounds . iflux target is such an array . A program with such an array is non-conforming and will not be accepted without diagnostics by a standard conforming Fortran processor . If portability is your goal then do not use this sort of feature . Lack of a diagnostic from previous versions of Intel Fortran was presumably an oversight . Module arrays that need to have their size specified by a variable should be made allocatable with the array allocated in an initialise procedure or similar before the operations proper provided by the module are used .", "Question : When I compile the program below I have an error and a warning in the call Coor Trans command-line as .. . .. . Warning : Line truncated .. . .. . Error : Syntax error in argument list .. . .. . I compile the program several times but it does not work . Maybe there is something wrong with my call command . Comment : Always use tag fortran http : stackoverflow.com questions tagged fortran otherwise only few people will see your post . The versions like fortran95 http : stackoverflow.com questions tagged fortran95 are only to specify the version in version specific questions and they are only used in addition to the main tag . Comment : Thanks for your suggestion .. . Answer : The Fortran standard imposes a limit on the length of line that compilers are required to deal with these days it s 132 characters . You can break the line at a suitable place and use a continuation line . Something like this : .. . .. . Notice the at the end of the continued line . Once the line is truncated arbitrarily it is syntactically erroneous which explains the second part of your compiler s complaint . Your compiler probably has an option to force it to read longer lines .", "Question : I ve been trying to find a standards-compliant way to check for Infinite and NaN values in Fortran 90 95 but it proved harder than I thought . I tried to manually create Inf and NaN variables using the binary representation described in IEEE 754 but I found no such functionality . I am aware of the intrinsic ieee arithmetic module in Fortran 2003 with the ieee is nan and ieee is finite intrinsic functions . However it s not supported by all the compilers notably gfortran http : gcc.gnu.org bugzilla show bug.cgi id 29383 as of version 4.9 . Defining infinity and NaN at the beginning like pinf 1 . 0 and nan 0 . 0 seems hackish to me and IMHO can raise some building problems - for example if some compilers check this in compile-time one would have to provide a special flag . Is there a way I can implement in standard Fortran 90 95 and isnan Comment : gnu fortran 4.10 fixes this https : gcc.gnu.org bugzilla show bug.cgi id 29383 c16 Comment : GCC 5 and more recent do support IEEE ARITHMETIC but support of older versions is still an issue and will continue to be for a long time . .. . Answer : The simple way without using the ieee arithmatic is to do the following . Infinity : Define your variable infinity HUGE dbl prec var or if you have it a quad precision variable . Then you can simply check to see if your variable is infinity by if my var infinity . NAN : This is even easier . By definition NAN is not equal to anything even itself . Simply compare the variable to itself : if my var my var . Comment : Odd that nobody else mentioned the NaN case . I guess they were worried that you might be using fortran on a non-ieee cpu Aside from that the NaN check is very robust . The infinity check on the other hand is a bit less elegant since it depends on the data type . Comment : Beware clever optimisers . Comment : @amaurea : You can take care of the data-type issue by using INTERFACE and linking the few types you might be using into the same MODULE PROCEDURE . Comment : @IanH : You could reasonably set infinity 1.e100 dp and still obtain a good infinity checker . Even when using small scales like 1e-24 m to describe big scales like 1e+24 m you still are no where near 1e100 . Comment : Thank you for the answer and good catch about the MODULE PROCEDURE . One can make a very clean interface with it . If my code is worth it I might release it . Thanks again", "Question : I ve been trying to find a standards-compliant way to check for Infinite and NaN values in Fortran 90 95 but it proved harder than I thought . I tried to manually create Inf and NaN variables using the binary representation described in IEEE 754 but I found no such functionality . I am aware of the intrinsic ieee arithmetic module in Fortran 2003 with the ieee is nan and ieee is finite intrinsic functions . However it s not supported by all the compilers notably gfortran http : gcc.gnu.org bugzilla show bug.cgi id 29383 as of version 4.9 . Defining infinity and NaN at the beginning like pinf 1 . 0 and nan 0 . 0 seems hackish to me and IMHO can raise some building problems - for example if some compilers check this in compile-time one would have to provide a special flag . Is there a way I can implement in standard Fortran 90 95 and isnan Comment : gnu fortran 4.10 fixes this https : gcc.gnu.org bugzilla show bug.cgi id 29383 c16 Comment : GCC 5 and more recent do support IEEE ARITHMETIC but support of older versions is still an issue and will continue to be for a long time . .. . Answer : No . The salient parts of IEEE ARITHMETIC for generating checking for NaN s are easy enough to write for gfortran for a particular architecture . Comment : About your second statement they don t seem to agree gcc.gnu.org ml gcc-bugs 2012-10 msg00580.html http : gcc.gnu.org ml gcc-bugs 2012-10 msg00580.html or am I missing something Comment : Btw I added a link-to the relevant gfortran bug which dates from 2006 and has status NEW . Comment : Writing all of IEEE ARITHMETIC for all architectures that gfortran supports which is what that bug deals with would be difficult Writing the select bits that generate check for NaN s on a particular architecture for example x64 is pretty easy . See sites.google.com site tprincesite Home gfortran-ieee-arithmetic https : sites.google.com site tprincesite Home gfortran-ieee-arithmetic for one example by Tim Prince that relies on the inequality of any two NaN s an alternative approach is to use the Fortran bit intrinsics to generate test for the specific patterns that indicate a NaN . See the original gfortran bug 29383 for more discussion .", "Question : I am coding in Fortran 95 . I must extract the two floating values from this line in an ascii file : .. . .. . Of course the READ statement is .. . .. . The problem is that I must do that for hundreds of ascii files but there are variations in the number of digits . For instance : .. . .. . Therefore I cannot use a single format . I don t know how to read those x y coordinates using free format because I must skip the first 7 spaces anyway . Comment : By Fortran 95 do you mean that you cannot use anything from later standards TRs F2003 F2008 etc . Either way adding the generic fortran http : stackoverflow.com questions tagged fortran would enhance this question s visibility . Comment : @francescalus Thanks +1 but I am restricted to fortran 95 .. . Answer : Reading in the data into a string buffer and removing unnecessary parts probably work . Another way is to use index to find and please see ref http : stackoverflow.com questions 15485531 how-to-read-comma-delimited-data-file-if-some-data-include-spaces also . In this case the data may contain any string before or after . Similar methods can be used to extract necessary parts in more complicated cases . Comment : You can also use len trim . . instead of len trim . . . Comment : @francescalus thank you then I will remove my comment above later . Btw is this len trim a function in fortran2008 Comment : len trim goes back to Fortran 90 http : dx.doi.org 10.1145 2701654.2701655 Comment : @francescalus hmm.. . pretty old . gcc.gnu.org onlinedocs gfortran LEN 005fTRIM.html https : gcc.gnu.org onlinedocs gfortran LEN 005fTRIM.html", "Question : I am currently running a computation model in Fortran . During calculation sometimes I got NaN Infinity and numbers larger than double precision shows as . And I need to detect them . I can detect NaN with the following command . I don t know how to detect Infinity and numbers larger than double precision . How do I do this Comment : The asterisks do not mean that numbers are larger than double precision but instead that they overflow the format specifier when printing . This can e.g . occur if you print a two digit integer using only one character . Comment : Do you have a complier which supports the ieee intrinsic modules Comment : Possible duplicate of Is there a standard way to check for Infinite and NaN in Fortran 90 95 http : stackoverflow.com questions 17389958 is-there-a-standard-way-to-check-for-infinite-and-nan-in-fortran-90-95 Comment : Alexander Vogt - thanks for your comment . Yes I will check about that . for the link you gave I already checked and my compiler doesn t recognise isinf . francescalus - I don t know how to check if my compiler supports ieee . Comment : If you re using gfortran before 5.0 you won t be . Many other compilers do but the best way would be to check the documentation or just try use ieee arithmetic end . That said the answers in the linked question give a good selection of possibilities . .. . Answer : Now I solved the asterisks with the following command although it may not be that efficient . Thanks Alexander Vogt . However I still cannot solve Infinity . I tried IEEE but my compiler didn t support . Thanks Comment : Can t you just check if result huge result Comment : for robustness you should catch -infinity too . abs x huge x catches all three + -inf and NAN I should say I don t know if that s guaranteed to work per standards", "Question : null .. . Answer : I am using FORTRAN 95 using Silverfrost Plato where I am trying to make real double precision variables . Currently I use double precision which gives accuracy up to 12 decimal digits . But I wanted to know if we could have digits accurate up to 16 digits . Interestingly when I tried using real kind 3 there were some residual values showing up in the last few digits that ended up making the results go wrong . I am unable to find a proper solution to this . Any help or links to relevant documentation would be greatly appreciated . Comment : What is the result-of selected real kind 16 Comment : Directly selecting kind 3 is not portable . It will actually not compile at all for most compilers . If you have a problem with your code show the code . Read stackoverflow.com questions 838310 fortran-90-kind-parameter http : stackoverflow.com questions 838310 fortran-90-kind-parameter", "Question : I am looking for a library for dealing with sparse matrices in fortran 90 95 . I only need very basic operations like matrix-vector multiplication . What do you suggest I use I have searched around and an extension to BLAS called sparse blas documented in chapter 3 of the blast technical forum specification : .. . .. . http : www.netlib.org blas blast-forum .. . .. . seems ideal . According to that document there should be a fortran 95 interface to the library . However I haven t been able to find an actual implementation of this specification anywhere that I was able to download . I am kind of getting the impression that the fortran 95 sparse blas specification isn t really implemented anywhere Not as open-source anyway . I also found a library called sparsekit : .. . .. . http : people.sc.fsu.edu jburkardt f src sparsekit sparsekit.html .. . .. . Anyone got any experience with either one of these two or any other sparse-matrix library for fortran 90 95 I would like advice on which one to use and also where to get it in the case of sparsekit the source code is available through the above link . Is there anything like a standard for sparse matrices like BLAS is for dense ones Cheers .. . .. . Arne Comment : F95 it being a minor revision of the language often goes under F90 . It s been a while since I ve done anything with large matrices but this seems to be people.sc.fsu.edu jburkardt f src blas2 blas2.html http : people.sc.fsu.edu jburkardt f src blas2 blas2.html the F90 version . Comment : Thanks Idigas but I don t think that s it . It seems to me what you re linking to is the BLAS library and that sparse blas is not part of that . For example there should be a subroutine according to the specification called duscr begin or possibly blas duscr begin which is the sub you use to initialize a sparse-matrix which I haven t found anywhere in the BLAS library . I even downloaded all the files from netlib.org sparse-blas index.html http : www.netlib.org sparse-blas index.html and did grep -i duscr begin .f without any luck . I found that very confusing . Comment : Ah could be . I only looked at it hastily last time . Comment : Actually I think the F90 interface to the sparse BLAS is exactly on the page you linked to . Just download the shell script package from : http : www.netlib.org toms 818 and run it through bin sh . The .f90 files will then be created . Let me know if you have no Bourne shell available e.g . if you work under Windows . Comment : physics.jacobs-university.de theine research splas http : physics.jacobs-university.de theine research splas .. . Answer : OK I ll partially answer my own questions : .. . .. . Where to find a full f95 implementation of Sparse BLAS was provided by @alexurba above : .. . .. . http : www.netlib.org toms 818 .. . .. . That was it This script creates all the source code in the folder that you run it I have never seen software provided in this manner before . To make the INSTALL script work I needed to do some changes : The install instructions tell you to edit the INSTALL script and choose the appropriate arch . Your choices are : AIX ALPHA CRAY HP NAG SGI and SUN . Neither of these seemed appropriate to me as I am using linux and the only fortran compiler I have on this computer is gfortran . I didn t quite understand the purpose of this option but what I did that worked was the following : .. . .. . 1 In INSTALL make up a new arch I called GNU by setting the variable SB ARCH GNU . 2 In SOFTWARE Makefile change FC f90 to FC gfortran 3 In TESTER copy the file Makefile.NAG to Makefile.GNU change FC f90 to FC gfortran and change all instances of the the word NAG to GNU . You ll probably also want to change the FFLAGS option in the Makefiles . After this I ran INSTALL and then TESTER test all and the tests spit out 0.000.. . as errors which I assume to mean everything is working . I must say I found finding this source code unusually difficult . Luckily this thread comes up quite high on google when searching fortran 90 sparse-matrix library now . My final solution : Ironically after finally finding a full implementation of Sparse BLAS I have decided that for my problem it is better to use a more direct approach since all I ll probably need is matrix-vector multiplication : Figure out what sparse-matrix representation to use Compressed Sparse Row CSR seems to be appropriate for my problem dig out the corresponding matrix-vector multiplication routine from the Sparse BLAS source code see how it wants it input and just use that directly in my code . Comment : I am at the point where and the tests spit out 0.000.. . as errors which I assume to mean everything is working . Now how to use this library or libraries where I need them Which files should I copy into the directory containing my own programs", "Question : I have downloaded a Fortran 90 95 adaptive mesh refinment library Paramesh http : www.physics.drexel.edu olson paramesh-doc Users manual amr.html and now I m trying to compile an example program that came with it . In the process I modified the Makefile to use gfortran instead of the Intel Fortran compiler . In the library code there is a module containing this snippet : .. . .. . Elsewhere there is .. . .. . which is causing this error http : stackoverflow.com questions 14296787 fortran-95-array-must-have-constant-shape-error : .. . .. . Would that code work if compiled using another compiler I know that with standard Fortran or at least the one used by gfortran requires that integer variables which are used to denote array sizes should have the parameter keyword attached to them . Is that not the case for other Fortran compilers Do other compiler include non-standard features such as this .. . Answer : In a way this isn t truly an answer . However any compliant Fortran compiler must have the ability to detect and report violations of specified constraints within the Fortran language specification . The constraint you come up against in the code is indeed one of those . So does there exist a Fortran compiler which has the ability to detect this but chooses not to I don t know . But I d think not . So what is the constraint Unless nfluxvar is a constant-expression iflux target will be an automatic object . Such an automatic object is not allowed in the scoping unit of a module - see C554 and surrounding text in Fortran 2008 . To answer the question in the title : ifort will complain loudly about such attempts .", "Question : Let s have an array A : : .. . .. . defined by several loops over m j k .. . .. . and now I want to select subset of A : : such that their values are negative and store them into array B : unknown length yet i.e . Since max1 and max2 are very large numbers I don t want to allocate B : of the length max1 max2 but exactly of the length that A : : contains negative values . Also I don t want to go through complicated loops over m j and k again . Thank you . Comment : Do you really require Fortran 90 or 95 or do you allow Fortran 2003 the automatic re-allocation the answers use is from Fortran 2003 and is very useful . Comment : Both are possible prefer Fortran 90 95 but need to deal with loops and indices as @roygvib presented his answer . .. . Answer : If pre-allocation of B to some fixed size is not desirable we can emulate a dynamic array by using automatic reallocation of an allocatable-array . In the simplest case we can expand B element-by-element by adding a new value . For example suppose that we have double loops over m and j select values that match a given condition and add tho values to B . Here the size of B grows from 0 1 2 .. . automatically . The result becomes .. . .. . In your case you can probably add desired values of A in a similar way for example .. . .. . .. . .. . A drawback of this approach is that it is very inefficient because B is re-allocated every time a new element is added . Although this is no problem for small B it may become a serious bottleneck for large B . In this case one can increase the size of B geometrically rather than increasing by 1 . For example the following code doubles the size of B as needed so as to decrease the number of reallocation . Some more notes : .. . .. . If a similar approach is used very often it is convenient to write a utility routine like resize that takes an allocatable-array as an argument and changes its size . If the efficiency truly matters it may be better to use allocate and move alloc explicitly in resize to eliminate one temporary array . The above code needs relatively new compilers that supports automatic reallocation of allocatable arrays in the left-hand side . If you use Intel fortran it is necessary to add the -assume realloc lhs option . If the size of B can become rather large you will also need -heap-arrays option . For gfortran or Oracle fortran no special options are necessary . We should not attach colon in the left-hand side i.e . B : B m is NG .. . For more details about dynamic-arrays e.g . growth rate please see Wiki https : en.wikipedia.org wiki Dynamic array page .", "Question : How do I get the contents of a directory in Fortran 95 Comment : What do you mean I have to pad it or otherwise it does not go through . What have you tried so far . Is it sufficient to print the contents of a directory to screen or do you need to store the list of files in a variable Comment : @Chris : I was referring to the question itself too short to be accepted by SO . .. . Answer : To be pedantic you don t . There s no intrinsic or such in Fortran 95 that helps you . On a POSIX system and a recent Fortran compiler you can use ISO C BINDING to create interfaces to the POSIX opendir and readdir functions or readdir r if you need thread-safety which allow you to iterate over the directory entries . Comment : Does this language allow to do anything useful except multiplying numbers Comment : For comparison can you point out where-in the C or C++ standard one can find the functionality to list the contents of a directory Comment : one would expect that a standard-library for such trivial operations is available out of the box for a language of such age ." ] }
[ "yes-answer-long", "yes-answer-short" ]
fortran
UNK_RELATION
jigsaw@module@66
jigsaw -- project jigsaw aims to design and implement a standard @placeholder system for the java se platform .
{ "confidence": [ 67.80017852783203, 51.51371765136719, 50.78443145751953, 49.79961395263672, 48.546470642089844, 47.56464385986328, 46.84105682373047, 45.414485931396484, 45.21821594238281, 45.094085693359375, 44.93675231933594, 44.89725875854492, 44.753684997558594, 44.52922058105469, 43.527320861816406, 42.800048828125, 41.77854537963867, 41.77854537963867, 41.61843490600586, 41.090919494628906, 40.85887908935547, 40.73727798461914, 40.06560516357422, 39.77255630493164, 39.77255630493164, 39.73762512207031, 39.56529998779297, 39.429931640625, 39.429931640625, 39.429931640625, 39.429931640625, 39.429931640625, 39.23127365112305, 37.95029067993164, 37.473899841308594, 36.663551330566406, 36.248600006103516, 36.248600006103516, 36.248600006103516, 35.963809967041016, 35.963809967041016, 35.963809967041016, 35.67966079711914, 34.565792083740234, 34.565792083740234, 33.387184143066406, 33.387184143066406, 32.82590866088867, 32.82590866088867, 32.82590866088867, 31.963363647460938, 31.963363647460938, 31.963363647460938, 31.963363647460938, 31.963363647460938, 31.963363647460938, 31.963363647460938, 31.963363647460938, 31.963363647460938, 31.963363647460938, 30.914955139160156, 30.914955139160156, 30.791385650634766, 30.791385650634766, 29.386737823486328, 29.386737823486328, 29.386737823486328, 29.360837936401367, 29.34070587158203, 29.34070587158203, 29.311344146728516, 29.311344146728516, 29.17198944091797, 28.284048080444336, 28.000011444091797, 28.000011444091797, 27.89065933227539, 27.2254638671875, 26.764080047607422, 26.495838165283203, 26.40323829650879, 26.40323829650879, 26.40323829650879, 26.40323829650879, 26.40323829650879, 25.98798370361328, 25.541244506835938, 25.231258392333984, 25.088153839111328, 24.437122344970703, 24.42392349243164, 23.826610565185547, 23.826610565185547, 23.488719940185547, 22.866554260253906, 22.743247985839844, 22.669599533081055, 21.03857421875, 20.783123016357422, 20.352310180664062 ], "content": [ "From the official site : .. . .. . The goal of this Project is to design and implement a standard module system for the Java SE Platform and to apply that system to the Platform itself and to the JDK .", ".. . .. . .. . .. . If and when a future version of the Java SE Platform includes a speci c module system then Sun will provide a means to migrate Jigsaw modules up to that standard .", "Java 8 with Project Jigsaw brings a module system to the SDK .", "Jigsaw is out of Java 8 .", "In addition Project Jigsaw is now targeted for Java 9 http : openjdk.java.net projects jigsaw .", "I am trying to create cross-platform platform independent executables for my JAVA-9 application project jigsaw .", "When researching I found out about OSGI and the Java Platform Module System or Project Jigsaw .", "Furthermore the Jigsaw project will have it goals and requirements rethought mail.openjdk.java.net pipermail jigsaw-dev 2013-August http : mail.openjdk.java.net pipermail jigsaw-dev 2013-August 003328.html and perhaps be part of Java 9 .", "Is it possible to get Jigsaw for your project even though its not a part of the Java platform yet", "The answer given to the question OSGi Java Modularity and Jigsaw http : stackoverflow.com a 7500268 235273 says that Jigsaw module system is probably necessary for JRE .", "Jigsaw was just merged into JDK9 on build 111 http : mreinhold.org blog jigsaw-module-system .", "As written in the comments already Java 8 will not ship with Jigsaw .", "The rationale behind project Jigsaw and how it relates to OSGi was outlined by the Jigsaw team in Java Posse Podcast 259 http : www.javaposse.com index.php post 5Fid 492239 .", "I think JAVA9 project jigsaw is a paradigm shift in the Java technology .", "This is not a OSGi vs Jigsaw .", "One of Java 9 s largest features will be a module system defined by Project Jigsaw .", "Why was Jigsaw cut from J7", "Should we consider Jigsaw for modularization", "Documentation .. . .. . Interestingly enough neither the State of the Module System http : openjdk.java.net projects jigsaw spec sotms nor the Jigsaw Quick Start Guide http : openjdk.java.net projects jigsaw quick-start address this issue .", "Jigsaw still doesn t exist in any released version of Java .", "From reading the Jigsaw project page I think it s the former .", "Here you go bro openjdk.java.net projects jigsaw http : openjdk.java.net projects jigsaw", "Citing http : blogs.oracle.com mr entry jigsaw : .. . .. . OSGi is not at all integrated with the Java language however having been built atop the Java SE Platform rather than from within it .", "Taking into consideration Project Jigsaw for Java 8 to modularize the JDK will a new Swing Framework be able to be taken into consideration", "javacodegeeks.com 2015 04 http : www.javacodegeeks.com 2015 04 how-java-9-and-project-jigsaw-may-break-your-code.html", "The Jigsaw page says : Relationship to JSR 294 Working documents posted here should be considered as drafts of material subject to further discussion within that EG . openjdk.java.net projects jigsaw http : openjdk.java.net projects jigsaw", "See Slides 41-42 of this deck http : openjdk.java.net projects jigsaw talks jigsaw-under-the-hood-j1-2015.pdf .", "If Jigsaw can do what it is said to do i.e .", "In any case OSGi should run fine with Jigsaw .", "In fact it s the intention of Jigsaw to be interoperable somehow with both .", "I am on build 109 of JDK9 with the Jigsaw build .", "I am creating a jigsaw puzzle solver .", "Also note that there is the project Penrose : openjdk.java.net projects penrose http : openjdk.java.net projects penrose The goal of this Project is to explore and implement interoperability between the Jigsaw Project and OSGi .", "These projects do not entirely overlap and the introduction of Jigsaw does not sound the death knell for OSGi - the scope of OSGi goes beyond anything Jigsaw will attempt .", "Sun is putting a lot of effort behind modularising the JDK in the form of Jigsaw http : openjdk.java.net projects jigsaw and insinuating that it should be the module format of choice for other Java developers as well .", "I am exploring Project Jigsaw @ JDK 9 almost all Java developers are thinking of how Oracle going to bring modularity for Java 9 .", "How sure is the community that Jigsaw will get implemented next year in J8", "JSR294 is effectively dead and has no bearing on Jigsaw or vice versa .", "The JCP page lists it as inactive but work is apparently continuing as part of Jigsaw .", "slideshare.net mfrancis http : www.slideshare.net mfrancis java-8-modules-jigsaw-and-osgi-neil-bartlett almost the same contents .", "So this means we don t know what Jigsaw will be nor when it will appear in Java .", "Jigsaw will be used by the JRE to modularize the JRE read : rt.jar itself but it s not supposed to be used by Java developers .", "The main differences as of March 2015 are : .. . .. . Class loaders - Jigsaw will not use class loader it s up to runtimes such as application servers or OSGi to work with modules and class loaders .. . Dependencies - Jigsaw will allow to specify dependency on modules by name but not at the package level .. . Dynamic Services - The runtime services model provided by OSGi will not be provided by Jigsaw .. . .. . Jigsaw is not intended to replace and or compete with any other runtime or build time module system such as OSGi or Maven .", "It looks like Sun are giving up on the JSR and just doing their own thing the mailing list is dead as a dodo and the last message says Go and discuss Jigsaw on the Jigsaw mailing list .", ".. . .. . requiring Jigsaw in the core code would mean JUnit wouldn t work on Android .. . .. . I m wondering what exactly would break when Jigsaw would be applied to Android", "However it is our understanding that Jigsaw in Java 9 is going to break JSR-305 annotations one package in two modules is not allowed .", "Playing around with jigsaw in jdk9 I m trying to find out the minimal memory-footprint for a java application to run .", "My understanding is that both OSGi and Jigsaw can be used to write normal modular Java applications and not just ser based apps servlets etc right", "Also at JavaOne 2013 I attended a talk by Mark Reinhold and it sounded that the way Jigsaw is heading to is not generally open for Java developers i.e .", "In case anyone wonders why the strange name foo.bar : I m experimenting with JDK 1.9 Jigsaw and the new Java modules require directory names with dots .", "I therefore regard Jigsaw as a kind of extreme measure to keep the JRE code alive while splitting it up .", "Finally : OSGi exists whereas Jigsaw does not exist yet and may never exist .", "In my opinion Jigsaw is a combination of a compromise of what s doable in the JDK and previous bad relationship between SUN and the OSGi guys .", "There s a difference to what the Jigsaw page says and what the 294 group is supposed to be working on .", "There s much more to Jigsaw than the OSGi team is in a position to provide language class and JVM implementation changes .", "Jigsaw and OSGi are trying to solve the same problem : how to allow coarser-grained modules to interact while shielding their internals .", "But if you have a higher-level model like Jigsaw you can easily manage different versions of a JAR in different modules .", "One of the reasons given was that Jigsaw should not compete with existing solutions like Maven OSGi etc .", "Calling handler.getClass .newInstance on the handler instance returned by your getURLStreamHandler fails with a Jigsaw-specific IllegalAccessException .", "What you are looking for are automatic modules http : openjdk.java.net projects jigsaw spec sotms automatic-modules .", "Just found an article from pre-Java 7 about Jigsaw and thought how perfect it would be for some code I was writing and figured SURELY it was in Java 8....Nope .", "I have the following code to retrieve the default URLStreamHandlers for http and https which works in Java 8 by accessing the static package scoped method URL.getURLStreamHandler : .. . .. . Will this still be possible in Java 9 with jigsaw or will modifiying the visibility in this way be prohibited", "view and permits were keywords in an earlier Jigsaw prototype but they ve been simplified out of existence .", "I am working on a jigsaw puzzle solver that should work for any size puzzle .", "Yes services http : openjdk.java.net projects jigsaw quick-start services is what you re looking for .", "Before Jigsaw it was quite easy to replace one or several classes in OpenJDK to perform some test or make a contribution .", "I m guessing here.. . Did you create a module-info.java as explained in SotmS http : openjdk.java.net projects jigsaw spec sotms", "A more recent one is the list of open issues http : openjdk.java.net projects jigsaw spec issues which explicitly mentions cyclic dependencies http : openjdk.java.net projects jigsaw spec issues CyclicDependences : .. . .. . The current draft disallows cycles when the module graph is initially resolved at compile-time link time and run time .", "Jigsaw lets you access certain types and as long as you limit your interaction to that type s API public or via reflection everything is fine .", "They have to go on the class path where they get bunched into the unnamed module http : openjdk.java.net projects jigsaw spec sotms the-unnamed-module .", "My position is that something like Jigsaw is probably necessary for the JRE only but that it will create far more problems than it claims to solve if used by other Java libraries or apps .", "But I also heard from someone attending the BOF later that day that there was some demand from the community to open Jigsaw for Java developers but I haven t heard any updates on that .", "guava-19.0.jar in a folder libs - see my example project https : github.com CodeFX-org demo-jigsaw-advent-calendar blob 04-automatic-modules compileAndRun.sh L50 .", "The proposed additions to the language and VM for the module system are described here http : cr.openjdk.java.net mr jigsaw spec lang-vm.html : .. . .. . module requires exports to uses provides and with are restricted keywords i.e .", "Experimentation .. . .. . I ve created a little demo project on GitHub https : github.com CodeFX-org lab-jigsaw-cyclic-dependencies that contains two cycles pair : two - one - two triple : three - two - one - three .", "I can t find good official sources but Jigsaw Project documentation seems to suggest that they are modifiers rather than keywords.. . Hopefully they aren t reserved when used out of context of module .", "From the excellent State of the Module System http : openjdk.java.net projects jigsaw spec sotms accessibility emphasis mine : .. . .. . The Java compiler and virtual-machine consider the public types in a package in one module to be accessible by code in some other module only when .. . .. . .. . Note that it only mentions types .", "These features will benefit application developers library developers and implementors of the Java SE Platform itself directly and also indirectly since they will enable a scalable platform greater platform integrity and improved performance .", "The compilation command reports tons of errors starting like this : .. . .. . And even if I compile with older JDK then JVM cannot start : .. . .. . How to make patches for JDK with Jigsaw", "When reading slides from the Project Jigsaw : Under the Hood at JavaOne 2015 I noticed the following source code : .. . .. . What is interesting here to me is that the file ends in .java and seems to use two new keywords : module and exports .", "Now that I finally understand what OSGi is I just don t get how something like Jigsaw has taken 20+ years to come to fruition and then how that could have been canned from a release .", "But for those of you who absolutely insist that a SO question be backed with some code segment : .. . .. . Thanks to anybody who can weigh-in on this OSGi Jigsaw classloader namespace JAR hell stuff", "Finally the published requirements for JSR376 http : openjdk.java.net projects jigsaw spec reqs 02 state that OSGi interop is required.. . so adopting OSGi remains a safe choice and today the only practical choice .", "Jigsaw itselfs currently adds some setup work during startup but enables startup optimizations elsewhere e.g . JDK-8152641 https : bugs.openjdk.java.net browse JDK-8152641 .", "require guava - see here https : github.com CodeFX-org demo-jigsaw-advent-calendar blob 04-automatic-modules src org.codefx.demo.advent.factory.quote module-info.java L4 .", "But if someone were to design the java .", "Will the Java Platform module System allow Modules to be added like Plugins", "Trying the multi-module compilation http : openjdk.java.net projects jigsaw quick-start multimodulecompile as shown in the quick start guide these are the results : .. . .. . So you can t even compile the modules let alone use them in a configuration .", "Is JavaFX replacing Swing as the new client UI library for Java SE", "We also have module exports provides uses with to and requires explained here http : openjdk.java.net projects jigsaw spec sotms : .. . .. . The module system could identify uses of services by scanning the class files in module artifacts for invocations of the ServiceLoader : : load methods but that would be both slow and unreliable .", "Java 9 will include a module system for Java .", "Note that the -Xpatch syntax you are using is an old form that will disappear soon - see the mailing list http : mail.openjdk.java.net pipermail jigsaw-dev 2016-March 007079.html .", "Using example 9 from : https : github.com AdoptOpenJDK jdk9-jigsaw I m able to make a very small custom jdk with an application which just prints hallo world .", "JSR 376 Java Platform Module System is still forming its expert group and hasn t even started on a first draft yet .", "Closing Remarks .. . .. . .. . .. . In the initial edition of The State of the Module System http : openjdk.java.net projects jigsaw spec sotms report Mark Reinhold describes the specific goals of the module system as following : .. . .. . Reliable configuration to replace the brittle error-prone class-path mechanism with a means for program components to declare explicit dependences upon one another along with .. . Strong encapsulation to allow a component to declare which of its public types are accessible to other components and which are not .", "However Swing will remain part of the Java SE specification for the foreseeable future and therefore included in the JRE .", "I am a little bit confused about the Specifications of the Java Platform Module System .", "I could copy an original file from OpenJDK source for example java util ArrayList.java into src java util add any changes I want then compile it normally outputting to mypatch directory : .. . .. . After that I could launch JVM with -Xbootclasspath p to replace original ArrayList with the patched one : .. . .. . However this does not work anymore since Jigsaw integration in Java 9-ea+111 .", "If you are planning a project be aware of this statement from the JDK 8 public review https : jcp.org en jsr detail id 337 : The original request for this Specification proposed to include a module system and to use that system to modularize the Platform itself .", "IDE developer plugin developer Build System and of course groud level java developer need to understand new java systems ." ] }
{ "confidence": [ 74.88570404052734, 68.01400756835938, 66.8672103881836, 60.431175231933594, 59.22002029418945, 59.01952362060547, 55.35721969604492, 51.931365966796875, 51.76716995239258, 51.044883728027344, 50.369422912597656, 49.126373291015625, 48.99041748046875, 48.586307525634766, 47.69536209106445, 47.69536209106445, 46.42989730834961, 45.252403259277344, 44.84789276123047, 43.9093132019043 ], "content": [ "Question : Java s package management system always seemed simple and effective to me . It is heavily used by the JDK itself . We have been using it to mimic the concept of namespaces and modules . What is Project Jigsaw trying to fill in From the official site : .. . .. . The goal of this Project is to design and implement a standard module system for the Java SE Platform and to apply that system to the Platform itself and to the JDK . .. . Answer : Jigsaw and OSGi are trying to solve the same problem : how to allow coarser-grained modules to interact while shielding their internals . In Jigsaw s case the coarser-grained modules include Java classes packages and their dependencies . Here s an example : Spring and Hibernate . Both have a dependency on a 3rd party JAR CGLIB but they use different incompatible versions of that JAR . What can you do if you rely on the standard JDK Including the version that Spring wants breaks Hibernate and visa versa . But if you have a higher-level model like Jigsaw you can easily manage different versions of a JAR in different modules . Think of them as higher-level packages . If you build Spring from the GitHub source you ll see it too . They ve redone the framework so it consists of several modules : core persistence etc . You can pick and choose the minimal set of module dependencies that your application needs and ignore the rest . It used to be a single Spring JAR with all the .class files in it . Comment : What if you still needed to use the exact same module but two different versions of it Shouldn t they just add some kind of support so two version of the same classes can coexist Comment : this post is misleading given what is actually slated to be released in java-9 . It may have been accurate at the time of writing . Comment : It was written FOUR YEARS AGO . Yes it was accurate on the day it was written . My apologies for not being clairvoyant . Are we downvoting for failing to predict the future Were all the other answers downvoted as well Unjust .", "Question : Sun is putting a lot of effort behind modularising the JDK in the form of Jigsaw http : openjdk.java.net projects jigsaw and insinuating that it should be the module format of choice for other Java developers as well . The only notable player who is using this is NetBeans and derivative applications . On the other hand the industry has standardised around OSGi with all of the major application vendors basing their runtimes on the module platform even Sun s own Glassfish . There s even a port of NetBeans to use OSGi as the module system instead of NetBeans own modules . Even Maven is working towards becoming an OSGi runtime . Is it just NIH licensing or another reason Comment : Do you have a reference for the insinuating that it should .. . part of your question The page you link has the tone of a research project s homepage not that used to introduce a key technology that Sun wants everyone to use . .. . Answer : Citing http : blogs.oracle.com mr entry jigsaw : .. . .. . OSGi is not at all integrated with the Java language however having been built atop the Java SE Platform rather than from within it . .. . This last problem can be xed . Sun plans now to work directly with the OSGi Alliance so that a future version of the OSGi Framework may fully leverage the features of JSR 294 and thereby achieve tighter integration with the language . .. . .. . .. . .. . If and when a future version of the Java SE Platform includes a speci c module system then Sun will provide a means to migrate Jigsaw modules up to that standard . In the meantime we ll actively seek ways in which to interoperate with other module systems and in particular with OSGi . Comment : Ah that s the blog entry I was looking for and couldn t find : Comment : The problem is that that isn t happening . JSR294 is effectively dead and has no bearing on Jigsaw or vice versa . Whether the module keyword can end up being used is somewhat orthogonal to the problem of a module system itself . Comment : @AlBlue - the status of JSR294 confuses me too . The JCP page lists it as inactive but work is apparently continuing as part of Jigsaw . I think you are mistaken about them being unrelated . The Jigsaw page says : Relationship to JSR 294 Working documents posted here should be considered as drafts of material subject to further discussion within that EG . openjdk.java.net projects jigsaw http : openjdk.java.net projects jigsaw Comment : There s a difference to what the Jigsaw page says and what the 294 group is supposed to be working on . It looks like Sun are giving up on the JSR and just doing their own thing the mailing list is dead as a dodo and the last message says Go and discuss Jigsaw on the Jigsaw mailing list .", "Question : Java 8 with Project Jigsaw brings a module system to the SDK . I see it as a good thing as it s part of the package built-in . OSGi also provides a module system but requires a container . But apart from that what are the major difference among them . If I use OSGi will I able to run it using the standard JDK 8 release Will OSGi relevant when the default SDK includes such capabilities My understanding is that both OSGi and Jigsaw can be used to write normal modular Java applications and not just ser based apps servlets etc right The answer given to the question OSGi Java Modularity and Jigsaw http : stackoverflow.com a 7500268 235273 says that Jigsaw module system is probably necessary for JRE . By JRE I assume the OP means the Java standard libraries like IO CORBA RMI which are written in Java or is it the class-library implementations that underlies these which are the target From reading the Jigsaw project page I think it s the former . If it s the later how does it even help other Java developers who write Java code The class libraries are written in C C++ . Could anyone please clarify This is not a OSGi vs Jigsaw . I want to really understand which one to use . If I am to write a new application be it desktop or server I would like to be based on technologies that might not get obsolete by standard implementations and go abandon-ware . I am not saying OSGi is obsolete I like OSGi . I am looking at the big picture what the future directions are for OSGi itself . Comment : If you are planning a project be aware of this statement from the JDK 8 public review https : jcp.org en jsr detail id 337 : The original request for this Specification proposed to include a module system and to use that system to modularize the Platform itself . That feature was however deferred to a future release in order to allow sufficient time for the broad evaluation review and feedback which such a profound change to the Platform demands . Comment : Yes . Jigsaw is out of Java 8 . Furthermore the Jigsaw project will have it goals and requirements rethought mail.openjdk.java.net pipermail jigsaw-dev 2013-August http : mail.openjdk.java.net pipermail jigsaw-dev 2013-August 003328.html and perhaps be part of Java 9 . So this means we don t know what Jigsaw will be nor when it will appear in Java . So it hard to make any comparison to OSGi which is here now . Comment : Also note that there is the project Penrose : openjdk.java.net projects penrose http : openjdk.java.net projects penrose The goal of this Project is to explore and implement interoperability between the Jigsaw Project and OSGi . .. . Answer : As written in the comments already Java 8 will not ship with Jigsaw . Maybe Java 9 . Also at JavaOne 2013 I attended a talk by Mark Reinhold and it sounded that the way Jigsaw is heading to is not generally open for Java developers i.e . Jigsaw will be used by the JRE to modularize the JRE read : rt.jar itself but it s not supposed to be used by Java developers . One of the reasons given was that Jigsaw should not compete with existing solutions like Maven OSGi etc . Another reason was to shut down access to sun . internal packages . But I also heard from someone attending the BOF later that day that there was some demand from the community to open Jigsaw for Java developers but I haven t heard any updates on that . In any case OSGi should run fine with Jigsaw . But a lot libraries will break on Java 9 if they continue to use old sun . packages or other internal JRE code . Update March 2015 .. . .. . At EclipseCon 2015 Mark Reinhold gave a keynote with an update on Java 9 . Java 9 will include a module system for Java . It is intended for the JRE JDK and will also be available to any Java application that would like to use it . However the scope changed a bit . The main differences as of March 2015 are : .. . .. . Class loaders - Jigsaw will not use class loader it s up to runtimes such as application servers or OSGi to work with modules and class loaders .. . Dependencies - Jigsaw will allow to specify dependency on modules by name but not at the package level .. . Dynamic Services - The runtime services model provided by OSGi will not be provided by Jigsaw .. . .. . Jigsaw is not intended to replace and or compete with any other runtime or build time module system such as OSGi or Maven . In fact it s the intention of Jigsaw to be interoperable somehow with both . Comment : Just found an article from pre-Java 7 about Jigsaw and thought how perfect it would be for some code I was writing and figured SURELY it was in Java 8....Nope .", "Question : Sun is putting a lot of effort behind modularising the JDK in the form of Jigsaw http : openjdk.java.net projects jigsaw and insinuating that it should be the module format of choice for other Java developers as well . The only notable player who is using this is NetBeans and derivative applications . On the other hand the industry has standardised around OSGi with all of the major application vendors basing their runtimes on the module platform even Sun s own Glassfish . There s even a port of NetBeans to use OSGi as the module system instead of NetBeans own modules . Even Maven is working towards becoming an OSGi runtime . Is it just NIH licensing or another reason Comment : Do you have a reference for the insinuating that it should .. . part of your question The page you link has the tone of a research project s homepage not that used to introduce a key technology that Sun wants everyone to use . .. . Answer : The rationale behind project Jigsaw and how it relates to OSGi was outlined by the Jigsaw team in Java Posse Podcast 259 http : www.javaposse.com index.php post 5Fid 492239 . These projects do not entirely overlap and the introduction of Jigsaw does not sound the death knell for OSGi - the scope of OSGi goes beyond anything Jigsaw will attempt . There s much more to Jigsaw than the OSGi team is in a position to provide language class and JVM implementation changes . The design of OSGi is based on the current JVM design - the changes to the JVM will benefit everyone . At least that is my take from what I ve read http : www.osgi.org blog 2009 08 simple-module-system.html .", "Question : Java s package management system always seemed simple and effective to me . It is heavily used by the JDK itself . We have been using it to mimic the concept of namespaces and modules . What is Project Jigsaw trying to fill in From the official site : .. . .. . The goal of this Project is to design and implement a standard module system for the Java SE Platform and to apply that system to the Platform itself and to the JDK . .. . Answer : Based on Mark Reinhold s keynote speech at Devoxx Belgium https : www.youtube.com watch v l1s7R85GF1A project jigsaw is going to address two main pain points : .. . .. . 1 . Classpath .. . 2 . Massive Monolithic JDK .. . .. . What s wrong with Classpath .. . .. . We all know about the JAR Hell https : en.wikipedia.org wiki Java Classloader . This term describes all the various ways in which the classloading process can end up not working . The most known limitations of classpath are : .. . .. . It s hard to tell if there are conflicts . build tools like maven can do a pretty good job based on artifact names but if the artifacts themselves have the different names but same contents there could be a conflict . The fundamental problem with jar files is that they are not components . They re just bunch of file containers that will be searched linearly . Classpath is a way to lookup classes regardless of what components they re in what packages they re in or their intended use . Massive Monolithic JDK .. . .. . .. . .. . The big monolithic nature of JDK causes several problems : .. . .. . It doesn t fit on small devices . Even though small IoT type devices have processors capable of running an SE class VM but they do not have necessarily the memory to hold all of the JDK especially when the application only uses small part of it . It s even a problem in the Cloud . Cloud is all about optimizing the use of hardware if you got thousands of images containing the whole JDK but applications only use small part of it it would be a waste . Modules : The Common Solution .. . .. . .. . .. . To address the above problems we treat modules as a fundamental new kind of Java program component . A module is a named self-describing collection of code and data . Its code is organized as a set of packages containing types i.e . Java classes and interfaces its data includes resources and other kinds of static information . To control how its code refers to types in other modules a module declares which other modules it requires in order to be compiled and run . To control how code in other modules refers to types in its packages a module declares which of those packages it exports . The module system locates required modules and unlike the class-path mechanism ensures that code in a module can only refer to types in the modules upon which it depends . The access-control mechanisms of the Java language and the Java virtual-machine prevent code from accessing types in packages that are not exported by their defining modules . Apart from being more reliable modularity could improve performance . When code in a module refers to a type in a package then that package is guaranteed to be defined either in that module or in precisely one of the modules read by that module . When looking for the definition of a specific type there is therefore no need to search for it in multiple modules or worse along the entire class path . Closing Remarks .. . .. . .. . .. . In the initial edition of The State of the Module System http : openjdk.java.net projects jigsaw spec sotms report Mark Reinhold describes the specific goals of the module system as following : .. . .. . Reliable configuration to replace the brittle error-prone class-path mechanism with a means for program components to declare explicit dependences upon one another along with .. . Strong encapsulation to allow a component to declare which of its public types are accessible to other components and which are not . These features will benefit application developers library developers and implementors of the Java SE Platform itself directly and also indirectly since they will enable a scalable platform greater platform integrity and improved performance .", "Question : I am currently evaluating possibilities to develop a plugin concept for a desktop application . When researching I found out about OSGI and the Java Platform Module System or Project Jigsaw . I am a little bit confused about the Specifications of the Java Platform Module System . Will the Java Platform module System allow Modules to be added like Plugins Will it possible to declare optional Modules and access their services Will it be possible for Modules to have their own classpath and be separated from the rest of the application Will it be possible for third party programmers to implement plugins that seamlessly integrate into an existing application I would be very thankful if anyone could help me understand the specification . .. . Answer : 1 . Yes services http : openjdk.java.net projects jigsaw quick-start services is what you re looking for . 2 . Yes each module has its own modulepath . 3 . Too broad .", "Question : Taking into consideration Project Jigsaw for Java 8 to modularize the JDK will a new Swing Framework be able to be taken into consideration Consideration means : .. . .. . someone actually rewriting it .. . including it into a JDK release .. . .. . I m thinking since modules can be included into the JDK a new framework for Swing can be created and delivered for use to new applications developers while for the legacy applications the current Swing framework would be included . Would rewriting a new Swing and including it into the new JDK be an option for Java 8 What are your opinions and considerations to take into account for this task Comment : I highly doubt that this will find its way into Java 8 . Even if it s wanted and planned which I m not sure of I m pretty sure that such a project would not be done in time for Java 8 which is expected relatively soon . Java 8 should deliver all the missing features that Java 7 didn t include and that s already a pretty long list . Comment : will it be technically doable even if not practically accessible Comment : If Jigsaw can do what it is said to do i.e . allow real modularity including incompatible updates that don t break older versions then it will technically doable . Comment : On the other hand : If you want to do an incompatible break from earlier versions then why restrict yourself to Swing You could just as easily switch to an entirely different system altogether SWT for example . Comment : was using Swing as an example could be anything else . the important thing i was looking for is if the new JDK modularity provides the ability to pack Swing for old applications and SWT for example for new applications .. . Answer : It was not included in Java 8 and is highly unlikely that it will even be considered for Java 9 . According this JavaFX page http : www.oracle.com technetwork java javafx overview faq-1446554.html 6 JavaFX is the replacement for Swing : .. . .. . 6 . Is JavaFX replacing Swing as the new client UI library for Java SE .. . Yes . However Swing will remain part of the Java SE specification for the foreseeable future and therefore included in the JRE . While we recommend developers to leverage JavaFX APIs as much as possible when building new applications it is possible to extend a Swing application with JavaFX allowing for a smoother transition . In addition Project Jigsaw is now targeted for Java 9 http : openjdk.java.net projects jigsaw .", "Question : In Java 9 will cyclic modules be allowed If no what are the reasons Comment : If two or more modules have a cyclical dependency they re not separate modules - you can t have one without the other . Comment : See Slides 41-42 of this deck http : openjdk.java.net projects jigsaw talks jigsaw-under-the-hood-j1-2015.pdf . Comment : I updated my answer http : stackoverflow.com a 35693883 2525313 to include more current information . .. . Answer : Most likely not . Documentation .. . .. . Interestingly enough neither the State of the Module System http : openjdk.java.net projects jigsaw spec sotms nor the Jigsaw Quick Start Guide http : openjdk.java.net projects jigsaw quick-start address this issue . One source found by Andy http : stackoverflow.com questions 35688995 will-cyclic-module-dependencies-be-possible-in-java-9 comment59056350 35688995 is a JavaOne talk by Alex Buckley see him explain it here https : www.youtube.com watch v 8RhwmJlZQgs t 10h01m24s . A more recent one is the list of open issues http : openjdk.java.net projects jigsaw spec issues which explicitly mentions cyclic dependencies http : openjdk.java.net projects jigsaw spec issues CyclicDependences : .. . .. . The current draft disallows cycles when the module graph is initially resolved at compile-time link time and run time . Cycles can arise later on at run time if readability edges are added for automatic modules or via reflection . .. . This constraint is not however a documented requirement .. . . Justification .. . .. . Cyclic dependencies are bad mkay . .. . .. . They emerge when two entities methods classes modules projects .. . collaborate but are not sufficiently decoupled . For users as well as maintainers this coupling means that they can not use or improve one without considering the other . But this is exactly the benefit modularization is trying to achieve . From the issue list linked above : .. . .. . The rationale for disallowing cycles during resolution is that it makes the module graph easier to reason about it simplifies the module system itself and that philosophically any modules involved in a cycle are logically one module anyway so they should be defined as such in the first place . Experimentation .. . .. . I ve created a little demo project on GitHub https : github.com CodeFX-org lab-jigsaw-cyclic-dependencies that contains two cycles pair : two - one - two triple : three - two - one - three . Trying the multi-module compilation http : openjdk.java.net projects jigsaw quick-start multimodulecompile as shown in the quick start guide these are the results : .. . .. . So you can t even compile the modules let alone use them in a configuration . Comment : Cycles can arise.. . for automatic modules So that explains slide 32", "Question : null .. . Answer : I was reading through the recent changes in the Junit-Lambda https : github.com junit-team junit-lambda wiki wiki when I came across this comment https : github.com junit-team junit-lambda wiki Suggestions-for-JUnit-Lambda compare de65fe4 5E...de65fe4 . Should we consider Jigsaw for modularization .. . .. . requiring Jigsaw in the core code would mean JUnit wouldn t work on Android .. . .. . I m wondering what exactly would break when Jigsaw would be applied to Android Will libraries after jdk9 not work any longer on Android Will libraries developed with Android in mind be usable with Jigsawed code Googling this brings up all kinds of apps so that doesn t help . Comment : Here you go bro openjdk.java.net projects jigsaw http : openjdk.java.net projects jigsaw Comment : javacodegeeks.com 2015 04 http : www.javacodegeeks.com 2015 04 how-java-9-and-project-jigsaw-may-break-your-code.html", "Question : One of Java 9 s largest features will be a module system defined by Project Jigsaw . When reading slides from the Project Jigsaw : Under the Hood at JavaOne 2015 I noticed the following source code : .. . .. . What is interesting here to me is that the file ends in .java and seems to use two new keywords : module and exports . What other keywords will be introduced in Java 9 How will backwards compatibility be dealt with i.e . functions or variables named module Comment : I think at some point we re also going to get ref and any . Comment : @PaulBoddington certainly not in Java 9 for any keyword . That is Valhalla ie . 10 or later . Comment : How will backwards compatibility be dealt with presumably the same as always : you have to compile affected files with an older source version .. . Answer : For the backward compatibility part of the question . I think JAVA9 project jigsaw is a paradigm shift in the Java technology . so that java9 will not be backward compatible but you can easily transform your non-modular dependency with the modular version of the same library . concept of No-Pain No-Gain will work here . Everyone has to upgrade transform to take advantage of the new modular java . IDE developer plugin developer Build System and of course groud level java developer need to understand new java systems . JAVA9 advocates for clean dependency . it also provide a brand new way to secure your code by private modules . even reflection can not access the modules not exposed by the library API owner . There are two approach to use non-modular LIB APIs . 1 . Top-Down approach .. . 2 . Bottom-Up approach lot of pain here to implement .. . .. . second approach make a very clean module dependency hierarchy .", "Question : One of Java 9 s largest features will be a module system defined by Project Jigsaw . When reading slides from the Project Jigsaw : Under the Hood at JavaOne 2015 I noticed the following source code : .. . .. . What is interesting here to me is that the file ends in .java and seems to use two new keywords : module and exports . What other keywords will be introduced in Java 9 How will backwards compatibility be dealt with i.e . functions or variables named module Comment : I think at some point we re also going to get ref and any . Comment : @PaulBoddington certainly not in Java 9 for any keyword . That is Valhalla ie . 10 or later . Comment : How will backwards compatibility be dealt with presumably the same as always : you have to compile affected files with an older source version .. . Answer : The proposed additions to the language and VM for the module system are described here http : cr.openjdk.java.net mr jigsaw spec lang-vm.html : .. . .. . module requires exports to uses provides and with are restricted keywords i.e . they are keywords solely where they appear as terminals in ModuleDeclaration and are identifiers everywhere else . If you presently have a method named module or any of the other keywords listed here it will continue to compile . At this time there are no other new keywords restricted or otherwise slated for appearance in Java 9 . view and permits were keywords in an earlier Jigsaw prototype but they ve been simplified out of existence . Comment : It s very nice to see the Mark Reinhold here", "Question : I am trying to create cross-platform platform independent executables for my JAVA-9 application project jigsaw . I think jlink command will create only platform specific executable runtime . .. . Answer : JLink covered by JEP 282 http : openjdk.java.net jeps 282 creates modular runtime images covered by JEP 220 http : openjdk.java.net jeps 220 particularly the section New run-time image structure . These images are a generalization of JRE JDK and compact profiles and like them are OS specific . JLink can hence not be used to create cross-platform executables .", "Question : Java s package management system always seemed simple and effective to me . It is heavily used by the JDK itself . We have been using it to mimic the concept of namespaces and modules . What is Project Jigsaw trying to fill in From the official site : .. . .. . The goal of this Project is to design and implement a standard module system for the Java SE Platform and to apply that system to the Platform itself and to the JDK . .. . Answer : AFAIK The plan is to make the JRE more modular . I.e . have smaller jars which are optional and or you can download upgrade only the functionality you need . Its to make it less bloated and give you the option of dropping legacy modules which perhaps most people don t use . Comment : The accepted answer is valid but this answer is better because it explains the actual desired effects . +1 well deserved . Comment : I am curious so does this also mean if I have Google Guava as a dependency but I only use the ImmutableList in it then I can only import ImmutableList dependencies and leave the rest of the Guava classes out Comment : @ThomasN . when you use an import all this does is introduce this class into the name space of the class for the compiler . If you don t actually use it it won t appear in the byte code created . If you actually use the class you need to have that class and every class it uses at runtime . In theory you could create a cut down version of the guava API which only had what you need and use that JAR instead . In reality this is error prone and not very useful in most cases and you end up just adding the entire JAR as released .", "Question : So as of yesterday morning I hadn t a clue as to what OSGi even was . OSGi was just some buzzword that I kept seeing cropping up over and over again and so I finally set aside some time to brush up on it . It actually seems like pretty cool stuff so I d like to start off by stating for the record that I m not anti-OSGi in any respect nor is this is some OSGi-bashing question . At the end of the day it seems that OSGi has - essentially - addressed JSR 277 http : www.jcp.org en jsr detail id 277 on Java Modularity which recognized that there are shortcomings with the JAR file specification that can lead to namespace resolution and classloading issues in certain corner cases . OSGi also does a lot of other really cool stuff but from what I can ascertain that s its biggest draw or one of them . To me - as a fairly new a few years now Java EE developer it is absolutely mind-boggling that we are in the year 2011 and currently living in the era of Java 7 and that these classloading issues are still present particularly in enterprise environments where one app server could have hundreds of JARs on it with many of them depending on different versions of one another and all running more or less concurrently . My question : .. . .. . As interested as I am in OSGi and as much as I want to start learning about it to see where if it could be of use to my projects I just don t have the time to sit down and learn something that large at least now . So what are non-OSGi developers to do when these problems arise What Java Oracle Sun JCP solutions currently exist if any Why was Jigsaw cut from J7 How sure is the community that Jigsaw will get implemented next year in J8 Is it possible to get Jigsaw for your project even though its not a part of the Java platform yet I guess what I m asking here is a combination of panic intrigue and a facepalm . Now that I finally understand what OSGi is I just don t get how something like Jigsaw has taken 20+ years to come to fruition and then how that could have been canned from a release . It just seems fundamental . .. . .. . And as a developer I am also curious as to what my solutions are sans OSGi . Also Note : I know this isn t a pure programming -type question but before some of you get your noses bent out of shape I wanted to state again for the record that I deliberately put this question on SO . That s because I have nothing but the utmost respect for my fellow SOers and I m looking for an architectural-level answer from some of the Gods of IT that I see lurking around here every day . But for those of you who absolutely insist that a SO question be backed with some code segment : .. . .. . Thanks to anybody who can weigh-in on this OSGi Jigsaw classloader namespace JAR hell stuff Comment : +1 for the int x 9 Comment : Oh the irony...the irony +1 .. . Answer : First understand that Jigsaw s primary use-case is to modularise the JRE itself . As a secondary goal it will offer a module system that may be used by other Java libraries and applications . My position is that something like Jigsaw is probably necessary for the JRE only but that it will create far more problems than it claims to solve if used by other Java libraries or apps . The JRE is a very difficult and special case . It is over 12 years old and is a frightful mess riddled with dependency cycles and nonsensical dependencies . At the same time is is used by approximately 9 million developers and probably billions of running systems . Therefore you absolutely cannot refactor the JRE if that refactoring creates breaking changes . OSGi is a module system that helps you or even forces you to create software that is modular . You cannot simply sprinkle modularity on top of an existing non-modular codebase . Making a non-modular codebase into a modular one inevitably requires some refactoring : moving classes into the correct package replacing direct instantiation with the use of decoupled services and so on . This makes it hard to apply OSGi directly to the JRE codebase yet we still have a requirement to split the JRE into separate pieces or modules so that cut-down versions of the JRE can be delivered . I therefore regard Jigsaw as a kind of extreme measure to keep the JRE code alive while splitting it up . It does not help code to become more modular and I m convinced that it will actually increase the maintenance required to evolve any library or application that uses it . Finally : OSGi exists whereas Jigsaw does not exist yet and may never exist . The OSGi community has 12 years of experience in developing modular applications . If you are seriously interested in developing modular applications OSGi is the only game in town . Comment : Killer answer - thank you Comment : Is this you too slideshare.net mfrancis http : www.slideshare.net mfrancis java-8-modules-jigsaw-and-osgi-neil-bartlett almost the same contents . Comment : Wow I checked again It s you Comment : There is also JBoss Modules : docs.jboss.org author display MODULES Introduction https : docs.jboss.org author display MODULES Introduction It is also used by Ceylon ceylonlang.org . See this thread on the Ceylon user forum : groups.google.com forum hl de topic ceylon-users RmDskLDNkug https : groups.google.com forum hl de topic ceylon-users RmDskLDNkug Comment : @AdamArold I believe so . Jigsaw still doesn t exist in any released version of Java . JSR 376 Java Platform Module System is still forming its expert group and hasn t even started on a first draft yet . Java 9 is not due for more than a year and even when released is not guaranteed to have modularity it slipped from Java 7 then from Java 8 and could easily slip again . Finally the published requirements for JSR376 http : openjdk.java.net projects jigsaw spec reqs 02 state that OSGi interop is required.. . so adopting OSGi remains a safe choice and today the only practical choice .", "Question : Sun is putting a lot of effort behind modularising the JDK in the form of Jigsaw http : openjdk.java.net projects jigsaw and insinuating that it should be the module format of choice for other Java developers as well . The only notable player who is using this is NetBeans and derivative applications . On the other hand the industry has standardised around OSGi with all of the major application vendors basing their runtimes on the module platform even Sun s own Glassfish . There s even a port of NetBeans to use OSGi as the module system instead of NetBeans own modules . Even Maven is working towards becoming an OSGi runtime . Is it just NIH licensing or another reason Comment : Do you have a reference for the insinuating that it should .. . part of your question The page you link has the tone of a research project s homepage not that used to introduce a key technology that Sun wants everyone to use . .. . Answer : Excellent question . My understanding is that in some areas OSGi goes way beyond that which is necessary for JVM modules with all the corresponding complexity that brings whilst in other areas it doesn t go far enough . So there s a lot of overlap between them but perhaps not enough . See this blog entry http : altair.cs.oswego.edu pipermail jsr294-modularity-eg 2009-November 000390.html", "Question : Sun is putting a lot of effort behind modularising the JDK in the form of Jigsaw http : openjdk.java.net projects jigsaw and insinuating that it should be the module format of choice for other Java developers as well . The only notable player who is using this is NetBeans and derivative applications . On the other hand the industry has standardised around OSGi with all of the major application vendors basing their runtimes on the module platform even Sun s own Glassfish . There s even a port of NetBeans to use OSGi as the module system instead of NetBeans own modules . Even Maven is working towards becoming an OSGi runtime . Is it just NIH licensing or another reason Comment : Do you have a reference for the insinuating that it should .. . part of your question The page you link has the tone of a research project s homepage not that used to introduce a key technology that Sun wants everyone to use . .. . Answer : Check out the JavaPosse interview with Mark Reinhold http : www.javaposse.com index.php post 5Fid 492239 on the subject .", "Question : So as of yesterday morning I hadn t a clue as to what OSGi even was . OSGi was just some buzzword that I kept seeing cropping up over and over again and so I finally set aside some time to brush up on it . It actually seems like pretty cool stuff so I d like to start off by stating for the record that I m not anti-OSGi in any respect nor is this is some OSGi-bashing question . At the end of the day it seems that OSGi has - essentially - addressed JSR 277 http : www.jcp.org en jsr detail id 277 on Java Modularity which recognized that there are shortcomings with the JAR file specification that can lead to namespace resolution and classloading issues in certain corner cases . OSGi also does a lot of other really cool stuff but from what I can ascertain that s its biggest draw or one of them . To me - as a fairly new a few years now Java EE developer it is absolutely mind-boggling that we are in the year 2011 and currently living in the era of Java 7 and that these classloading issues are still present particularly in enterprise environments where one app server could have hundreds of JARs on it with many of them depending on different versions of one another and all running more or less concurrently . My question : .. . .. . As interested as I am in OSGi and as much as I want to start learning about it to see where if it could be of use to my projects I just don t have the time to sit down and learn something that large at least now . So what are non-OSGi developers to do when these problems arise What Java Oracle Sun JCP solutions currently exist if any Why was Jigsaw cut from J7 How sure is the community that Jigsaw will get implemented next year in J8 Is it possible to get Jigsaw for your project even though its not a part of the Java platform yet I guess what I m asking here is a combination of panic intrigue and a facepalm . Now that I finally understand what OSGi is I just don t get how something like Jigsaw has taken 20+ years to come to fruition and then how that could have been canned from a release . It just seems fundamental . .. . .. . And as a developer I am also curious as to what my solutions are sans OSGi . Also Note : I know this isn t a pure programming -type question but before some of you get your noses bent out of shape I wanted to state again for the record that I deliberately put this question on SO . That s because I have nothing but the utmost respect for my fellow SOers and I m looking for an architectural-level answer from some of the Gods of IT that I see lurking around here every day . But for those of you who absolutely insist that a SO question be backed with some code segment : .. . .. . Thanks to anybody who can weigh-in on this OSGi Jigsaw classloader namespace JAR hell stuff Comment : +1 for the int x 9 Comment : Oh the irony...the irony +1 .. . Answer : It s simple if you want to do real component-based development in Java today then OSGi is the only game in town . In my opinion Jigsaw is a combination of a compromise of what s doable in the JDK and previous bad relationship between SUN and the OSGi guys . Maybe it will ship with Java 8 but we have to wait and see . OSGi is no panacea if you are working in a typical enterprise setting and you will need to become familiar with how class loading works as a number of well-known libraries looking at you Hibernate made assumptions about class visibility that are no longer valid inside OSGi . I like OSGi but I wouldn t try and retrofit it to an existing system . I d also weigh the pros and cons in terms of greenfield development - I would recommend looking at the Apache or Eclipse products that simplify life for OSGi and not doing it all yourself . If you re not doing OSGi then your out of luck if you ve come up with a system that has dependencies on different versions of the same library - all you can do is try and avoid the problem though needing multiple versions of a library seems like a architecture smell to me . Comment : Yeah I figured there was a lot of bad blood between Sun and the OSGi Alliance . I can t imagine Oracle is going to let things slide out of their control though . You re really telling me that there are no plans to truly remedy not hack this JAR hell stuff anytime soon That blows my mind Comment : @Mara It s not really fair to say there is bad blood . After all Sun was one of the co-creators of OSGi around 12 years ago JSR 8 . Sun also rejoined the OSGi Alliance as a full member about a year before the Oracle acquisition . They also developed quite a lot of software on top of OSGi pre-Oracle . The most obvious example being Glassfish . However it is fair to say that there is friction between certain individuals at Sun Oracle and OSGi .", "Question : I have the following code to retrieve the default URLStreamHandlers for http and https which works in Java 8 by accessing the static package scoped method URL.getURLStreamHandler : .. . .. . Will this still be possible in Java 9 with jigsaw or will modifiying the visibility in this way be prohibited Comment : The possibility to access them via access override may exist but since package-private methods are not part of the official API there is no guaranty that the method will exist at all .. . Answer : Yes it will be possible . Accessing Types .. . .. . Jigsaw s new accessibility rules are bases on packages and types . From the excellent State of the Module System http : openjdk.java.net projects jigsaw spec sotms accessibility emphasis mine : .. . .. . The Java compiler and virtual-machine consider the public types in a package in one module to be accessible by code in some other module only when .. . .. . .. . Note that it only mentions types . If you can access a type you can do exactly the same things with it as you could before . Hence because the module java.base exports the package java.net which contains the public types URL and URLStreamHandler your code works just fine . Using Types .. . .. . This is true even though what you actually get from URL : : getURLStreamHandler are internal types either sun.net.www.protocol.http.Handler or sun.net.www.protocol.https.Handler . Because these are not exported you can not do with them what you like . As long as you interact with them through the methods that are declared on a class or interface that is accessible to you everything works . This is why it is possible to call e.g . getDefaultPort on them via reflection : that method belongs-to URLStreamHandler . The two types contain no methods of their own but what always breaks is the constructor . Calling handler.getClass .newInstance on the handler instance returned by your getURLStreamHandler fails with a Jigsaw-specific IllegalAccessException . Summary .. . .. . This may sound complicated but when you think about it it makes sense . Jigsaw lets you access certain types and as long as you limit your interaction to that type s API public or via reflection everything is fine . This is true even if you are actually dealing with a subtype because said subtype is an implementation detail . If you want to play around with this I created a gist https : gist.github.com nicolaiparlog 730e89860c45fad077c53ec54b3cea52 that contains your code calls to methods constructors as described above and a script to run it on Java 9 .", "Question : One of Java 9 s largest features will be a module system defined by Project Jigsaw . When reading slides from the Project Jigsaw : Under the Hood at JavaOne 2015 I noticed the following source code : .. . .. . What is interesting here to me is that the file ends in .java and seems to use two new keywords : module and exports . What other keywords will be introduced in Java 9 How will backwards compatibility be dealt with i.e . functions or variables named module Comment : I think at some point we re also going to get ref and any . Comment : @PaulBoddington certainly not in Java 9 for any keyword . That is Valhalla ie . 10 or later . Comment : How will backwards compatibility be dealt with presumably the same as always : you have to compile affected files with an older source version .. . Answer : This is likely not a complete list and none of this has been finalized to the best of my knowledge but I found a few . We also have module exports provides uses with to and requires explained here http : openjdk.java.net projects jigsaw spec sotms : .. . .. . The module system could identify uses of services by scanning the class files in module artifacts for invocations of the ServiceLoader : : load methods but that would be both slow and unreliable . That a module uses a particular service is a fundamental aspect of that module s definition so for both efficiency and clarity we express that in the module s declaration with a uses clause : .. . .. . .. . module java.sql .. . requires public java.logging .. . requires public java.xml .. . exports java.sql .. . exports javax.sql .. . exports javax.transaction.xa .. . uses java.sql.Driver .. . .. . .. . .. . The module system could identify service providers by scanning module artifacts for META-INF services resource entries as the ServiceLoader class does today . That a module provides an implementation of a particular service is equally fundamental however so we express that in the module s declaration with a provides clause : .. . .. . .. . module com.mysql.jdbc .. . requires java.sql .. . requires org.slf4j .. . exports com.mysql.jdbc .. . provides java.sql.Driver with com.mysql.jdbc.Driver .. . .. . .. . .. . .. . .. . .. . .. . module java.base .. . .. . .. . exports sun.reflect to .. . java.corba .. . java.logging .. . java.sql .. . java.sql.rowset .. . jdk.scripting.nashorn .. . .. . .. . .. . Also view and permits : .. . .. . In large software systems it is often useful to define multiple views of the same module . One view can be declared for general use by any other module while another provides access to internal interfaces intended only for use by a select set of closely-related modules . .. . For example with JNDI we want that com.sun.jndi.toolkit.url be visible only for cosnaming and kerberos modules as specified in the module declaration . .. . .. . view jdk.jndi.internal .. . exports com.sun.jndi.toolkit.url . .. . exports sun.net.dns . .. . permits jdk.cosnaming .. . permits jdk.kerberos .. . .. . .. . .. . .. . This way we have more flexibility to define module boundaries . I ve also heard mention of optional . Comment : I know of the class Optional T but they are really considering making that a keyword Do you have JEP on that one Comment : Not to mention.. . with and to are very commonly used as variable names . I hope that the keywords are only relevantly used within a module definition Comment : Hopefully I can t find good official sources but Jigsaw Project documentation seems to suggest that they are modifiers rather than keywords.. . Hopefully they aren t reserved when used out of context of module .", "Question : So as of yesterday morning I hadn t a clue as to what OSGi even was . OSGi was just some buzzword that I kept seeing cropping up over and over again and so I finally set aside some time to brush up on it . It actually seems like pretty cool stuff so I d like to start off by stating for the record that I m not anti-OSGi in any respect nor is this is some OSGi-bashing question . At the end of the day it seems that OSGi has - essentially - addressed JSR 277 http : www.jcp.org en jsr detail id 277 on Java Modularity which recognized that there are shortcomings with the JAR file specification that can lead to namespace resolution and classloading issues in certain corner cases . OSGi also does a lot of other really cool stuff but from what I can ascertain that s its biggest draw or one of them . To me - as a fairly new a few years now Java EE developer it is absolutely mind-boggling that we are in the year 2011 and currently living in the era of Java 7 and that these classloading issues are still present particularly in enterprise environments where one app server could have hundreds of JARs on it with many of them depending on different versions of one another and all running more or less concurrently . My question : .. . .. . As interested as I am in OSGi and as much as I want to start learning about it to see where if it could be of use to my projects I just don t have the time to sit down and learn something that large at least now . So what are non-OSGi developers to do when these problems arise What Java Oracle Sun JCP solutions currently exist if any Why was Jigsaw cut from J7 How sure is the community that Jigsaw will get implemented next year in J8 Is it possible to get Jigsaw for your project even though its not a part of the Java platform yet I guess what I m asking here is a combination of panic intrigue and a facepalm . Now that I finally understand what OSGi is I just don t get how something like Jigsaw has taken 20+ years to come to fruition and then how that could have been canned from a release . It just seems fundamental . .. . .. . And as a developer I am also curious as to what my solutions are sans OSGi . Also Note : I know this isn t a pure programming -type question but before some of you get your noses bent out of shape I wanted to state again for the record that I deliberately put this question on SO . That s because I have nothing but the utmost respect for my fellow SOers and I m looking for an architectural-level answer from some of the Gods of IT that I see lurking around here every day . But for those of you who absolutely insist that a SO question be backed with some code segment : .. . .. . Thanks to anybody who can weigh-in on this OSGi Jigsaw classloader namespace JAR hell stuff Comment : +1 for the int x 9 Comment : Oh the irony...the irony +1 .. . Answer : I love your use of the phrase corner cases to describe the current situation . there are shortcomings with the JAR file specification that can lead to namespace resolution and classloading issues in certain corner cases .. . .. . Anyhow since many years I ve been interested in tools and techniques that supports the creation of and even better enforce code that is cleaner more decoupled more coherent and more maintainable than what probably would have been the result without them . Test Driven Design and Junit was such a combination . After having spent a couple of months moving a substantial part of our code base to OSGi I would say that OSGi is an even better tool in this regard . And that is really a sufficient reason to move to OSGi . In the long run it will save you a lot of money . And as a bonus it ll give you a chance to do a lot of cool stuff . Imagine during a demo seamlessly upgrading the authentication module without traffic loss to support OAuth .. . it s suddenly a joy again to create stuff" ] }
[ "yes-answer-long", "yes-answer-short" ]
module
UNK_RELATION
obexftp@obex@64
obexftp -- obexftp is a library bundling everything needed for @placeholder transfers and exposing it via a simple interface .
{ "confidence": [ 40.47515869140625, 40.47515869140625, 38.975582122802734, 38.975582122802734, 38.975582122802734, 31.97669792175293, 14.843320846557617, 14.843320846557617, 14.843320846557617, 14.843320846557617, 14.843320846557617, 14.843320846557617, 14.843320846557617, 14.843320846557617, 14.843320846557617, 14.843320846557617, 13.343744277954102, 13.343744277954102, 13.343744277954102, 13.343744277954102, 13.343744277954102, 13.343744277954102, 13.343744277954102, 13.343744277954102, 13.343744277954102 ], "content": [ "When i populate this with my data .. . .. . I get the following error .. . .. . Try obexftp --help for more information .", "No matter how u use the obexftp with bluez you need to use the pin to pair the device which was not acceptable by me .", "I am trying to build some of the bluetooth terminal tools such as hcitool and obexftp for Android with NDK .", "Specifically I need obexftp to be able to perform bluetooth ftp transfer between two Nexus 5 and OnePlus One phones .", "I might try to do that port of bluez to make hcitool and obexftp work again .", "However from what I understand the libbluetooth.so which was included in several Android implementations of hcitool hcidump obexftp no longer works since the bluetooth stack on most recent Android has changed .", "Hi This command in terminal .. . .. . Should allow a file to be sent to remote bluetooth device without the requirement of a pin on a remote device .", "Nothing to do .", "Use --help for help .", "I can get it to work with this terminal command .. . .. . But the problem is the remote device asks the user to pair before allowing the file to be received .", "I need the solution to skip the pair request .", "Or if anyone can suggest an alternative terminal solution where i can send a file from a raspberry-pi to mobile device without the requirement to pair would be great .", "Any suggestions would be gratefully appreciated .", "Thank you .", "Even i am facing these issue .", "Though there is one way around use gnome-bluetooth package you will be able to send the file using bluetooth-sento command with some parameters which i guess you will get it .", "Here are links to few implementation of tools from 5-6 years ago which no longer work .", "I am getting error Device not found .", "Does anyone know which libbluetooth.so file I need now or do I need other libraries to be able to use bluetooth stack", "My current phones have Cyanogenmod 12.1 and Android 5 Lolipop .", "stackoverflow.com questions 24605783 http : stackoverflow.com questions 24605783 bluez-commands-in-bluedroid", "BlueZ standard linux bluetooth stack has been replaced with bluedroid originally by Broadcom now open sourced in Android 4.2 .", "There is no easy way to make old bluez tools work with the new stack .", "Thanks .", "I did not know that ." ] }
{ "confidence": [ 58.49140167236328, 51.882347106933594 ], "content": [ "Question : I am trying to build some of the bluetooth terminal tools such as hcitool and obexftp for Android with NDK . However from what I understand the libbluetooth.so which was included in several Android implementations of hcitool hcidump obexftp no longer works since the bluetooth stack on most recent Android has changed . Specifically I need obexftp to be able to perform bluetooth ftp transfer between two Nexus 5 and OnePlus One phones . Here are links to few implementation of tools from 5-6 years ago which no longer work . I am getting error Device not found . Does anyone know which libbluetooth.so file I need now or do I need other libraries to be able to use bluetooth stack My current phones have Cyanogenmod 12.1 and Android 5 Lolipop . Comment : stackoverflow.com questions 24605783 http : stackoverflow.com questions 24605783 bluez-commands-in-bluedroid .. . Answer : BlueZ standard linux bluetooth stack has been replaced with bluedroid originally by Broadcom now open sourced in Android 4.2 . There is no easy way to make old bluez tools work with the new stack . Comment : Thanks . I did not know that . I might try to do that port of bluez to make hcitool and obexftp work again .", "Question : Hi This command in terminal .. . .. . Should allow a file to be sent to remote bluetooth device without the requirement of a pin on a remote device . When i populate this with my data .. . .. . I get the following error .. . .. . Try obexftp --help for more information . Nothing to do . Use --help for help . I can get it to work with this terminal command .. . .. . But the problem is the remote device asks the user to pair before allowing the file to be received . I need the solution to skip the pair request . Or if anyone can suggest an alternative terminal solution where i can send a file from a raspberry-pi to mobile device without the requirement to pair would be great . Any suggestions would be gratefully appreciated . Thank you . .. . Answer : Even i am facing these issue . No matter how u use the obexftp with bluez you need to use the pin to pair the device which was not acceptable by me . Though there is one way around use gnome-bluetooth package you will be able to send the file using bluetooth-sento command with some parameters which i guess you will get it ." ] }
[ "yes-answer-long", "yes-answer-short" ]
obex
UNK_RELATION
com-interop -- com-interop is the layer that allows @placeholder assemblies to communicate with standard com objects and libraries .
{ "confidence": [ 68.86699676513672, 64.47831726074219, 63.526573181152344, 62.696678161621094, 62.56818389892578, 61.389801025390625, 61.389801025390625, 60.30338668823242, 58.797325134277344, 58.61968231201172, 58.61968231201172, 57.98790740966797, 57.98790740966797, 57.98790740966797, 57.83759689331055, 57.113616943359375, 56.97027587890625, 56.76597595214844, 56.58309555053711, 56.05035400390625, 56.05035400390625, 54.96880340576172, 54.899391174316406, 54.899391174316406, 54.899391174316406, 54.899391174316406, 54.899391174316406, 54.631080627441406, 53.53712463378906, 52.94856262207031, 52.94856262207031, 52.1323127746582, 52.06884765625, 51.54375076293945, 51.54375076293945, 51.54375076293945, 51.031044006347656, 50.666839599609375, 50.4486083984375, 50.4486083984375, 50.4486083984375, 50.4486083984375, 50.4486083984375, 50.282936096191406, 49.891998291015625, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.86004638671875, 49.817840576171875, 49.817840576171875, 49.645416259765625, 49.29785919189453, 49.244590759277344, 48.97433853149414, 48.87812042236328, 48.77735900878906, 48.456417083740234, 48.29271697998047, 48.22303771972656, 47.946510314941406, 47.884979248046875, 47.884979248046875, 47.884979248046875, 47.884979248046875, 47.884979248046875, 47.8427734375, 47.8403205871582, 47.662879943847656, 47.61609649658203, 47.57832336425781, 47.57832336425781, 47.57832336425781, 46.40769958496094, 46.24236297607422, 46.16059875488281, 46.16059875488281, 46.16059875488281, 46.16059875488281, 46.16059875488281, 46.16059875488281, 46.16059875488281, 46.15606689453125, 46.15606689453125, 46.15606689453125 ], "content": [ "It is also possible to provide one interop assembly for multiple COM libraries or multiple interop assemblies for one COM library .", "Can this be handled with COM interop", "The host is not using COM but I AM using COM interop for doing interop .", "Overloading does not work for the interop layer to COM .", "This will apply for regular COM objects and the ones exposed through .NET COM Interop .", "and it works correctly as COM-INTEROP", "Or this not possible via COM Interop", "This is a big deficiency of .NET COM Interop .", "But I don t enough COM COM Interop VDS to do this in a reasonable way .", "It is being registered with COM interop as well .", "Similar limitations exist for COM interop .", "COM interop is stable and reasonably well documented .", "Set component property .NET COM Interop to Yes .", "More at : http : www.writeulearn.com com-interop-using-csharp", "COM does not support method-overloading so .NET COM Interop layer has to improvise .", ".NET COM interop treats the interfaces as regular COM interfaces .", "COM interop does not necessarily create one interop library for one COM library .", "Using VSTO or COM Interop the underlaying communication layer marshalling overhead is the same .", "I do not define an explicit interface for the COM interop .", "Two different interop assemblies are generated for this COM control : .. . .. . 1 .", "Interop assemblies are automatically generated when you add a COM reference .", "Is this only for the Office Primary Interop Assemblies or can I also use this to Embed my Redemption library or other COM libraries", "So its not a plain vanilla COM-interop scenario .", "An interop assembly is not even linked to an COM library", "Which is what Register for COM interop does .", "I m using VB .NET and the Excel COM interop .", "Also will List index even work with COM Interop", "Regardless of how I write my COM exposed class I get the warning : XXX.dll does not contain any types that can be registered for COM interop marked project as Register for COM interop in the project properties .", "COM Interop aims to provide access to the existing COM components without requiring that the original component be modified and vice-versa .", "My scenario is that I m exposing a .NET control as an ActiveX using COM interop .", "I have a problem in a utility library which does some COM interop .", "I have an SSIS Package that utilizes a COM Interop Interop.RFCOMAPILib.dll around RightFax s COM API rfcomapi.dll .", "See C + COM Interop deterministic release http : stackoverflow.com questions 949177 c-com-interop-deterministic-release .. . .. . As a workaround I created a helper class .. . .. . Usage : .. . .. . My questions : Are there potential problems with this code", "Is this possible or is this a non-starter due to how COM interop works", "I run regasm.exe codebase on the managed DLL and it registers it for COM interop .", "Normally I would suspect that the COM .NET interop overhead is creating the delay .", "COM objects are real objects that implement one or more COM interfaces .", "The intention originally was to allow legacy code to use these managed objects through COM interop services .", "EDIT : It is NOT a common COM-interop scenario : The host is not COM and no one calls CoInitialize CoCreateInstance etc .", "The COM interop assembly is automatically generated when you add a COM reference to a project in Visual Studio .", "Unfortunately due to the way that COM works it would be impossible to install a COM object interop or otherwise without admin privileges .", "If COM compatible Visual Studio will automaticly create a COM Interop Assembly that will act as a .NET wrapper to your VB6 DLL .", "For this reason lightweight COM APIs can be used from .NET via COM interop .", "Not an exact duplicate because the C is the client but you might be interested in this question http : stackoverflow.com questions 5085965 com-interop-with-vb6-and-c also about passing a VB6 control ref across COM interop .", "The COM Objects still use standard COM reference counting .", "COM-Interop would consistently fail due to dependency issues .", "If it s available as a COM DLL .NET will build an interop wrapper for you .", "Normally there is a signed Primary Interop Assembly PIA provided by the author of the COM DLL .", "This is done via COM Interop by adding a reference to the Google Earth Plugin .", "I am aware of p invoke but I must use COM Interop .", "An interop assembly is required to let .NET code use a COM server .", "A colleague of mine created an assembly in VB.net for use with JScript via COM interop .", "Do you recreated the COM Interop after the signing of the assembly", "I have been having a prolonged encounter with the beast known as COM Interop.. .", "Also do you know any other useful resources for COM Interop", "You can use .NET methods through COM-interop in VBScript .", "That s classic C++ it has nothing to do with .Net or COM Interop .", "List Department but it seems that generics don t work well with COM Interop .", "COM Interop compatible collection : .. . .. . Updated .NET component MyLibrary.GetDepartments : .. . .. . Updated ASP :", "And what about unmanaged code accessed via COM Interop and or P Invoke", "This is a side-effect of a flaw in the way COM interop is implemented in the CLR .", "I have a c dll that has Register for COM interop set to true .", "Looking to do something similar but in C++ using the COM Interop .", "I m trying to work with client-side certificate enrollment via COM Interop .. . .. .", "The error is a type mismatch between two different ComPublicT types from the two different COM interop assemblies .", "When .net assemblies are registered for COM Interop there is a CodeBase key in the registry that points to the executable .", "So you ll use the .NET class es directly instead of going through the COM interop twice .", "COM Interop is a technology included in the .NET Framework Common Language Runtime CLR that enables Component Object Model COM objects to interact with .NET objects and vice versa .", "I ve used COM interop to access the dto2.dll COM library and have read the samples but I am having problems creating the database .", "This includes com objects that are properties of another com object .", "If you can try to do it by producing XML Excel files otherwise please consider VSTO un managed Memory Management : jake.ginnivan.net vsto-com-interop http : jake.ginnivan.net vsto-com-interop", "The language syntax permits only one setter and the COM interop layer in the CLR is missing the plumbing to synthesize two .", "In the .tlb file s COM .Net Settings properties I have it configured to Registration Type : Extract COM Information and have enabled COM Interop .", "and also see .. . Overloads in COM interop CCW - IDispatch names include suffix 2 3 etc http : stackoverflow.com questions 1277740 overloads-in-com-interop-ccw-idispatch-names-include-suffix-2-3-etc .. . .. . So through the COM layer you could call your original methods with", "Most COM interop libraries require a dispatch interface however I m not sure about COM4J .", "I am referencing a COM library in Visual Studio so it has automatically created the corresponding Interop assembly for me .", "For Reg-Free managed COM Interop it ignores the root manifest path .", "By adding the COM control in VS2010 an interop and Ax.. . is automatically generated .", "It is referencing a COM interop library that I add via the Add References dialog .", "The application is classic ASP with a custom Interop COM object managing the upload .", "Check Register COM for interop .. . .. . 03 VB.NET .. . .. . Open MyProject .", "The main application is written in Delphi XE Win32 and it does some calls to .Net assemblies using COM interop .", "IIRC C COM objects require the use of regasm to register their COM objects .", "When a COM apartment and a thread-generated apartment are compatible COM allows the calling thread to make calls directly to the COM object .", "A COM object is not the same as a COM interface .", "That is you should do it before creating any .NET objects from C++ via COM interop .", "I need to iterate COM+ ActiveX collection objects using late bind interop in C .", "Thanks but I can t see how that help with referencing counting CLR objects created in VBScript through COM Interop .", "support COM objects", "Related questions I have asked may provide more context : Interop COM -isch interface marshaling results in AccessViotlationException on simple call http : stackoverflow.com questions 19465041 interop-com-isch-interface-marshaling-results-in-accessviotlationexception-on Returned managed object method not called from C++ in COM interop http : stackoverflow.com questions 19479488 returned-managed-object-method-not-called-from-c-in-com-interop", "Here are specific questions comments for each .. . .. . COM INTEROP - It appears event-handling is a hurdle .", "How do I make a C DLL into a COM interop DLL that can be consumed by a VB6 application", "I am using InstallSheild 11.5 and I do not see the .NET COM Interop option .", "Using InstallShield 2011 in the Organization Components tree there is a section for .NET Settings which includes the .NET COM Interop setting .", "I have been blocked in the C call C++ callback function the COM Interop is arcane for me .", "When registering a managed class for COM Interop by hand certain registry keys are needed .", "For example .. . .. . I ve noticed that when VS registers a library for COM Interop it also adds a key .. . .. . What is this key for and is it absolutely necessary", "I d anticipate that for each referenced project if the Register for COM Interop option is set then Votive MSBuild would generate COM registration stuff for that project s output assembly .", "Other than creating a type that mimics ComPublicT how can I allow Executable to reference the COM DLL rather than the Signed s COM interop assembly", "I dont know the answer but can point you to the .NET COM interop bible Adam Nathan s .Net and COM : The complete interoperability guide" ] }
{ "confidence": [ 72.18611145019531, 69.1361083984375, 65.90129089355469, 63.09934997558594, 62.884727478027344, 62.689918518066406, 61.17081832885742, 60.808414459228516, 60.388633728027344, 60.321533203125, 60.07516098022461, 59.7785758972168, 59.664424896240234, 59.08930969238281, 59.056861877441406, 58.9539794921875, 58.73310089111328, 58.71983337402344, 58.59067153930664, 58.04362487792969 ], "content": [ "Question : I have an Interop DLL RCW.Xyz.dll but I can t find the corresponding DLL . Because the name doesn t follow the default naming scheme Interop.Xyz.dll my guess is that the interop assembly was simply renamed . Even if the DLL is generated by Visual Studio with a default name if the DLL has spaces in its name the spaces will get lost making it hard to find the source DLL again .. . .. . How can I find out the COM DLL name behind the interop assembly I assume I need to use disassembly tools . Preferably I m looking for a solution which works in dotPeek http : www.jetbrains.com decompiler as I don t own a Reflector license . .. . Answer : COM interop does not necessarily create one interop library for one COM library . This is only the default behaviour of the type library importer . It is also possible to provide one interop assembly for multiple COM libraries or multiple interop assemblies for one COM library . An interop assembly is not even linked to an COM library It can be easily deployed without the source library installed on the target system . In fact it will fail as soon as you are trying to create an instance of one of the libraries objects . The objects inside an interop assembly are important when you want to find their source . They are called Runtime Callable Wrappers Runtime stands for the CLR . That s the reason why your interop assembly is called RCW.Xyz.dll . Propably the developer of the assembly used tlbimp s out switch to create it . When you want to search for the library a certain COM type is defined in just find the class name inside the interop assembly . You can use Visual Studio s object explorer to do this - no need to dissassemble the interop assembly . Those assemblies usually do not define any code at all . They only provide metadata to satisfy the CLR . Each class is marked with a ComImport attribute and a Guid attribute . Use this GUID to identify the class inside your registry HKEY CLASSES ROOT CLSID GUID as you mentioned in your answer . The Inproc32 key s default-value is the library the type is defined in . Note that this only applies to inproc COM servers DLL s COM als supports other library types . As mentioned above this must actually be done for each class . However if the developer of the interop assembly used the type library importer to generate the interop assembly and did not modify or merge it with others it should be enought to do it only for one type because of tlbimp s default behaviour mentioned earlier .", "Question : How do I make a C DLL into a COM interop DLL that can be consumed by a VB6 application .. . Answer : COM Interop is a technology included in the .NET Framework Common Language Runtime CLR that enables Component Object Model COM objects to interact with .NET objects and vice versa . COM Interop aims to provide access to the existing COM components without requiring that the original component be modified and vice-versa . More at : http : www.writeulearn.com com-interop-using-csharp", "Question : Sorry about the terrible title . I have a signed assembly Signed.dll that is a dependency of another assembly say Executable.exe . Signed.dll references a COM DLL and publically exposes one of this COM DLL s types : ComPublicT . Executable.exe must reference the automatically generated Interop.COM.dll from the Signed project rather than adding a reference to the original COM DLL . The error is a type mismatch between two different ComPublicT types from the two different COM interop assemblies . This is only required if Signed.dll is signed . Other than creating a type that mimics ComPublicT how can I allow Executable to reference the COM DLL rather than the Signed s COM interop assembly Why does this happen Edit Here is a somewhat different breakdown : .. . .. . Signed Project references COM.dll and publically exposes a type from the COM.dll Adding this reference in Visual Studio automatically creates Interop.COM.dll .. . .. . Executable references and depends on the Signed Project Normally you can add a reference to COM.dll and all is well . Because Signed is signed the publically exposed Interop.COM.dll type from Signed is not seen by the compiler as the same as the publically exposed type from Executable s Interop.COM.dll .. . .. . Executable must manually reference Signed s Interop.COM.dll which feels fragile . Comment : How are you generating the interop used by Signed.dll Since Signed.dll is well signed you must have done it manually so you could provide a .snk key file . Comment : The COM interop assembly is automatically generated when you add a COM reference to a project in Visual Studio . COM.dll generates Interop.COM.dll and is placed in the obj and bin folders . Comment : The problem is that the generated Interop assembly will not med signed : .. . Answer : 1 . Every assembly referenced by a signed assembly must also be signed . 2 . Normally there is a signed Primary Interop Assembly PIA provided by the author of the COM DLL . It should be the sole interop assembly for its parent COM types referenced by any .NET assembly . http : msdn.microsoft.com en-us library aax7sdch.aspx There isn t a PIA available in my case . The two interop assemblies generated by Visual Studio for my two projects differ in that one interop assembly is signed and the other is unsigned . Thus the types contained in the the interop assemblies differ . One solution is to generate a single signed interop assembly that is referenced by both projects .", "Question : I am referencing a COM library in Visual Studio so it has automatically created the corresponding Interop assembly for me . I would like to do a GetType on these com objects but they always return System . ComObject . Querying them for an interface works though : .. . .. . But what I really want is this to return the actual type of the com object : .. . .. . Does anyone know how to do what I want to do .. . Answer : I stumbled upon this question a few days ago while I was looking for the full type name of a System . ComObject object . I ended up getting the type name using Darin s solution and then looping through all classes in all assemblies to test the match : .. . .. . Not the fastest and most elegant solution but it worked . Comment : someCOMObject as type Not sure if that would work .", "Question : I found some information about this on Scott Hanselmans Blog http : www.hanselman.com blog CLRAndDLRAndBCLOhMyWhirlwindTourAroundNET4AndVisualStudio2010Beta1.aspx .. . .. . Does anybody exactly know what this mean Is this only for the Office Primary Interop Assemblies or can I also use this to Embed my Redemption library or other COM libraries .. . Answer : The process described in Scott Hanselman s blog is called Type Equivalence a rather nebulous term for the CLR 4.0 s support for COM interop type assemblies . Although I haven t had a chance to look at it there is a video here at Channel 9 that discusses it : .. . .. . Raja Krishnaswamy and Vance Morrison : CLR 4 - Inside Type Equivalence .. . http : channel9.msdn.com shows Going+Deep Raja-Krishnaswamy-and-Vance-Morrison-CLR-4-Inside-Type-Equivalence .. . .. . Apparently you can write your own type equivalence assemblies and embed them . Note that this probably does not apply to just any COM assembly type equivalence assemblies implement an interface called IApplication . See here : .. . .. . Advances in .NET Type system : Type Equivalence Demo http : blogs.msdn.com mshneer archive 2008 10 28 advances-in-net-type-system-type-equivalence-demo.aspx", "Question : Consider the following C code using a COM object . This will release the COM objects o and baz but not the temporary objects returnd by o.Foo and o.Foo.Bar . This can cause problems when those objects hold a large amount of unmanaged memory or other resources . An obvious but ugly solution would be to clutter the code even more with try-finally and Marshal.ReleaseComObject . See C + COM Interop deterministic release http : stackoverflow.com questions 949177 c-com-interop-deterministic-release .. . .. . As a workaround I created a helper class .. . .. . Usage : .. . .. . My questions : Are there potential problems with this code Has anybody a more elegant solution Comment : added an example using the expression tree approach Comment : @downvoter : please leave a comment .. . Answer : The solution of Marc Gravell won t work with .Net 4.+ because of introduction of Dynamic in COM instead of object . Furthermore when testing with the Excel COM there is an exception with the constructor saying Convert not supported default of the switch of WalkImpl . There are others limitations with Expressions as no indexed-properties and no optional arguments . Never coded Expression before then I have no idea how to address these problems . Won t compile or execute :", "Question : I m using the Excel interop in C ApplicationClass and have placed the following code in my finally clause : .. . .. . Although this kind of works the Excel.exe process is still in the background even after I close Excel . It is only released once my application is manually closed . Anyone realize what I am doing wrong or has an alternative to ensure interop objects are properly disposed of . Comment : Are you trying to shut down the Excel.exe without closing your application Not sure I fully understand your question . Comment : I m trying to make sure the unmanaged interop objects are disposed of properly . So that there are not Excel processes hanging around even when the user has finished with Excel spreadsheet we created from the app . Comment : If you can try to do it by producing XML Excel files otherwise please consider VSTO un managed Memory Management : jake.ginnivan.net vsto-com-interop http : jake.ginnivan.net vsto-com-interop Comment : Does this translate to Excel nicely Comment : See besides answers below this support article from Microsoft where they specifically give solutions to this problem : support.microsoft.com kb 317109 http : support.microsoft.com kb 317109 .. . Answer : Never use 2 dots with com objects is a great rule of thumb to avoid leakage of com references but Excel PIA can lead to leakage in more ways than apparent at first sight . .. . .. . One of these ways is subscribing to any event exposed by any of the Excel object-model s COM object .. . .. . For e.g . subscribing to Application class s WorkbookOpen event . Some theory on COM events .. . .. . COM classes expose a group of events through call-back interfaces . In order to subscribe to events the client code can simply register an object implementing the call-back interface and the COM class will invoke its methods in response to specific events . Since the call-back interface is a COM interface it is the duty of the implementing object to decrement the reference count of any COM object it receives as a parameter for any of the event handlers . How Excel PIA expose COM Events .. . .. . Excel PIA exposes COM events of Excel Application class as conventional .Net events . Whenever the client code subscribes to a .Net event emphasis on a PIA creates an instance of a class implementing the call-back interface and registers it with Excel . Hence a number of call-back objects get registered with Excel in response to different subscription requests from the .Net code . One call-back object per event subscription . A call-back interface for event-handling means that PIA has to subscribe to all interface events for every .Net event subscription request . It cannot pick and choose . On receiving an event call-back the call-back object checks if the associated .Net event handler is interested in the current event or not and then either invokes the handler or silently ignores the call-back . Effect on COM instance reference counts .. . .. . All these call-back objects do not decrement the reference count of any of the COM objects they receive as parameters for any of the call-back methods even for the ones that are silently ignored . They rely solely on the CLR garbage collector to free up the COM objects . Since GC run is un-deterministic this can leads to the holding off of Excel process for a longer duration than desired and create an impression of memory leak . Solution .. . .. . Only solution as of now is to avoid the PIA s event provider for the COM class and write your own event provider which deterministically releases COM objects . For Application class this can be done by implementing AppEvents interface and then registering the implementation with Excel by using IConnectionPointContainer interface http : msdn.microsoft.com en-us library system.runtime.interopservices.comtypes.iconnectionpointcontainer.aspx . Application class and for that matter all COM objects exposing events using callback mechanism implements the IConnectionPointContainer interface .", "Question : I am trying to write a managed plugin to an unmanaged host application using COM interop . The unmanaged plugin interfaces are all COM compatible although no COM is used no registry etc . I have come a long way to get it to work there is just one thing I would like to change . The calls that are made from the unmanaged host app into the managed plugin assembly are all made on a STA- managed thread . I would like it to be MTA so there is no sync pumping overhead . I cannot find a way to to achieve this . Any help or suggestions is most apprecicated . EDIT : It is NOT a common COM-interop scenario : The host is not COM and no one calls CoInitialize CoCreateInstance etc . It seems the CLR does assign the apartment to the unmanaged thread that calls into the managed plugin . THAT is what I want to change it now defaults to STA instead of MTA . Related questions I have asked may provide more context : Interop COM -isch interface marshaling results in AccessViotlationException on simple call http : stackoverflow.com questions 19465041 interop-com-isch-interface-marshaling-results-in-accessviotlationexception-on Returned managed object method not called from C++ in COM interop http : stackoverflow.com questions 19479488 returned-managed-object-method-not-called-from-c-in-com-interop .. . Answer : You mentioned there is no COM involved in the host app and the entry-point into your managed plugin is an exported function . How is that exported function implemented I imagine there is a piece of unmanaged C++ code inside your plugin to bootstrap the managed code . If so that s where you can do CoInitializeEx NULL COINIT MULTITHREADED in theory . That is you should do it before creating any .NET objects from C++ via COM interop . However doing so may be very irresponsible and dangerous in respect to the host app . Are you absolutely sure the host doesn t use COM on this thread and so do not any of its other plugins Are you sure it will not try to initialize COM at some later stage Also if the host has already initialized COM on this thread as STA your call to CoInitializeEx will most likely fail with RPC E CHANGED MODE error . Comment : Here is the DllExport attribute that I use to export a managed function . sites.google.com site robertgiesecke https : sites.google.com site robertgiesecke It rewrites the assembly with some extra IL-flags for the exported methods . No unmanaged interop thunking code comes into play . Yes I am absolutely 100 sure the host does not and will not ever use COM . I understand you cannot change the apartment after the fact - that is why I am looking for a way to tell the CLR what to do.. . Comment : @obiwanjacobi so have you tried calling CoInitializeEx NULL COINIT MULTITHREADED explicitly via p invoke at the beginning of your entry-point", "Question : We have developed a s w architecture consisting of set of objects developed in C . They make extensive use of events to notify the client of changes in status etc . The intention originally was to allow legacy code to use these managed objects through COM interop services . That was easy to write in the design specification but I m seeing that actually implementing it is more problematic . I ve searched for many hours looking for a good sample of event-handling using this method . Before we march down that path I want to make sure that COM interop is the best way to allow legacy code to call our new code . It appears there are several different options : 1 COM interop 2 write unmanaged wrapper classes 3 use the clr compiler switch to enable calling of managed objects 4 use some sort of reverse pInvoke call . Am I missing any Each option will have its benefits drawbacks and I m wondering what the best way to go is . Here are specific questions comments for each .. . .. . COM INTEROP - It appears event-handling is a hurdle . We use events that have variable types as parameters . An event parameter may have an event ID and an object . Based on the event ID the object will be of a certain type . Can this be handled with COM interop Many of the objects that are exposed have properties . You can t declare properties in an interface so all properties will need a corresponding get set method . WRITE UNMANAGED WRAPPER - I assume this means creating a DLL using the clr option to allow creating and calling managed objects and exposing unmanaged objects . Would the client of these unmanaged . I haven t done this before . What are benefits drawbacks of this USE THE CLR SWITCH - I understand this means to add support for managed objects . What are the drawbacks of this approach Does this option support events as described above Can we say here s the managed library . Use the clr compiler option with your legacy code and have at it I don t know the ramifications of this . Is there a good sample of how this works around I m sure there is I just haven t found it .. . .. . USE A REVERSE PINVOKE - I m not sure exactly how this would work but from what I ve been able to find this is not a likely valid solution . So what does the decision-tree look like to find the correct direction Any help is appreciated . DP .. . Answer : I think your initial solution is the best one . COM interop is stable and reasonably well documented . All you need to do is ensure that all the different event objects that might pop out of a given event handler implement the same COM-visible base event object interface that has the event type id etc . From there individual objects can implement whatever other interfaces they want and your unmanaged code can QI for the right detail interface based on whatever criteria you want to define . It s really not that hard . Have a look at this http : www.codeproject.com KB COM cominterop.aspx CodeProject article for an end-to-end sample including unmanaged event handlers .", "Question : I m using the Excel interop in C ApplicationClass and have placed the following code in my finally clause : .. . .. . Although this kind of works the Excel.exe process is still in the background even after I close Excel . It is only released once my application is manually closed . Anyone realize what I am doing wrong or has an alternative to ensure interop objects are properly disposed of . Comment : Are you trying to shut down the Excel.exe without closing your application Not sure I fully understand your question . Comment : I m trying to make sure the unmanaged interop objects are disposed of properly . So that there are not Excel processes hanging around even when the user has finished with Excel spreadsheet we created from the app . Comment : If you can try to do it by producing XML Excel files otherwise please consider VSTO un managed Memory Management : jake.ginnivan.net vsto-com-interop http : jake.ginnivan.net vsto-com-interop Comment : Does this translate to Excel nicely Comment : See besides answers below this support article from Microsoft where they specifically give solutions to this problem : support.microsoft.com kb 317109 http : support.microsoft.com kb 317109 .. . Answer : Excel does not quit because your app is still holding references to COM objects . I guess you re invoking at least one member of a COM object without assigning it to a variable . .. . .. . For me it was the excelApp.Worksheets object which I directly used without assigning it to a variable : .. . .. . What I didn t know was that internally C created a wrapper for the Worksheets COM object which didn t get released by my code because I wasn t aware of it and was the cause why Excel was not unloaded . I found the solution to my problem on this page http : www.velocityreviews.com forums showpost.php s f87f0674feda4442dcbd40019cbca65b p 528575 postcount 2 which also has a nice rule for the usage of COM objects in C : .. . .. . Never use 2 dots with com objects . .. . .. . So with this knowledge the right way of doing the above is : Comment : Then I suggest not using Excel from COM and save yourself all of the trouble . The Excel 2007 formats can be used without ever opening Excel gorgeous . Comment : I did not understand what two dots mean . Can you please explain Comment : This means you shouldn t use the pattern comObject.Property.PropertiesProperty you see the two dots . Instead assign comObject.Property to a variable and use and dispose that variable . A more formal version of the above rule could be sth . like Assign com object to variables before you use them . This includes com objects that are properties of another com object . Comment : @Nick : Actually you don t need any kind of cleanup since the garbage collector will do it for you . The only thing you need to do is to assign every COM object to its own variable so the GC knows of it . Comment : @VSS thats bollocks the GC cleans up everything since the wrapper variables are made by the .net framework . It just might take forever for the GC to clean it up . Calling GC.Collect after heavy interop isn t a bad idear .", "Question : I have a COM control that has a MyCOMCtl class having Data property which is available as get Data in the generated COM Interop assembly . Two different interop assemblies are generated for this COM control : .. . .. . 1 . By adding the COM control in VS2010 an interop and Ax.. . is automatically generated . 2 . Using TLBIMP v4 Tool from VS2010 command-prompt . The problem is that when the interop assembly is generated using TLBIMP then the get Data becomes : .. . .. . but when its auto-generated by VS2010 then it becomes : .. . .. . My code needs the second one that returns an object . The VS2010 project targets .NET Framwork 4 Client Profile and TLBIMP version is 4.0.30319.1 . Why is this happening Is there a way to correct this .. . Answer : I guess you are mixing things up . tlbimp should not create dynamic types for backwards compatibility http : stackoverflow.com a 1187197 1254352 reasons . However Visual Studio generates dynamic types when using NoPIA http : blogs.msdn.com b samng archive 2010 01 24 the-pain-of-deploying-primary-interop-assemblies.aspx . NoPIA means that you do not have to ship an primary interop assembly together with your control . Also the types are not generated by tlbimp any longer . Instead they are directly created within the assembly that imports the type library . You can and imho should disable this setting by right-clicking the COM reference in Visual Studio choosing the Properties menu and setting the Embed interop types property to false . You will see that the Visual Studio generated reference also creates an object return-type . However this is not completely correct yet . If you are generating an primary interop library for your control using tlbimp you should also reference it Do not add a COM reference to your project . Instead browse for the tlbimp-generated interop library and add this one .", "Question : I found some information about this on Scott Hanselmans Blog http : www.hanselman.com blog CLRAndDLRAndBCLOhMyWhirlwindTourAroundNET4AndVisualStudio2010Beta1.aspx .. . .. . Does anybody exactly know what this mean Is this only for the Office Primary Interop Assemblies or can I also use this to Embed my Redemption library or other COM libraries .. . Answer : One remark about : if you add reference and property Embed Interop Types true - this can make some casuistic errors while you compiling : - you see what inside reference have functions and propertyes - but compilator don t find it and generate errors", "Question : How do I make a C DLL into a COM interop DLL that can be consumed by a VB6 application .. . Answer : This is the answer I wanted to find in StackOverflow but couldn t . It turns out to be fairly easy to turn a simple C dll into a COM dll . To create the C dll .. . .. . Create a solution with a C class project . The class should have an interface for the properties methods and an interface for the events . Assign GUID attributes to the class and interfaces as described in MSDN - Example COM Class C Programming Guide http : msdn.microsoft.com en-us library c3fd4a20.aspx . Also see : MSDN - How to : Raise Events Handled by a COM Sink http : msdn.microsoft.com en-us library dd8bf0x3 28v VS.90 29.aspx . In Project Properties Application tab Assembly Information button check Make assembly COM-Visible . This makes all public methods in the class COM visible . In Project Properties Build tab Set Platform target to x86 . That s all you need to do to create the DLL . To call the DLL you need to register it . Registering the DLL on your development-machine .. . .. . You can register the DLL one of these ways : .. . .. . Check Project Properties Build Tab Register for COM Interop . This will automatically register the DLL when you build it . Manually register the DLL with RegAsm . This allows you to register the DLL in the directory of your choice rather than in the build directory . This is the method I used . Do not check Project Properties Build Tab Register for COM Interop .. . Copy the DLL to the directory where you want to register it .. . Open a command shell with administrator rights and type .. . .. . RegAsm.exe -tlb -codebase mydll.dll .. . .. . .. . RegAsm.exe can be found in C : Windows Microsoft.NET Framework v2.0.50727 while mydll.dll is the name of your DLL tlb means create a type library codebase means write the directory location to the Registry assuming it is not being placed in the GAC . RegAsm will display a warning that the assembly should be strong-named . You can ignore it . At this point you should be able to add a reference to the COM DLL in VB6 see it with Intellisense and run it just like a regular COM DLL . Installing the DLL with InstallShield .. . .. . If you are using InstallShield to install the DLL along with the rest of your application do the following . In InstallShield add a new Component to the Components list . Remember to associate the Component with a Feature . Set component property .NET COM Interop to Yes . Add the .dll file to the Files section of the Component . Do not check the Self-Register property . Right-click on the .dll file and select Set Key File . Add the .tlb file to the Files section of the Component . Check the Self-Register property . The correct version of the .Net Framework needs to exist on the target PC . That s it . Comment : I am using InstallSheild 11.5 and I do not see the .NET COM Interop option . The help file that 11.5 comes with does say it should be there so I don t know if I am just looking in the wrong view or what . Could you update your answer to include where that property is set Comment : Using InstallShield 2011 in the Organization Components tree there is a section for .NET Settings which includes the .NET COM Interop setting .", "Question : I m using the Excel interop in C ApplicationClass and have placed the following code in my finally clause : .. . .. . Although this kind of works the Excel.exe process is still in the background even after I close Excel . It is only released once my application is manually closed . Anyone realize what I am doing wrong or has an alternative to ensure interop objects are properly disposed of . Comment : Are you trying to shut down the Excel.exe without closing your application Not sure I fully understand your question . Comment : I m trying to make sure the unmanaged interop objects are disposed of properly . So that there are not Excel processes hanging around even when the user has finished with Excel spreadsheet we created from the app . Comment : If you can try to do it by producing XML Excel files otherwise please consider VSTO un managed Memory Management : jake.ginnivan.net vsto-com-interop http : jake.ginnivan.net vsto-com-interop Comment : Does this translate to Excel nicely Comment : See besides answers below this support article from Microsoft where they specifically give solutions to this problem : support.microsoft.com kb 317109 http : support.microsoft.com kb 317109 .. . Answer : I found http : www.deez.info sengelha 2005 02 11 useful-idisposable-class-3-autoreleasecomobject a useful generic template that can help implement the correct disposal pattern for COM objects that need Marshal.ReleaseComObject called when they go out of scope : .. . .. . Usage : .. . .. . Template : .. . .. . Reference : .. . .. . http : www.deez.info sengelha 2005 02 11 useful-idisposable-class-3-autoreleasecomobject Comment : yup this one is good . I think this code can be updated though now that FinalReleaseCOMObject is available . Comment : It s still annoying to have a using block for each object . See here stackoverflow.com questions 2191489 http : stackoverflow.com questions 2191489 releasing-temporary-com-objects for an alternative .", "Question : Specifically I am using Wise Installation Studio to install several shared .NET 2.0 assemblies into the GAC . These are being used by some legacy COM application files as well as other application assemblies . I have the flag for Generate COM interop registry keys for .NET assembly set . Reference counting appears to be working for removing the actual assembly from the GAC but the COM registration information is getting removed with the first uninstall via ARP . I am wondering if there is some work around for this if I would be better off installing the assembly to Common Files or if there are any other suggestions out there .. . Answer : How I could read on the http : www.ssw.com.au ssw standards wisesetup WiseStandards.aspx page using of Generate COM interop registry keys for .NET assembly allow you just add a set of registry keys to MSI . As in all Windows Installer Setups it is important to define to which MSI component a registry key or a file belong . If you make these registry keys as a part of the same components as the file and the assembly the keys will be removed always together with the assembly . If multiple setups use the same component GUID then only if you uninstall the last setup used the component the component will be uninstalled .", "Question : I have a managed assembly containing a few classes and those classes have overloaded methods . I expose the assembly to COM IDispatch callers via .. . .. . ..and also setting the proper Guid on the assembly itself . I do not define an explicit interface for the COM interop . It s all done dynamically . I run regasm.exe codebase on the managed DLL and it registers it for COM interop . When I run OleView I can see the ProgId s of the various classes in the assembly . But browsing into those ProgIds and expanding IDispatch node there is no TypeLib information for these classes . Even so from a script I can invoke a method that accepts zero arguments or a method that accepts one argument . If there is also an overload that accepts more than one argument I cannot invoke that method by name . The error I get consistently is .. . .. . From this I understood that COM IDispatch clients were not able to properly resolve overloaded methods on an object exposed via COM interop . .. . .. . Then I added .. . .. . ...to each of the classes in question . After regasm.exe on the DLL I can see typelib information for each method under the IDispatch node . What I found is that overloaded methods automatically get a name that includes an appended suffix . MethodX will expose overloads in the auto-generated typelib assembly as MethodX MethodX 2 MethodX 3 and so on . And I found that by referencing the method names with those suffixes I could invoke overloaded methods although not with the common name . More interestingly if I then removed the ClassInterface ClassInterfaceType.AutoDual from the classes I could still invoke the overloaded methods in this way thus avoiding the Wrong number of arguments or invalid property assignment error . My question is : is this behavior - appending numeric suffixes to the member names - stable documented dependable .. . Answer : COM does not support method-overloading so .NET COM Interop layer has to improvise . I m not sure if name-mangling as you described as documented anywhere but even if it is I don t think that using it is a good idea - it s still pretty inconvenient API for COM users . If you want to expose your classes to COM the best way is to write a distinct COM-friendly ComVisible interface and hide the class itself . The correct way to handle overloads in a COM-friendly way would be have a single method with some Optional arguments and delegate to your corresponding .NET overloads .", "Question : I am referencing a COM library in Visual Studio so it has automatically created the corresponding Interop assembly for me . I would like to do a GetType on these com objects but they always return System . ComObject . Querying them for an interface works though : .. . .. . But what I really want is this to return the actual type of the com object : .. . .. . Does anyone know how to do what I want to do .. . Answer : You ve basically figured it out . GetType on a COM object is going to give you System . ComObject and you have to try to cast it to something else to see what the object really is . Comment : Hm..is there really no other way Because I can t test for every possible COM object in existing I just want the type . The reason is that I am using the type of an object as a key in a dictionary.. . Comment : Quite obvious.. . Comment : Darin Dimitrov s solution is great .", "Question : I have a C project where I would like to access MS outlook if it is installed on a client s machine . The access outlook part has been done by referencing the outlook COM object and going from there . My problem is now the if it is installed part . At the moment my project doesn t compile on machines without outlook installed so I assume that I will have to not reference the outlook component and instead load and use it dynamically after detecting that outlook is present but I haven t found a way to do this . Am I correct and does anybody have any hints on how to do this Thanks . Edit : Resolved . Following the advice given by Hans Passant in one of the comments about using the office PIAs proved to be the path of least resistance . I had a little difficulty getting the PIAs on my office-less machine but it was overcome using the accepted answer to this http : stackoverflow.com questions 5070124 why-doesnt-the-the-office-pia-install-correctly-to-the-gac question . Comment : Ciao Boris I fear you are mixing development-environment with deployment env . in Development you should reference proper assemblies and these assemblies should be available to build the code . In production you don t have to build anything but your program will require outlook to be installed . Comment : @Davide Piras : I think you are overusing your edit and re-tag privileges.. . Comment : I had done some tag cleanup because for example in this case I believe we do not need both com and com-interop tags.. . sorry if I was wrong Boris . Comment : @Davide Piras : No problem . I am not entirely sure what tags I started out giving this but I don t think I had com-interop as I also do not see a need for both . I do not object to the current four tags but I would like to add some tag that indicated that the question was specifically about loading a COM object based on its availability . I don t know which tag this should be though . .. . Answer : You definitely won t be able to compile your assembly on a machine without the Outlook COM object being present but that doesn t mean that your application will completely fail to work on a machine without Outlook - just that attempting to create or use the Outlook COM object will result in a failure exception being thrown . According to this question http : stackoverflow.com questions 298592 what-is-the-best-way-to-detect-if-a-com-component-is-installed the best way of detecting whether or not a COM object is present is simply attempting to instantiate it and catching the resulting exception in the case where it is not installed . Comment : Thanks . I was unsure of when the COM object was actually loaded but vaguely believing that the code for the object would be loaded at program load-time not at object instantiation time and so in my mind I wasn t sure how to catch that . Just to be sure is it behavior standard for COM objects and assemblies to be loaded only when one of their classes are used Comment : You definitely can that s what type libraries are meant to do . Pretty essential you might not want to target the version you ve got installed for example . MSOutl.olb from the Office install directory copy it to your project directory . Or install the Office PIA . Comment : @Hans Passant : Thanks your advice was what I ended up following . If you make this an answer I will accept it .", "Question : In .NET perspective : .. . .. . What is a Memory Leak http : en.wikipedia.org wiki Memory leak How can you determine whether your application leaks What are the effects How can you prevent a memory leak If your application has memory leak does it go away when the process exits or is killed Or do memory-leaks in your application affect other processes on the system even after process completion And what about unmanaged code accessed via COM Interop and or P Invoke I have some answers for these questions myself but they are incomplete . What do you think .. . Answer : Also keep in mind that .NET has two heaps one being the large-object-heap . I believe objects of roughly 85k or larger are put on this heap . This heap has a different lifetime rules than the regular heap . If you are creating large memory structures Dictionary s or List s it would prudent to go lookup what the exact rules are . As far as reclaiming the memory on process termination unless your running Win98 or it equivalents everything is released back to the OS on termination . The only exceptions are things that are opened cross-process and another process still has the resource open . COM Objects can be tricky tho . If you always use the IDispose pattern you ll be safe . But I ve run across a few interop assemblies that implement IDispose . The key here is to call Marshal.ReleaseCOMObject when you re done with it . The COM Objects still use standard COM reference counting .", "Question : I m using the Excel interop in C ApplicationClass and have placed the following code in my finally clause : .. . .. . Although this kind of works the Excel.exe process is still in the background even after I close Excel . It is only released once my application is manually closed . Anyone realize what I am doing wrong or has an alternative to ensure interop objects are properly disposed of . Comment : Are you trying to shut down the Excel.exe without closing your application Not sure I fully understand your question . Comment : I m trying to make sure the unmanaged interop objects are disposed of properly . So that there are not Excel processes hanging around even when the user has finished with Excel spreadsheet we created from the app . Comment : If you can try to do it by producing XML Excel files otherwise please consider VSTO un managed Memory Management : jake.ginnivan.net vsto-com-interop http : jake.ginnivan.net vsto-com-interop Comment : Does this translate to Excel nicely Comment : See besides answers below this support article from Microsoft where they specifically give solutions to this problem : support.microsoft.com kb 317109 http : support.microsoft.com kb 317109 .. . Answer : The two dots rule did not work for me . In my case I created a method to clean my resources as follows :" ] }
[ "yes-answer-long", "yes-answer-short" ]
.net
UNK_RELATION
oomph@open-source@54
oomph -- eclipse oomph a.k.a eclipse installer is an @placeholder project epl license related to the eclipse ide .
{ "confidence": [ 71.28533172607422, 69.38337707519531, 68.53533172607422, 62.52914810180664, 60.73219680786133, 60.73219680786133, 59.606346130371094, 52.55441665649414, 52.07679748535156, 49.991241455078125, 47.96465301513672, 45.73648452758789, 44.380035400390625, 43.80189514160156, 43.083343505859375, 42.738922119140625, 42.59199905395508, 41.71634292602539, 38.93017578125, 36.84461975097656, 36.109291076660156, 35.377830505371094, 35.16527557373047, 34.46775817871094, 34.07857131958008, 33.86302185058594, 33.21357727050781, 32.71088409423828, 32.71088409423828, 32.479454040527344, 31.49038314819336, 31.327316284179688, 29.467010498046875, 29.404830932617188, 28.021263122558594, 28.021263122558594, 27.200756072998047, 25.888038635253906, 25.888038635253906, 23.583717346191406, 21.806476593017578, 21.271167755126953, 18.62360382080078, 15.780584335327148, 15.780584335327148, 15.780584335327148, 15.780584335327148, 15.780584335327148, 15.780584335327148, 15.780584335327148, 15.780584335327148, 15.780584335327148, 15.780584335327148, 15.780584335327148, 13.69503116607666, 13.69503116607666, 13.69503116607666, 13.69503116607666, 13.69503116607666, 13.69503116607666, 13.69503116607666, 13.69503116607666, 13.69503116607666, 13.69503116607666, 12.311463356018066, 12.311463356018066, 12.311463356018066, 12.311463356018066, 12.311463356018066, 12.311463356018066, 12.311463356018066, 12.311463356018066 ], "content": [ "The Oomph team and the Eclipse fundation are working on this .", "Given an Eclipse installation and a workspace created by Oomph is it possible to let Oomph create a second workspace with a different project setup reusing the same Eclipse installation", "I installed eclipse mars using Oomph installer on Centos 7 .", "The main reason to remove it is to reset the preferences stored with the Oomph Preference Recorder since they will be reused if Eclipse is reinstalled with Oomph .", "This question has been asked before but that was before the integration of Oomph into Eclipse .", ".eclipse : A folder that contains among other things the Oomph profile of the current user .", "See my Blog Post : Oomph changes the way you handle multiple eclipse installations https : www.bsi-software.com en scout-blog article oomph-changes-the-way-you-handle-multiple-eclipse-installations.html .", ".p2 is used to share features and plugins between many Eclipse installations done with Oomph .", "Of course Oomph is a part of Profiles .", "Oomph is the newest latest attempt .", ".. . .. . EDIT : .. . .. . To reproduce your problem : .. . .. . Step 1 : select any Eclipse Eclipse IDE for Eclipse Commiter is one possibility : .. . .. .", "If you want your second workspace to be automatically managed by Oomph I think that the philosophy is to let Oomph manage your installation with your workspace .", "Oomph project selection http : i.stack.imgur.com E45bT.png .. . .. . The setup script of this project has a problem .", "In your second workspace use File Import Oomph Projects into Workspace .", "Trying to setup eclipse development-environment using oomph https : www.eclipse.org community eclipse newsletter 2014 may article3.php but getting an error Cannot complete the install because one or more required items could not be found .. . .. . See stack-trace : .. . .. . Any clues or pointer to resolve this and successfully setup eclipse dev environment using oomph", "For the moment the UA project can not be setup with Oomph until Bug 497350 https : bugs.eclipse.org bugs show bug.cgi id 497350 is solved .", "Your problem is not directly linked to the new Eclipse Installer .", "Oomph only does the setup automation but no synchronization or sharing on its own .", "An install managed by Oomph is less than 20MB + the bundle pool shared across the installations .", "You may want to try Yatta Profiles https : marketplace.yatta.de profiles instead which builds on top of Oomph .", "Profiles includes an Launcher for Eclipse http : profiles.yatta.de download which enables you to manage your different Eclipse Installations with a single applications .", "Oomph product selection http : i.stack.imgur.com thQlK.png .. . .. . Step 2 : select the setup of the project UA UA means user assistance https : wiki.eclipse.org User Assistance under Platform : .. . .. .", "The Eclipse installation folder can obviously be removed .", "This is the first time i used the installer for eclipse and i did not expect that you can t copy plugins anymore .", "I ve already found plenty of related questions on Stack Overflow and the most promising tools seem to be Oomph https : projects.eclipse.org projects tools.oomph and Workspace Mechanic https : code.google.com archive a eclipselabs.org p workspacemechanic .", "Does Oomph have a feature like an Ooomph Cloud where I can login with my Google Account and sync my preferences", "The adoption is good inside the Eclispe Community developers building something on top of Eclipse and the project leaders are really active .", "The folder can be removed but that could break other Eclipse installations if there s some .", "We re looking for a way to synchronize Eclipse workspaces and associated settings at our company .", "If you like to automate this installation process for each of your installations or inside a team you can work with the Oomph setup file to do it .", "You can use Eclipse Profiles for that http : profiles.yatta.de just duplicate the Profile and set the Workspace to another location .", "You should install additional plugins with the Install new software of Eclipse .", ".. . .. . That said you can also create a second workspace with your Eclipse install select another folder during the startup or select Menu File Switch Workspace .", "I use Eclipse on three different computers and want to unify my preferences such as UTF-8 encoding and code templates .", "after copying a plugin to the plugin-folder C : Users myUserName.p2 pool plugins eclipse does not show use this plugin .", "what would be the right way to add our custom birt extension plugin to eclipse these days", "I have selected all components under Eclipse platform for commiters Check here eclipse.org forums https : www.eclipse.org forums index.php t msg th 1078951 goto 1736761 msg 1736761", "What version of the installer", "Latest version of installer on eclipse.org .", "Can you tell what you have selected in the installer", "It allows sharing your IDE setup and workspace settings .", "Eclipse P2 Update Site http : i.stack.imgur.com o8BAK.png .. . .. . A P2 Update site this is also more or less what you bundle pool is consists of folders plugins features containing jars and or bin files and some XML Files named artifacts.xml and content.xml sometimes those files are also packed in jar files .", "Check this : dev.eclipse.org mhonarc lists cross-project-issues-dev http : dev.eclipse.org mhonarc lists cross-project-issues-dev msg12867.html", "The great thing is : the plugins jars are not downloaded twice .", "This way no installation will be created but you can import the projects you want in the second workspace .", "Not nearly enough information is provided to know what might be going on .", "What OS", "What package did you select to install", "etc .", "OS : Ubuntu 14.04 .", "From the log you are trying to install org.eclipse.help.infocenter feature.feature.group and this feature requires org.apache.commons.el .", "Is this a setup task you have written", "If so you probably need a P2 Setup Task containing a P2 Repo providing this bundle .", "I have updated my answer with the steps to reproduce the problem and I have opened Bug 497350 https : bugs.eclipse.org bugs show bug.cgi id 497350", "There is no sharing mechanism but the setup file corresponding to your user scope : user.setup is stored on your machine : .. . .. . You can share this XML file between different computers .", "How do i uninstall it cleanly", "As root you could use whereis and locate to find all the directories or files where things are and then remove them one by one .", "Thanks Jonathan .", "It looks like removing manually is the only way to do it .", "From what I know there s at least 3 folders that can be removed .", "Are there any significant differences between them", "Both projects share similar goals .", "The technical approach and the concepts are not the same .", "I am not sure if the development of Workspace Mechanic continues .", "Does that mean i have to go back to the zip package", "-Christian", "Just copying things to the plugins folder has not been guaranteed to work for a long time .", "Try starting with the -clean option .", "thanks but I tried that too .", "Creating a feature and using Export Plug-in Development Deployable features gives you something that can be installing using Install new software", "The XML Files keep a record of the available plugins .", "You cannot add something manually without tampering your pool ." ] }
{ "confidence": [ 88.64802551269531, 84.01533508300781, 83.82736206054688, 82.16242218017578, 81.99530029296875, 75.15149688720703, 74.9305648803711, 58.03321838378906 ], "content": [ "Question : Trying to setup eclipse development-environment using oomph https : www.eclipse.org community eclipse newsletter 2014 may article3.php but getting an error Cannot complete the install because one or more required items could not be found .. . .. . See stack-trace : .. . .. . Any clues or pointer to resolve this and successfully setup eclipse dev environment using oomph Comment : Not nearly enough information is provided to know what might be going on . What version of the installer What OS What package did you select to install etc . Comment : Latest version of installer on eclipse.org . OS : Ubuntu 14.04 . I have selected all components under Eclipse platform for commiters Check here eclipse.org forums https : www.eclipse.org forums index.php t msg th 1078951 goto 1736761 msg 1736761 .. . Answer : From the log you are trying to install org.eclipse.help.infocenter feature.feature.group and this feature requires org.apache.commons.el . Can you tell what you have selected in the installer Is this a setup task you have written If so you probably need a P2 Setup Task containing a P2 Repo providing this bundle . .. . .. . EDIT : .. . .. . To reproduce your problem : .. . .. . Step 1 : select any Eclipse Eclipse IDE for Eclipse Commiter is one possibility : .. . .. . Oomph product selection http : i.stack.imgur.com thQlK.png .. . .. . Step 2 : select the setup of the project UA UA means user assistance https : wiki.eclipse.org User Assistance under Platform : .. . .. . Oomph project selection http : i.stack.imgur.com E45bT.png .. . .. . The setup script of this project has a problem . For the moment the UA project can not be setup with Oomph until Bug 497350 https : bugs.eclipse.org bugs show bug.cgi id 497350 is solved . Comment : I have selected all components under Eclipse platform for commiters Check here eclipse.org forums https : www.eclipse.org forums index.php t msg th 1078951 goto 1736761 msg 1736761 Comment : I have updated my answer with the steps to reproduce the problem and I have opened Bug 497350 https : bugs.eclipse.org bugs show bug.cgi id 497350", "Question : I installed eclipse mars using Oomph installer on Centos 7 . How do i uninstall it cleanly .. . Answer : As root you could use whereis and locate to find all the directories or files where things are and then remove them one by one . Comment : Thanks Jonathan . It looks like removing manually is the only way to do it . Comment : From what I know there s at least 3 folders that can be removed . The Eclipse installation folder can obviously be removed . .p2 is used to share features and plugins between many Eclipse installations done with Oomph . The folder can be removed but that could break other Eclipse installations if there s some . .eclipse : A folder that contains among other things the Oomph profile of the current user . The main reason to remove it is to reset the preferences stored with the Oomph Preference Recorder since they will be reused if Eclipse is reinstalled with Oomph .", "Question : I use Eclipse on three different computers and want to unify my preferences such as UTF-8 encoding and code templates . This question has been asked before but that was before the integration of Oomph into Eclipse . Does Oomph have a feature like an Ooomph Cloud where I can login with my Google Account and sync my preferences Comment : The Oomph team and the Eclipse fundation are working on this . Check this : dev.eclipse.org mhonarc lists cross-project-issues-dev http : dev.eclipse.org mhonarc lists cross-project-issues-dev msg12867.html .. . Answer : Oomph only does the setup automation but no synchronization or sharing on its own . You may want to try Yatta Profiles https : marketplace.yatta.de profiles instead which builds on top of Oomph . It allows sharing your IDE setup and workspace settings .", "Question : Given an Eclipse installation and a workspace created by Oomph is it possible to let Oomph create a second workspace with a different project setup reusing the same Eclipse installation .. . Answer : You can use Eclipse Profiles for that http : profiles.yatta.de just duplicate the Profile and set the Workspace to another location . Profiles includes an Launcher for Eclipse http : profiles.yatta.de download which enables you to manage your different Eclipse Installations with a single applications . Of course Oomph is a part of Profiles .", "Question : Given an Eclipse installation and a workspace created by Oomph is it possible to let Oomph create a second workspace with a different project setup reusing the same Eclipse installation .. . Answer : If you want your second workspace to be automatically managed by Oomph I think that the philosophy is to let Oomph manage your installation with your workspace . The great thing is : the plugins jars are not downloaded twice . An install managed by Oomph is less than 20MB + the bundle pool shared across the installations . See my Blog Post : Oomph changes the way you handle multiple eclipse installations https : www.bsi-software.com en scout-blog article oomph-changes-the-way-you-handle-multiple-eclipse-installations.html . .. . .. . That said you can also create a second workspace with your Eclipse install select another folder during the startup or select Menu File Switch Workspace . In your second workspace use File Import Oomph Projects into Workspace . This way no installation will be created but you can import the projects you want in the second workspace .", "Question : We re looking for a way to synchronize Eclipse workspaces and associated settings at our company . I ve already found plenty of related questions on Stack Overflow and the most promising tools seem to be Oomph https : projects.eclipse.org projects tools.oomph and Workspace Mechanic https : code.google.com archive a eclipselabs.org p workspacemechanic . Are there any significant differences between them .. . Answer : Both projects share similar goals . The technical approach and the concepts are not the same . Oomph is the newest latest attempt . The adoption is good inside the Eclispe Community developers building something on top of Eclipse and the project leaders are really active . I am not sure if the development of Workspace Mechanic continues .", "Question : I use Eclipse on three different computers and want to unify my preferences such as UTF-8 encoding and code templates . This question has been asked before but that was before the integration of Oomph into Eclipse . Does Oomph have a feature like an Ooomph Cloud where I can login with my Google Account and sync my preferences Comment : The Oomph team and the Eclipse fundation are working on this . Check this : dev.eclipse.org mhonarc lists cross-project-issues-dev http : dev.eclipse.org mhonarc lists cross-project-issues-dev msg12867.html .. . Answer : There is no sharing mechanism but the setup file corresponding to your user scope : user.setup is stored on your machine : .. . .. . You can share this XML file between different computers .", "Question : after copying a plugin to the plugin-folder C : Users myUserName.p2 pool plugins eclipse does not show use this plugin . This is the first time i used the installer for eclipse and i did not expect that you can t copy plugins anymore . Does that mean i have to go back to the zip package -Christian Comment : Just copying things to the plugins folder has not been guaranteed to work for a long time . Try starting with the -clean option . Comment : thanks but I tried that too . what would be the right way to add our custom birt extension plugin to eclipse these days Comment : Creating a feature and using Export Plug-in Development Deployable features gives you something that can be installing using Install new software .. . Answer : Your problem is not directly linked to the new Eclipse Installer . Eclipse P2 Update Site http : i.stack.imgur.com o8BAK.png .. . .. . A P2 Update site this is also more or less what you bundle pool is consists of folders plugins features containing jars and or bin files and some XML Files named artifacts.xml and content.xml sometimes those files are also packed in jar files . The XML Files keep a record of the available plugins . You cannot add something manually without tampering your pool . You should install additional plugins with the Install new software of Eclipse . If you like to automate this installation process for each of your installations or inside a team you can work with the Oomph setup file to do it ." ] }
[ "yes-answer-long", "yes-answer-short" ]
open-source
UNK_RELATION
nested-forms@ruby-on-rails@57
nested-forms -- a form within another form often in the @placeholder environment .
{ "confidence": [ 35.930519104003906, 35.263309478759766, 34.6701545715332, 33.34199523925781, 32.81727600097656, 32.712337493896484, 32.5457649230957, 32.409027099609375, 32.409027099609375, 32.07419204711914, 31.550893783569336, 31.29778289794922, 31.29778289794922, 31.05142593383789, 30.923738479614258, 30.843355178833008, 30.843355178833008, 30.763328552246094, 30.45429801940918, 30.285741806030273, 30.213699340820312, 30.138723373413086, 30.138723373413086, 30.138723373413086, 29.630279541015625, 29.621732711791992, 29.621732711791992, 29.48828887939453, 29.326082229614258, 28.901268005371094, 28.870922088623047, 28.870922088623047, 28.870922088623047, 28.80929946899414, 28.565813064575195, 28.565813064575195, 28.565587997436523, 28.524330139160156, 28.475683212280273, 28.369285583496094, 28.36847686767578, 28.294830322265625, 28.136444091796875, 28.136444091796875, 28.056060791015625, 28.056060791015625, 28.012723922729492, 28.005290985107422, 27.839296340942383, 27.839296340942383, 27.839296340942383, 27.839296340942383, 27.670013427734375, 27.66192054748535, 27.565975189208984, 27.351428985595703, 27.351428985595703, 27.351428985595703, 27.351428985595703, 27.351428985595703, 27.080636978149414, 27.080636978149414, 27.080636978149414, 27.080636978149414, 27.080636978149414, 26.953763961791992, 26.920961380004883, 26.791980743408203, 26.791980743408203, 26.791980743408203, 26.783376693725586, 26.734649658203125, 26.734649658203125, 26.648990631103516, 26.586040496826172, 26.512393951416016, 26.273624420166016, 26.273624420166016, 26.2409725189209, 26.21978759765625, 26.15052032470703, 26.11397361755371, 26.043943405151367, 25.831893920898438, 25.7971248626709, 25.77829360961914, 25.77829360961914, 25.77829360961914, 25.77829360961914, 25.58418846130371, 25.568992614746094, 25.568992614746094, 25.568992614746094, 25.568992614746094, 25.568992614746094, 25.568992614746094, 25.568992614746094, 25.49100685119629, 25.262176513671875 ], "content": [ "I have a form with 2 nested-forms .", "Please read the Nested Forms http : guides.rubyonrails.org form helpers.html nested-forms in Form Helpers chapter of Rails Guide .", "Hi I have a rails form with a nested form .", "From what I ve read Rails in the nested form makes a hidden-field in the nested form that has the project id as a submission .", "Trying to do a simple nested form .", "I m using Nested Forms as described in RailsCasts 197 http : railscasts.com episodes 197-nested-model-form-part-2 .", "Is it because of the nested form", "I am trying to add nested fields in a form .", "A simple workaround is to use a iframe to hold the nested form .", "You should watch RailsCasts Nested Model Form http : railscasts.com episodes 196-nested-model-form-part-1 .", "I have a nested form payments in an order and I would like to test a value in my nested-forms fields for in edit view .", "I have a basic nested form .", "Does it applies for a nested form element", "You mean you want to write a form-for content with nested form-for content block .", "In Angular forms can be nested .", "As u can see on clicking Add More Questions nested form option not shown just question form show .", "Use empty form tag before your nested form .. . .. . Tested and Worked on Firefox Chrome .. . .. . Not Tested on I.E .", "Here is the haml nested form", "You can use th standard Rails form with nestings : .. . .. . http : guides.rubyonrails.org form helpers.html nested-forms .. . .. . Also check Simple Form : .. . .. . https : github.com plataformatec simple-form wiki Nested-Models", "This means that the outer form is valid when all of the child forms are valid as well .", "In the user form I use the gem nested form to dynamically create nested photo forms .", "I am trying to implement nested form in rails with the help of nested form gem .", "can u please explain about your form to be nested", "Visually the form is nested but on the code side its in a separate html file altogether .", "I am trying to create a nested form within the Project form using the Team model and in this nested form I have a collection select field which allows the user to select an existing User s email from the User model and input the data retrieved in a column called : member within the Team model .", "The question is only in pushing custom tag in nested form .", "I m using simple nested form-for to build a form with nested fields .", "I ve been watching and reproducing these railscasts on my app : 196-nested-model-form-part-1 http : railscasts.com episodes 196-nested-model-form-part-1 and 197-nested-model-form-part-2 http : railscasts.com episodes 197-nested-model-form-part-2 .", "try looking at these tuts from railscasts posted january last year .. . .. . .. . http : railscasts.com episodes 196-nested-model-form-part-1 .. . .. . and .. . .. . .. . http : railscasts.com episodes 197-nested-model-form-part-2 .. . .. . I did initially have problems with deep nesting but they all follow the same pattern checkout the problems i faced with rails 3 below .. . .. . .. . Problems adding fields in nested form through jQuery form railscasts episode http : stackoverflow.com questions 6505267 problems-adding-fields-in-nested-form-through-jquery-form-railscasts-episode .. . .. . How to limit nested form fields using jquery not working http : stackoverflow.com questions 6759605 how-to-limit-nested-form-fields-using-jquery-not-working .. . .. . hope this helps as deeply nested fields can be tricky at first", "However browsers do not allow nesting of form elements so Angular provides the ngForm directive which behaves identically to form but can be nested .", "I have a nested form between lets say employee and address .", "For some reason the nested form fields don t appear in the view .", "I m trying to create a nested model form in Rails 3.0.3 .", "I am trying to use multiple nested-attributes within a form though only the first set of attributes appears to be appearing .", "Also there is a good tutorial on nested form by Ryan Bates on Railscasts http : railscasts.com episodes 196-nested-model-form-part-1", "I am following RailsCast 196 http : railscasts.com episodes 196-nested-model-form-part-1 Nested Model Form Part 1 .", "So we need HTML 5.1 with nested-forms .", "I am trying add a nested form of address in user but its throwing error : undefined method accept nested-attributes for for .. . .. . User.rb .. . .. . Address.rb .. . .. . form template .. . .. . controller .. . .. . Please help what am I missing .", "when i tried this on chrome it outputs this form name mainForm form form name subForm form", "Here is my parent form .. . .. . Here is my nested form which is displayed by row in my table in my main form .", "Your Project class must define .. . .. . See Nested Model Form on Railscasts http : railscasts.com episodes 196-nested-model-form-part-1 for more details on how to make the form .", "I ve got a multi layer nested form .. . .. . and in the same form .. . .. . The location form works fine now I m trying to specify prerequisites to the current task .", "I m new to Nested Forms .", "Nested forms are invalid html .", "I have a nested form in a form which on clicking on a button adds a bunch of fields for the user to complete .", "I need to put a value of beauty type id in beauty type form to product in nested form format .", "using an upload photo form with a profile edit form .", "I want to create an appointment form with dynamics forms .", "How does the html generated by the nested form look", "How I can do this in my nested form .", "So I know that this nested form should be working", "Are you using cocoon or nested-form gem", "I want to add one other element to nested form when I select twice a day and add two other elements to nested form when I select 3 times a day and so on .", "I am at the moment creating a complicated rails form-for 1 : n relationship with nested form and collection select with values from yet another data table .", "The main form : .. . .. . And the included form is as follows .", "I m trying to use the HTML5 multiple attribute on a file field in a nested form .", "Are you creating tasks through a nested form when you create the project", "I didn t seem to need this in my other nested form .", "I would like a nested form to create Bananas as well as Images .", "How to forbid the app to edit grapes through the nested form", "Now if a task was made in the nested form-for Project then since Task belongs-to project it will have a column for project id .", "github.com ryanb nested form https : github.com ryanb nested form ..clear guide for implementing nested form is in this link", "So I m building a nested form with an Campaigns model and a Sites model where Campaigns has-many Sites .", "If you re using AngularJS any form tags inside your ng-app are replaced at runtime with ngForm directives that are designed to be nested .", "Each item wants to have its own nested form with a Submit Item N button .", "I m trying to create a navigation menu editor comprised of multiple nested sortable forms that will ultimately be submitted en masse as one giant nested JSON data blob containing all of the form-data .", "I have another form to add grapes .", "I have a nested form to create products that permit nested-attributes for creating categories .", "Try adding a hidden-field for the user s id in the nested form : .. . .. . The nested save will use this to determine if it is a create or an update for the User .", "You could use fields for to build the nested-attributes form-for your roads and permit nested-attributes like the example .", "I initially used this RailsCast as a blueprint leveraging accepts nested-attributes for : Railscast 196 : Nested Model Form http : railscasts.com episodes 196-nested-model-form-revised .", "You can have several forms in a page but they should not be nested .", "There are many examples where using nested-forms would be easier to program i.e .", "With Ryan Daigle s Nested Object Forms post http : ryandaigle.com articles 2009 2 1 what-s-new-in-edge-rails-nested-attributes I ve made this work in a form to edit all possible Completions for a user but I need to edit a subset of possible Completions in one form .", "I m using Rails 4.2.2 Ruby version 2.2.1 . .. . .. . schema .. . .. . user model .. . .. . preference model .. . .. . actual form that has contains the partials to the nested form : .. . .. . partial that includes nested form .. . .. . user controller pertaining to the user params", "I am trying to refresh the second nested form once the first form is used to create an object which is what is inserted into the second form .", "I ve also tried removing the form partial putting the nested form in locally but that didn t help .", "Added the full form that has a partial of the settings form which includes the nested partial .", "The form attribute is new in HTML5 .", "If at least one of the forms is being submitted with javascript then it would probably be better to create the form elsewhere and copy the values or move the form elements prior to submitting .", "The code can be found at : github.com railscasts 196-nested-model-form-revised tree master https : github.com railscasts 196-nested-model-form-revised tree master questionnaire-after", "In my vendors form I have used nested form to create vendor products with attributes as vendor id product id and copies.On creating a new vendor it also creates a vendor product .", "A post has-many materiel links and accepts nested-attributes for : materiel links .. . .. . I use the gem cocoon to create a nested form : on the post form I want to be able to add links that will be created on submit of the form .", "I have a problem with nested form and has-many relation .", "When dealing with nested-forms and singular associations it is necessary to ensure that if the association doesn t already exist on the model it is built-in the controller so that it is available to the form builder .", "I am using nested-forms for images .", "But isn t the nested-forms what gives you trouble", "Deeply nested Rails forms using belong to not working", "Nested forms does not only create new associations .", "In form .on form ... .", "I ve been struggling to get my nested form to save the users inputs .", "I have 3 models : .. . .. . The below form is for the profile but with the organization nested inside of it .", "I have created a nested model form-for Lessons to Questions and Answers .", "However when I load the form the nested field does not show .", "I have for-loop inside nested form but @customer answer.customer answer details.build is not working inside .", "I am working on a dynamically nested form using the cocoon-gem .", "Right now the nested form is not showing up on the actual page .", "Specifies the form element the element belongs-to .", "This allows you to have nested-forms which is very useful when using Angular validation directives in forms that are dynamically generated using the ngRepeat directive ." ] }
{ "confidence": [ 39.27346420288086, 38.79676818847656, 38.54038619995117, 38.16321563720703, 36.123565673828125, 35.209930419921875, 35.038211822509766, 34.77592086791992, 34.542808532714844, 34.20661544799805, 34.14175796508789, 34.08594512939453, 33.81119155883789, 33.37393569946289, 33.174922943115234, 32.63835525512695, 32.147708892822266, 31.94650650024414, 31.730085372924805, 31.667068481445312 ], "content": [ "Question : Is it possible to nest html forms like this .. . .. . so that both forms work My friend is having problems with this a part of the subForm works while another part of it does not . Comment : As a matter of interest why would you want to do this I m not trying to criticise I just can t imagine why you d want to do it . Comment : He is setting up a cart where the update quantity is inside of the form that keeps track of totals . I personally wouldn t do that but he is running into problems getting that to work . Comment : Seems like he d be better off using Javascript to copy values from one form to the other rather than trying to nest them . I don t think the nesting will work . Comment : Old question but to answer the comment nesting forms could be necessary to avoid JavaScript . I m coming across this because I d like to nest forms for subform reset buttons which don t require JavaScript to be enabled . Comment : Possible duplicate of : stackoverflow.com questions 597596 http : stackoverflow.com questions 597596 how-do-you-overcome-the-html-form-nesting-limitation .. . Answer : If you re using AngularJS any form tags inside your ng-app are replaced at runtime with ngForm directives that are designed to be nested . In Angular forms can be nested . This means that the outer form is valid when all of the child forms are valid as well . However browsers do not allow nesting of form elements so Angular provides the ngForm directive which behaves identically to form but can be nested . This allows you to have nested-forms which is very useful when using Angular validation directives in forms that are dynamically generated using the ngRepeat directive . source https : docs.angularjs.org api ng directive form Comment : angular saves the day jsfiddle.net gikoo qNrFX http : jsfiddle.net gikoo qNrFX", "Question : I m looking for a working tutorial for Rails 3.1 that shows you step-by-step how to create a nested model that s 3 levels deep . The complex forms screencasts http : railscasts.com episodes 73-complex-forms-part-1 on RailsCasts doesn t seem to be working seeing that the code is 4+ years old . .. . Answer : try looking at these tuts from railscasts posted january last year .. . .. . .. . http : railscasts.com episodes 196-nested-model-form-part-1 .. . .. . and .. . .. . .. . http : railscasts.com episodes 197-nested-model-form-part-2 .. . .. . I did initially have problems with deep nesting but they all follow the same pattern checkout the problems i faced with rails 3 below .. . .. . .. . Problems adding fields in nested form through jQuery form railscasts episode http : stackoverflow.com questions 6505267 problems-adding-fields-in-nested-form-through-jquery-form-railscasts-episode .. . .. . How to limit nested form fields using jquery not working http : stackoverflow.com questions 6759605 how-to-limit-nested-form-fields-using-jquery-not-working .. . .. . hope this helps as deeply nested fields can be tricky at first Comment : I didn t even know about those nested model forms tutorials at rails casts I ll take a look at those : Thanks man . Comment : @imjp no problem glad to help", "Question : Is it possible to nest html forms like this .. . .. . so that both forms work My friend is having problems with this a part of the subForm works while another part of it does not . Comment : As a matter of interest why would you want to do this I m not trying to criticise I just can t imagine why you d want to do it . Comment : He is setting up a cart where the update quantity is inside of the form that keeps track of totals . I personally wouldn t do that but he is running into problems getting that to work . Comment : Seems like he d be better off using Javascript to copy values from one form to the other rather than trying to nest them . I don t think the nesting will work . Comment : Old question but to answer the comment nesting forms could be necessary to avoid JavaScript . I m coming across this because I d like to nest forms for subform reset buttons which don t require JavaScript to be enabled . Comment : Possible duplicate of : stackoverflow.com questions 597596 http : stackoverflow.com questions 597596 how-do-you-overcome-the-html-form-nesting-limitation .. . Answer : In a word no . You can have several forms in a page but they should not be nested . From the html5 working draft https : www.w3.org TR html5 forms.html the-form-element : .. . .. . 4.10.3 The form element .. . .. . Content model : .. . .. . Flow content but with no form element descendants . Comment : and if you try that in asp.net it s not that simple either.. . Comment : I agree with the answer but to ask another why not Why does HTML not allow for nesting forms To me it appears to be a limitation that we would be better off without . There are many examples where using nested-forms would be easier to program i.e . using an upload photo form with a profile edit form . Comment : @Nilzor he s not asking whether or not it can t be done he s asking WHY not . I agree nesting forms is actually really useful . So if you have a one page app with tabs each tab is its own form so you can submit it to save progress and they re all wrapped in a form which you can submit to save everything . Makes sense to me . Comment : I agree with what others have said . This limitation seems arbitrary and harmful . Comment : So we need HTML 5.1 with nested-forms .", "Question : Is it possible to nest html forms like this .. . .. . so that both forms work My friend is having problems with this a part of the subForm works while another part of it does not . Comment : As a matter of interest why would you want to do this I m not trying to criticise I just can t imagine why you d want to do it . Comment : He is setting up a cart where the update quantity is inside of the form that keeps track of totals . I personally wouldn t do that but he is running into problems getting that to work . Comment : Seems like he d be better off using Javascript to copy values from one form to the other rather than trying to nest them . I don t think the nesting will work . Comment : Old question but to answer the comment nesting forms could be necessary to avoid JavaScript . I m coming across this because I d like to nest forms for subform reset buttons which don t require JavaScript to be enabled . Comment : Possible duplicate of : stackoverflow.com questions 597596 http : stackoverflow.com questions 597596 how-do-you-overcome-the-html-form-nesting-limitation .. . Answer : A simple workaround is to use a iframe to hold the nested form . Visually the form is nested but on the code side its in a separate html file altogether .", "Question : Is it possible to nest html forms like this .. . .. . so that both forms work My friend is having problems with this a part of the subForm works while another part of it does not . Comment : As a matter of interest why would you want to do this I m not trying to criticise I just can t imagine why you d want to do it . Comment : He is setting up a cart where the update quantity is inside of the form that keeps track of totals . I personally wouldn t do that but he is running into problems getting that to work . Comment : Seems like he d be better off using Javascript to copy values from one form to the other rather than trying to nest them . I don t think the nesting will work . Comment : Old question but to answer the comment nesting forms could be necessary to avoid JavaScript . I m coming across this because I d like to nest forms for subform reset buttons which don t require JavaScript to be enabled . Comment : Possible duplicate of : stackoverflow.com questions 597596 http : stackoverflow.com questions 597596 how-do-you-overcome-the-html-form-nesting-limitation .. . Answer : While I don t present a solution to nested-forms it doesn t work reliably I do present a workaround that works for me : .. . .. . Usage scenario : A superform allowing to change N items at once . It has a Submit All button at the bottom . Each item wants to have its own nested form with a Submit Item N button . But can t.. . In this case one can actually use a single form and then have the name of the buttons be submit 1 . . submit N and submitAll and handle it servers-side by only looking at params ending in 1 if the name of the button was submit 1 . Ok so not much of an invention but it does the job .", "Question : Is it possible to nest html forms like this .. . .. . so that both forms work My friend is having problems with this a part of the subForm works while another part of it does not . Comment : As a matter of interest why would you want to do this I m not trying to criticise I just can t imagine why you d want to do it . Comment : He is setting up a cart where the update quantity is inside of the form that keeps track of totals . I personally wouldn t do that but he is running into problems getting that to work . Comment : Seems like he d be better off using Javascript to copy values from one form to the other rather than trying to nest them . I don t think the nesting will work . Comment : Old question but to answer the comment nesting forms could be necessary to avoid JavaScript . I m coming across this because I d like to nest forms for subform reset buttons which don t require JavaScript to be enabled . Comment : Possible duplicate of : stackoverflow.com questions 597596 http : stackoverflow.com questions 597596 how-do-you-overcome-the-html-form-nesting-limitation .. . Answer : Use empty form tag before your nested form .. . .. . Tested and Worked on Firefox Chrome .. . .. . Not Tested on I.E . Comment : when i tried this on chrome it outputs this form name mainForm form form name subForm form Comment : Did you tried with submit button . I m used this method many times and always worked . Comment : This is a violation of the specification and using it is begging for future problems .", "Question : I am trying to implement nested form in rails with the help of nested form gem . I want the nested fields to be displayed in tabular format . Can any one help me out Following is my view file : .. . .. . This structure adds the nested fields outside the table structure . How to add it within div class table-body .. . Answer : can u please explain about your form to be nested inside your parent form model .. . accepts nested-attributes for : your nested form .. . inside your parent form .. . nested form-for @your parent form do f Comment : github.com ryanb nested form https : github.com ryanb nested form ..clear guide for implementing nested form is in this link", "Question : I want to include a collection type inside another collection type . It should look like this : enter image description here http : i.stack.imgur.com fceax.jpg .. . .. . Using just one collection works fine but I need to edit the prototype of the outer form so it renders the prototype of the inner form-for each line . Any ideas how could I do that Also what would be the best way to save .. . .. . EDIT : Now I am trying to render the prototype of the nested form : .. . .. . It gives error in form widget form.characteristics.options.vars.prototype e .. . .. . I tried characteristics 0 and it says the key doesnt exist .. . .. . Here are my form classes : .. . .. . PromotionType the base form .. . .. . PromotionCharacteristicType .. . .. . PromotionCharacteristicOptionType .. . .. . The first level prototype works fine . .. . Answer : forms and prototype .. . .. . You need to keep two prototypes from different collections . Symfony offers to store them in a data-prototype attribute of div tag which wrap the collection . In your situation it s very inefficient . So you can just render it by hand in empty div somethere .. . .. . Example you have characters form .. . .. . Then create form that has characters collection .. . .. . and get prototypes .. . .. . And then render collection like in this example http : symfony.com doc current reference forms types collection.html adding-and-removing-items or override collection widget block .. . .. . how to save it .. . .. . Use nosql database if you can . Or use EAV http : en.wikipedia.org wiki Entity E2 80 93attribute E2 80 93value model model for relation databases . But if you do not need to search through the options or sort them you can store a serialized array in the database and use the doctrine type array Comment : I have a problem with data-prototype2 : Key 0 in object with ArrayAccess of type Symfony Component Form FormView does not exist . Comment : Sorry set up new version of symfony and see the error . Update my answer . Comment : Thank you for your help . Comment : Thank you too good question Comment : Thanks . Only in your answer I found how to reach the prototype in nested-forms : data-prototype-opt form widget form.chars.vars.prototype.children opts .vars.prototype e .", "Question : null .. . Answer : Using nested-forms in rails for association forms . Survey model .. . .. . Question model .. . .. . In survey form when I click on .. . .. . Question fields open but options fields not open.It open by click on question.link to add Add more options : options .. . .. . I want when I click on add more questions option fields also appear .. . .. . Here is screenshot of my page . As u can see on clicking Add More Questions nested form option not shown just question form show . http : i.stack.imgur.com zc78I.png", "Question : null .. . Answer : When dealing with nested-forms and singular associations it is necessary to ensure that if the association doesn t already exist on the model it is built-in the controller so that it is available to the form builder . I have often seen this done something like this : .. . .. . I have always found this approach to be rather clunky . Is there a better way to handle this I have tried directly using a method something like this which I call from the form where the nested model is needed but it didn t feel right : .. . .. . I have also tried moving this out to a Draper decorator but again this feels wrong .", "Question : I have this fragment : .. . .. . and all is working as expected . What I d like to achieve is this : .. . .. . but I unsuccessfully tried some combination of process and update for button1 resulting in process anything.. . input1 is even resetting.. . So how to build a p : dialog that can be shipped inside a fragment or a composite comp and that is excluded from outside form Note that using : .. . .. . is not an acceptable solution . I m on JSF 2.2.8 mojarra and PF 5.1 Comment : I guess its not acceptable to start the include with h : form and end with h : form : Seems to me you ll get nested-forms no matter what Comment : no it isn t allowed : however i m not trying to avoid nested-forms i m trying to make them work with the help of appendTo attribute . according to PF dialog docs this should be possible . Comment : But isn t the nested-forms what gives you trouble I always expected it would be unnested in the outputted html through appendTo . There is some discussion on primefaces forum about it maybe you can find something there Comment : Try using the form name instead of @form Comment : possible duplicate of Can you nest html forms http : stackoverflow.com questions 379610 can-you-nest-html-forms .. . Answer : Only use one form inside of dialog . Work fine for me . Comment : did you read the question", "Question : Is it possible to nest html forms like this .. . .. . so that both forms work My friend is having problems with this a part of the subForm works while another part of it does not . Comment : As a matter of interest why would you want to do this I m not trying to criticise I just can t imagine why you d want to do it . Comment : He is setting up a cart where the update quantity is inside of the form that keeps track of totals . I personally wouldn t do that but he is running into problems getting that to work . Comment : Seems like he d be better off using Javascript to copy values from one form to the other rather than trying to nest them . I don t think the nesting will work . Comment : Old question but to answer the comment nesting forms could be necessary to avoid JavaScript . I m coming across this because I d like to nest forms for subform reset buttons which don t require JavaScript to be enabled . Comment : Possible duplicate of : stackoverflow.com questions 597596 http : stackoverflow.com questions 597596 how-do-you-overcome-the-html-form-nesting-limitation .. . Answer : Although the question is pretty old and I agree with the @everyone that nesting of form is not allowed in HTML .. . .. . But this something all might want to see this .. . .. . where you can hack I m calling it a hack since I m sure this ain t legitimate html to allow browser to have nested form .. . .. . JS FIDDLE LINK .. . .. . http : jsfiddle.net nzkEw 10", "Question : What I have is a remote form inside another remote form like this : .. . .. . But then I click the second submit it doesn t do a remote call It does a normal call with leads me to an error Missing Template because my action only responds to JS Ajax Calls Comment : I know this doesn t answer the question but according to the W3C http : www.w3.org you aren t allowed to nest form tags http : dev.w3.org html5 markup form.html form-constraints . That might be the overall issue with the forms itself . .. . Answer : Nested forms are invalid html . The browsers behaviour is undefined what to do in such a case . It s just like trying to use IDs multiple times inside a html document . It will normally be the earliest occurrence of the ID that will be selected by a document.getElementById and here you are finding the outermost earliest form is the one that is submitting . If at least one of the forms is being submitted with javascript then it would probably be better to create the form elsewhere and copy the values or move the form elements prior to submitting .", "Question : Is it possible to nest html forms like this .. . .. . so that both forms work My friend is having problems with this a part of the subForm works while another part of it does not . Comment : As a matter of interest why would you want to do this I m not trying to criticise I just can t imagine why you d want to do it . Comment : He is setting up a cart where the update quantity is inside of the form that keeps track of totals . I personally wouldn t do that but he is running into problems getting that to work . Comment : Seems like he d be better off using Javascript to copy values from one form to the other rather than trying to nest them . I don t think the nesting will work . Comment : Old question but to answer the comment nesting forms could be necessary to avoid JavaScript . I m coming across this because I d like to nest forms for subform reset buttons which don t require JavaScript to be enabled . Comment : Possible duplicate of : stackoverflow.com questions 597596 http : stackoverflow.com questions 597596 how-do-you-overcome-the-html-form-nesting-limitation .. . Answer : Note you are not allowed to nest FORM elements http : www.w3.org MarkUp html3 forms.html Comment : I have no idea why you d post on a question that has been answered 3 and a half years but more problematic is linking to HTML3 which hasn t been a recommendation for a long time . Comment : It s a reference to how long the underlying question has been answered which I believed to be constructive . Also I found the tact-free Note you are not allowed to nest FORM elements within the spec to be humorous . Comment : This is a problem because I have to insert an API that is a form and because .net app which wraps a form tag around everything . How do you overcome this issue .", "Question : null .. . Answer : Quick problem description .. . .. . The value of the id in a nested form is rendered as 10006.0 instead of 10006 decimal float instead of an integer resulting in an ActiveRecord : : RecordNotFound exception . What is causing this behaviour The code setup .. . .. . So I followed the rails-guides tutorial http : guides.rubyonrails.org form helpers.html building-complex-forms on how to build nested-forms . My 2 models are : .. . .. . and .. . .. . My form includes haml snippet with the : id field explicitly rendered for debugging purposes . The value of the id box is rendered as 10006.0 instead of 10006 decimal float instead of an integer resulting in an ActiveRecord : : RecordNotFound exception when updating because there s only a record with id 10006 . My current environment .. . .. . Otherwise fully functioning .. . .. . jruby 1.7.19 1.9.3p551 2015-01-29 20786bd on Java HotSpot TM 64-Bit Server VM 1.8.0 45-b14 +jit darwin-x86 64 .. . JDBC Oracle Thin Driver Implementation-Version : 11.2.0.4.0 .. . Rails 4.0.13 .. . Boostrap 3 for Layouts Comment : What is the database type of the id field Comment : ExecutionGroup.columns hash : id .type gives me integer . And on ExecutionGroup.first.id on the rails console returns something like 10001 . The above behaviour happens only when using nested-forms . Any ideas Comment : Curious if you remove the include id : false and let rails generate the hidden input is the id in there also a float Comment : Yes it is . I ve only started to use include id : false after I got the strange errors . Comment : Hmm well you could convert it back to an int in your controller but that s just a workaround . Have you tried on MRI vs jRuby", "Question : I want to write data for 2 different models that are related to each other like this : .. . .. . Of course de roads table has a post id column . My form-for in the post view looks like this .. . .. . Finally my posts controller create method .. . .. . with the private .. . .. . The post is submitted and if i check the console all the atributes for post has been saved but the ones for road has not . How can i use just one form two make records for these two models and that the post id gets registered so i can relate the tables Thanks a lot .. . Answer : Please read the Nested Forms http : guides.rubyonrails.org form helpers.html nested-forms in Form Helpers chapter of Rails Guide . You could use fields for to build the nested-attributes form-for your roads and permit nested-attributes like the example . Below is an example from rails guide you could try and figure it out yourself . form.html.erb .. . .. . permit nested-attributes in people controller.rb Comment : Hey Thanks there was the solution i was missing the @post.roads.build in the posts controller", "Question : Using Rails 2.3.8 .. . .. . Goal is to create a Blogger while simultaneously updating the nested User model in case info has changed etc . OR create a brand new user if it doesn t exist yet . Model : .. . .. . Blogger controller : .. . .. . Form : .. . .. . Works fine when I m creating a new user via the nested model but fails if the nested user already exists and has and ID in which case I d like it to simply update that user . Error : .. . .. . This SO question deals with a similar issue and only answer suggests that Rails simply won t work that way . The answer suggests simply passing the ID of the existing item rather than showing the form-for it -- which works fine except I d like to allow edits to the User attributes if there are any . Deeply nested Rails forms using belong to not working http : stackoverflow.com questions 3783247 deeply-nested-rails-forms-using-belong-to-not-working .. . .. . Suggestions This doesn t seem like a particularly uncommon situation and seems there must be a solution . .. . Answer : Try adding a hidden-field for the user s id in the nested form : .. . .. . The nested save will use this to determine if it is a create or an update for the User . Comment : Rails actually already does this essentially . If the User object already exists it adds a hidden blogger user attributes id form field not present if it s a new user . As the error message in my original notes Rails knows the ID of the nested model . Comment : Did you confirm that it s actually showing up in the HTML Comment : Yes definitely not a problem with the ID of the nested object being passed . In the error I pasted in original it knows the ID of the nested object User is 7 and the outer object Blogger doesn t have an ID yet because it s brand new . It just apparently freaks out in that situation .", "Question : I have 3 models in my Rails 4.2 app : .. . .. . My cocoon form with nested-attributes is working well . My uniq problem is I don t want to allow to create update grapes through the nested form . My vintage owns many grapers associated to grapes . I don t want the app can create update grapes through this form . I have another form to add grapes . I just want to use the nested form to attach grapes to vintage through grapers . What did I miss How to forbid the app to edit grapes through the nested form Actually for example if I enter Merlo and don t click on Merlot row the app will-change Merlot to Merlo in my database EDIT : Code in my view : .. . Answer : If you do not want grapes to be created then you should remove . You cocoon form should generate graper forms from which you can choose but not edit grapes . Also in your sanitizer do not permit grapes parameters . Comment : In fact I have already removed accepts nested-attributes for : grapes in the vintage model . But I can yet change a grape name for example . What do you mean by grape parameters in my sanitizer I added my link-to add association in the main message . Comment : OK I commented attr-accessible : grape attributes in the graper model . Seems to work : I can t change a graper grape already saved . I need to remove the graper grape and add a new one if I want to change . Comment : The default rails sanitizer is strong parameters and you do not have to comment attr-accessible .", "Question : Is it possible to nest html forms like this .. . .. . so that both forms work My friend is having problems with this a part of the subForm works while another part of it does not . Comment : As a matter of interest why would you want to do this I m not trying to criticise I just can t imagine why you d want to do it . Comment : He is setting up a cart where the update quantity is inside of the form that keeps track of totals . I personally wouldn t do that but he is running into problems getting that to work . Comment : Seems like he d be better off using Javascript to copy values from one form to the other rather than trying to nest them . I don t think the nesting will work . Comment : Old question but to answer the comment nesting forms could be necessary to avoid JavaScript . I m coming across this because I d like to nest forms for subform reset buttons which don t require JavaScript to be enabled . Comment : Possible duplicate of : stackoverflow.com questions 597596 http : stackoverflow.com questions 597596 how-do-you-overcome-the-html-form-nesting-limitation .. . Answer : I ran into a similar problem and I know that is not an answer to the question but it can be of help to someone with this kind of problem : .. . if there is need to put the elements of two or more forms in a given sequence the HTML5 input form attribute can be the solution . Form http : www.w3schools.com tags att input form.asp : .. . .. . 1 . The form attribute is new in HTML5 . 2 . Specifies the form element the element belongs-to . The value of this attribute must be the id attribute of a element in the same document . Scenario : .. . .. . .. . input Form1 n1 .. . input Form2 n1 .. . input Form1 n2 .. . input Form2 n2 .. . .. . Implementation : .. . .. . Note : The form attribute does not work in any version of Internet Explorer .", "Question : I m working on a messy form which among other things has to manage a section with two-level nesting . It s almost working but there s a snag and the only thing I can see that s different from other deeply-nested forms that work is that there s a belongs-to relationship rather than has-many . Here are the models : .. . .. . So it s a fairly standard many-to-many relationship via a link table company events . The form in question is creating editing an event with a dynamic Add Company Javascript button all pretty much based on Ryan Bates screencast and GitHub repo . The main form : .. . .. . And the included form is as follows . An important thing to note is that the company ID is set via a Javascript update which I won t include here because it s long . Basically the user starts typing a name an autocomplete list is displayed and clicking on the name sets both the company name and the id in the form . When I update an existing record everything works just fine . When I try to save the form with a newly-created record though I get : .. . .. . With the stacktrace : .. . .. . I ve looked through the code in nested-attributes and run through it with a debugger . What s happening seems to be that because there s a Company.id ActiveRecord is assuming that there is already an entry but then of course it doesn t find one . This seems very odd since obviously I d need to pass in an ID in order to create a new CompanyEvent entry . So I m guessing that I m missing something . The examples I ve found that work all seem to be nested using has-many relationships all the way down while in this case it s a belongs-to and I m wondering if that s the root of the problem . Any ideas would be greatly appreciated.. . .. . Answer : Here s another possible solution that I posted in a similar question : http : stackoverflow.com a 12064875 47185 .. . .. . Something like this.. ." ] }
[ "yes-answer-long", "yes-answer-short" ]
ruby-on-rails
UNK_RELATION
value-restriction@value-restriction@101
value-restriction -- in functional-programming in particular the ml programming language family the @placeholder means that declarations are only polymorphically generalized if they are syntactic values also called non-expansive .
{ "confidence": [ 37.415931701660156, 35.89437484741211, 34.12084197998047, 33.83556365966797, 33.60987091064453, 33.392112731933594, 33.1180419921875, 32.83527374267578, 31.914371490478516, 31.914371490478516, 31.069393157958984, 30.677597045898438, 29.898420333862305, 29.898420333862305, 29.747312545776367, 29.732728958129883, 29.27644920349121, 29.128190994262695, 29.00231170654297, 29.00231170654297, 29.00231170654297, 29.00231170654297, 28.830825805664062, 28.480422973632812, 28.410457611083984, 28.332752227783203, 28.11614990234375, 27.965045928955078, 27.383583068847656, 27.383583068847656, 27.383583068847656, 27.343101501464844, 26.745716094970703, 26.745716094970703, 26.745716094970703, 26.745716094970703, 26.745716094970703, 26.745716094970703, 26.745716094970703, 26.745716094970703, 26.745716094970703, 26.745716094970703, 26.745716094970703, 26.068004608154297, 25.992393493652344, 25.992393493652344, 25.992393493652344, 25.992393493652344, 25.44348907470703, 25.43362808227539, 25.3646297454834, 25.3646297454834, 25.3646297454834, 25.15898895263672, 25.126985549926758, 25.126985549926758, 25.126985549926758, 25.126985549926758, 24.373661041259766, 24.329500198364258, 24.251827239990234, 24.225040435791016, 24.01380729675293, 23.817764282226562, 23.817764282226562, 23.817764282226562, 23.745899200439453, 23.745899200439453, 23.745899200439453, 23.4866943359375, 23.4866943359375, 23.385133743286133, 23.352243423461914, 23.186893463134766, 23.186893463134766, 23.02978515625, 22.950851440429688, 22.801250457763672, 22.606307983398438, 22.51620101928711, 22.207056045532227, 22.199033737182617, 22.13666534423828, 22.13666534423828, 22.132352828979492, 21.94647216796875, 21.754549026489258, 21.723926544189453, 21.60588264465332, 20.949447631835938, 20.949447631835938, 20.829788208007812, 20.829788208007812, 20.81204605102539, 20.454984664916992, 20.411888122558594, 20.28026580810547, 20.28026580810547, 20.265953063964844, 20.20119857788086 ], "content": [ "I suggest you read up on the value-restriction https : realworldocaml.org v1 en html imperative-programming-1.html the-value-restriction .", "PS : Value restriction is a different problem - that essentially means that F cannot make things that are not syntactic functions generic but in your example you re writing syntactic functions so that s not the issue here .", "You re hitting the infamous value-restriction https : realworldocaml.org v1 en html imperative-programming-1.html the-value-restriction : .. . .. . Those a b c d mean types to be determined as soon as we can .", "The value-restriction is a syntactic restriction .", "Per The Definition of Standard ML Revised : .. . .. . The idea is that dynamic evaluation of a non-expansive expression will neither generate an exception nor extend the domain of the memory while the evaluation of an expansive expression might .", "Value restriction error : .. . .. . No value-restriction error : .. . .. . Why", "F inherits this from OCaml and I believe value-restriction exists in all ML variants .", "This is the value-restriction I believe .", "You re encountering the F value-restriction .", "OCaml has a relaxed value-restriction .", "Your listIntoJsonArray and listIntoJsonObject are values not functions so you met value-restriction http : blogs.msdn.com b mulambda archive 2010 05 01 value-restriction-in-f.aspx monster .", "Is there any way around the value-restriction here", "But whenever I tried to test with any input in F Interactive : .. . .. . I encountered a value-restriction error : .. . .. . error FS0030 : Value restriction .", "see Finer Points of F Value Restriction http : blogs.msdn.com b mulambda archive 2010 05 01 value-restriction-in-f.aspx", "I d like it to be generic but putting it into a file apart from its usage yields a value-restriction error : .. . .. . Value restriction .", "Possibly see also stackoverflow.com questions 1131456 http : stackoverflow.com questions 1131456 understanding-f-value-restriction-errors", "This seems to do with value-restriction .", "This approach is a bit more concise but very likely less familiar to someone new to functional-programming so I ve tried to describe this process in more detail .", "Editing because this is not really the value-restriction calling it such will confuse readers .", "It s worth pointing out that the value-restriction doesn t mention ref anywhere .", "Thus a lot of discussion about the value-restriction naturally involves ref .", "I don t understand that the function my path mapper doesn t subject to the value-restriction .", "You can see that if you enter just the two let declarations to F Interactive so that the compiler doesn t infer the type from the first use : .. . .. . error FS0030 : Value restriction .", "I want to define sumOfSquares without explicity using parameter relying instead on functional composition .. . .. . Here s my code below .. . .. . However I got the following error .. . .. . stdin 80 5 : error FS0030 : Value restriction .", "Only syntactic functions can be inlined .", "This is unfortunate in your case since it means that you have to explicitly annotate makeElem with a type-annotation or make it a syntactic function .", "I get the value-restriction error on let makeElem in the following code : .. . .. . Why I get the value-restriction error if anonymous function returned from elemCreator hasn t any generic parameters", "Still learning F - never worked with a functional language before .", "I don t understand how the Value Restriction in F works .", "Value restriction was introduced to address some issues with polymorphism in the presence of side effects .", "Your example does not obey the value-restriction since it is a function application .", "In your case you have the equivalent of .. . .. . so bar is a value rather than a syntactic function .", "I have read all treads about value-restriction in F but I still not understand it .", "in OCaml .. . .. . In F .. . .. . What whould I do to be able to pass the empty list as argument without triggering a value-restriction error", "But when I insert a empty list as parameter I get this error : .. . .. . stdin 78 1 : error FS0030 : Value restriction .", "The compiler does essentially the same inference procedure except now the value-restriction applies .", "Simple enough but I keep getting a value-restriction error and I cannot figure out why .", "My apologies for the late comment : Unfortunately that did not seem to solve the issue and the value-restriction error remains .", "I learned about this use of the variance annotation from @gasche here : When does the relaxed value-restriction kick in in OCaml", "http : stackoverflow.com questions 15561714 when-does-the-relaxed-value-restriction-kick-in-in-ocaml 15562110 15562110", "There s nothing particularly special about ref except that under the relaxed value-restriction it s invariant with respect to subtyping .", "ref was a lot more special in SML which is the context in which the value-restriction was originally proposed .", "http : stackoverflow.com questions 15561714 when-does-the-relaxed-value-restriction-kick-in-in-ocaml s 1 7C3.9878", ".. . .. . As an example of why generative exceptions are useful consider MLton s sample implementation of a universal type http : www.mlton.org UniversalType : .. . .. . This code would cause a huge type safety hole if ML had no value-restriction :", "Here s a good explanation of some workarounds : http : stackoverflow.com questions 1131456 understanding-f-value-restriction-errors .. . .. . Here s a fairly in-depth article explaining the reasons behind it : http : blogs.msdn.com b mulambda archive 2010 05 01 value-restriction-in-f.aspx", "csvList looks generic enough : string - string - a list - a - string - string .. . .. . But you ve encountered Value Restriction http : stackoverflow.com questions 1131456 understanding-f-value-restriction-errors in your attempt at partial-application with listIntoJsonArray and listIntoJsonObject you need to add explicit parameters :", "However I want to see if I can define sum of squares by using composition alone .. . .. . Update .. . .. . Here s a nice article http : blogs.msdn.com b mulambda archive 2010 05 01 value-restriction-in-f.aspx describing the issue I ve encountered : Value Restriction .", "You can read about it here : .. . .. . Jacques Garrigue Relaxing the Value Restriction http : caml.inria.fr pub papers garrigue-value restriction-fiwflp04.pdf .. . .. . Here is a previous discussion on StackOverflow : .. . .. . When does the relaxed value-restriction kick in in OCaml", "Full value-restriction as in SML would reject your code altogether .", "For example from http : mlton.org GenerativeException : .. . .. . In Standard ML exception declarations are said to be generative because each time an exception declaration is evaluated it yields a new exception .", "As a consequence the compiler infers a too generic type for the function a list - b list and the result is always a generic list which is not allowed due to value-restriction .", "Since zs is unused its type is unknown making your partially applied function return a generic function value value-restriction .", "I m encoding a form of van Laarhoven lenses in OCaml https : gist.github.com tel 08d2a94de21f483cbb20 but am having difficulty due to the value-restriction .", "Some background just in case you re interested in theoretical details but none of this is really something that would be important in day-to-day real world F programming .", "As for your questions I think question 3 is truly related to value-restriction while the first two are not .", "Use for example obj ResizeArray in-place of the list and it will give the value-restriction error as well .", "I m building a merge sort function and my split method is giving me a value-restriction error .", "However I m getting a value-restriction error and I can t figure out what the problem is .", "Why for example this gives me a Value Restriction error Taken from this http : stackoverflow.com questions 416508 f-compiler-error-fs0030-problems-with-the-value-restriction question : .. . .. . let toleq e : float a b abs a - b e .. . .. . .. . But ths doesn t : .. . .. . let toleq e a : float b abs a - b e .. . .. . .. . 2 .", "@Daniel Could you point me towards some in-depth explanation of the difference between syntactic functions and function values", "Since Haskell is pure it s not subjected to this restriction .", "The functions lens fst and build all have fully generalized types but their composition lens fst build does not .", "This should naturally be problematic as dependent typing is much more expressive than the let bound polymorphism seen in ML", "There is an excellent article by Dmitry Lomov http : blogs.msdn.com b mulambda archive 2010 05 01 value-restriction-in-f.aspx from the F team which explains it in detail .", "As a result one alternative to a type-annotation is to make the argument explicit like so .. . .. . And this works .. . .. . Searching SO for value-restriction errors should give some more examples of this problem .", "I never personally tried this before but it does seem to work : .. . .. . I believe this works because of the relaxed value-restriction http : caml.inria.fr pub papers garrigue-value restriction-fiwflp04.pdf .", "Cross ref to another question on same topic : stackoverflow.com questions 1131456 http : stackoverflow.com questions 1131456 understanding-f-value-restriction-errors", "Cross ref to another question on same topic : stackoverflow.com questions 416508 http : stackoverflow.com questions 416508 f-compiler-error-fs0030-problems-with-the-value-restriction", "Explanation : I upvoted your answer because It is a great answer but accepted Jeffreys because the question actually states that the problem is with value-restriction and asks for a work-around .", "This means that you can only call display with single actual type used for the type variable a in the body of NotWorking .", "Since zs is still there your function accepts two args which means you re only partially applying it .", "In ML new exception classes can be created at runtime .", "ML exceptions being generative means that whenever the control of flow reaches the same exception declaration twice two different exceptions are created .", "I think this is very similar to value-restriction but f and g are already eta-expanded", "It should be compared against the partial-application form let f and this one should be vulnerable to value-restriction .", "I would like to expand on this answer which has actually two parts : 1 Defining a syntactic function instead of a right-hand-side lambda function solves the value-restriction problem : let f x y x y and 2 the inline solves the operator constraint problem .", "Generic numeric programming is done using static member constraints which can t be represented in the .NET type system .", "More precisely references and function applications may cause issues and are excluded from syntactic values and the rule states that the inferred type shall remain monomorphic .", "This is generalized all right.. . .. . .. . let is bigger a b a b .. . .. . .. . but this isn t it is specified as int : .. . .. . let add a b a + b .. . .. . .. . 3 .", "On the other-hand + is an inline function which works on a handful of primitive-types and a certain class of other types it can only be generalized inside other inline-functions otherwise it must be pinned down to a specific type or will default to int .", "This is the syntactic function issue I discussed above let s compile down into fields properties which unlike functions cannot be generic .", "Dmitri has written a nice post on this more recently : blogs.msdn.com b mulambda archive 2010 05 01 http : blogs.msdn.com b mulambda archive 2010 05 01 value-restriction-in-f.aspx", "According to the MLton documentation : .. . .. . Standard ML requires types to be defined before they are used .", "The Standard ML Basis Library likewise uses exception in this way .", "Why functions with implicit parameters generate Value Restriction : .. . .. . this : .. . .. . let item count List.fold fun acc - 1 + acc 0 .. . .. . .. . vs this : .. . .. . let item count l List.fold fun acc - 1 + acc 0 l .. . .. . .. . Mind you if I do use this function in a code fragment the VR error will be gone but then the function will be specified to the type I used it for and I want it to be generalized .. . .. . How does it work", "Weakly polymorphic types are described in the paper Relaxing the Value Restriction by Jacques Garrigue which I admittedly just stumbled upon after reading your question : .. . .. . http : caml.inria.fr pub papers garrigue-value restriction-fiwflp04.pdf .. . .. . The fact that cache is shared across invocations should be obvious if you have a correct mental model of what ML code means .", "I am writing a toy language that uses Hindley-Milner -Damas-Curry-etc.. . type-inference and as I was getting into mutable references I stumbled upon the whole value-restriction issue in ML .", "The aspect of F that s causing this is called value-restriction .", "I ve made the initial function non-recursive as I saw that it was not necessary as well .", "Every language has its nooks and crannies .", "@Dave Berk I think that F is a beautiful language .", "Will need to research the Value Restrictions more.. . Thx .", "M.foo 123 is not a value it s a function application .", "Just when I feel like I am gettng a solid hold on the language it takes another turn .", "Incidentally this shows an important difference between ML exceptions and exceptions in most other languages .", "Well I messed around a bit and found the solution in desperation but I m not sure that I understand why.. . .. . .. . Ugh it s almost as ugly as generic declarations in C .", "As a result you get this as the type .. . .. . Now the problem is that sumofSquares is a value which is a function .", "Unfortunately you can t have a generic value in a top level binding .", "I ve been able to come up with one exception-related unsoundness that if I m not mistaken is prevented only by the value-restriction but that unsoundness does not depend on raising an exception : .. . .. . So can anyone tell me what the Definition is getting at and why it mentions exceptions", "F for the most part is a very stable very elegant practical language IMHO ." ] }
{ "confidence": [ 50.656471252441406, 49.25891876220703, 43.24956512451172, 42.739967346191406, 42.12039566040039, 41.832855224609375, 41.6044921875, 39.295738220214844, 39.00309371948242, 38.0316276550293, 37.14495086669922, 33.755863189697266, 32.606849670410156, 32.58085632324219, 32.5135383605957, 32.352394104003906, 31.99541664123535, 31.952295303344727, 31.61422348022461, 31.288042068481445 ], "content": [ "Question : Per The Definition of Standard ML Revised : .. . .. . The idea is that dynamic evaluation of a non-expansive expression will neither generate an exception nor extend the domain of the memory while the evaluation of an expansive expression might . 4.7 p19 emphasis mine .. . .. . I ve found a lot of information online about the ref-cell part but almost none about the exception part . A few sources point out that it s still possible for a polymorphic binding to raise Bind and that this inconsistency can have type-theoretic and or implementation consequences but I m not sure whether that s related . I ve been able to come up with one exception-related unsoundness that if I m not mistaken is prevented only by the value-restriction but that unsoundness does not depend on raising an exception : .. . .. . So can anyone tell me what the Definition is getting at and why it mentions exceptions Is it possible that generate an exception means generating an exception name rather than generating an exception packet .. . Answer : Hat-tip to Eduardo Le n http : stackoverflow.com users 46571 eduardo-le c3 b3n s answer for stating that the Definition is indeed referring to this and for bringing in the phrase generative exceptions . I ve upvoted his answer but am posting this separately because I felt that his answer came at the question from the wrong direction somewhat : most of that answer is an exposition of things that are already presupposed by the question . .. . .. . Is it possible that generate an exception means generating an exception name rather than generating an exception packet Yes I think so . Although the Definition doesn t usually use the word exception alone other sources do commonly refer to exception names as simply exceptions including in the specific context of generating them . For example from http : mlton.org GenerativeException : .. . .. . In Standard ML exception declarations are said to be generative because each time an exception declaration is evaluated it yields a new exception . And as you can see there that page consistently refers to exception names as exceptions . The Standard ML Basis Library likewise uses exception in this way . For example from page 29 : .. . .. . At one extreme a programmer could employ the standard exception General.Fail everywhere letting it carry a string describing the particular failure . For example one technique is to have a function sampleFn in a structure Sample raise the exception Fail Sample.sampleFn . As you can see this paragraph uses the term exception twice once in reference to an exception name and once in reference to an exception value relying on context to make the meaning clear . So it s quite reasonable for the Definition to use the phrase generate an exception to refer to generating an exception name though even so it is probably a small mistake the Definition is usually more precise and formal than this and usually indicates when it intends to rely on context for disambiguation .", "Question : Per The Definition of Standard ML Revised : .. . .. . The idea is that dynamic evaluation of a non-expansive expression will neither generate an exception nor extend the domain of the memory while the evaluation of an expansive expression might . 4.7 p19 emphasis mine .. . .. . I ve found a lot of information online about the ref-cell part but almost none about the exception part . A few sources point out that it s still possible for a polymorphic binding to raise Bind and that this inconsistency can have type-theoretic and or implementation consequences but I m not sure whether that s related . I ve been able to come up with one exception-related unsoundness that if I m not mistaken is prevented only by the value-restriction but that unsoundness does not depend on raising an exception : .. . .. . So can anyone tell me what the Definition is getting at and why it mentions exceptions Is it possible that generate an exception means generating an exception name rather than generating an exception packet .. . Answer : I m not a type theorist or formal semanticist but I think I understand what the definition is trying to get at from an operational point of view . ML exceptions being generative means that whenever the control of flow reaches the same exception declaration twice two different exceptions are created . Not only are these distinct objects in memory but these objects are also extensionally unequal : we can distinguish these objects by pattern-matching against exceptions constructors . Incidentally this shows an important difference between ML exceptions and exceptions in most other languages . In ML new exception classes can be created at runtime . On the other hand if your program builds the same list of integers twice you may have two different objects in memory but your program has no way to distinguish between them . They are extensionally equal . .. . .. . As an example of why generative exceptions are useful consider MLton s sample implementation of a universal type http : www.mlton.org UniversalType : .. . .. . This code would cause a huge type safety hole if ML had no value-restriction : Comment : Hi thanks for your reply . It seems like this answer is just a long-hand way of replying yes to the question in my last paragraph Comment : Because unless I m really missing something you are using the term exception or in one place exception class to mean what the Definition refers to as an exception name . Comment : Essentially yes . Comment : Go ahead make the change .", "Question : Given the following code : .. . .. . The last line gives the error : This expression was expected to have type int but here has type string .. . .. . I thought the following might work but it doesn t : .. . .. . My question is how do I define the NotWorking function so that the display parameter stays generic within the function .. . Answer : Functions that are passed as arguments to other functions like your display cannot be themselves polymorphic in F . They can use the generic type-parameter a etc . but the actual type for this parameter is specified when the main function NotWorking in your case is called . This means that you can only call display with single actual type used for the type variable a in the body of NotWorking . As a workaround you can use an interface with a generic method : .. . .. . The method Display of the interface is itself generic method so you can call that method multiple times with different type arguments int in the first case and string in the second . However I didn t find this a limitation when writing normal code in F very often so maybe there is an easier solution for your problem possibly taking a non-generic IEnumerable or something simple like that - or obj list as in the answer from John . If you give more details about your actual code that would be useful . Some background just in case you re interested in theoretical details but none of this is really something that would be important in day-to-day real world F programming . Anyway - .. . .. . This is possible in other langauges like Haskell and the mechanism that allows it is called universal types . When you have a polymorphic function in F it essentially means that that the scope of the type-variables is the entire function so a - unit - unit can be viewed as forall a . a - unit - unit . When you call the function you need to specify what a is and that cannot be changed i.e . you can t use the function a - unit that you get as an argument with two different types for a once a is fixed . Using universal types you can write forall yourself so you can say that the type is : .. . forall a . a - unit - unit . Now the generic parameter a is only linked to the function that you ll get as an argument . The type of the function given as an argument is now itself a generic function and so you can call it with different types standing for a . PS : Value restriction is a different problem - that essentially means that F cannot make things that are not syntactic functions generic but in your example you re writing syntactic functions so that s not the issue here . Comment : Great answer thank you", "Question : I don t understand how the Value Restriction in F works . I ve read the explanation in the wiki http : www.strangelights.com fsharp wiki default.aspx FSharpWiki ValueRestriction.html as well as the MSDN documentation http : msdn.microsoft.com en-us library dd233183 VS.100 .aspx . What I don t understand is : .. . .. . 1 . Why for example this gives me a Value Restriction error Taken from this http : stackoverflow.com questions 416508 f-compiler-error-fs0030-problems-with-the-value-restriction question : .. . .. . let toleq e : float a b abs a - b e .. . .. . .. . But ths doesn t : .. . .. . let toleq e a : float b abs a - b e .. . .. . .. . 2 . This is generalized all right.. . .. . .. . let is bigger a b a b .. . .. . .. . but this isn t it is specified as int : .. . .. . let add a b a + b .. . .. . .. . 3 . Why functions with implicit parameters generate Value Restriction : .. . .. . this : .. . .. . let item count List.fold fun acc - 1 + acc 0 .. . .. . .. . vs this : .. . .. . let item count l List.fold fun acc - 1 + acc 0 l .. . .. . .. . Mind you if I do use this function in a code fragment the VR error will be gone but then the function will be specified to the type I used it for and I want it to be generalized .. . .. . How does it work I m using the latest F v1.9.6.16 Comment : Cross ref to another question on same topic : stackoverflow.com questions 416508 http : stackoverflow.com questions 416508 f-compiler-error-fs0030-problems-with-the-value-restriction .. . Answer : Value restriction was introduced to address some issues with polymorphism in the presence of side effects . F inherits this from OCaml and I believe value-restriction exists in all ML variants . Here s a few http : www.faqs.org faqs meta-lang-faq more http : caml.inria.fr pub docs oreilly-book html book-ora026.html toc35 links http : caml.inria.fr pub old 5Fcaml 5Fsite FAQ FAQ 5FEXPERT-eng.html for you to read besides the links you cited . Since Haskell is pure it s not subjected to this restriction . As for your questions I think question 3 is truly related to value-restriction while the first two are not .", "Question : I get the value-restriction error on let makeElem in the following code : .. . .. . Why I get the value-restriction error if anonymous function returned from elemCreator hasn t any generic parameters The compiler states that the infered type of makeElem is string - a - XmlNode . But why it infers second parameter as a if I ve declared it as obj .. . Answer : I believe that this may be the expected behavior although unfortunate in this case as a result-of the compiler s generalization and condensation processes . Consider Tomas s example : .. . .. . If you were to define .. . .. . then the compiler will infer the type bar : a - obj because it generalizes the type of the first argument . In your case you have the equivalent of .. . .. . so bar is a value rather than a syntactic function . The compiler does essentially the same inference procedure except now the value-restriction applies . This is unfortunate in your case since it means that you have to explicitly annotate makeElem with a type-annotation or make it a syntactic function .", "Question : I don t understand how the Value Restriction in F works . I ve read the explanation in the wiki http : www.strangelights.com fsharp wiki default.aspx FSharpWiki ValueRestriction.html as well as the MSDN documentation http : msdn.microsoft.com en-us library dd233183 VS.100 .aspx . What I don t understand is : .. . .. . 1 . Why for example this gives me a Value Restriction error Taken from this http : stackoverflow.com questions 416508 f-compiler-error-fs0030-problems-with-the-value-restriction question : .. . .. . let toleq e : float a b abs a - b e .. . .. . .. . But ths doesn t : .. . .. . let toleq e a : float b abs a - b e .. . .. . .. . 2 . This is generalized all right.. . .. . .. . let is bigger a b a b .. . .. . .. . but this isn t it is specified as int : .. . .. . let add a b a + b .. . .. . .. . 3 . Why functions with implicit parameters generate Value Restriction : .. . .. . this : .. . .. . let item count List.fold fun acc - 1 + acc 0 .. . .. . .. . vs this : .. . .. . let item count l List.fold fun acc - 1 + acc 0 l .. . .. . .. . Mind you if I do use this function in a code fragment the VR error will be gone but then the function will be specified to the type I used it for and I want it to be generalized .. . .. . How does it work I m using the latest F v1.9.6.16 Comment : Cross ref to another question on same topic : stackoverflow.com questions 416508 http : stackoverflow.com questions 416508 f-compiler-error-fs0030-problems-with-the-value-restriction .. . Answer : EDIT .. . .. . Better recent info is here : http : stackoverflow.com questions 4047308 keeping-partially-applied-function-generic .. . .. . original below .. . .. . I think a pragmatic thing here is not to try to understand this too deeply but rather to know a couple general strategies to get past the VR and move on with your work . It s a bit of a cop out answer but I m not sure it makes sense to spend time understanding the intracacies of the F type system which continues to change in minor ways from release to release here . The two main strategies I would advocate are these . First if you re defining a value with a function type type with an arrow - then ensure it is a syntactic function by doing eta-conversion http : en.wikipedia.org wiki Eta expansion .CE.B7-conversion : .. . .. . Second if you still encounter VR generalizing problems then specify the entire type signature to say what you want and then back off as F allows : .. . .. . I think those two strategies are the best pragmatic advice . That said here s my attempt to answer your specific questions . 1 . I don t know . 2 . is a fully generic function a - a - bool which works for all types and thus is bigger generalizes . On the other-hand + is an inline function which works on a handful of primitive-types and a certain class of other types it can only be generalized inside other inline-functions otherwise it must be pinned down to a specific type or will default to int . The inline method of ad-hoc polymorphism is how the mathematical operators in F overcome the lack of type classes . 3 . This is the syntactic function issue I discussed above let s compile down into fields properties which unlike functions cannot be generic . So if you want it to be generic make it a function . See also this question http : stackoverflow.com questions 927400 how-should-i-modify-my-queue-class-to-allow-users-to-create-empty-queues-of-unspe for another exception to this rule . Comment : Dmitri has written a nice post on this more recently : blogs.msdn.com b mulambda archive 2010 05 01 http : blogs.msdn.com b mulambda archive 2010 05 01 value-restriction-in-f.aspx", "Question : I m building a merge sort function and my split method is giving me a value-restriction error . I m using 2 accumulating parameters the 2 lists resulting from the split that I package into a tuple in the end for the return . However I m getting a value-restriction error and I can t figure out what the problem is . Does anyone have any ideas Any input is appreciated . Comment : Right so the expected input would be : list 1 2 3 4 and the output would then be for example 4 2 3 1 Comment : Did you check out the F tag info http : stackoverflow.com tags f 23 info . .. . Answer : The code as you have written it doesn t really make sense . F uses immutable values by default therefore your function as it s currently written can be simplified to this : .. . .. . This is probably not what you want . In fact due to immutable bindings there is no value in predeclaring a b and ctr . Here is a recursive function that will do the trick : .. . .. . Instead of using a recursive function you could also solve this problem using List.fold fold is a higher order function which generalises the accumulation process that we described explicitly in the recursive function above . This approach is a bit more concise but very likely less familiar to someone new to functional-programming so I ve tried to describe this process in more detail . Comment : Right on man that worked like a charm . Still learning F - never worked with a functional language before . Cheers for the assist", "Question : I don t understand how the Value Restriction in F works . I ve read the explanation in the wiki http : www.strangelights.com fsharp wiki default.aspx FSharpWiki ValueRestriction.html as well as the MSDN documentation http : msdn.microsoft.com en-us library dd233183 VS.100 .aspx . What I don t understand is : .. . .. . 1 . Why for example this gives me a Value Restriction error Taken from this http : stackoverflow.com questions 416508 f-compiler-error-fs0030-problems-with-the-value-restriction question : .. . .. . let toleq e : float a b abs a - b e .. . .. . .. . But ths doesn t : .. . .. . let toleq e a : float b abs a - b e .. . .. . .. . 2 . This is generalized all right.. . .. . .. . let is bigger a b a b .. . .. . .. . but this isn t it is specified as int : .. . .. . let add a b a + b .. . .. . .. . 3 . Why functions with implicit parameters generate Value Restriction : .. . .. . this : .. . .. . let item count List.fold fun acc - 1 + acc 0 .. . .. . .. . vs this : .. . .. . let item count l List.fold fun acc - 1 + acc 0 l .. . .. . .. . Mind you if I do use this function in a code fragment the VR error will be gone but then the function will be specified to the type I used it for and I want it to be generalized .. . .. . How does it work I m using the latest F v1.9.6.16 Comment : Cross ref to another question on same topic : stackoverflow.com questions 416508 http : stackoverflow.com questions 416508 f-compiler-error-fs0030-problems-with-the-value-restriction .. . Answer : No one including the people on the F team knows the answer to this question in any meaningful way . The F type-inference system is exactly like VB6 grammar in the sense that the compiler defines the truth . Unfortunate but true . Comment : Well I bet Don knows the answer . And F is still in Beta . At some point we ll have to firm up the spec . And the compiler is not a black-box the F compiler source is freely available . All that said I didn t downvote you as for the most part I don t disagree hardly anyone knows and the lack of a succinct spec is indeed unfortunate . Comment : Every language has its nooks and crannies . F for the most part is a very stable very elegant practical language IMHO . Obviously it is still work in progress but compared to some other developing languages without naming names the future sure is bright for F . That said I didn t downvote you either . Comment : @Brian Don knows the answer only because he has access to the source . There is no theory of type-inference in F . Comment : @Dave Berk I think that F is a beautiful language . In fact I run an F user group . However it doesn t follow that it has a beautiful type-inference mechanism . Comment : @Brian is this still true today 2014 that the F type-inference is tricky and only defined by the source itself would you still answer I don t know to the first question", "Question : This code doesn t compile : .. . .. . http : ideone.com qktsOb .. . .. . I guess the unifier fixed the type parameters associated with f and g upon seeing their first occurrences . What governs this process I think this is very similar to value-restriction but f and g are already eta-expanded This is a hard problem . http : en.wikipedia.org wiki Value restriction .. . .. . I would surely imagine there s some black magic behind typing predefined operators with ad-hoc polymorphism over integral types but that s just my speculation . Any information appreciated . .. . Answer : Generic numeric programming is done using static member constraints which can t be represented in the .NET type system . They exist only in F and therefore must be marked inline . Your code could be written this way : .. . .. . More info on MSDN : .. . Inline Functions http : msdn.microsoft.com en-us library dd548047.aspx .. . Statically Resolved Type Parameters http : msdn.microsoft.com en-us library dd548046.aspx Comment : I wonder how long it could have took me to find these pages by myself Comment : I would like to expand on this answer which has actually two parts : 1 Defining a syntactic function instead of a right-hand-side lambda function solves the value-restriction problem : let f x y x y and 2 the inline solves the operator constraint problem . B.t.w . System.Int32 does not really have a static member op LeftShift . The F compiler implicitly augments the type with it which further complicates type-inference . Comment : @MarcSigrist I think let f x y x y is just a syntax sugar for let f fun x y - x y . I was just desperate in getting my code compile so I used the most verbose form trying to get any possible clues . It should be compared against the partial-application form let f and this one should be vulnerable to value-restriction . Comment : @nodakai : There is a meaningful distinction in F between syntactic functions and function values . Only syntactic functions can be inlined . Comment : @Daniel Could you point me towards some in-depth explanation of the difference between syntactic functions and function values", "Question : I am a little confused about weak polymorphism in OCaml . Please see the following snippet where I define a function remember : .. . .. . The compiler can infer the polymorphic type a - a and cache is used locally . But when I modify the above code into .. . .. . the compiler infers the weakly polymorphic type a - a also it seems that cache is shared across invocations of remember . Why does the compiler infer a weakly polymorphic type here and why is cache shared What is more if I change the code again .. . .. . the compiler infers the polymorphic type a - a - a and cache becomes locally used . Why is this the case .. . Answer : This seems to do with value-restriction . Full value-restriction as in SML would reject your code altogether . Weakly polymorphic types are described in the paper Relaxing the Value Restriction by Jacques Garrigue which I admittedly just stumbled upon after reading your question : .. . .. . http : caml.inria.fr pub papers garrigue-value restriction-fiwflp04.pdf .. . .. . The fact that cache is shared across invocations should be obvious if you have a correct mental model of what ML code means . You are defining two values remember and cache . Nesting simply makes the scope of cache private to the block .", "Question : Is it possible to partially apply a function such as bprintf and prevent it from being restricted based on its initial use I d like to do the following : .. . Answer : The aspect of F that s causing this is called value-restriction . You can see that if you enter just the two let declarations to F Interactive so that the compiler doesn t infer the type from the first use : .. . .. . error FS0030 : Value restriction . The value append has been inferred to have generic type val append : a - b when a : Printf.BuilderFormat b Either make the arguments to append explicit or if you do not intend for it to be generic add a type-annotation . There is an excellent article by Dmitry Lomov http : blogs.msdn.com b mulambda archive 2010 05 01 value-restriction-in-f.aspx from the F team which explains it in detail . As the article suggests one solution is to add explicit type-parameter declaration : .. . .. . This will work just fine .", "Question : EDIT : I m sorry everyone I thought my small examle was complete turns out it s not . I made a new one that really should be As soon as I use a formatter as parameter to Scanf or Printf functions the formatter type gets bound to a in- or output-channel respectively . Is there a way to have a function take a formatter or string and use that as a formatter for both printing and reading strike strike .. . .. . gives .. . .. . Which means a subsequent Printf.printf fmt 1 2 gives a type error . This goes for every combination of format of string and Scanf.format from string like functions I ve tried . Example : .. . .. . Gives .. . .. . For the last line of the both function which seems to make sense but if I remove the both function from the module I can call read and print with the same format string same variable as parameter and it just works . So with hopes that you guys haven t given up on me yet how do I get around that neither eta-expansion nor type-annotation seems to work in this case Comment : An example would be nice . Comment : Yeah sorry . Realized it the moment I had posted : .. . Answer : Your example does not obey the value-restriction since it is a function application . However the call to format of string is not necessary . format of string is actually just the identity function with type .. . .. . It works by forcing a type-annotation on its argument which causes the literal to be interpreted as a format specifier instead of a string . Instead you can simply provide the type-annotation directly yourself : .. . .. . Note that the type is now fully polymorphic because the expression is now a value . Update : In OCaml 4.02 you can now shorten the type-annotation to : Comment : Wonderful While long type annotations are not exactly pretty it s far less hacky than wrapping a value in a function . Could you explain why my example is a function application though Why isn t format of string d d evaluated to a value Comment : The value-restriction is a syntactic restriction . format of string d d is syntactically a function application since function applications can have side-effects it is not considered a value . Comment : But the result stored as fmt that isn t considered a value either I would get it if it was a partial-application but it s not . Comment : The result is not important what matters is whether there may have been side effects whilst creating the result . I suggest you read up on the value-restriction https : realworldocaml.org v1 en html imperative-programming-1.html the-value-restriction . Comment : Makes sense I m still having some problems with it though .", "Question : I want to define sumOfSquares without explicity using parameter relying instead on functional composition .. . .. . Here s my code below .. . .. . However I got the following error .. . .. . stdin 80 5 : error FS0030 : Value restriction . The value sumOfSquares has been inferred to have generic type .. . .. . .. . val sumOfSquares : a - int when a : seq int .. . .. . .. . Either make the arguments to sumOfSquares explicit or if you do not intend for it to be generic add a type-annotation . One way to resolve it is by using parameters .. . .. . and this will work . However I want to see if I can define sum of squares by using composition alone .. . .. . Update .. . .. . Here s a nice article http : blogs.msdn.com b mulambda archive 2010 05 01 value-restriction-in-f.aspx describing the issue I ve encountered : Value Restriction . .. . Answer : So lets see what happens when the type-inference tries to work here . First you have .. . .. . Now as Seq allows for anything that implements Seq we can input int list int or many others . As a result you get this as the type .. . .. . Now the problem is that sumofSquares is a value which is a function . Unfortunately you can t have a generic value in a top level binding . You can though have a generic function if you make the arguments explicit . As a result one alternative to a type-annotation is to make the argument explicit like so .. . .. . And this works .. . .. . Searching SO for value-restriction errors should give some more examples of this problem .", "Question : I ve got an F assignment where I am trying to compute the transpose of a matrix . Simple enough but I keep getting a value-restriction error and I cannot figure out why . I consulted many of the VR error questions that are out there but I m still in the dark . Here s my code : .. . .. . I assume the error is in part due to the empty list but nothing I do seems to help . Any pointers would be greatly appreciated . EDIT : This following version of the code works . Could anyone explain why However the compiler still complains that the transpose call above should have a unit-type unless I bind it using lets . Could anyone please clarify what is going on here Comment : Which school is giving you an assignment in F out of curiosity .. . Answer : My guess is you originally wrote this let rec transpose zs match zs with .. . and later changed it to use function instead which removes the need for the explicit argument . Since zs is still there your function accepts two args which means you re only partially applying it . Since zs is unused its type is unknown making your partially applied function return a generic function value value-restriction . Remove zs and all is well . Comment : My apologies for the late comment : Unfortunately that did not seem to solve the issue and the value-restriction error remains . I ve made the initial function non-recursive as I saw that it was not necessary as well . Casting it perhaps to an int list list does not seem to work either . Comment : I ve added a working version of the code with uses the match .. . with .. . pattern but I am unsure of why it works in the first place when I still get a warning about types . I would greatly appreciate it if you could clarify Comment : After editing both your transpose functions are equivalent and work . The latest error can be fixed by binding the result using let or piping to ignore ignore . Comment : Thank you for your follow-up .", "Question : EDIT : I m sorry everyone I thought my small examle was complete turns out it s not . I made a new one that really should be As soon as I use a formatter as parameter to Scanf or Printf functions the formatter type gets bound to a in- or output-channel respectively . Is there a way to have a function take a formatter or string and use that as a formatter for both printing and reading strike strike .. . .. . gives .. . .. . Which means a subsequent Printf.printf fmt 1 2 gives a type error . This goes for every combination of format of string and Scanf.format from string like functions I ve tried . Example : .. . .. . Gives .. . .. . For the last line of the both function which seems to make sense but if I remove the both function from the module I can call read and print with the same format string same variable as parameter and it just works . So with hopes that you guys haven t given up on me yet how do I get around that neither eta-expansion nor type-annotation seems to work in this case Comment : An example would be nice . Comment : Yeah sorry . Realized it the moment I had posted : .. . Answer : You re hitting the infamous value-restriction https : realworldocaml.org v1 en html imperative-programming-1.html the-value-restriction : .. . .. . Those a b c d mean types to be determined as soon as we can . They are not parameters i.e . fmt is not a polymorphic value . In contrast an empty list is polymorphic : .. . .. . Now we have a and not a . But maybe you already know all this . The point is that when we apply Printf.printf to fmt its type gets fixed as .. . .. . but when we apply Scanf.sscanf to fmt its type gets fixed as .. . .. . These two types are not compatible and because fmt is not polymorphic you cannot use it both ways . The solution is simply to have two copies fmt in and fmt out . Is there something unacceptable with that solution Comment : Is there something unacceptable with that solution -- Sort of . I m making a module library and would like to avoid the uncleanliness of taking the same parameter twice but also I ve been unable to pull it off . Saving two identical formatters binds them to the same restricted types . Using one binds the type of both . Comment : Explanation : I upvoted your answer because It is a great answer but accepted Jeffreys because the question actually states that the problem is with value-restriction and asks for a work-around . Comment : I was going to suggest the trick with thunking.. .", "Question : I want to define sumOfSquares without explicity using parameter relying instead on functional composition .. . .. . Here s my code below .. . .. . However I got the following error .. . .. . stdin 80 5 : error FS0030 : Value restriction . The value sumOfSquares has been inferred to have generic type .. . .. . .. . val sumOfSquares : a - int when a : seq int .. . .. . .. . Either make the arguments to sumOfSquares explicit or if you do not intend for it to be generic add a type-annotation . One way to resolve it is by using parameters .. . .. . and this will work . However I want to see if I can define sum of squares by using composition alone .. . .. . Update .. . .. . Here s a nice article http : blogs.msdn.com b mulambda archive 2010 05 01 value-restriction-in-f.aspx describing the issue I ve encountered : Value Restriction . .. . Answer : Make a type-annotation : Comment : Thanks . Correct me if I m wrong F assumed I m making a function that accepts generic typed parameter but upon type-inference it detected I wanted to define seq int - int hence it got confused . Is is the case Comment : @OnesimusUnbound As you can see from the message F inferred that you want a function accepting any collection descending from IEnumerable int in the type hierarchy and returning int . If you want the argument to be strictly seq int you have to annotate it : Unfortunately subtyping and also overloading can be tricky for the type inference.. .", "Question : In the following code Seq.generateUnique is constrained to be of type Assembly - seq Assembly - seq Assembly - seq Assembly . I d like it to be generic but putting it into a file apart from its usage yields a value-restriction error : .. . .. . Value restriction . The value generateUnique has been inferred to have generic type val generateUnique : a - b - c - seq a when b : seq a and c : seq a Either make the arguments to generateUnique explicit or if you do not intend for it to be generic add a type-annotation . Adding an explicit type-parameter let generateUnique T .. . eliminates the error but now it returns different results . Output without type-parameter desired correct behavior : .. . .. . And with : .. . .. . Why does the behavior change How could I make the function generic and achieve the desired behavior Comment : Why not use Seq.distinctBy Comment : @Huusom : There s a bit more going on here . It s like distinct + recursive collect + memoization with subtle interdependencies between them . .. . Answer : I don t think that your definition is quite correct : it seems to me that f needs to be a syntactic argument to generateUnique that is I don t believe that it makes sense to use the same HashSet for different f s . Therefore a simple fix is : Comment : That produces the latter incorrect output with and without the type-parameter . I expect f to be non-deterministic therefore I m passing it to the inner function not sure if that s a good reason .", "Question : I can t seem to find the magic sauce to make the csvList or its partially applied helpers listIntoJsonArray or listIntoJsonObject generic . Thanks for the help . .. . Answer : Your listIntoJsonArray and listIntoJsonObject are values not functions so you met value-restriction http : blogs.msdn.com b mulambda archive 2010 05 01 value-restriction-in-f.aspx monster . You can either convert them to functions by adding explicit argument or to type functions .", "Question : I can t seem to find the magic sauce to make the csvList or its partially applied helpers listIntoJsonArray or listIntoJsonObject generic . Thanks for the help . .. . Answer : csvList looks generic enough : string - string - a list - a - string - string .. . .. . But you ve encountered Value Restriction http : stackoverflow.com questions 1131456 understanding-f-value-restriction-errors in your attempt at partial-application with listIntoJsonArray and listIntoJsonObject you need to add explicit parameters : Comment : Didn t seemt to do the trick . Just when I feel like I am gettng a solid hold on the language it takes another turn . Will need to research the Value Restrictions more.. . Thx . Comment : @akaphenom : my original solution had a mistake I added the parameters to the function definition but then didn t pass them as arguments to csvList it should work correctly now . F is a wild beast but that makes the taming so much more exciting and the rewards so much greater :", "Question : is weakly polymorphism but involving ref . Any ways to write a weakly polymorphism function without involving ref or partial-application Comment : It s worth pointing out that the value-restriction doesn t mention ref anywhere . There s nothing particularly special about ref except that under the relaxed value-restriction it s invariant with respect to subtyping . Comment : ref was a lot more special in SML which is the context in which the value-restriction was originally proposed . In SML records are not mutable only ref s and arrays are . Thus a lot of discussion about the value-restriction naturally involves ref . Of course in OCaml ref is just a instance of a record with a mutable field . .. . Answer : Sure . Module abstraction will do it essentially instructing the compiler to abandon all information about the implementation : .. . .. . and the weakly polymorphic result : .. . .. . Note that if you wanted polymorphism here you would use variance annotations to recover it . It s also easy to construct examples based on mutable structures other than ref arrays mutable fields but that s not very instructive as it is pretty much the same thing ." ] }
[ "yes-answer-long", "yes-answer-short" ]
value-restriction
UNK_RELATION
pyjamas@javascript@152
pyjamas -- pyjamas is a port of google web toolkit to python featuring a python debugging environment and desktop deployment option and compilation to @placeholder for web device deployment .
{ "confidence": [ 51.60563278198242, 51.151763916015625, 51.151763916015625, 49.88813781738281, 49.25817108154297, 47.55402374267578, 47.12723922729492, 46.565269470214844, 44.62224578857422, 44.27818298339844, 44.089080810546875, 44.00398635864258, 43.61939239501953, 42.483707427978516, 42.2114372253418, 42.2114372253418, 42.17120361328125, 42.17120361328125, 41.63629150390625, 41.52153015136719, 41.52153015136719, 41.52153015136719, 41.498992919921875, 41.14410400390625, 41.14410400390625, 40.908931732177734, 40.894596099853516, 40.894596099853516, 40.8281135559082, 40.580387115478516, 40.004852294921875, 40.00470733642578, 39.80403137207031, 39.80403137207031, 39.80403137207031, 39.80403137207031, 39.80403137207031, 39.80403137207031, 39.31431579589844, 38.38960266113281, 38.260562896728516, 38.260562896728516, 37.94871520996094, 37.299041748046875, 36.69598388671875, 36.543067932128906, 36.543067932128906, 36.543067932128906, 36.543067932128906, 36.543067932128906, 36.543067932128906, 36.543067932128906, 36.543067932128906, 36.543067932128906, 36.543067932128906, 36.543067932128906, 36.53562927246094, 36.43560791015625, 35.419708251953125, 35.40367126464844, 35.40367126464844, 35.40367126464844, 35.40367126464844, 35.008602142333984, 34.81813430786133, 34.81813430786133, 34.0380744934082, 34.0380744934082, 34.0380744934082, 34.0380744934082, 34.0380744934082, 34.0380744934082, 33.86805725097656, 33.86805725097656, 33.86805725097656, 33.67873764038086, 33.59066390991211, 33.33989334106445, 33.33989334106445, 32.15056228637695, 32.15056228637695, 32.15056228637695, 32.15056228637695, 32.15056228637695, 32.15056228637695, 32.15056228637695, 32.15056228637695, 32.15056228637695, 31.011167526245117, 31.011167526245117, 31.011167526245117, 31.011167526245117, 31.011167526245117, 31.011167526245117, 30.573532104492188, 30.30270004272461, 29.645570755004883, 29.645570755004883, 29.645570755004883, 29.645570755004883 ], "content": [ "I am learning Pyjamas framework of python to generate the frontend which is basically a javascript code generated by Pyjamas .", "I am using pyjamas to develop a web page .", "I am writing a web application using Pyjamas .", "From skimming through the documentation for Pyjamas I am getting the impression that Pyjamas itself is written in Python .", "I tried installing pyjamas-desktop but it was not straight forward for me and I could not succeed in installing pyjamas-desktop .", "This seems would require pyjamas-desktop be installed .", "I write python code which is translated to javascript by pyjamas .", "tl dr : would it be reasonable to try to use Pyjamas in a .NET desktop application to convert loose Python scripts into JavaScript in-memory", "I m running Pyjamas on Windows 8.1 with Python 2.7 64-bit .", "pyjamas is really a ported version of GWT google widget or something of the likes not a pure encompassing Python - JS .", "Does anyone know of a good reference for Pyjamas or GWT", "But Pyjamas is something else entirely .", "we converted the desktop app into web app using pyjamas and it generated the html files javascripts .", "Some tornado references on the old pyjamas list i m not familiar with it though : http : groups.google.com group pyjamas-dev search group pyjamas-dev q tornado qt g Search+in+this+group http : groups.google.com group pyjamas-dev search group pyjamas-dev q tornado qt g Search+in+this+group", "In my opinion Pyjamas should be avoided .", "You cannot use Tkinter with pyjamas .", "I usually work on Django framework for developing web-applications and I am very confused in using Pyjamas with Django .", "I am trying to create web based system using pyjamas and hangs on one functionality .", "What I have in mind is to provide a desktop-like frontend for my web application with pyjamas and do server-side logic with tornado .", "Also is it a good idea to use Pyjamas with Django", "Use pyjamas for client-side Django for server-side .", "The pyjs vs . pyjamas doesn t match either .", "Is there an equivalent method for GWT pyjamas", "But I use pyjamas and the last code does rais the error stating .. . .. . It appears that pyjamas is not supporting eval and exec yet .", "See this message https : groups.google.com forum topic pyjamas-dev 0lr7ox1O9jE on the pyjamas mailing list .", "I am thinking that one option might be to automatically translate the Python script to JavaScript using something like Pyjamas http : pyjs.org .", "I m very interested Pyjamas for python javascript - but the documentation doesn t explain how to implement security with the JSON-RPC .", "I am trying to use pyjamas http : pyjs.org to compile some python that I wrote into javascript .", "I am currently using the latest 0.8 Pyjamas in order to test .", "that TodoApp was relevant for pyjamas 0.5 . .. . .. . for a working JSONRPC example please see either rick hightower s absolutely brilliant article : http : www.ibm.com developerworks web library wa-aj-pyjamas .. . .. . or simply see the standard pyjamas examples jsonrpc .", "There is a tutorial on how to use Pyjamas with AJAX on this page http : pyjs.org book output Bookreader.html Rest 20of 20the 20World of of Pyjamas book .", "There s nothing specific to integrating pinax and pyjamas more than it is specific to integrating django and pyjamas .", "Is it possible to send these notifications to the pyjamas application running in the browser", "I don t know if you are familiar with the pyjamas bookreader", "pyjamas has it s own UI components .", "I m trying to use pyjamas http : pyjs.org .", "What other alternatives to pyjamas would you refer", "I am trying to get scipy working with pyjamas .", "I am somewhat new to both web development and new to the Django and Pyjamas frameworks .", "Is this possible by running my Python through pyjamas and then using the outputted javascript into a chrome extension", "Has anyone succeeded in getting Pyjamas and Web.py working together", "PS : I am using web.py V0.37 and the latest Pyjamas development release .", "pyjamas doesn t support translating a tkinter app and you definitely can t run a tkinter app in a web browser .", "Oh well pyjamas coolness makes up for a lot .", "Specifically I want to trigger events in the web application generated in the server-side and be able to display those events using the pyjamas widgets .", "I would like to create small project using django and pyjamas .", "I find it hard to choose between pyjamas + django and GWT + Hibernate .", "Is pyjamas mature enough to replace GWT on a performance and functionality point of view", "Is pyjamas mature enough to replace GWT on a performance and functionality point of view", "I ve played with pyjamas a little and am currently implementing json-rpc with django .", "Is it possible to easily convert between say Jython and Java or Pyjamas and Javascript", ": Sorry for the pyjamas tag I m not allowed to create a pyjd tag : -", "Does pyjamas support all the pyqt UI features with same look-and-feel", "Is it possible to write an application using the pyjamas widgets together with the tornado server model", "So my question is : how do I do long-polling in pyjamas", "Numpy is written in C and Pyjamas can t translate C to javascript .", "So i googled again read different articles and what helped me to understand things clearly is this http : code.google.com p pyjamas wiki JSONRpcWithApacheModPython and this http : groups.google.com group pyjamas-dev browse thread thread 2ddce43c99c54b57 .", "I am having a difficult time understanding the Pyjamas GWT event-handling system .", "I am not a web application pro but need to start working on a project so I need to know if pyjamas or shall I say the javascript generated o p of pyjamas is as good as pyqt in terms of 2d graphics and widget features .", "Hope this http : code.google.com p pyjamas wiki DjangoWithPyjamas link helps you .", "This can be done with javascript jQuery Sproutcore JavascriptMVC Pyjamas .. . or Adobe AIR or.. .", "I have the compiled Pyjamas my project.html being served as Django templates .", "Why do you want pyjamas to be served as django template", "Tried all sorts of other combinations of URLs renaming directories compiling the Pyjamas part with the -d option in the hope to get a debug stack-trace .. . to no avail .", "i am installed pyjamas as yum install pyjamas on fedora19 .. . .. . The following file i executed .. . .. . hello.py .. . .. . when i am building the js file .. . .. . i am getting following error .. . .. . How to resolve this", "So to embed the functionality of Pyjamas inside our software I think I would need to include all of the Pyjamas source files in my software and then execute them using IronPython .", "Is there some solution for clean-urls in Pyjamas or that should be solved on some other level", "The only thing I ve confirmed is that this gets the pyjamas-generated page to show up .", "Further we chose mootools as js lib over pyjamas .", "Recently I came across pyjamas http : pyjs.org framework .", "I ve got Pyjamas and Django running via Apache2 with mod-wsgi on Windows 7 .", "How would one get the csrf token into the Pyjamas-generated form", "GWT and Pyjamas were created to remove the drugery of coding Javascript and compensating for all of the different browser implementations and object models .", "Since you get an .. . .. . ImportError : No module named pyjamas .. . .. . you may need to add the module s path to PYTHONPATH with", "https : groups.google.com forum fromgroups topic pyjamas-dev hoUsC7iQ9J0 use this link it might help u for solving your issue", "To answer Daniel Kluev our reason for serving the pyjamas page through django is because JSONRPC requests from pyjamas - django run into the CSRF protections in django resulting in a 403 error .", "Or .. . .. . I can learn one of the twitter apis the Requests library and pyjamas converts python code to javascript so I can make a simple script and load it into google-chrome s firefox extensions .", "It seems like it might be impossible because from what I understand CSRF tokens are not persistent which a Pyjamas-generated page is .. . My Pyjamas page is generated from a Pyjamas .py file resulting in a folder full of hard-coded stuff .", "Okay that seemed like the ticket and I m sure it would be if I could just get Django to serve up the relevant Pyjamas page in a reasonable way but I m tired of hacking the URLs interface of Django to get Pyjamas to even show up correctly .. . Too many frustrations and not enough documentation to keep going with this Pyjamas thing .", "I ve managed to deploy a couple of medium sized webapps using pyjamas and believe me it was very smooth sailing .", "If you are looking into using webkit you could get best of the two worlds and use Pyjamas with PyJD .", "The core functionality of my application is to show some Events which are generated asynchronously in an HTML table using the corresponding pyjamas widget .", "The route I have chosen is to combine pyjs old pyjamas with web2py via JSONRPC .", "I have an application written in pyjamas which must check for new events to update an event table in the browser .", "Currently I am doing JSONRPC calls in pyjamas periodically to look for new events .", "Anyway I want to do long-polling just for the kick of it : Seriously : there must be a way to do long-polling in pyjamas isn t there", "I downloaded the latest pyjamas and I installed it in my c : Python26 Lib site-packages folder .", "I am trying to build the HelloWorld example page from the Pyjamas example folder .", "Maybe some integration code and or a sample Pyjamas interface which uses Pinax as the backend -- all with adequate explanation if possible", "So the pyjamas book http : pyjs.org book output Bookreader.html Rest 20of 20the 20World would be a good starting point .", "I am setting up Django and Pyjamas to work together JSONRPC Client Server + Django templates .", "I have the Django template folder set to my Pyjamas project output folder .", "that we have seen is to pass the token to pyjamas as a cookie or form element which can then be sent back to django during the RPCs .", "I believe pyjamas py2Js http : www.mccarroll.net py2js will do good job of conversion .", "Pylint is probably the first place to start - it can be installed with easy install then run as .. . .. . The verbosity of errors can be easily edited - but any major problems will be highlighted immediately - and you don t need those extra pyjamas-desktop modules installed", "speed ease of development platform independence .. . .. . Platform independence if you mean cross-browser compatibility is a HUGE reason to use pyjamas because the python code includes a sane override infrastructure which handles everything for you .", "I am farily new to the topic but I am trying to combine both Django and Pyjamas .", "Is it a standard way to pass some arguments as GET parameteres in a clean-url while calling a Pyjamas generated JS", "You should take a look at the good Django With Pyjamas https : github.com pyjs pyjs wiki pyjamaswithdjangojsonrpc Howto .", "You need to make these edits manually each time you regenerate the files with pyjamas ." ] }
{ "confidence": [ 75.52071380615234, 74.59690856933594, 67.79689025878906, 66.04603576660156, 65.86951446533203, 63.78676986694336, 63.4118537902832, 62.88903045654297, 62.22549057006836, 61.84913635253906, 61.64451217651367, 60.624263763427734, 58.76409149169922, 56.612022399902344, 56.377166748046875, 55.86934280395508, 55.28816604614258, 54.91922378540039, 54.44533920288086, 54.36849594116211 ], "content": [ "Question : I am using pyjamas to develop a web page . I write python code which is translated to javascript by pyjamas . This way debugging programming error is caught only when testing the web page . It would be much more efficient if we can run the code-first in the Python interpreter before compiling to javascript . This seems would require pyjamas-desktop be installed . I tried installing pyjamas-desktop but it was not straight forward for me and I could not succeed in installing pyjamas-desktop . I am wondering if there is anyway to run the code to just check for errors i.e . I do not want to see the widgets popped up . But just running in the interpreter so that errors like missing to import a module that is used in the program are caught . .. . Answer : Pylint is probably the first place to start - it can be installed with easy install then run as .. . .. . The verbosity of errors can be easily edited - but any major problems will be highlighted immediately - and you don t need those extra pyjamas-desktop modules installed Other similar tools that do the same sort of thing are PyCheckMate syntax check only PyChecker and PyFlakes .", "Question : I am not a web application pro but need to start working on a project so I need to know if pyjamas or shall I say the javascript generated o p of pyjamas is as good as pyqt in terms of 2d graphics and widget features . I have a desktop python application which has some rich 2d graphics with animations collision-detection etc. . implemented using pyqt . Now I am specifically looking for equivalent web client with similar graphics and widget features . Does pyjamas support all the pyqt UI features with same look-and-feel I am also exploring GWT for this since I believe GWT has a good set of UIs and also supports decent 3rd party tools like vaadin smartgwt but my preference is for pyjamas because its python and I am writing a equivalent pyqt based desktop app so am more comfortable with python then java . Also am not sure if GWTs look-and-feel would match with that of pyqt based UI on windows . Any insights would be very helpful .. . .. . Thanks in advance .. . .. . Regards Shyam Comment : I figured out that there is a qt webkit which is also ported to pyqt using which a web interface can be developed with the same look-and-feel as a pyqt desktop application . Will explore this further . If somebody has any pointers to it then plz suggest .. . Answer : Probably too late but if anyone else would need an answer .. . .. . Pyjamas widgets are mostly same as GWT s most are direct translation from GWT but we have some own widgets too and do not target Qt GTK or any other toolkit . If you are looking into using webkit you could get best of the two worlds and use Pyjamas with PyJD . This way your very same application could be compiled into html css javascript and run in web browsers and at the same time you could run it in pyqt-webkit xulrunner or mshtml with original python code .", "Question : null .. . Answer : I am working on a .NET application that uses Python for its internal scripting-language IronPython . We now have a goal of generating HTML pages using the information that users have created using the application . Ideally when we export to HTML we would be able to bring over the functionality our users have written in their Python scripts . I am thinking that one option might be to automatically translate the Python script to JavaScript using something like Pyjamas http : pyjs.org . I am not a Python expert or JavaScript expert . From skimming through the documentation for Pyjamas I am getting the impression that Pyjamas itself is written in Python . So to embed the functionality of Pyjamas inside our software I think I would need to include all of the Pyjamas source files in my software and then execute them using IronPython . However before I head down that road I want to ask whether that sounds feasible . I am trying to give my client an estimate and I can easily imagine spinning my wheels for a lot of hours before figuring out that Pyjamas just isn t going to work in that scenario . tl dr : would it be reasonable to try to use Pyjamas in a .NET desktop application to convert loose Python scripts into JavaScript in-memory", "Question : we have created the python desktop application using Tkinter library and it is working . we converted the desktop app into web app using pyjamas and it generated the html files javascripts . While opening the html file in the browser it showing the following error in the message box .. . .. . Is anything needs to be configured or setup to run this in web Thanks in advance.. . Comment : use web framework like Flask or Django and create it from scratch - web-applications work different then desktop applications . .. . Answer : pyjamas doesn t support translating a tkinter app and you definitely can t run a tkinter app in a web browser .", "Question : I love both python and Java and I have this first serious web application project that I would like to carry out . I find it hard to choose between pyjamas + django and GWT + Hibernate . In fact from my beginner point of view it seems like the python world is more suitable for a quickly-developed and fun web application . And on the other hand the java world is useful for performance-oriented scalable solutions and for serious projects with big money involved.. . .. . .. . My requirements are quite simple : this application has to replace a desktop application . So the performance factor is there . But my deadlines are pretty short . Is pyjamas mature enough to replace GWT on a performance and functionality point of view .. . Answer : In fact from my beginner point of view it seems like the python world is more suitable for a quickly-developed and fun web application . And on the other hand the java world is useful for performance-oriented scalable solutions and for serious projects with big money involved.. . .. . .. . Naah . For example YouTube is in Python -- where do you see that affecting its performance scalability or big money characteristics Is pyjamas mature enough to replace GWT on a performance and functionality point of view Completely different question from the previous silly observation . GWT has been around for longer and has more users and contributors . Perhaps pyjamas is good enough for many uses -- nevertheless it is at release 0.7 with GWT at release 2.0 which can be taken as an indication that GWT is better more developed and mature . Most real-world highly-scalable web apps use real Javascript typically with some supporting framework such as the very popular jQuery or any of its many competitors if for whatever reason you can t or more likely don t want to then GWT is probably a less risky choice than pyjamas in my opinion . Comment : Of course my silly observation was ironic Comment : -1 you can t compare version numbers like that .", "Question : Is it possible to write an application using the pyjamas widgets together with the tornado server model What I have in mind is to provide a desktop-like frontend for my web application with pyjamas and do server-side logic with tornado . Specifically I want to trigger events in the web application generated in the server-side and be able to display those events using the pyjamas widgets . Does somebody have a working example of this .. . Answer : Some tornado references on the old pyjamas list i m not familiar with it though : http : groups.google.com group pyjamas-dev search group pyjamas-dev q tornado qt g Search+in+this+group http : groups.google.com group pyjamas-dev search group pyjamas-dev q tornado qt g Search+in+this+group", "Question : I love both python and Java and I have this first serious web application project that I would like to carry out . I find it hard to choose between pyjamas + django and GWT + Hibernate . In fact from my beginner point of view it seems like the python world is more suitable for a quickly-developed and fun web application . And on the other hand the java world is useful for performance-oriented scalable solutions and for serious projects with big money involved.. . .. . .. . My requirements are quite simple : this application has to replace a desktop application . So the performance factor is there . But my deadlines are pretty short . Is pyjamas mature enough to replace GWT on a performance and functionality point of view .. . Answer : I ve managed to deploy a couple of medium sized webapps using pyjamas and believe me it was very smooth sailing . It s a slimmed-down version of GWT too so it is easier to learn . Most of the UI widgets are 100 lines ish Also the pythonic use of OO is pretty exemplary . Comment : Can you as well provide info on how easy it is to debug a pyjama application in comparison to GWT pyjama does not have a hosted mode", "Question : I am trying to create web based system using pyjamas and hangs on one functionality . The functionality is to click a button and it should run some python programs in back-end . I have to display the logs generated by back-end python program in the same page where the clicked button is . I really appreciate your help guys .. . Answer : There is a tutorial on how to use Pyjamas with AJAX on this page http : pyjs.org book output Bookreader.html Rest 20of 20the 20World of of Pyjamas book . Comment : Thanks @farfromhome i read that article but frankly its not explained in a way it should be . So i googled again read different articles and what helped me to understand things clearly is this http : code.google.com p pyjamas wiki JSONRpcWithApacheModPython and this http : groups.google.com group pyjamas-dev browse thread thread 2ddce43c99c54b57 . Comment : Then by Stack Overflow custom you ought to put that in a new answer yourself and select it as the right one to let people know that you ve figured it out by yourself . : Comment : Sorry for very very long delayed answer : I had added the solution to my blog pymantra.pythonblogs.com 90 pymantra archive http : pymantra.pythonblogs.com 90 pymantra archive 531 pyjamas-run python script onclick of button.html", "Question : Is it possible to write an application using the pyjamas widgets together with the tornado server model What I have in mind is to provide a desktop-like frontend for my web application with pyjamas and do server-side logic with tornado . Specifically I want to trigger events in the web application generated in the server-side and be able to display those events using the pyjamas widgets . Does somebody have a working example of this .. . Answer : The route I have chosen is to combine pyjs old pyjamas with web2py via JSONRPC . So far it is working fine .", "Question : I am learning Pyjamas framework of python to generate the frontend which is basically a javascript code generated by Pyjamas . Though being a new concept and a GWT equivalent in python I am interested in learning it but I can not really find out what is the actual significance of it I mean we are coding in python compiling the code and generating javascript which allows us to put CSS classes with the code . So basically it does not removes the need of a designer as well . Also is it a good idea to use Pyjamas with Django Please suggest . Thanks in advance .. . Answer : GWT and Pyjamas were created to remove the drugery of coding Javascript and compensating for all of the different browser implementations and object models . Yes you still need a designer . Yes you can code in python and not .. . have to learn Javascript in theory . No you won t have to recode to work around features of the Javascript .. . implementations in new browsers or old browsers . Comment : Thanks Terrel . I usually work on Django framework for developing web-applications and I am very confused in using Pyjamas with Django . I am not able to find out whether it should be used with Django or not because they both are so different that it does not seem to be a good deal atleast to me . Comment : Use pyjamas for client-side Django for server-side . GWT actually gives you a choice - you can write once and deploy on either server or client or both . youtube.com watch v hNEvr2eLad0 http : www.youtube.com watch v hNEvr2eLad0 Comment : Interesting comment : joelonsoftware.com items 2007 09 18.html http : www.joelonsoftware.com items 2007 09 18.html maybe GWT is the NewSDK and Gmail won t be obsolete .", "Question : I m running Pyjamas on Windows 8.1 with Python 2.7 64-bit . I ve struggled a bit with getting everything installed but I believe the struggle has been fruitful -- I ve run bootstrap the file run bootstrap first then pyjd setup.py and have moved on to experimenting with Pyjamas DESKTOP . I m trying to view the Hello.py example in the examples helloworld directory by running both a run.bat file in the command-line by double-clicking in the GUI Windows Explorer . The code of the .bat file is below : .. . .. . The program will compile run open up a white window then immediately quit . Which makes me think it s not quite running or that Pyjamas doesn t interface with Windows 8.1 . If I run the Hello.py file directly by typing .. . .. . into the command-line the same thing happens . I m guessing this is a Windows software versioning problem 8.1 isn t capable of running the current version of Pyjamas or .....any ideas .. . Answer : Haven t run into this particular error but to help debug what is going on you can try this : .. . .. . If you can get an IDE that can have a running console of python . Here is an overly comprehensive list http : stackoverflow.com questions 81584 what-ide-to-use-for-python . Just quick browsing on the debugging column I would say use Netbeans or PyDev with Eclipse .", "Question : I am having a difficult time understanding the Pyjamas GWT event-handling system . I am currently using the latest 0.8 Pyjamas in order to test . I am not sure of what the best event-handling structure would be as I have never done GUI programming . I haven t had much luck with the documentation I ve found thus far . Does anyone know of a good reference for Pyjamas or GWT My main difficulty comes from understanding where listeners such as onClick onMouseleave etc are coming from How are they triggered Where are they defined Do I define them What is the layered structure for the event-handling system I know these are very general questions but I m really just looking for a point in the right direction . Thank you and I appreciate any help given . .. . Answer : I would suggest you study source in examples folder . Start with this http : pyjs.org book output Bookreader.html Getting 20Started .. . .. . There are some links which has been helpful for me : http : gwt.google.com samples Showcase Showcase.html .. . .. . http : pyjs.org examples .. . .. . Also in examples folder there is a great example called showcase which gives you all API and some helpful code samples localhost somedir showcase output Showcase.html .. . .. . since API is similar you can always check them books especially helpful for understanding callback etc. . : .. . .. . http : www.amazon.com Beginning-Google-Web-Toolkit-Professional dp 1430210311 ref sr 1 12 ie UTF8 qid 1334659695 sr 8-12 http : rads.stackoverflow.com amzn click 1430210311 .. . .. . http : www.amazon.com Google-Toolkit-Applications-Ryan-Dewsbury dp 0321501969 ref sr 1 7 ie UTF8 qid 1334659695 sr 8-7 http : rads.stackoverflow.com amzn click 0321501969 .. . .. . for Django and Pyjamas http : www.derekschaefer.net 2011 02 08 pyjamas-django-pure-win .. . .. . However i agree there is a great need for better introduction tutorials beyond the hello world example . I m struggling with it myself . Good luck .. . .. . ps . I ve created small callback example that seems to work . I would be greatfull if people correct me here and edit this example to be of more use for people . All im trying to do here is to have navigation with 2 pages represented by 2 classes : Intro and Outro", "Question : I want to do some pixel level image-manipulation for the HTML5 canvas through GWT or pyjamas . I know one way to do this in JavaScript is to use the contexts createImageData function to create an ImageData object which lets you access pixel values . Is there an equivalent method for GWT pyjamas Also is there a performance difference between using this ImageData object and drawing 1x1 pixel size rectangles Thanks .. . Answer : Not sure if it helps : For GWT you can check out either one of these two libraries not sure if they support ImageData : .. . .. . http : code.google.com p google-web-toolkit-incubator wiki GWTCanvas .. . .. . http : code.google.com p gwt-canvas", "Question : This has already cost me many hours of Googling and I still cannot get it working time to ask SO for help : - .. . .. . I try to put together a simple test application where the frontend is written in Pyjamas the backend is running on Web.py http : webpy.org . They are supposed to talk to each other via JSON-RPC . The desired functionality is to let the user enter a string which is then converted to uppercase . There is a description in the Pyjamas online book Rest of the World http : pyjs.org book Bookreader.html Rest 20of 20the 20World on how to use JSON-RPC which presents various technologies mixed together and is therefore difficult to parse . By looking at hints e.g . from Amund Tveit s blog http : amundblog.blogspot.co.at 2008 12 ajax-with-python-combining-pyjs-and.html etc . I cobbled together the following : .. . .. . 1 The server script which is really simple : .. . .. . and it definitely works tested with a simple query script not shown that relies on Josh Marshall s JSON-RPC library https : github.com joshmarshall jsonrpclib . 2 The client-script for Pyjamas which is also straightforward : .. . .. . I compiled it with PyJs renamed the default output directory to static so that web.py can serve it edited static Client.html so that the internal references point to static : .. . .. . .. . and then pointing the browser to http : localhost : 8080 static Client.html . All I get is a blank page inspecting the page source shows static Client.html above so it was indeed served to the browser . The server s log also shows that at least some pages have been served : .. . .. . No indication of what went wrong however . Tried all sorts of other combinations of URLs renaming directories compiling the Pyjamas part with the -d option in the hope to get a debug stack-trace .. . to no avail . Has anyone succeeded in getting Pyjamas and Web.py working together If yes then please share how . Thanks . PS : I am using web.py V0.37 and the latest Pyjamas development release . The current stable release V0.8.1 does not work either . .. . Answer : https : groups.google.com forum fromgroups topic pyjamas-dev hoUsC7iQ9J0 use this link it might help u for solving your issue", "Question : I am writing a web application using Pyjamas . . The core functionality of my application is to show some Events which are generated asynchronously in an HTML table using the corresponding pyjamas widget . Is it possible to send these notifications to the pyjamas application running in the browser I have been looking for an example without success . .. . Answer : I don t know if you are familiar with the pyjamas bookreader If not there s a lot of information and some examples about ajax over there . http : pyjs.org book Bookreader.html Rest 20of 20the 20World", "Question : I m trying to make a simple script in python that will scan a tweet for a link and then visit that link . I m having trouble determining which direction to go from here . From what I ve researched it seems that I can Use Selenium or Mechanize Which can be used for browser automation . Would using these be considered web-scraping Or .. . .. . I can learn one of the twitter apis the Requests library and pyjamas converts python code to javascript so I can make a simple script and load it into google-chrome s firefox extensions . Which would be the better option to take .. . Answer : For web-scraping Scrapy http : scrapy.org seems to be the best framework . It is very well documented and easy to use .", "Question : I m doing a Pyjamas example http : web2py.com book default section 9 2 and get this error : .. . .. . Here is the significant portion of TodoApp.py from the linked tutorial please ignore indentation from the copy-paste : .. . .. . Has anyone else encountered this Some articles around the web recommend adjusting the C++ code of your browser to fix it but that doesn t seem safe to me . Comment : Can you show your code It sounds like you ve got some infinite recursion going on . Comment : It s actually the exact code that s at the linked tutorial page without any of the actions like onKeyUp . I ve posted it above . .. . Answer : that TodoApp was relevant for pyjamas 0.5 . .. . .. . for a working JSONRPC example please see either rick hightower s absolutely brilliant article : http : www.ibm.com developerworks web library wa-aj-pyjamas .. . .. . or simply see the standard pyjamas examples jsonrpc .", "Question : I have one design decision to make . In my web ajax application we need to decide where should we put user-interface logic Should It be completely loaded via javascript pure single page . and Only data comes and go . or .. . .. . Should server send some format XML which translated via javascript to dynamically create rich user-interface . semi-ajax . so some data and ui comes and go . Which option is better speed ease of development platform independence .. . .. . Thanks . .. . Answer : I faced similar dilemma few months back . As Lennart above says it makes sense to go for pyjamas or similar library if your app is more desktopish . Further one of the biggest advantage of pyjamas provide is logically well separated backend and frontend code . IMO that is very important . If your app is not like a desktop app like ours was then multipage offers more advantages such as single change wont breaks entire app easier to maintain etc . You might want to consider can have your app server serve json and other web server serves static content and js . Js would request json app server for data . That way we managed to keep out frontend and backend separate . Further we chose mootools as js lib over pyjamas . Ofcourse it is upto your taste and need of application . We did use python template server-side templates but at compile-time not at runtime like usual approach . This needed to change our thinking a little but the offered many advantages . I end up telling you my story but I thought it s relevant and hope that helps .", "Question : null .. . Answer : I am trying to get scipy working with pyjamas . I have a python script that I am trying to convert to javascipt : .. . .. . However when I load it up in a browser it says this : .. . .. . I found out that I could get pyjs to translate scipy by copying scipy directly to my project folder . When I build my project it translates it but now I get the following error in my browers : .. . .. . I tried copying numpy directly to the project folder but it doesn t work . Running the python script gives an error saying numpy cannot be imported from the source directory . I looked into getting around this but it keeps going deeper and deeper into the rabbit hole . My questions then : Is there a way to use scipy in pajamas without having to write a custom module myself Is it even possible to translate imported modules packages Comment : See this message https : groups.google.com forum topic pyjamas-dev 0lr7ox1O9jE on the pyjamas mailing list . Numpy is written in C and Pyjamas can t translate C to javascript .", "Question : I am somewhat new to both web development and new to the Django and Pyjamas frameworks . So I appreciate any patience offered to me as I learn . I am setting up Django and Pyjamas to work together JSONRPC Client Server + Django templates . I have the compiled Pyjamas my project.html being served as Django templates . I have the Django template folder set to my Pyjamas project output folder . Pyjamas compiles a bootstrap.js to the same output folder and I need proper referencing within the Django templates to these files as the current reference of : .. . .. . Is not functioning . The Django way of managing static files is not very obvious to me even after reading it s documentation . What is the best way to set this up in terms of folder hierarchy and Django settings What is the best way to reference my static files from within my Django templates I know I am likely asking obvious questions but after reading the available documentation I just can t seem to put this together . This is the last piece of the puzzle before I really start rolling so any help will be appreciated greatly Comment : Why do you want pyjamas to be served as django template Usually they are separated from each other and serving correct files is done by http server nginx lighttpd apache etc .. . Answer : It won t let me comment but I am running into the same issue . To answer Daniel Kluev our reason for serving the pyjamas page through django is because JSONRPC requests from pyjamas - django run into the CSRF protections in django resulting in a 403 error . The best solution and maybe only that we have seen is to pass the token to pyjamas as a cookie or form element which can then be sent back to django during the RPCs . We have not been able to implement this due to the issues Shattered1113 mentioned in his question . The only other option I ve seen is to turn off the CSRF middleware or exempt specific views from it using a decorator . This seems to be the solution everyone uses however we require the csrf-protection to be enabled so it will not work for us ." ] }
[ "yes-answer-long", "yes-answer-short" ]
javascript
UNK_RELATION
ddmathparser@mathematical-expressions@54
ddmathparser -- an objective-c framework for parsing @placeholder .
{ "confidence": [ 39.61993408203125, 36.733436584472656, 36.421142578125, 34.72909927368164, 32.112388610839844, 32.112388610839844, 30.820798873901367, 30.225341796875, 30.102535247802734, 29.966373443603516, 29.682777404785156, 29.557310104370117, 29.266571044921875, 29.266571044921875, 28.45305824279785, 28.337507247924805, 27.926891326904297, 27.532012939453125, 27.28803253173828, 27.277315139770508, 26.2950439453125, 26.2950439453125, 26.2950439453125, 26.2950439453125, 26.2950439453125, 25.86815643310547, 25.609188079833984, 25.5157470703125, 25.5157470703125, 25.5157470703125, 25.119300842285156, 25.119300842285156, 25.119300842285156, 24.61949920654297, 24.61949920654297, 24.61949920654297, 24.61949920654297, 24.61949920654297, 24.61949920654297, 24.61949920654297, 24.61949920654297, 24.37290382385254, 24.13483428955078, 24.13483428955078, 23.733196258544922, 23.710142135620117, 23.710142135620117, 23.443756103515625, 23.439556121826172, 22.930845260620117, 22.930845260620117, 22.930845260620117, 22.75353240966797, 22.75353240966797, 22.362548828125, 22.362548828125, 22.362548828125, 22.362548828125, 22.362548828125, 22.362548828125, 22.362548828125, 22.362548828125, 22.362548828125, 22.362548828125, 22.362548828125, 22.362548828125, 22.339244842529297, 22.034597396850586, 22.034597396850586, 22.034597396850586, 21.60910987854004, 21.38774871826172, 21.206424713134766, 21.186805725097656, 21.186805725097656, 21.186805725097656, 21.186805725097656, 20.98124885559082, 20.98124885559082, 20.98124885559082, 20.854652404785156, 20.433366775512695, 20.433366775512695, 20.212005615234375, 20.13199806213379, 19.805505752563477, 19.805505752563477, 19.793840408325195, 19.777647018432617, 19.777647018432617, 19.777647018432617, 19.777647018432617, 19.777647018432617, 19.777647018432617, 19.526735305786133 ], "content": [ "The Objective-C version of DDMathParser returns an NSNumber .", "I d like to use the DDMathParser https : github.com davedelong DDMathParser library with Objective-C but it was written in Swift .", "While written in Objective-C DDMathParser can indeed be used from Swift .", "If you need to use DDMathParser from Objective-C I d recommend using the code at the objc tag that s the most recent version of the Objective-C code : https : github.com davedelong DDMathParser releases tag objc", "DDMathParser is for Objective-C I tried using it in swift but whenever I run it it always crashes even though I imported it .", "The Swift version of DDMathParser wasn t written to be usable from Objective-C it was written to be Swift-like .", "everybody I am new to Stack Overflow and DDMathParser but came here because of a weird problem that occurred when I was trying to use DDMathParser in an objective-c++ file main.mm .", "DDMathParser author here .", "So : .. . .. . Now you would parse that in the DDMathParser appropriate methods to convert there are some designed for parsing Strings to Numbers .", "@Biff I recommend reading the wiki page on integrating DDMathParser https : github.com davedelong DDMathParser wiki Adding-DDMathParser-to-your-project .", "No need for DDMathParser for that .", "Probably better to write this to the DDMathParser issue tracker : github.com davedelong DDMathParser issues https : github.com davedelong DDMathParser issues", "I tried following the installation instructions from the DDMathParser wiki though it did not work : .. . .. . DDMathParser is packaged as a Swift framework .", "In any file that you want to use the DDMathParser framework just add import DDMathParser to the top of your file .", "There is no build in way to do this with DDMathParser .", "@zyl1024 github.com davedelong DDMathParser blob master DDMathParser https : github.com davedelong DDMathParser blob master DDMathParser DDFunctionUtilities.m L69 DDExpression objects don t just represent numbers .", "I am trying to import the DDMathParser framework into my Swift app .", "Is there a possibility that the DDMathParser can calculate them", "I added DDMathParser https : github.com davedelong DDMathParser as a submodule in my Git repository and after running it the code only seems to work with OS X .", "My code for using ddmathparser :", "I m struggling to add a new function nCr to DDMathParser .", "In the file that needs the function or in one of the DDMathParser file", "I m making a calculator app using DDMathParser .", "I am using DDMathParser in my project .", "I d like to use DDMathParser to solve a math problem .", "But can not import DDMathParser correctly .", "This page on the DDMathParser wiki has information on what you re supposed to do : https : github.com davedelong DDMathParser wiki Adding-DDMathParser-to-your-project", "Caveat Implementor .. . .. . .. . .. . Incidentally if this is a function you d like to see built-in to DDMathParser please open a new issue https : github.com davedelong DDMathParser issues over at Github .", "The only one I can find is the short tutorial on ddmathparser s wiki page https : github.com davedelong DDMathParser wiki Adding-New-Functions .", "I responded to the issue you filed on github : github.com davedelong DDMathParser issues 42 https : github.com davedelong DDMathParser issues 42", "I am using DDMathParser in my Xcode project .", "I am using DDMathParser to parse the string expressions .", "DDMathParser is for evaluating expressions it does not solve for unknown values .", "That probably means that you did not add the DDMathParser files to your target .", "I know that the maker of DDMathParser is often sighted in this neck of the woods .", "I want to add some new functions such as derivatives and integrations to ddmathparser .", "Do you have any ideas on how to implement this using DDMathParser", "The math library I m using DDMathParser only processes trigonometric functions in radians .", "Things like DDMathParser can be used directly from Swift .", "Here is its Documentation https : github.com davedelong DDMathParser wiki Errors", "You have to cast the error as a GroupedTokenError to access the specific DDMathParser error messages .", "There is an expression evaluator included with the Foundation framework which is part of iOS and Mac OS X and is accessible from both Objective-C and Swift .", ": .. . .. . Cocoa Cocoa.h file-not-found .. . .. . Can DDMathParser work with a mobile device using iOS7", "I am trying to use the DDMathParser in my application and am having difficulty in getting it to work with symbol as percent instead of modulo .", "sum is a built-in function https : github.com davedelong DDMathParser wiki Built-in-Functions and built-in functions cannot be overridden https : github.com davedelong DDMathParser wiki Adding-New-Functions .", "Now I need to use DDMathParser written in Swift .", "DDMathParser is not working even in swift file I ve created .", "Are you doing anything else with DDMathParser or is it just this one line", "You ll have to translate the example from Objective-C to Swift yourself .", "I ve filed a bug github.com davedelong DDMathParser issues 21 https : github.com davedelong DDMathParser issues 21 and will get around to fixing this at some point .", "Assuming you are using this project https : github.com davedelong DDMathParser tree master DDMathParser GiHub link I did not see a method evaluateWithSubstitutions : error : .", "From the GitHub project it looks like the full method-signature is source https : github.com davedelong DDMathParser blob master DDMathParser DDExpression.h line 33 :", "First of all you have to add this to your code as mentioned before : .. . .. . Then however you also need to fix a bug in the DDMathParser source code .", "The github link https : github.com davedelong DDMathParser wiki Operators implies that you need to use a string and convert to a number type in order for it to work .", "I want to pass a string to DDMathParser and store answer in another string variable using swift .", "This is unclear and or too broad : Do you have problems with the Swift syntax or with the DDMathParser expression syntax", "Here is a simple example how to use DDMathParser from Swift : .. . .. . If you need floating-point results then replace integerValue by doubleValue .", "I found that in DDMathParser all arguments are of type DDExpression even though they are essentially numbers .", "So for DDMathParser : .. . .. . .. . is equivalent to : .. . .. . However this means you can have variables now with more complex stuff : .. . .. . .. . etc", "DDMathParser natively supports using degrees for trigonometric functions and will insert the relevant dtor functions for you .", "I want it to be built into Swift not 3rd party like DDMathParser and GCMathParser It would be nice if you could a couple of them .", "This most likely means that you did not build and link the DDMathParser library with the little sample program .", "I am using DDMathParser library in my project and I want to use error-handling .", "The documentation https : github.com davedelong DDMathParser wiki of library shows that it is supported on iOS 8.0+ .", "Here s what I ve tried so far : .. . .. . This doesn t build because the compiler can t find the Expression type declared by DDMathParser .", "I have already linked the latest version of DDMathParser to my Xcode Project through my Xcode Workspace .", "I am wondering whether the issue might be the fact that the downloaded source files from DDMathParser do not contain any .framework files. . perhaps I must build them first somehow in order to generate the .framework file", "In other words Xcode isn t compiling DDMathParser into your project .", "I think there s a problem in importing DDMathParser from CocoaPods not in using it", "I am building a some kind of calculator for iOS using DDMathParser .", "I m looking to get tokens back from a string to aid in editing and referring to the answer here iOS DDMathParser Get Number Blocks http : stackoverflow.com questions 14417462 ios-ddmathparser-get-number-blocks it appears that this functionality may be deprecated .", "I haven t been able to find any examples online of using this library in Objective-C .", "UPDATE An issue was created for this and the answer is here DDMathsParser https : github.com davedelong DDMathParser issues 68 .. . .. . I think DDMathOperatorSet defaultOperatorSet setInterpretsPercentSignAsModulo : NO might be what you want .", "Based on the documentation I could find not example of where DDMathParser could handle symbolic expressions .", "I am generating a random equation say like 2 3+4.... . and using DDMathparser to evaluate it .", "I am attempting to define and format a custom function in Swift via the mechanisms built into DDMathParser .", "Incidentally are you aware that DDMathParser has support for the exact case you re describing already", "I am secretly hoping that he will come to the rescue and either fix my problem so I can implement it myself or him make it part of DDMathParser", "I would like to ask you if there is a way for DDMathParser to calculate absolute values e.g 2+4 5 88 should give 1 4 and not 0.25 .", "The top answer on this http : stackoverflow.com questions 13260682 ddmathparser-create-expression-from-nsstring StackOverflow question shows how but it only solves it to the log .", "I m a newbie in Objective-C programming and it s still tricky for me .", "I don t know much about DDMathParser OK I don t know anything about it but taking a look at the documentation https : github.com davedelong DDMathParser wiki gives some clues about what is going wrong with your code .", "An example of declaring a custom function can be found in the unit tests for DDMathParser https : github.com davedelong DDMathParser blob master MathParserTests EvaluatorTests.swift L261 which I ll include here : .. . .. . You would obviously want to provide a different implementation of the evaluation block passed to the Function constructor .", "It can be considered as first degree function that I need to solve using Objective C . .. . .. . Guys any ideas", "I m new to Objective-C so I don t even know what import statement to use maybe other people find this common knowledge", "I hope that @DaveDeLong will see your question at some point he s the author of DDMathParser http : stackoverflow.com users 115730 dave-delong : : :", "I am working on one expression which is 2+x 6+2x+2y 5y+2x I am trying to parse it and evaluate it using DDMathParser .", "I ended up putting this in by parsing strings as variables .", "In my Xcode project I need to rename my ViewController.m in ViewController.mm but I also need the DDMathParser .", "I try to add DDMathParser library to my project but i get two linking errors .", "I found DDMathParser and theoretically I would be able to validate my expression like so : .. . .. . Any thoughts why", "This implies that you re using version 3.0 of DDMathParser which was recently re-written in Swift and in which the method numberByEvaluatingString does not exist .", "Link : https : github.com davedelong DDMathParser wiki Installing .. . .. . Here s what I did : .. . .. . 1 .", "7 pod DDMathParser Cocoapods Podfile name This is example .. . .. . 8 pod install .. . .. . CocoaPods 0.36 and above will support for swift", "i just haven t implemented the function i wanted to use - ddmathparser still used for other functions just can t get my head around the switching yet - when i finally get it sorted i ll post the solution here if i can" ] }
{ "confidence": [ 45.01172637939453, 41.842647552490234, 37.89120864868164, 37.235923767089844, 36.985923767089844, 36.393028259277344, 35.79974365234375, 35.79974365234375, 33.917640686035156, 33.37742614746094, 32.799339294433594, 32.60103225708008, 31.873090744018555, 31.856380462646484, 31.470340728759766, 31.038543701171875, 31.028369903564453, 30.60150146484375, 30.49983024597168, 30.387191772460938 ], "content": [ "Question : I d like to use the DDMathParser https : github.com davedelong DDMathParser library with Objective-C but it was written in Swift . Here s what I ve tried so far : .. . .. . This doesn t build because the compiler can t find the Expression type declared by DDMathParser . I also tried switching my import statement to : .. . .. . But still no luck . I haven t been able to find any examples online of using this library in Objective-C . I m new to Objective-C so I don t even know what import statement to use maybe other people find this common knowledge .. . Answer : The Swift version of DDMathParser wasn t written to be usable from Objective-C it was written to be Swift-like . If you need to use DDMathParser from Objective-C I d recommend using the code at the objc tag that s the most recent version of the Objective-C code : https : github.com davedelong DDMathParser releases tag objc", "Question : I am wondering if there are any nice Mathematical Parsers in Swift . That is it can take a string and solve it . I need it to have factorials exponents square roots and all the basic arithmetic operators . I want it to be built into Swift not 3rd party like DDMathParser and GCMathParser It would be nice if you could a couple of them . Comment : Given that there aren t any Apple-provided frameworks for this this would by necessity be a third-party solution . Things like DDMathParser can be used directly from Swift . Comment : DDMathParser is for Objective-C I tried using it in swift but whenever I run it it always crashes even though I imported it . Comment : While written in Objective-C DDMathParser can indeed be used from Swift . Swift only had a problem with NSDecimal structs before 1.2 but that s been fixed in the language . Using it from Swift should not be a source of crashes so you might want to examine the stack traces you re getting from those crashes to identify the reason behind them . Comment : Do you know how to use it so you can help me Comment : Edit your question to include the code you wrote to try to use it and the exact error messages you got . .. . Answer : There is no mathematical expression parser built into Swift in the way you mean . There is an expression evaluator included with the Foundation framework which is part of iOS and Mac OS X and is accessible from both Objective-C and Swift . It s called NSExpression . Example : .. . .. . It doesn t include a factorial function but this article http : nshipster.com nsexpression describes how to add your own functions and uses factorial as an example . You ll have to translate the example from Objective-C to Swift yourself . Comment : I added the error and the code I used", "Question : null .. . Answer : i am developing a calculator for iPad . I would like to ask you if there is a way for DDMathParser to calculate absolute values e.g 2+4 5 88 should give 1 4 and not 0.25 . Is it possible to have two modes absolute and exact decimal I would also like to ask you if there is a way to calculate first and second degree equations e.g : 2 x+3 5-7 x should give the value of x .. . derivatives and integrations using DDMathParser I would really appreciate any help . Thank you in advance . Best regards Comment : That s not what absolute-value is . Comment : ok then how should i call this Do you have any ideas on how to implement this using DDMathParser Thank you in advance Comment : Probably a fractional value http : stackoverflow.com questions 5552537 convert-decimal-to-fraction-in-objective-c and what you re trying to do with the derivatives and integrals is a tremendously complicated task . There is no build in way to do this with DDMathParser . Comment : thank you very much . Do you have any idea about latex functions Is there a possibility that the DDMathParser can calculate them Thank you in advance", "Question : I am using DDMathParser to parse the string expressions . I am working on one expression which is 2+x 6+2x+2y 5y+2x I am trying to parse it and evaluate it using DDMathParser . It can be considered as first degree function that I need to solve using Objective C . .. . .. . Guys any ideas Help would be highly appreciated . Comment : What error or problem are you getting Comment : Not facing any error but getting 0 as num that should not be the result . Comment : @Dave Delong can you please help on this Comment : see my answer below . It may not be what you want to hear but I think it is correct.. . I don t think that library does symbolic-math . Comment : Correct . DDMathParser is for evaluating expressions it does not solve for unknown values . .. . Answer : I don t know much about DDMathParser OK I don t know anything about it but taking a look at the documentation https : github.com davedelong DDMathParser wiki gives some clues about what is going wrong with your code . Based on the documentation I could find not example of where DDMathParser could handle symbolic expressions . All of the examples on the Usage page show numeric expressions . For symbolic-math see Symbolic Math Library in C C++ Obj-C http : stackoverflow.com questions 7210417 symbolic-math-library-in-c-c-obj-c . In addition it looks like you are trying to solve for two variables with a single equation which is certainly not going to result in a numeric solution . However if you are just trying to substitute values in for x and y you should use the sign before them as the documentation https : github.com davedelong DDMathParser wiki Variables says : .. . .. . If you don t know what the value of a particular term should be when the string is constructed that s ok simply use a variable : .. . .. . .. . NSString math @ 6 a .. . .. . .. . So if you just want to substitute values in your expression try using : .. . .. . Then fill in with values . And evaluate .", "Question : I try to add DDMathParser library to my project but i get two linking errors . I m a newbie in Objective-C programming and it s still tricky for me . Below there is a snapshot of the errors i get : enter image description here http : i.stack.imgur.com B851g.png .. . .. . What should i do I also tried CGMathParser but i didn t manage to solve some errors i get . I asked here but i didn t get any feedback http : stackoverflow.com questions 10850698 how-to-use-gcmathparser-in-ios-5-application-xcode-4-2-with-arc .. . .. . Any advice Thanks .. . Answer : It looks like you ve copied in the headers but not actually linked the source files in . In other words Xcode isn t compiling DDMathParser into your project . This page on the DDMathParser wiki has information on what you re supposed to do : https : github.com davedelong DDMathParser wiki Adding-DDMathParser-to-your-project", "Question : I would like to make a function which would allow me to pass a string in the argument - what s the best way to do this eg. . Moles Ca OH 2 .. . .. . Any help would be extremely gratefully received . Comment : I responded to the issue you filed on github : github.com davedelong DDMathParser issues 42 https : github.com davedelong DDMathParser issues 42 .. . Answer : I ended up putting this in by parsing strings as variables . So for DDMathParser : .. . .. . .. . is equivalent to : .. . .. . However this means you can have variables now with more complex stuff : .. . .. . .. . etc", "Question : everybody I am new to Stack Overflow and DDMathParser but came here because of a weird problem that occurred when I was trying to use DDMathParser in an objective-c++ file main.mm . No matter how simple the code was it would give a thread error . Here s my code : .. . .. . And here s the console after running : .. . .. . Any suggestions Comment : oops it cut out the Hello .. . Answer : You are not getting a thread error . The ObjC runtime is throwing an exception because you are sending a message to an object and that object does not implement the message . Specifically you are trying to invoke the selector numberByEvaluatingString on an instance of NSCFConstantString which can be thought of for this purpose as NSString . Now since you include the header-files that define the method as a category on NSString you don t get a compile error . However at runtime when the ObjC runtime environment sends the selector to the object it can t find the implementation so it throws an exception . This most likely means that you did not build and link the DDMathParser library with the little sample program . Thus the implementation code is is unavailable at runtime .", "Question : I d like to use DDMathParser to solve a math problem . The top answer on this http : stackoverflow.com questions 13260682 ddmathparser-create-expression-from-nsstring StackOverflow question shows how but it only solves it to the log . I d like to get the answer as a string on an integer . The code NSLog @ @ math numberByEvaluatingString also works but it only prints it to the log . What I d like to do would be something like answerText @ @ math numberByEvaluatingString where math is the string to evaluate and answerText is the string to push the answer to . However when I try to display the string in a label like Label.text NSString stringWithFormat : answerText I get a sigabrt error . I m not sure what s up . That code does not work at all with an integer . Thanks in advance .. . Answer : The Objective-C version of DDMathParser returns an NSNumber . That means that in order to show it as the value in a textfield you need to convert it to a string . While using +stringWithFormat : would work it s not technically correct . By using +stringWithFormat : you re relying on the -description of the NSNumber which may have information you don t want or lack information that you do want . The best way to render an NSNumber into an NSString suitable for human consumption is to use an NSNumberFormatter .", "Question : I added DDMathParser https : github.com davedelong DDMathParser as a submodule in my Git repository and after running it the code only seems to work with OS X . Right away it gives me the following error in DemoController.h etc . : .. . .. . Cocoa Cocoa.h file-not-found .. . .. . Can DDMathParser work with a mobile device using iOS7 If so it isn t clear to me how to accomplish this . My google-search online suggests that Cocoa is not possible with iOS . I was able to get it working with Mac OS X - how can I do the same for iOS with my app .. . Answer : DDMathParser author here . You ve copied over more than you need . As the name implies DemoController is part of a demo showing how the parser works . You shouldn t be including it in your app . Comment : Well that was a careless mistake on my part . It would be nice however if I could delete the unnecessary files if I do so will a submodule update re-download them Comment : @Biff I recommend reading the wiki page on integrating DDMathParser https : github.com davedelong DDMathParser wiki Adding-DDMathParser-to-your-project . I think a git submodule update should bring it all back but I d have to try it to be sure .", "Question : I am trying to import the DDMathParser framework into my Swift app . I tried following the installation instructions from the DDMathParser wiki though it did not work : .. . .. . DDMathParser is packaged as a Swift framework . .. . Add DDMathParser.xcodeproj to your workspace and link MathParser.framework into your app . Link : https : github.com davedelong DDMathParser wiki Installing .. . .. . Here s what I did : .. . .. . 1 . I dragged in the .xcodeproj file into my project from Finder to Xcode and the file shows up under my project in the sidebar . 2 . I went to my project settings and clicked the + under Linked Frameworks and Libraries and neither MathParser.framework or DDMathParser.framework are showing up in the list of available frameworks . 3 . I tried building my application after adding the xcodeproj but the framework files are still not showing up . What am I doing wrong or how do I correctly install this framework Using Xcode 7.2.1 Comment : Ensure you create an Xcode workspace for your project . Comment : I believe I have a workspace for my project does this look right http : i.imgur.com 2J1dWkj.png Comment : It might . If you have a workspace and there is a framework project within it you should be able to add it via : in the target editor select your app target click Tab Build Phases open section Link Binary With Libraries and click the + button Add Items . Then a sheet should roll down with a file selection dialog also showing a Workspace virtual folder . In this Workspace folder there should be your third party framework . Comment : Thanks for the help . I followed your steps and I got to this point http : i.imgur.com 2zXNyZW.png where the action sheet rolls down but there is no Workspace folder just the standard OS X folder and the Developer Frameworks folder . I am wondering whether the issue might be the fact that the downloaded source files from DDMathParser do not contain any .framework files. . perhaps I must build them first somehow in order to generate the .framework file Comment : It seems you don t have a workspace yet . A workspace bundle has the extension . xcworkspace . The workspace bundle is oftentimes located in the same folder where the main projects file .xcodeproj resides . .. . Answer : Navigate to your project using the Terminal app once at the root folder type pod init a Podfile will be created you can open it with nano Podfile and add these changes with updated paths to your specific project . Then save your file . type pod install and hit enter . Now open your new .xcworkspace that was created . In any file that you want to use the DDMathParser framework just add import DDMathParser to the top of your file .", "Question : I am trying to use the DDMathParser in my application and am having difficulty in getting it to work with symbol as percent instead of modulo . The wiki advises the following - .. . .. . The sign is usually interpreted as the modulo operator . However DDMathParser.h defines a compile-time switch DD INTERPRET PERCENT SIGN AS MOD that allows you to change it to be interpreted as a percentageI .. . .. . I added this define in the DDMathParser.h but it hasn t worked . expressions are still calculated as modulo and this is not the result i would like . Does anybody have any experience of this and know specifically how to set this up Please advise Comment : Did you end up resolving this Comment : no i gave up - emailed the developer with no response Comment : So what did you go with as an alternative or was your project abandoned to forever collect meta-dust - Comment : i just haven t implemented the function i wanted to use - ddmathparser still used for other functions just can t get my head around the switching yet - when i finally get it sorted i ll post the solution here if i can Comment : Great . Look forward to it . .. . Answer : The github link https : github.com davedelong DDMathParser wiki Operators implies that you need to use a string and convert to a number type in order for it to work . So : .. . .. . Now you would parse that in the DDMathParser appropriate methods to convert there are some designed for parsing Strings to Numbers . UPDATE An issue was created for this and the answer is here DDMathsParser https : github.com davedelong DDMathParser issues 68 .. . .. . I think DDMathOperatorSet defaultOperatorSet setInterpretsPercentSignAsModulo : NO might be what you want . FOR DISPLAYING PURPOSES .. . .. . In iOS you can use to represent percent in a string : Comment : Thanks for your response I already pass the string to the parser and get the result as modulo . I want the result as percent and so the switch used the define is not working for me . My question therefore is whether i have set the switch correctly and how to do so . Comment : Then you do simple mathematics as the site says : 100 10 10 . Then just display as d result which will display as 10 . So just do normal mathematics and then place a sign in when you need it . Comment : sorry but your comment isn t helping me - the idea is to pass the string 100+10 to the mathparser and for it to do the math for me returning 110 Comment : Can you give an actual example of what you have tried and what it s giving back at all That might help me more to identify what the issue is . If you want the result as a percentage it s not hard mathematics to implement without using the DDMathsParser classes but fair call if you are wondering why it s not working how it should . Comment : i simply send math expressions to the DDMathparser and get back a result - 10+20+30 returns 60 sin 45 returns 0.89399... . 100 3 returns 1 modulo i want to send 100+10 and return 110", "Question : I am trying to import the DDMathParser framework into my Swift app . I tried following the installation instructions from the DDMathParser wiki though it did not work : .. . .. . DDMathParser is packaged as a Swift framework . .. . Add DDMathParser.xcodeproj to your workspace and link MathParser.framework into your app . Link : https : github.com davedelong DDMathParser wiki Installing .. . .. . Here s what I did : .. . .. . 1 . I dragged in the .xcodeproj file into my project from Finder to Xcode and the file shows up under my project in the sidebar . 2 . I went to my project settings and clicked the + under Linked Frameworks and Libraries and neither MathParser.framework or DDMathParser.framework are showing up in the list of available frameworks . 3 . I tried building my application after adding the xcodeproj but the framework files are still not showing up . What am I doing wrong or how do I correctly install this framework Using Xcode 7.2.1 Comment : Ensure you create an Xcode workspace for your project . Comment : I believe I have a workspace for my project does this look right http : i.imgur.com 2J1dWkj.png Comment : It might . If you have a workspace and there is a framework project within it you should be able to add it via : in the target editor select your app target click Tab Build Phases open section Link Binary With Libraries and click the + button Add Items . Then a sheet should roll down with a file selection dialog also showing a Workspace virtual folder . In this Workspace folder there should be your third party framework . Comment : Thanks for the help . I followed your steps and I got to this point http : i.imgur.com 2zXNyZW.png where the action sheet rolls down but there is no Workspace folder just the standard OS X folder and the Developer Frameworks folder . I am wondering whether the issue might be the fact that the downloaded source files from DDMathParser do not contain any .framework files. . perhaps I must build them first somehow in order to generate the .framework file Comment : It seems you don t have a workspace yet . A workspace bundle has the extension . xcworkspace . The workspace bundle is oftentimes located in the same folder where the main projects file .xcodeproj resides . .. . Answer : 1 sudo gem install cocoapods gem will get installed in Ruby inside System library .. . .. . 2 create a xcode project .. . .. . 3 Open terminal .. . .. . 4 cd path to your project root directory .. . .. . 5 pod init .. . .. . 6 open -e podfile podfile will get open in text mode . Initially it will be emppty put the follwoing line of code . 7 pod DDMathParser Cocoapods Podfile name This is example .. . .. . 8 pod install .. . .. . CocoaPods 0.36 and above will support for swift", "Question : I added DDMathParser https : github.com davedelong DDMathParser as a submodule in my Git repository and after running it the code only seems to work with OS X . Right away it gives me the following error in DemoController.h etc . : .. . .. . Cocoa Cocoa.h file-not-found .. . .. . Can DDMathParser work with a mobile device using iOS7 If so it isn t clear to me how to accomplish this . My google-search online suggests that Cocoa is not possible with iOS . I was able to get it working with Mac OS X - how can I do the same for iOS with my app .. . Answer : It definitely works with iOS 7 . I copied it into my Xcode project folder and it parses like a champ . Can you try that first then work on Git", "Question : I am using DDMathParser library in my project and I want to use error-handling . I want the error to be displayed to user if he inputs wrong expression . What would be my catch block to detect and display related error and its position . Following is my sample code : .. . .. . According to DDMathParser it should be Grouping error and by using Range with it it should specify its location where parenthesis got missed or any other error type occurred . Here is its Documentation https : github.com davedelong DDMathParser wiki Errors .. . Answer : You have to cast the error as a GroupedTokenError to access the specific DDMathParser error messages . Note that you also have to add a generic error catching block for non-DDMathParser errors in my example a generic ErrorType will be bridged to an NSError to display the contents the Cocoa way .", "Question : I am new to programming . I want to add some new functions such as derivatives and integrations to ddmathparser . The only one I can find is the short tutorial on ddmathparser s wiki page https : github.com davedelong DDMathParser wiki Adding-New-Functions . However I can t follow it because it s too short and after reading it several times I still can t understand what it s doing . So can anyone elaborate steps to add a new function or give me some more detailed tutorials of doing this I really did my research but I can t find one . Thanks very much . .. . Answer : DDMathParser author here . Here s how you add a multiply by two function : .. . .. . Now you can do : .. . .. . and get back @42 . .. . .. . What s going on here : .. . .. . Internally DDMathEvaluator essentially has a big NSDictionary where it keeps a list of all the functions it knows about keyed off the name of that function kind of like this : .. . .. . Obviously it s a bit more complicated than that but that s the basic idea .. . .. . When the evaluator evaluates a string and comes across the a function it looks up in this dictionary what the block for the function is . It retrieves the block and then executes the block with the arguments if there are any from the string . The result-of the block is the result-of the function . That result gets substituted back in and evaluation continues . Comment : Thank you . Now I understand how this works . So where should I put the code In the file that needs the function or in one of the DDMathParser file Comment : @zyl1024 put it in your own code . Comment : Thank you especially for the explanation added . Comment : Hi Mr . DeLong I met a new problem . I want to make a new function that takes several arguments . I found that in DDMathParser all arguments are of type DDExpression even though they are essentially numbers . Can you tell me how to convert DDExpression to NSNumber or int type because I want to do some complex things to the arguments and I m more comfortable working with NSNumber or int Comment : @zyl1024 github.com davedelong DDMathParser blob master DDMathParser https : github.com davedelong DDMathParser blob master DDMathParser DDFunctionUtilities.m L69 DDExpression objects don t just represent numbers . They can also represent functions and variables .", "Question : I m struggling to add a new function nCr to DDMathParser . I ve tried to follow these instructions by the author of DDMathParser : .. . .. . http : stackoverflow.com a 15599814 2521277 .. . .. . My problem : I can t manage to combine DDExpressions to a complex expression with variables.. . .. . .. . Can you help me to add the function nCr http : en.wikipedia.org wiki Binomial coefficient Factorial formula .. . .. . Thank you .. . Answer : DDMathParser author here . The basic signature for all functions is this : .. . .. . So you need to create one of these blocks that implements the nCr algorithm . There are a couple of ways you could do it : .. . .. . 1 . You could implement the function exactly as shown in the article calculating the factorials doing the subtraction and doing the division . 2 . You could implement the function wholly in terms of the existing factorial subtraction and division functions . 3 . You could do a combination of the two . Personally I d recommend the last one because it saves having to re-evaluate the arguments http : en.wikipedia.org wiki Memoization but also means you don t have to write most of the logic yourself . It d be something like this : .. . .. . With this block you can register the function on your DDMathEvaluator : .. . .. . That s it Now you can do : .. . .. . Warning : code typed in a browser and not compiled . Caveat Implementor .. . .. . .. . .. . Incidentally if this is a function you d like to see built-in to DDMathParser please open a new issue https : github.com davedelong DDMathParser issues over at Github .", "Question : I want to pass a string to DDMathParser and store answer in another string variable using swift . I am totally new to iOS platform so I dont really know syntax of functions . Example : Comment : This is unclear and or too broad : Do you have problems with the Swift syntax or with the DDMathParser expression syntax Comment : DDMathParser s swift syntax . I think its different from Obj-C Comment : @MartinR i have edited my question now it might be less confusing . .. . Answer : Here is a simple example how to use DDMathParser from Swift : .. . .. . If you need floating-point results then replace integerValue by doubleValue . Comment : It gave me an exception . Shouldn t i be using NSlog function . because in C-Obj i saw that statement is executed through that function . But i am unable to get it working in swift . Comment : @Bilal : Any error messages I tried that code and it worked for me . Comment : Following exception : NSCFString numberByEvaluatingString : unrecognized-selector sent to instance 0x7f9212dcc1e0 2015-05-10 16 : 40 : 43.826 Test-1 956 : 13800 Terminating app due to uncaught exception NSInvalidArgumentException reason : - NSCFString numberByEvaluatingString : unrecognized-selector sent to instance 0x7f9212dcc1e0 Comment : Its v long actually cant copy-paste all of it . Comment : That probably means that you did not add the DDMathParser files to your target .", "Question : In my Xcode project I need to rename my ViewController.m in ViewController.mm but I also need the DDMathParser . I compile the parser in the .m file without any errors . But when I compile it in the .mm file I get following errors : .. . .. . Parse issue at line : Comment : Thanks for bringing this to my attention . I ve filed a bug github.com davedelong DDMathParser issues 21 https : github.com davedelong DDMathParser issues 21 and will get around to fixing this at some point . .. . Answer : Chage the name of the parameter from operator to anything else . operator is a keyword in C++ .", "Question : I am trying to use the DDMathParser in my application and am having difficulty in getting it to work with symbol as percent instead of modulo . The wiki advises the following - .. . .. . The sign is usually interpreted as the modulo operator . However DDMathParser.h defines a compile-time switch DD INTERPRET PERCENT SIGN AS MOD that allows you to change it to be interpreted as a percentageI .. . .. . I added this define in the DDMathParser.h but it hasn t worked . expressions are still calculated as modulo and this is not the result i would like . Does anybody have any experience of this and know specifically how to set this up Please advise Comment : Did you end up resolving this Comment : no i gave up - emailed the developer with no response Comment : So what did you go with as an alternative or was your project abandoned to forever collect meta-dust - Comment : i just haven t implemented the function i wanted to use - ddmathparser still used for other functions just can t get my head around the switching yet - when i finally get it sorted i ll post the solution here if i can Comment : Great . Look forward to it . .. . Answer : I ve been able to resolve this . First of all you have to add this to your code as mentioned before : .. . .. . Then however you also need to fix a bug in the DDMathParser source code . I ve been using the latest available ObjectiveC version of the source dated Nov 10 2015 from here : https : github.com davedelong DDMathParser releases tag objc and the bug is in the DDMathOperator.m .. . .. . Where it says : .. . .. . change it to : .. . .. . That s it - percents calculate fine afterward .", "Question : I have an Obj-C project with CocoaPods . Now I need to use DDMathParser written in Swift . But can not import DDMathParser correctly . When I add new Swift file to the project it works fine . DDMathParser is not working even in swift file I ve created . Here s a bit of my code : .. . .. . What I must do to make it work P.S . Bridging header created and working . In build settings Defines Modules set to YES .. . .. . CocoaPods file : Comment : Please add your Cocoapods file . Comment : Please also describe what doesn t work means . Does it fail to build If so what s the build failure Does it fail at runtime If so what s the runtime-error Etc . Comment : It fails to build . Looks like DDMathParser s classes havent imported yet .. . Answer : This implies that you re using version 3.0 of DDMathParser which was recently re-written in Swift and in which the method numberByEvaluatingString does not exist . It was renamed to evaluate . Comment : It doesn t work too . I think there s a problem in importing DDMathParser from CocoaPods not in using it" ] }
[ "yes-answer-long", "yes-answer-short" ]
mathematical-expressions
UNK_RELATION
dalekjs@javascript@65
dalekjs -- dalekjs is an open-source ui-testing tool written in @placeholder .
{ "confidence": [ 50.62134552001953, 46.153297424316406, 44.460670471191406, 44.456912994384766, 43.97054672241211, 43.54560852050781, 43.20512771606445, 43.20512771606445, 42.684173583984375, 41.91974639892578, 41.818180084228516, 41.8012580871582, 41.8012580871582, 40.8491325378418, 40.76080322265625, 40.68271255493164, 40.64405059814453, 40.64405059814453, 40.076480865478516, 40.076480865478516, 39.257102966308594, 39.05575942993164, 38.92363357543945, 38.76494216918945, 38.33213424682617, 38.33213424682617, 38.188995361328125, 38.01128005981445, 38.01128005981445, 37.99414825439453, 37.99414825439453, 37.174922943115234, 37.174922943115234, 36.451324462890625, 36.451324462890625, 36.43217468261719, 35.403587341308594, 35.403587341308594, 35.403587341308594, 35.33988571166992, 33.65924072265625, 33.65924072265625, 33.65924072265625, 33.65924072265625, 33.65924072265625, 33.65924072265625, 33.65924072265625, 33.65924072265625, 33.65924072265625, 33.65924072265625, 33.65924072265625, 32.50203323364258, 32.50203323364258, 32.50203323364258, 32.50203323364258, 31.948169708251953, 31.948169708251953, 31.11508560180664, 31.11508560180664, 31.11508560180664, 30.799331665039062, 30.799331665039062, 30.799331665039062, 30.799331665039062, 29.64212417602539, 29.340478897094727, 28.799972534179688, 28.255176544189453, 28.255176544189453, 28.255176544189453, 27.59613037109375, 27.59613037109375, 25.05197525024414, 25.05197525024414, 24.118423461914062, 22.961212158203125, 22.961212158203125, 22.721813201904297, 21.620101928710938, 21.53518295288086, 21.053667068481445, 20.52202606201172, 20.141407012939453, 19.583084106445312, 19.41958236694336, 18.957740783691406, 18.44597625732422, 18.27880859375, 18.26185417175293, 17.579242706298828, 17.122394561767578, 17.093944549560547, 16.560161590576172, 16.514400482177734, 16.514400482177734, 16.422033309936523, 16.41630744934082, 15.865401268005371, 15.806500434875488, 15.806500434875488 ], "content": [ "Is there a way of doing this in Dalekjs", "How can I access a frameset using dalekjs", "Which tool would be better keeping my project in mind is it Selenium or DalekJS", "I use the testing framework DalekJS to test the user-interface .", "all my tests are inside the menu and content frames but i can t access them and dalekjs is the better testing tool i ve came across so far .", "Just a quick question -- Does DalekJS support https", "Is there a workaround to get us to run dalekjs", "i need help in terms of dalekjs .", "I m relatively new to DalekJS and I ve been battling with clearing a field and then typing .", "Here is the Angularjs TODO code snippet part .. . .. . I am trying to change the value Task one to Edited Task while testing using dalekjs with chrome .. . .. . the dalekjs code is .. . .. . this code works very well for backbone but not for angular .", "Do DalekJS installation as suggested .. . 2 .", "Is there a way to let dalekjs do that work for me", "I have a problem with my DalekJS test .", "I can get assert attributes and existence of elements but trying to use .type or .setValue fails .. . .. . Here is the test .. . .. . the assert.val fails : .. . .. . Output : .. . .. . DalekJS CLI Tools Version : 0.0.5 DalekJS local install : 0.0.9", "I am new to using Dalekjs and am trying to open a browser run some tests and crucially want to leave the browser window open .", "I am using Windows 10 Node 4.4.5 DalekJS CLI 0.0.5 DalekJS 0.0.9 PhantomJS 2.1.1", "I m using DalekJS with PhantomJS to test a web application .", "I wanted to automate image-comparison through dalekjs .", "Having read a bit of DalekJS I can see it wouldn t work .", "Judging from the documentation you did not define a valid test case for DalekJS .", "npm-install dalekjs --save-dev is failing...i.e .", "Chrome version : 46.0.2490.71 64-bit .. . .. . Dalek version : .. . .. . DalekJS CLI Tools Version : 0.0.5 DalekJS local install : 0.0.9", "Running Browser : Google Chrome OS : Mac OS X 10.8.5 x86-64 Browser Version : 36.0.1985.125 DalekJS CLI Tools Version : 0.0.4 DalekJS local install : 0.0.8 .. . .. . Header Search Results : function test test .execute function var searchTerm prompt Please enter a known search term .open myURL .. . .. .", "I m having a crack at using DalekJS as a way to debug both UI and JS sides of a library I m working on .", "We are working on bringing back support for real devices with the next version of DalekJS .", "Is there a way to pass flags command-line switches to the browser being used with DalekJS", "We are trying to automate the test workflows using only open-source test automation tools are looking at options like Selenium DalekJS .", "And the solution is snip2code.com Snippet 23817 http : www.snip2code.com Snippet 23817 Screenshot-of-an-array-of-URLs- DalekJS", "Dalekjs keeps saying Found Object object .. . .. . How do we assert this properly", "Could you please file an issue here https : github.com dalekjs dalek-browser-chrome issues state open", "The DalekJS documentation for the open action says You can forge GET POST PUT DELETE and HEAD requests .", "Answer to the question is provided here https : groups.google.com forum topic dalekjs wCmEKfDvxYQ", "I would like to click on a link which downloads page with DalekJS .", "I faced the same problem but it seems github.com dalekjs dalek issues 3 https : github.com dalekjs dalek issues 3 we are limited to standard CSS selectors - w3.org TR css3-selectors selectors http : www.w3.org TR css3-selectors selectors", "I am trying to write my very first test case with DalekJS but it keeps failing on error : .. . .. . I have just copy-pasted the example from dalekjs webpage : .. . .. . I have even tried empty test function but the error was the same .", "Still experimental and is yet to be merged into DalekJS core but you could try using gskachkov https : github.com gskachkov s pull request here https : github.com dalekjs dalek pull 112 which adds screenshot comparison functionality to DalekJS .", "Unfortunately every-time DalekJS runs through my code it seems to skip over the email function .", "That s why I ended up using the test.execute method because it supposedly allows non dalekjs functions to run .", "I am new to dalekjs and tried to learn it by using it to test a TODO application built using Angularjs .", "I have run into this issue https : github.com dalekjs dalek-browser-ie issues 15 that prevents Dalekjs from working properly with webdriver for IE on 64bit windows install .", "Hi Shashi Vardhan Andem .. . .. . unfortunatly it seems DalekJS is dead unmaintained dependencies last commit 2 years ago .", "We recently switched from dalekjs to http : webdriver.io .. . .. . So to answere your question .", "When running on phantonJS it shows .. . .. . Does DalekJs have problem with Window8 64bit system because it runs fine on 32-bit", "I ve got DalekJS running really well on WinLin but am interested to know exactly what the process is for running it on iOS .", "System specs : win7 64 bit Dalek specs : cli tools -- 0.0.4 dalekjs local install -- 0.0.8 cheers izocan", "hey sebastian you can view the detailed description on github https : github.com dalekjs grunt-dalek issues 12", "Is there any plugin exists for casperjs as similar to DalekJS dalek-browser-chrome or something similar to this", "A basic DalekJS iOs simulator test fails to launch on OS X Yosemite 10.10.1 .", "I tried adding the code to the config.js file in dalekjs lib dalek config.js but it doesn t seem to do anything .", "I have an issue where the link I need to traverse to using DalekJS that is not clickable it is rather copy pastable .", "DalekJS does not allow reading values of HTML element synchronously and using them in the test scripts .", "This question has been further discussed here : https : groups.google.com forum topic dalekjs HHt6eoZRQc4", "Versions : Win7 dalek-cli 0.0.4 dalekjs local install : 0.0.8 .. . .. . cheers izocan", "How can I get a 64bit windows system to run Dalekjs on 64bit windows system", "I tried this code to test if in Dalekjs Documentation assertions examples are corrects but it doesn t work in Chrome .", "Once the done https : github.com dalekjs dalek blob master lib dalek unit.js L165 function is run it runs a promise with the result-of your test and completes the test run - i.e .", "This behaviour can be misleading in making you think that the tests are taking a bit of time to run when that is not the case - I ve created a ticket https : github.com dalekjs dalek issues 118 about this here .", "Location : .. . .. . yourproject node-modules dalekjs node-modules dalek-browser-phantomjs node-modules .. . .. . Now all your tests should work", "So on the DalekJS home page it simply says to run the npm-install commands without sudo or root .", "I just want to know the proper syntax for loops in DalekJS.. . any example would be awesome .", "I have successfully installed Dalekjs on windows OS but when i try to run my first test script the test doesn t run .", "My code : .. . .. . Running my PHP-script in browser it prints : .. . .. . The DalekJS script generates a screenshot when executing in shell but running with PHP it does not happen anything .", "In the example above I would like DalekJS to dynamically run test.open http : example.com link-1 during the progression of my test .", "This feels like the stupidest question ever asked on SO but I m having no luck with things I ve tried to check a simple checkbox within a DalekJS test .", "following situation : .. . .. . I tried and succeeded to access it on the browser console with this selector : .tableclasss tbody tr : last td : eq 2 but this fails if i use it in DalekJS becaus of the colons", "We are going to improve the API session in the upcoming version of DalekJS so iterating over DOM elements interaction between JavaScript executed on the client-side JavaScript executed on the server as part of the tests will be a lot smother .", "But if I understand you correct you do not need to test it you only need to get rid of the dialog I don t know what to do with PhantomJS but I believe you can get rid of that if you pass an option to Chrome see DalekJS : start browser with custom flags http : stackoverflow.com questions 22206520 dalekjs-start-browser-with-custom-flags but I don t know which option you need to set Maybe you need to puzzle a bit .", "Those two are missing which leads to the error that this.spawned is set to null which throws the error at dalekjs node-modules dalek-browser-phantomjs index.js : 273 : 17 .", "Execute the next npm command WITHOUT ROOT SUDO privileges : npm-install dalekjs --save-dev had to do similar on Ubuntu .", "I m just experimenting with DalekJS and I m trying to get a Forloop to run.. . but the terminal gives me a.. . ERROR : Error : socket hang up.. .", "http : dalekjs.com docs ios.html .. . .. . When running on Windows for example I install the DalekJS npm globally and then install the IE web-driver before executing my test suite .", "This hasn t made it into the official docs yet but I recently merged a pull request that allows you exactly that : .. . .. . See https : github.com dalekjs dalek-browser-chrome pull 8 for more details .", "The first command installs the modules the second command however configures your directory for phantomJS usage--and if you call the second command npm-install dalekjs --save-dev with root privileges then that will cause problems .", "I never used DalekJS but it looks like you are calling test.done twice : once in the shared function you wrote in common tests.js and then in your test file after calling the common function .", "I do not know if there is a flag for enabling the camera access or on the other hand disabling the dialog that asks for permission but if there is one you can apply it using your Dalekfile like described in this pull request : https : github.com dalekjs dalek-browser-chrome pull 8", "Dalekjs doesn t give any native method to access image let alone compare them.. . Only thing i can think of is somehow save image through Dom and compare it through js script.. . Bt again the problem is to do it with dalek", "Lets consider below Select example with value attribute .. . .. . Using dalekjs I m able to select the option using below code .. . .. . But when the above example don t have value attribute as show below .. . .. . How to select option from dropdown", "Can you share what is it that you are testing", "If you do not need to do UI testing of any kind try visionmedia supertest https : github.com visionmedia supertest", "I fear DalekJS is not the tool you need right now even if it is my little tool I suggest to use Karma former called Testacular - which was originally developed to test AngularJS applications : http : karma-runner.github.io 0.12 index.html .. . .. . You could use it together with Protractor https : github.com angular protractor It depends on selenium but is fairly easy compared to some other tools to set up .", "Is there a way to capture the URL from the a href tag and then use a new .open statement", "what i want : .. . .. . run dalekjs http : dalekjs.com -tests on saucelabs https : saucelabs.com with grunt http : www.gruntjs.com .. . .. . what i did : .. . .. . 1 . installed grunt-dalek https : www.npmjs.org package grunt-dalek dalek-driver-sauce https : www.npmjs.org package dalek-driver-sauce .. . .. . 2 . created grunt config : .. . .. . dalek : .. . options : .. . driver : sauce .. . browser : chrome .. . advanced : .. . driver.sauce : .. . user : xxx .. . key : xxx .. . .. . .. . .. . .. . .. . .. . what my problem is", "Something like var myLink .footer-content li : nth-child 7 a href and .open myLink", "Right now it lets me enter a search term but doesn t open the web site the test just hangs and I have to enter ctrl-C to exit .", "I thought I d implemented this some time ago but reading my own source code made it clear to me that this isn t the case .", "I m trying to access a 2nd window opened by my test code : .. . .. . I can see the correct page open in the browser but the test still returns the title of the originating page .", "I m skipping over the login and open site part for security purposes .", "If you want to block a test and leave a window open you will need to either use a wait http : dalekjs.com docs actions.html meth-wait to sleep for a given amount of time or a waitFor http : dalekjs.com docs actions.html meth-waitFor to wait until a given condition is met before the next step is processed .", "The problem with assertions is they don t seem to return a true of false value but show up in the command-line tool as passed or failed .", "To execute my testing script mytest.js I type into the shell : .. . .. . and it works fine .", "I saw chromeOptions in the source but no example of how to format it .", "Open a terminal and execute :", "Using CasperJS is probably the best way to go at least if you need to combine it with UI tests .", "If you need to interact with the content of the testing page the execute http : dalekjs.com docs actions.html meth-execute method may help .", "I ll be investigating an alternative fetching mechanism come back to you for testing purposes when it is ready .", ".. . .. . NOTE : Select tag cannot be modified as I m just testing .", "I use Dalek to test my sample to-do application written with help of Mithril framework .", "My question is keeping my project in mind which tool would be ideal to easily automate test workflows with a great test-coverage and easy maintainability .", "What i m trying to do is to get an element out of a list .", "I want to take the text in a link and click on the link if it contains the right text ." ] }
{ "confidence": [ 57.58219909667969, 56.57762145996094, 54.79368591308594, 52.37965393066406, 52.108577728271484, 51.27095413208008, 49.795040130615234, 49.77804946899414, 48.673980712890625, 48.55842590332031, 48.146888732910156, 47.99753189086914, 47.79039001464844, 46.7358283996582, 46.53391647338867, 46.20131301879883, 45.715667724609375, 45.62855911254883, 45.48729705810547, 45.39719009399414 ], "content": [ "Question : I am working in a team responsible for development and maintenance of an enterprise web solution project where the front end customer portal is developed with PHP on Yii framework and backend web application for back office operations is developed with Python on OpenERP . We are trying to automate the test workflows using only open-source test automation tools are looking at options like Selenium DalekJS . My question is keeping my project in mind which tool would be ideal to easily automate test workflows with a great test-coverage and easy maintainability . We might have regular enhancements and fixes for both customer portal and back office web application . Which tool would be better keeping my project in mind is it Selenium or DalekJS .. . .. . Any inputs feedback or past experience would be quite helpful . .. . Answer : Hi Shashi Vardhan Andem .. . .. . unfortunatly it seems DalekJS is dead unmaintained dependencies last commit 2 years ago . We recently switched from dalekjs to http : webdriver.io .. . .. . So to answere your question . Definitly Selenium because it s gonna be still developed . Cheers .. . .. . Dennis", "Question : Is there another way to collect user input than using execute to run a prompt command or how do I get the code to continue running after prompting the user for input Right now it lets me enter a search term but doesn t open the web site the test just hangs and I have to enter ctrl-C to exit . Running Browser : Google Chrome OS : Mac OS X 10.8.5 x86-64 Browser Version : 36.0.1985.125 DalekJS CLI Tools Version : 0.0.4 DalekJS local install : 0.0.8 .. . .. . Header Search Results : function test test .execute function var searchTerm prompt Please enter a known search term .open myURL .. . .. . .. . Answer : Currently when Dalek hangs it probably means that something has error erd out and the test cannot proceed . This behaviour can be misleading in making you think that the tests are taking a bit of time to run when that is not the case - I ve created a ticket https : github.com dalekjs dalek issues 118 about this here . Now on the other hand I would get you to reconsider the idea of prompting user input when running a Dalek test . What you should be doing is scripting Dalek tests that run with known static data and script all your tests with any input parameters in your tests . Can you share what is it that you are testing", "Question : null .. . Answer : I am new to dalekjs and tried to learn it by using it to test a TODO application built using Angularjs . Adding task elements and removing them works well but when it comes to editing the list it is not working . I have tried to the best of my ability but couldn t figure it out . I really appreciate your contribution . Here is the Angularjs TODO code snippet part .. . .. . I am trying to change the value Task one to Edited Task while testing using dalekjs with chrome .. . .. . the dalekjs code is .. . .. . this code works very well for backbone but not for angular . can you please give your suggestions . thanks in advance", "Question : How can I access a frameset using dalekjs There is an Action toFrame but it seems it works only for iFrames . Example : .. . .. . I wanna access the frame name menu . Is it possible .. . Answer : Nope as Dalek has been created in the year of 2013 it does not support frameset Dalek only aims to support HTML5 compliant HTML the frameset tag is gone in HTML5 . Comment : Ohh too bad : is there any workaround i could use to solve this problem all my tests are inside the menu and content frames but i can t access them and dalekjs is the better testing tool i ve came across so far . Comment : I m afraid no : I can recommend you WD.js github.com admc wd https : github.com admc wd the entry barrier is a bit higher than with Dalek only but it has the ability you re looking for as far as I know . If you have problems setting up Selenium locally try this node module npmjs.org package selenium-standalone https : www.npmjs.org package selenium-standalone it helps with that a lot . Last least check this video it helps get you started with WD.js - youtube.com watch v Dzplh1tAwIg https : www.youtube.com watch v Dzplh1tAwIg Sorry that I can t help you getting this to work with Dalek but fortunately this is not a common scenario nowadays .", "Question : I have successfully installed Dalekjs on windows OS but when i try to run my first test script the test doesn t run . Though it runs successfully on PhontomJs but when running with real browser the browser opens and closes and shows error . When running on phantonJS it shows .. . .. . Does DalekJs have problem with Window8 64bit system because it runs fine on 32-bit .. . Answer : I analysed the problem it seems like this is a bug during the system architecture check . Could you please file an issue here https : github.com dalekjs dalek-browser-chrome issues state open", "Question : I have an issue where the link I need to traverse to using DalekJS that is not clickable it is rather copy pastable . How can I retrieve a value from an input field in the browser and then use it in a test.open call In the example above I would like DalekJS to dynamically run test.open http : example.com link-1 during the progression of my test . How can I accomplish this .. . Answer : DalekJS does not allow reading values of HTML element synchronously and using them in the test scripts . If you need to interact with the content of the testing page the execute http : dalekjs.com docs actions.html meth-execute method may help . You can try setting the window location by a function executed in the browser :", "Question : I am trying to write my very first test case with DalekJS but it keeps failing on error : .. . .. . I have just copy-pasted the example from dalekjs webpage : .. . .. . I have even tried empty test function but the error was the same . dalek -v prits out : .. . .. . Any help is appriciated . Shimon .. . Answer : I can answer my question now . I had a typo in first line module.export instead of module.exports . Sorry for bothering you with stupid question . But still - could be the root cause printed something like export is undefined instead of done not called before timeout :", "Question : I am new to using Dalekjs and am trying to open a browser run some tests and crucially want to leave the browser window open . Is there a way of doing this in Dalekjs The default seems to be that the browser is automatically closed . I am running in a console using : .. . Answer : Once the done https : github.com dalekjs dalek blob master lib dalek unit.js L165 function is run it runs a promise with the result-of your test and completes the test run - i.e . closing any running browser . If you want to block a test and leave a window open you will need to either use a wait http : dalekjs.com docs actions.html meth-wait to sleep for a given amount of time or a waitFor http : dalekjs.com docs actions.html meth-waitFor to wait until a given condition is met before the next step is processed . I would suggest that you do something as follows : Comment : Thanks Hady . I think I understand what you re doing here . However when I implement I get an error : ERROR : Error : connect ECONNREFUSED ERROR : Error : socket hang up Comment : If you can post your test in a fiddle maybe myself or others can try and help you further Comment : Apologies my bad . I was getting the error due to me not running the test properly . Running dalek name-of-test -b chrome instead of dalek name-of-test.js -b chrome . Sorry your fix worked perfectly . Thanks Hady", "Question : null .. . Answer : I have run into this issue https : github.com dalekjs dalek-browser-ie issues 15 that prevents Dalekjs from working properly with webdriver for IE on 64bit windows install . I uninstalled node 64bit and installed node 32bit hoping it would fix the problem as mentioned here https : github.com angular protractor issues 1506 but it did not correct the issue . How can I get a 64bit windows system to run Dalekjs on 64bit windows system", "Question : I am writing code that runs a test and if the results come back a certain way I d like to send an email to myself . Unfortunately every-time DalekJS runs through my code it seems to skip over the email function . Here s what my code looks like . I m skipping over the login and open site part for security purposes . All of that part works fine . The code hangs on test.wait 15000 . This is the require code var emailjs require . seeifemail .. . .. . Here is what seeifemail looks like . Thanks for your help in advanced Comment : Just to clarify is done returned i.e . is msgCnt 0 If you did you try including a callback in your server.send It might be the case that your script terminates caused by return before the email can be sent . .. . Answer : Elaborating on my comment : Maybe you have to wait for your server.send to finish before you can return and thereby maybe terminate your app : .. . .. . And then : Comment : Thanks for the response . Removing the return statement or adding something in between it doesn t seem to have any effect . Its still hanging at the wait and never running the function magicFn Comment : Alright . Is msgCnt 0 actually true Comment : Judging from the documentation you did not define a valid test case for DalekJS . Your if then actually should be an assertion http : dalekjs.com docs assertions.html shouldn t it Comment : yeah msgCnt 0 does return true . If i were to run if msgCnt 0 alert something It will return the alert . Likewise when the value is false it successfully runs the false code . The problem with assertions is they don t seem to return a true of false value but show up in the command-line tool as passed or failed . So as a result I can t seem to have a function run as an effect of an assertion value . That s why I ended up using the test.execute method because it supposedly allows non dalekjs functions to run . Which it does but doesn t seem to run nodejs functions .", "Question : I wanted to automate image-comparison through dalekjs . Aim is to have better image comparisons through external libraries but for starters a basic image-comparison will do to tell if image on page is equal to local image . Help is highly appreciated . Comment : what have you tried soe far do you have any code Comment : Dalekjs doesn t give any native method to access image let alone compare them.. . Only thing i can think of is somehow save image through Dom and compare it through js script.. . Bt again the problem is to do it with dalek .. . Answer : Still experimental and is yet to be merged into DalekJS core but you could try using gskachkov https : github.com gskachkov s pull request here https : github.com dalekjs dalek pull 112 which adds screenshot comparison functionality to DalekJS . Otherwise I would recommend you to use PhantomCSS https : github.com Huddle PhantomCSS as your visual regression framework for the time being . PhantomCSS is built on top of CasperJS http : github.com n1k0 casperjs and uses Resemble.js http : huddle.github.com Resemble.js for image-comparison . Comment : thanxx man....i eventually got that and currently using the same .", "Question : Trying to use the .type action fails . This is on a web app using angular not sure if this is related to it . I can get assert attributes and existence of elements but trying to use .type or .setValue fails .. . .. . Here is the test .. . .. . the assert.val fails : .. . .. . Output : .. . .. . DalekJS CLI Tools Version : 0.0.5 DalekJS local install : 0.0.9 Comment : OK so after a few debugging sessions I can see that Dalek only sees the first DOM loaded and not the DOM loaded by angular . Is there any way to wait for angular to load the DOM Comment : This resolves the issue and provides support for angular : gist.github.com ryanzec 7546175 https : gist.github.com ryanzec 7546175 .. . Answer : This resolves the issue and provides support for angular : http : gist.github.com ryanzec 7546175", "Question : I m relatively new to DalekJS and I ve been battling with clearing a field and then typing . The .type seems to only add to an existing string in an input box is there any way to clear the field before typing .. . Answer : It does work with.. .", "Question : Hey I have following grunt task : .. . .. . The problem is that the dalek task does not kill the chrome instance after executing the test . Any ideas why EDIT : This happens only when an error is found during the tests . System specs : win7 64 bit Dalek specs : cli tools -- 0.0.4 dalekjs local install -- 0.0.8 cheers izocan .. . Answer : That is interesting can you specify your environment open up an issue over at github I suppose it is a bug . Please also add a reduced testcase . One test the stripped down contents of your Gruntfile so that we can reproduce this . Also please post the link-to your newly created issue here so people can keep track . Comment : hey sebastian you can view the detailed description on github https : github.com dalekjs grunt-dalek issues 12", "Question : Is there a way to pass flags command-line switches to the browser being used with DalekJS Esentially I want to use Chrome with some experimental features turned on : http : peter.sh experiments chromium-command-line-switches .. . .. . Vanilla CLI startup of custom Chrome looks like : .. . .. . How can I feed those args to Dalek s instance of Chrome .. . Answer : This hasn t made it into the official docs yet but I recently merged a pull request that allows you exactly that : .. . .. . See https : github.com dalekjs dalek-browser-chrome pull 8 for more details . You can add the instructions to your Dalekfile.json like so : Comment : Sweet that works Thank you I saw chromeOptions in the source but no example of how to format it . Perhaps a sample Dalekfile.json with all properties comments will users getting started .", "Question : following situation : .. . .. . I tried and succeeded to access it on the browser console with this selector : .tableclasss tbody tr : last td : eq 2 but this fails if i use it in DalekJS becaus of the colons if I use .tableclasss tbody tr the selector finds the tablerows but as soon as i use a colon like : .. . .. . .tableclasss tbody tr : last .. . .. . the selection fails . Any known issues about that Versions : Win7 dalek-cli 0.0.4 dalekjs local install : 0.0.8 .. . .. . cheers izocan Comment : Instead of an ASCII art please show the actual markup you have . Comment : try .tableclasss tbody tr .last .find td .eq 2 .. . Answer : Try to use .last and .eq instead : Comment : hey dude thanks for response . if i use the mentioned selector .tableclasss tbody tr : last td : eq 2 in jquery it works . i need help in terms of dalekjs . there is obviously an error with the selector handling in the testframework .", "Question : I m relatively new to DalekJS and I ve been battling with clearing a field and then typing . The .type seems to only add to an existing string in an input box is there any way to clear the field before typing .. . Answer : I thought I d implemented this some time ago but reading my own source code made it clear to me that this isn t the case . As long as the clear method is not implemented you can use this function as a workaround : .. . .. . That should do the trick . Comment : Thanks worked like a charm . Comment : You re welcome :", "Question : I m using DalekJS with PhantomJS to test a web application . I have important assertions which depend on the browser language . And these fail if the language is not English . Any Ideas how I can set the default browser language of pantomjs Cheers izocan . .. . Answer : This question has been further discussed here : https : groups.google.com forum topic dalekjs HHt6eoZRQc4", "Question : I have got a webpage where people are able to chat together and see each other through a webcam . Now for some reason i cannot set this option in chrome to always allow the camera . Is there a way to let dalekjs do that work for me Or any suggestion on how to pre-set this in chrome Thanks in advance .. . Answer : I do not know if there is a flag for enabling the camera access or on the other hand disabling the dialog that asks for permission but if there is one you can apply it using your Dalekfile like described in this pull request : https : github.com dalekjs dalek-browser-chrome pull 8", "Question : What i m trying to do is to get an element out of a list . I want to take the text in a link and click on the link if it contains the right text . this is the html-code : .. . .. . I tried this : .. . .. . But for some reason it doesn t work . I can t use this : .. . .. . because there will be added more tr tags as the site gets bigger . Any ideas .. . Answer : I cannot find a way to check link text but if you know href try to use it instead Comment : i tried that too but the problem is that my site creates the href itself all starting the same and ending with something like 231983nkjdasbdin2983u1ndsaknn1 and everytime i patch it there will be a new link for every href . Comment : I faced the same problem but it seems github.com dalekjs dalek issues 3 https : github.com dalekjs dalek issues 3 we are limited to standard CSS selectors - w3.org TR css3-selectors selectors http : www.w3.org TR css3-selectors selectors Comment : thank you for the help i now see that there really is no way doing this . Hope it will be added soon would be really helpful" ] }
[ "yes-answer-long", "yes-answer-short" ]
javascript
UNK_RELATION
pid@unix@161
pid -- in computing the process identifier normally referred to as the process id or just pid is a number used by most operating-system kernels such as that of @placeholder mac os x or microsoft windows to temporarily uniquely identify a process .
{ "confidence": [ 59.23456954956055, 58.34120559692383, 56.6464958190918, 54.74394226074219, 54.255409240722656, 53.397987365722656, 52.47574996948242, 50.694732666015625, 50.694732666015625, 50.674293518066406, 50.00904083251953, 49.9805793762207, 49.30345916748047, 49.22758102416992, 48.9415168762207, 48.317169189453125, 48.317169189453125, 47.57815170288086, 47.57815170288086, 47.25178909301758, 46.971946716308594, 46.50621032714844, 46.396995544433594, 46.1707763671875, 46.1707763671875, 46.1707763671875, 46.1707763671875, 46.1707763671875, 46.1707763671875, 46.1707763671875, 46.1707763671875, 46.1707763671875, 46.1707763671875, 45.61469268798828, 45.423736572265625, 45.23711395263672, 45.23711395263672, 45.207275390625, 44.95638656616211, 44.94978332519531, 44.80796432495117, 44.62567138671875, 44.20731735229492, 43.72923278808594, 43.3565673828125, 43.3565673828125, 43.3565673828125, 43.273658752441406, 42.720760345458984, 42.650394439697266, 42.60853958129883, 42.35404968261719, 42.32185745239258, 42.32185745239258, 42.32185745239258, 42.239986419677734, 42.00301742553711, 41.96455764770508, 41.94919204711914, 41.94919204711914, 41.94919204711914, 41.94919204711914, 41.94919204711914, 41.94919204711914, 41.94919204711914, 41.94919204711914, 41.84649658203125, 41.84649658203125, 41.84649658203125, 41.748451232910156, 41.68941879272461, 41.38819885253906, 41.38819885253906, 41.14937210083008, 41.015533447265625, 41.015533447265625, 41.015533447265625, 41.015533447265625, 41.015533447265625, 41.015533447265625, 41.015533447265625, 40.91283416748047, 40.719032287597656, 40.55718231201172, 40.55718231201172, 40.46221160888672, 40.3985481262207, 40.394466400146484, 40.33787536621094, 40.30186462402344, 39.896514892578125, 39.89607238769531, 39.793819427490234, 39.793819427490234, 39.793819427490234, 39.757301330566406, 39.60387420654297, 39.44532775878906, 39.04191970825195, 39.04191970825195 ], "content": [ "Note that a pid Process Identifier is just a reference to a process it is not the process itself .", "The last ID is not the PID of the process", "The term PID stands for Process IDentifier and is a unique number each process gets .", "operating systems - how to get name and parent pid of given by pid process", "Since PID is an unique identifier for a process there s no way to have two distinct process with the same PID .", "But whenever I killed the process by PID it created a new PID and the process persisted .", "When a windows process is started it gets a PID but when the process is shut down does the PID become retired like a-star basketballer s jersey number or is it possible for a new entirely unrelated process to be created under that released PID", "The PID refers to a process and a node table .", "This determines the PID of the Java process correctly .", "gives PID of the tail process .", "the pid of my Popen spawned process is the same as the pid in the .pid file .", "the pid files contains the process id a number of a given program .", "fork returns the PID of the child-process in the parent process and 0 in the child-process .", "Creating a pid does not guarantee that there is a process with that pid or that will ever be a process with that pid only a return from spawn ensures that .", "PID : Process Id .. . PPID : Parent Process Id the one which launched this PID .. . TGID : Thread Group Id .. . .. . see this question http : stackoverflow.com questions 9305992 linux-threads-and-process for more details", "Go on Xcode Product - Attach to Process - By process id and attach to the debugserver process PID .", "PS will show you not only the PID but also the owner as well as the Parent Process ID as in which process started this particular process .", "So when does a pid represent a thread or a process", "Is it possible to get the PID of a Process started by Java", "If you want to get the PID of the process I used the following command : .. . .. . Read the result finding the application name and then split to obtain PID process .", "possible duplicate of Get process name by PID http : stackoverflow.com questions 4189717 get-process-name-by-pid", "I m trying to get the PID of the responsible process for an XPC process .", "os.kill is supported on Windows but os.kill pid 0 is the same as os.kill pid signal.CTRL C EVENT which may terminate the process or fail .", "Evidently if the process is terminated its PID is available for reuse .", "Sample usage : .. . .. . Where .. . 1234 is the PID of the script process .", "If the call succeeds it means that a process with this pid exists .", "Vfork creates a child-process with the same PID .", "Spawn a shell process that will read its parent s pid .", "And proc pid comm actually gives the process name .", "The following code will display the pid and name for each process .", "Is there a way to check to see if a pid corresponds to a valid process", "BUT : How do I find the pid of the Process Object", "will expand to the PID of the last background-process in that shell .", "For the pid of a process in a node see stackoverflow.com questions 32708758 https : stackoverflow.com questions 32708758 getting-pid-for-a-process-running-on-a-remote-node", "In UNIX OS how can I find the port-number when i know the process name or pid", "How to get a process name from his pid", "How can I get the PID of the tail process", "Below also returns the PID of a process .. . .. . Now you can get process Id by using p.Id", "That question has to do with finding the pid of the Java process itself not a new process that the Java process spawned .", "If your Java app is spawning native processes quickly in a high-load system there is NO guarantee that the PID you pickup in your diff calculation is the PID of the Process started by the current Thread or that the PID of the process you pick was even spawned by our app maybe the host system was already running that process anyway .", "This could be done either synchronously : .. . .. . Or asynchronously : .. . .. . Note that I m hoping to find a solution for this that works with an arbitrary system PID not just the PID of a running Node.js process .", "Just a quick question if I clone a process the PID of the cloned process is the same yes", "Have your process print out the PID of the child and compare the PID you see with the webots process you see running after a failed execlp call .", "kill PID is equivalent to kill -15 PID which sends signal 15 SIGTERM to the process which is an instruction to terminate .", "As Padraic Cunningham wrote here : Python : How to get PID by process name", "First you grab a handle to the current process then query the PID :", "So to get the PID first thing to do is to search for the process with the highest CreationDate .", "What is happening is I am getting the pid of the parent process but I really want the the pid of the java process running from within the subshell .", "If you just need an identifier to uniquely identify processes then you can get the process ID of a tab via the chrome.webNavigation https : developer.chrome.com extensions webNavigation API .", "is the current script s pid .. . is the pid of the last background-process .. . .. . Here s a sample transcript from a bash session 1 refers to the ordinal number of background-process as seen from jobs :", "When you create a pid with either pid 3 in the shell or using list to pid 1 you get just a pid which may or may not refer to a process .", "You may store the pid of the tail command in a variable using Bash I O redirections only see How to get the PID of a process in a pipeline http : stackoverflow.com questions 3345460 how-to-get-the-pid-of-a-process-in-a-pipeline .", "The else begins the part for the parent process that means pid in waitpid contains the child s PID .", "If your UNIX implementation is like mine you will see an implementation class that has a property named pid that contains the PID of the process .", "ppid is the parent pid of a process you might want something that tells you all the pids with a given pid as their ppid", "If the lock file contained the PID of the program you could detect abnormal program termination in nearly all cases is there a running process with the PID matching the PID file", "This question addresses it : stackoverflow.com questions 5284139 http : stackoverflow.com questions 5284139 how-do-i-find-the-process-id-pid-of-a-process-started-in-java", "or .. . .. . In the latter form -o pid is an output format to display only the process ID column with no header .", "How I can get PID for a process executed via SSH2 .", "If you have echo Output process . .out the is the PID of the parent shell .", "Is there an easy way to get the canonical path and arguments that a certain process pid was run with .", "If the call fails and errno is set to ESRCH a process with such a pid does not exist .", "fork creates a child-process where the PID differs but everything else is the same .", "Another option is to use pgrep to find the PID of the newest ssh process", "How to get the PID of this process from my shell script", "That means if you need to get the PID for the process the display has to be started first .", "I want to know which PID belong to which Java process I mean not only java.exe but the full process name", "Given the pid of a Linux process I want to check from a C program if the process is still running .", "It means some process exists with that PID which may or may not be the process that he wanted to know about .", "Based on information for a given file test.txt I hope to get a pid and its executable path for a process that is operating on that file .", "On my systems Ubuntu RedHat proc loadavg contains the number of running processes the number after the forward slash as well as the pid of the most recently started process .", "That is in such a way to guarantee that the PID file is fully created and written with the valid PID value when the foreground process exits .", "The contents of proc PID cmdline will give you the command-line that process PID was run with .", "I m curious too was just wondering about how looking up a process by a pid will work if something new took the old pid", "Altering the interesting process to output or store its own PID is the right way .", "That allows the background-process to keep the PID file open and locked using e.g .", "Actually proc.Id should give you valid PID for the process .", "Is there any way I can get the PID by process name in Python", "It also works with getting the pid of process earlier in the chain that is running in background", "lsof -p PID will tell you about the process that has the file open .", "possible duplicate of linux : programmatically get parent pid of another process", "So with this method the foreground process doesn t exit until the background-process PID has been written .", "It writes the process ID to the lock file if it runs normally .", "Is there a way to tie a network connection to a PID process ID without forking to lsof or netstat", "I can use ProcDump.exe to do this and it works a treat IF it s fired before the PID Process ID changes .", "I need to find the PID of the current running process on a Linux platform it can be a system dependent solution .", "http : msdn.microsoft.com en-us library windows desktop ms683215 28v vs.85 29.aspx .. . .. . Remarks .. . .. . Until a process terminates its process identifier uniquely identifies it on the system .", "fork will give you the new process with a new process id and exec replaces that process with a new process but maintaining the process id .", "In Windows you can do it in this way : .. . .. . First of all in this code you try to get a handle for process with pid given .", "If you can somehow call the process asynchronously then you should obtain the PID or some other unique identifier that can be used to xref the process when you initiate it .", "I want to create a process with a pid containing a random 128bit value .", "You can however avoid using a subshell and use this on both Mac and Linux : if ps -p PID -o pid dev-null 2 1 then echo Process is running.. . fi", "If the parent process dies before the child the child is said to be an orphan adopted by init the process with PID 1 .", "When you spawn a process you get both a new process and a new pid referring to it .", "For example one field in a pid is the index of the process in the process table so it is illegal to have to different pids with the same table index .", "I used a non-portable approach to retrieve the UNIX PID from the Process object that is very simple to follow .", "It is complicated : pid is process identifier tid is thread identifier .", "If the parent process ignores the SIGCHLD signal at the time the process dies then the process is not turned into a zombie and its PID becomes available for reuse immediately .", "It just do not create that object and in accordance with Apple manual it returns nil - in other words : There is no process with that PID .", "This question already has an answer here : .. . .. . How to get PID of process I ve just started within java program" ] }
{ "confidence": [ 69.82821655273438, 68.42105102539062, 60.82267379760742, 60.102447509765625, 59.867435455322266, 59.1101188659668, 58.536922454833984, 58.30453109741211, 57.993099212646484, 57.823238372802734, 57.53462600708008, 56.948760986328125, 56.89024353027344, 56.737327575683594, 56.47332000732422, 56.1673698425293, 56.1591796875, 56.040706634521484, 56.035545349121094, 56.00943374633789 ], "content": [ "Question : I m trying to get the process id associated with current tab thru chrome extension . I did manage to get it thru chrome.processes experimental API . There is any way to get the tab pid with standard non-experimental API Thanks in advance . .. . Answer : If you want to get the real process ID i.e . one that can be used by other programs to identify processes then your only option is chrome.processes https : developer.chrome.com extensions processes but this API is only available on the Dev channel https : www.chromium.org getting-involved dev-channel so not for Chrome stable nor Beta . If you just need an identifier to uniquely identify processes then you can get the process ID of a tab via the chrome.webNavigation https : developer.chrome.com extensions webNavigation API . This ID is only meaningful within Chrome . Before I delve into the details let s first say that multiple tabs can share the same process ID and that one tab can contain multiple processes when the Site isolation project https : www.chromium.org developers design-documents site-isolation is enabled . So by tab PID I assume that you re referring to the process that hosts the top-level frame . Then you can retrieve a list of frames and extract the process ID for the tab as follows : .. . .. . background.js .. . .. . manifest.json Comment : Thanks but I need the operation system PID for use outside of chrome .", "Question : I have this little test proggy that tracks PID s as they are created and shut down . I am investigating a problem that my proggy has found and would like to ask you about this in order to have a better idea on what s going on . When a windows process is started it gets a PID but when the process is shut down does the PID become retired like a-star basketballer s jersey number or is it possible for a new entirely unrelated process to be created under that released PID Thanks Comment : Yes it does . So you have to keep a handle to the process to make sure it s still alive - as long as it is the ID will stay the same . .. . Answer : Evidently if the process is terminated its PID is available for reuse . http : msdn.microsoft.com en-us library windows desktop ms683215 28v vs.85 29.aspx .. . .. . Remarks .. . .. . Until a process terminates its process identifier uniquely identifies it on the system . For more information about access rights see Process Security and Access Rights .", "Question : I ve a somewhat silly question if i have a series of processes that are created .. . these are not necessarily some sort of inheritance the pid of the processes have to be numbers continuous or random pids Comment : in linux had no idea that they also depended on the operating system. . .. . Answer : This is determined by the Operating System . In general they are usually sequentially assigned by the OS . However this behavior is not something to base decisions upon since most operating-system specifications state that the process ID allocation is not deterministic ie : it could be random and could change in a future version etc .", "Question : I tried to kill mysql process since it was giving me an error as : The server quit without updating PID file . But whenever I killed the process by PID it created a new PID and the process persisted . Any explanation on this issue will be appreciated The code I tried was as follows : .. . .. . MySql was installed on Mac from .dmg file . And it was initially working fine the error happens after it has already worked for a while . Comment : Killing MySQL with -9 can very likely result in data loss or database corruption . Most likely recoverable but it s not a good idea in general . Comment : Also I think you need to provide more background information if you want to get an answer . What operating-system are you running how did you install mysql from a package from source etc Comment : I am using Mac with mysql installed from .dmg file . .. . Answer : have you tried to stop it using the daemon manager with service linux : .. . .. . and for Mac : .. . .. . Hope it helps . Comment : When I tried to run you code it says -bash : service : command not found . Comment : Hi Psidom can you tell me the OS in wich you have the mysql server installed . Comment : Sure it s OS X EI Capitan 10.11.2 Comment : I edited the answer for Mac try and tell if it works.. . Comment : It is still giving me the error MySQL server PID file could not be found slightly different though .", "Question : In a bash script I want to do the following in pseudo-code : .. . .. . What s the appropriate expression for the conditional statement .. . Answer : or .. . .. . In the latter form -o pid is an output format to display only the process ID column with no header . The quotes are necessary http : tldp.org LDP abs html comparison-ops.html STRTEST for non-empty string operator -n to give valid result . Comment : The second method works on Mac too as an added plus Mac OS X has no proc FS . You can however avoid using a subshell and use this on both Mac and Linux : if ps -p PID -o pid dev-null 2 1 then echo Process is running.. . fi Comment : Unfortunately ps options and features tend to vary between platforms so it s still not entirely portable .", "Question : How do I get the id of my Java process I know there are several platform-dependent hacks but I d prefer a more generic solution . Comment : A link-to a Linux question : How do I find my PID in Java or JRuby on Linux http : stackoverflow.com q 138097 772981 Comment : This is meant to be fixed in JDK9 . openjdk.java.net jeps 102 http : openjdk.java.net jeps 102 .. . Answer : You could use JNA https : github.com twall jna . Unfortunately there is no common JNA API to get the current process ID yet but each platform is pretty simple : .. . .. . Windows .. . .. . Make sure you have jna-platform.jar then : .. . .. . Unix .. . .. . Declare : .. . .. . Then : .. . .. . .. . .. . Java 9 .. . .. . Under Java 9 the new process API http : download.java.net jdk9 docs api java lang ProcessHandle.html can be used to get the current process ID . First you grab a handle to the current process then query the PID : Comment : +1 But I m afraid that in a security constrained environment it should not work tomcat WebLogic etc . . Comment : github.com jnr jnr-posix https : github.com jnr jnr-posix has getpid Comment : The getpid solution also works for OS X with a JNA call to the System library .", "Question : I ve started a process with following code .. . .. . Now I need to know the process s pid that I ve just started . Comment : This may help some : stackoverflow.com questions 35842 process-id-in-java http : stackoverflow.com questions 35842 process-id-in-java Comment : No idea how to do it in Java but in case it s your script you may modify it so it outputs it s pid and parse it from p.getInputStream . Comment : NOT an exact duplicate to the one who voted to close . That question has to do with finding the pid of the Java process itself not a new process that the Java process spawned . Comment : What do you need the PID for anyway Comment : It is possible that Java 9 will provide a standard API for doing this : openjdk.java.net jeps 102 http : openjdk.java.net jeps 102 .. . Answer : In Unix System Linux Mac", "Question : On Linux and other POSIX operating systems - how to get name and parent pid of given by pid process Currently I m reading proc but OSX doesn t have it . On OSX I m using libproc but that doesn t work on Linux : Comment : may be you need getppid http : linux.die.net man 3 getppid Comment : No I have a PID to check Comment : possible duplicate of linux : programmatically get parent pid of another process http : stackoverflow.com questions 1525605 linux-programmatically-get-parent-pid-of-another-process .. . Answer : Unfortunately when it comes to process info every OS does things differently . If you only need to know about user-launched apps look into the NSWorkspace class s runningApplicationWithProcessIdentifier : method . Otherwise you ll have to use a platform-specific sysctl as described here : .. . .. . https : developer.apple.com legacy library qa qa2001 qa1123.html apple ref doc uid DTS10001671 .. . .. . See also this stack-overflow question : .. . .. . Programmatically check if a process is running on Mac http : stackoverflow.com questions 2518160 programmatically-check-if-a-process-is-running-on-mac", "Question : I ve started a process with following code .. . .. . Now I need to know the process s pid that I ve just started . Comment : This may help some : stackoverflow.com questions 35842 process-id-in-java http : stackoverflow.com questions 35842 process-id-in-java Comment : No idea how to do it in Java but in case it s your script you may modify it so it outputs it s pid and parse it from p.getInputStream . Comment : NOT an exact duplicate to the one who voted to close . That question has to do with finding the pid of the Java process itself not a new process that the Java process spawned . Comment : What do you need the PID for anyway Comment : It is possible that Java 9 will provide a standard API for doing this : openjdk.java.net jeps 102 http : openjdk.java.net jeps 102 .. . Answer : There is no public API for this yet . see Sun Bug 4244896 http : bugs.sun.com bugdatabase view bug.do bug id 4244896 Sun Bug 4250622 http : bugs.sun.com bugdatabase view bug.do jsessionid a4867002d972460f4acf3239dc0a bug id 4250622 .. . .. . As a workaround : .. . .. . returns an Object of type .. . .. . The Process class is abstract and what you get back is some subclass of Process which is designed for your operating-system . For example on Macs it returns java.lang.UnixProcess which has a private field called pid . Using Reflection you can easily get the value of this field . This is admittedly a hack but it might help . What do you need the PID for anyway Comment : source : jroller.com santhosh entry get current java process id http : www.jroller.com santhosh entry get current java process id Comment : On Windows it returns java.lang.ProcessImpl which has no notion of PID . Your solution is not cross-platform unfortunately . Comment : There s another quite good example which provides reasonable cross-platform support at : github.com flapdoodle-oss de.flapdoodle.embed.process blob https : github.com flapdoodle-oss de.flapdoodle.embed.process blob master src main java de flapdoodle embed process runtime Processes.java Comment : I don t know about the OP but I need to be able to kill and possibly restart the process at some point .", "Question : In C how can I find out programmatically if a process is already running on Linux Ubuntu to avoid having it start twice I m looking for something similar to pidof . Comment : You could perhaps create a temporary lock file in a known location when starting the program then just check for existence of the file and delete it on shutdown - although then you have a problem if the program terminates unexpectedly Comment : @marnir - that s why you have the program write its own PID to the file then if the file-exists you can check to see if that PID is still active and if so if the process name matches your own . It isn t 100 foolproof but still abnormal terminations shouldn t be happening that often . Comment : If the lock file contained the PID of the program you could detect abnormal program termination in nearly all cases is there a running process with the PID matching the PID file This is not a perfect solution finite number of PIDs PID recycling . Comment : @marnir - If you actually lock the lockfile the lock will be released on process exit . The program just tries for a non-blocking exclusive lock and if it fails someone else is running . Comment : Anyone knows how to do this in Windows .. . Answer : There are ways to avoid proc usage and there might be good reasons to do so e.g . proc might not be installed at all and or it might have been symlinked to something deceptive or that pid has been hidden in proc . Granted the below method doesn t look that good I wish there were a proper API for that Anyway from Unix programming FAQ http : lib.ru UNIXFAQ unixprogrfaq.txt : .. . .. . Use kill with 0 for the signal number . There are four possible results from this call : .. . .. . kill returns 0 .. . .. . This implies that a process exists with the given PID and the system would allow you to send signals to it . It is system-dependent whether the process could be a zombie . kill returns -1 errno ESRCH .. . .. . Either no process exists with the given PID or security enhancements are causing the system to deny its existence . On some systems the process could be a zombie . kill returns -1 errno EPERM .. . .. . The system would not allow you to kill the specified process . This means that either the process exists again it could be a zombie or draconian security enhancements are present e.g . your process is not allowed to send signals to anybody . kill returns -1 with some other value of errno .. . .. . You are in trouble The most-used technique is to assume that success or failure with EPERM implies that the process exists and any other error implies that it doesn t . Comment : After re-reading your question.. . if all you want is preventing the process from being run twice you could create a named kernel object e.g . a semaphore or shared-memory with an unique name and check for its existence in the beginning . It might be better than a lock file as it will go away automatically if your process crashes .", "Question : null .. . Answer : I am using COM4J to generate MS Office documents but some times a process stop working . I would like to know if there is a way to identify a PID of a application created using COM4J . With the process id I will kill the process that is blocking my queue . Comment : possible duplicate of Get PID from Word ApplicationClass http : stackoverflow.com questions 814936 get-pid-from-word-applicationclass Comment : I tried as showed in this thread but I am using Com4J as a MS Office bridge and I dont have a implicitly way to access the system process list . tks", "Question : Does anyone know how to get the PID of the top active-window and then how to get the properties of the window using the PID I mean properties like process name program name etc . I m using Qt under Linux Ubuntu 9.10 . Comment : Your app knows its own pid is that what you want Comment : QT is not a language it s a toolkit . QT is written in C++ but has bindings for many other languages . Are you using C++ .. . Answer : xlib s XGetInputFocus will tell you which window has focus which is probably more interesting than which is topmost . Cf . Xfree86 s XGetInputFocus manpage http : www.xfree86.org 4.0 XGetInputFocus.3.html . If it s really the topmost window and not the window-with-focus you re after well I don t think there is a simple call to do that because xlib doesn t seem to offer any way of querying the global stacking order which is the data structure that tells you which windows are in front of which others . Once you have the right window id xprop will list the pid under NET WM PID - though not all windows have such a property.. . .. . .. . Postscript More thoughts long time since I ve thought about xlib .. . .. . .. . To summarise : .. . .. . 1 . X does not offer any reliable association between window ids and pids and as Noufal observes the windows served on an X desktop may come from many different machines and two remote clients might happen to use the same PID since it is only unique per machine . Cf . How to get an X11 Window from a Process ID http : stackoverflow.com questions 151407 how-to-get-an-x11-window-from-a-process-id .. . .. . 2 . X does not seem to offer an interface asking which is the topmost window or whether one window occludes another . Likewise with privileged access.. . Cf . How to identify top-level X11 windows using xlib http : stackoverflow.com questions 1201179 how-to-identify-top-level-x11-windows-using-xlib .. . .. . 3 . Commonly available window-managers and Qt don t give you privileged access to X .. . .. . 4 . Without both a way of finding the topmost window and a reliable association of the window id to the matching pid we can t solve the question . 5 . We can find which window has focus and this is probably what we want . But again without the wid to pid map .. . So sorry it looks like it can t be done .", "Question : I recently come across a file with the extension .pid and explored inside it but didn t find much . The documentation says : .. . .. . A Pid-File is a file containing the process identification number pid that is stored in a well-defined location of the filesystem thus allowing other programs to find out the pid of a running script . Can anyone shed more light on this or guide me to details of what s contained in the pid file .. . Answer : the pid files contains the process id a number of a given program . For example Apache HTTPD may write it s main process number to a pid file - which is a regular text file nothing more than that - and later use the information there contained to stop itself . You can also use that information just do a cat filename.pid to kill the process yourself using kill the number in the .pid file Comment : thanks lot got he point cause i also found same example son my system . containing only ids of the prcoess so it can be application specific so i can also basically use it for my personal use under linux env right Comment : Why not look up the process by name then Why bother with maintaining .pid files when you can just run pidof process name and get the ID Comment : @Shnatsel : because there might be two processes with that name running and you need to know which one is in charge of that PID file . There are other reasons more details are found here : unix.stackexchange.com questions 12815 http : unix.stackexchange.com questions 12815 what-are-pid-and-lock-files-for Comment : In that case there would be 2 pid files and you s be facing the same issue as with PID lookups . So pidfiles do not to any good and only complicate things in this scenario as well as any other scenario I can think of . I suspect they either appeared before procfs did or they re used as portability tool because procfs interfaces are different on e.g . Solaris are quite different from that on Linux . Comment : @Shnatsel The are used primarily for the daemon itself . When running something like daemonname start for this path it can check if a pidfile already exists for that location . Yes you could check the process table but the location of the pid file itself can add more information for instance if the daemon is watching a particular folder . Also the simplest mechanisms are often the most robust . Lastly if the pidfile exists but the process by that ID does not it may indicate something else such as other resources not being properly cleaned up .", "Question : How to get a process name from his pid For example I execute cat file1.txt but I want to figure out that cat command and its arguments since its pid in the system . Is there a struct to determine it or something similar Any idea Comment : possible duplicate of Get process name by PID http : stackoverflow.com questions 4189717 get-process-name-by-pid .. . Answer : On linux you can look in proc . Try typing man proc for more information . The contents of proc PID cmdline will give you the command-line that process PID was run with . There is also proc self for examining yourself : .. . .. . An alternative e.g . on Mac OS X is to use libproc . See libproc.h http : www.opensource.apple.com source dtrace dtrace-90 libproc libproc.h . Comment : Can you please tell me the difference between your answer and mine : Comment : Your answer wasn t there when I started writing mine : Comment : HAHAHA. . : D ... . Comment : hey don t fight thanks to each one of you", "Question : I ve started a process with following code .. . .. . Now I need to know the process s pid that I ve just started . Comment : This may help some : stackoverflow.com questions 35842 process-id-in-java http : stackoverflow.com questions 35842 process-id-in-java Comment : No idea how to do it in Java but in case it s your script you may modify it so it outputs it s pid and parse it from p.getInputStream . Comment : NOT an exact duplicate to the one who voted to close . That question has to do with finding the pid of the Java process itself not a new process that the Java process spawned . Comment : What do you need the PID for anyway Comment : It is possible that Java 9 will provide a standard API for doing this : openjdk.java.net jeps 102 http : openjdk.java.net jeps 102 .. . Answer : This page has the HOWTO : .. . .. . http : www.golesny.de p code javagetpid .. . .. . On Windows : .. . .. . Returns an instance of java.lang.Win32Process OR java.lang.ProcessImpl .. . .. . Both have a private field handle . This is an OS handle for the process . You will have to use this + Win32 API to query PID . That page has details on how to do that .", "Question : I ve started a process with following code .. . .. . Now I need to know the process s pid that I ve just started . Comment : This may help some : stackoverflow.com questions 35842 process-id-in-java http : stackoverflow.com questions 35842 process-id-in-java Comment : No idea how to do it in Java but in case it s your script you may modify it so it outputs it s pid and parse it from p.getInputStream . Comment : NOT an exact duplicate to the one who voted to close . That question has to do with finding the pid of the Java process itself not a new process that the Java process spawned . Comment : What do you need the PID for anyway Comment : It is possible that Java 9 will provide a standard API for doing this : openjdk.java.net jeps 102 http : openjdk.java.net jeps 102 .. . Answer : I used a non-portable approach to retrieve the UNIX PID from the Process object that is very simple to follow . .. . .. . STEP 1 : Use some Reflection API calls to identify the Process implementation class on the target server JRE remember that Process is an abstract-class . If your UNIX implementation is like mine you will see an implementation class that has a property named pid that contains the PID of the process . Here is the logging code that I used . STEP 2 : Based on the implementation class and field name that you obtained from the Reflection logging write some code to pickpocket the Process implementation class and retrieve the PID from it using the Reflection API . The code below works for me on my flavour of UNIX . You may have to adjust the EXPECTED IMPL CLASS NAME and EXPECTED PID FIELD NAME constants to make it work for you .", "Question : I have this little test proggy that tracks PID s as they are created and shut down . I am investigating a problem that my proggy has found and would like to ask you about this in order to have a better idea on what s going on . When a windows process is started it gets a PID but when the process is shut down does the PID become retired like a-star basketballer s jersey number or is it possible for a new entirely unrelated process to be created under that released PID Thanks Comment : Yes it does . So you have to keep a handle to the process to make sure it s still alive - as long as it is the ID will stay the same . .. . Answer : I ran a test for about an hour and in that time 302 processes exits and 70 of them had PIDs in common same PID was used for a new process . So that would say they are reused frequently .", "Question : I ve started a process with following code .. . .. . Now I need to know the process s pid that I ve just started . Comment : This may help some : stackoverflow.com questions 35842 process-id-in-java http : stackoverflow.com questions 35842 process-id-in-java Comment : No idea how to do it in Java but in case it s your script you may modify it so it outputs it s pid and parse it from p.getInputStream . Comment : NOT an exact duplicate to the one who voted to close . That question has to do with finding the pid of the Java process itself not a new process that the Java process spawned . Comment : What do you need the PID for anyway Comment : It is possible that Java 9 will provide a standard API for doing this : openjdk.java.net jeps 102 http : openjdk.java.net jeps 102 .. . Answer : As recommended here http : robaustin.wikidot.com the-pid-of-your-java-process I tried java.lang.management.ManagementFactory .. . .. . returns a string similar to 11639@myMachineName where 11639 is the ID of the current process . Tested on Windows XP and Linux version 2.6.16.46 . Comment : This returns the PID of the running host VM the original question was asking what the PID of the child-process started from the running Java app would be . This question addresses it : stackoverflow.com questions 5284139 http : stackoverflow.com questions 5284139 how-do-i-find-the-process-id-pid-of-a-process-started-in-java", "Question : Is there any policy in Linux as to the recycling of used PIDs I mean if a PId has been used how much later will it be used again Comment : I m curious too was just wondering about how looking up a process by a pid will work if something new took the old pid Comment : Seems to me that PIDs should only be used to identify currently running processes . If you follow that policy the exact way in which PIDs get recycled is never going to affect you . Trying to rely on how PIDs get recycled is fragile . For that reason alone you should not do it . Furthermore I can t imagine how such behavior could be useful . The only thing you might want to know is how large PIDs can be . E.g . one consequence of this is how many processes your system supports . Notice that no knowledge of how recycling works is needed to arrive at this realization . Comment : @allyourcode try writing a program like top without worrying about how PIDs are recycled . .. . Answer : As new processes fork in PIDs will increase to a system-dependent limit and then wrap around . The kernel will not reuse a PID before this wrap-around happens . The limit maximum number of pids is proc sys kernel pid max . The manual http : www.kernel.org doc man-pages online pages man5 proc.5.html says : .. . .. . proc sys kernel pid max since Linux 2.5.34 .. . .. . This file specifies the value at which PIDs wrap around i.e . the value in this file is one greater than the maximum PID . The default-value for this file 32768 results in the same range of PIDs as on earlier kernels Comment : OK . So this increasing policy is followed strictly Or it can reuse a PID before the limit has been reached Comment : I thought a pid had been reused before the wrap but after ps -A -L -o lwp sort -n I found pids about 32372 were still in use so my guess is it is wrapping around very fast on my system even if not too often but at least on boot .", "Question : Is there a way to check to see if a pid corresponds to a valid process I m getting a pid from a different source other than from os.getpid and I need to check to see if a process with that pid doesn t exist on the machine . I need it to be available in Unix and Windows . I m also checking to see if the PID is NOT in use . Comment : Windows is a non-standard OS . These kinds of things are NOT portable . Knowing you cannot have both which is your priority Pick one as a priority and edit the question . Comment : @S.Lott Windows is a non-standard OS This is one of the most silly remark I ve seen on SO.. . Comment : @Piotr Dobrogost : Can you provide code that handles POSIX standard unix and non-POSIX standard Windows If so please provide an answer that a solves the problem and b makes it clear that Windows is somehow compliant with the POSIX standard . Comment : @PiotrDobrogost I think S.Lott s remark was more about implementation details and API support than market share . Comment : Windows certainly has less in common with other popular OSes than the rest do with each other . Anybody who does web development may liken it to a similarly infamous Microsoft product . But in response to @S.Lott : I rarely write Python code for Windows that s not supposed to also work on Linux OSX BSD etc so I honestly don t think pick on as a priority is helpful advice especially since Python abstracts platform differences away as much as practicable . .. . Answer : Sending signal 0 to a pid will raise an OSError exception if the pid is not running and do nothing otherwise . Comment : Works for sure in linux and OSX I can t speak for Windows . It does not kill the process in the sense that you are asking it sends signal 0 which is basically Are you running . Comment : This definitely doesn t work on Windows as there s no such thing as UNIX-like signals . Comment : To be complete you should also check for the error number to make sure it is 3 catch the exception and check for first arg . This is important if the target process exists but you don t have permission to send signal for whatever reason . Comment : Supported by windows now . docs.python.org library os.html highlight os.kill os.kill http : docs.python.org library os.html highlight os.kill os.kill Comment : os.kill is supported on Windows but os.kill pid 0 is the same as os.kill pid signal.CTRL C EVENT which may terminate the process or fail . I get an OSError where errno EINVAL when I try this on a subprocess ." ] }
[ "yes-answer-long", "yes-answer-short" ]
unix
UNK_RELATION
msp430@texas-instruments@66
msp430 -- the msp430 is a family of 16-bit microcontrollers from @placeholder .
{ "confidence": [ 51.33007049560547, 45.89148712158203, 44.727882385253906, 43.39118194580078, 42.93161392211914, 41.83775329589844, 41.00825500488281, 41.00825500488281, 40.774658203125, 40.473976135253906, 40.1048469543457, 40.1048469543457, 39.91596221923828, 39.330970764160156, 39.330970764160156, 39.330970764160156, 39.330970764160156, 39.095157623291016, 39.07429504394531, 39.07429504394531, 38.04247283935547, 38.01142120361328, 37.839149475097656, 37.77754211425781, 37.77754211425781, 37.77754211425781, 37.77754211425781, 36.80732727050781, 36.80732727050781, 36.80732727050781, 36.746986389160156, 36.746986389160156, 36.746986389160156, 36.370513916015625, 36.300392150878906, 36.178504943847656, 35.870521545410156, 35.5118408203125, 35.5118408203125, 35.5118408203125, 35.5118408203125, 35.33995819091797, 35.28077697753906, 34.62507629394531, 34.62507629394531, 34.62507629394531, 34.62507629394531, 34.62507629394531, 34.62507629394531, 34.62507629394531, 34.62507629394531, 34.62507629394531, 34.62507629394531, 34.62507629394531, 34.55483627319336, 34.045631408691406, 33.594520568847656, 33.594520568847656, 33.594520568847656, 33.594520568847656, 32.95753479003906, 32.81022644042969, 32.81022644042969, 32.459407806396484, 32.359375, 31.932151794433594, 31.932151794433594, 31.932151794433594, 31.802101135253906, 31.418106079101562, 31.418106079101562, 30.771547317504883, 30.37872314453125, 30.37872314453125, 30.37872314453125, 30.37872314453125, 30.37872314453125, 30.37872314453125, 30.37872314453125, 30.37872314453125, 30.37872314453125, 30.37872314453125, 30.37872314453125, 30.37872314453125, 30.37872314453125, 29.898195266723633, 29.536401748657227, 29.348169326782227, 29.348169326782227, 29.348169326782227, 28.190044403076172, 28.11302375793457, 28.11302375793457, 28.11302375793457, 28.11302375793457, 28.11302375793457, 27.93060302734375, 27.93060302734375, 27.93060302734375 ], "content": [ "The problem is that msp430 microcontrollers have 16-bit registers not capable of holding numerical values larger than 65535 .", "The MSP430 series microcontrollers provide fast bit set bit clear machine instructions .", "Do you mean eleceng.dit.ie frank msp430 msp430.pdf", "I run the MSP430 at 8Mhz .", "For sake of documentation I gathered below a few useful references for the MSP430 : .. . .. . TI s MSP430 User s Guide pdf http : focus.ti.com lit ug slau049f slau049f.pdf Chapter 3 is particularly relevant .. . The TI MSP430 microcontroller pdf http : eleceng.dit.ie frank msp430 msp430.pdf A shorter overview 11 pages .. . MSPGCC manual http : mspgcc.sourceforge.net manual x223.html A GNU Port of TI s tools for the MSP430 microcontrollers .", "It is using CodeComposer on the MSP430 .", "afaik MSP430 has no difference in instruction latency between 8-bit and 16-bit operands .", "The MSP430 has 27 instructions with most instructions available in .B 8-bit and .W 16-bit suffixed versions .", "I have msp430 family mcu actually msp430g2553 on launchpad board .", "Hence I downloaded python-msp430-tools 0.6 from https : pypi.python.org pypi python-msp430-tools .", "I am writing an ISR for the MSP430 .", "On their example they only inlcude msp430.h .", "This question was already answered on the E2E forum https : e2e.ti.com support microcontrollers msp430 f 166 t 485532 .", "I am writing simulator to microcontroller msp430 .", "easiest just to get a 10 msp430 and try it .", "I am working on a simulator for the msp430 instruction-set .", "Is there an easy way to exactly wait for a timer overflow on the MSP430", "A 16-bit version of the CORDIC approach for sine and cosine for the MSP430 is here https : github.com the0b MSP430-CORDIC-sine-cosine you will need to determine whether it provides the degree of accuracy and precision you need .", "But this applies only to architectures like the MSP430", "Well you tagged the question msp430 .", "I ve installed the msp430-gcc compiler and associated tools to do some open-source msp430 development at home using Eclipse .", "If you look at msp430-libc source code https : sourceforge.net p mspgcc msp430-libc ci master tree include stdio.h you can clearly see that it only support for the printf function family .", "You mean the msp430-gcc version", "This is an example of interrupt http : importgeek.wordpress.com tag msp430-launchpad", "I am working with MSP430 with FRAM Controller .", ".. . .. . As mentioned by @Olaf msp430 uses 16bit integer .", "@WeatherVane : Nice try but the MSP430 is normally not that slow .", "I have this code which I compiled for MSP430 platform using msp430-gcc .", "I m trying to compile my MSP430 project using the Linux msp430-gcc compiler .", "Anyway for the MSP430 build I still have the 4 remaining verbose echo statements for the MSP430 build .", "I m trying to build gcc-4.9 for msp430 .", "which will fit in available memory of MSP430 Microcontroller", "In the MSP430 toolset use the --opt for speed 0 switch .", "Also some MSP430 already allow to access two adjacent ports P1 2 P3 4 by a single 16-bit read-write .", "Here are three : .. . .. . Use another microcontroller that has more memory there are many in the MSP430 family .", "There are at least a couple of existing open-source MSP430 emulators namely mspsim and Avrora .", "I am trying to write a program for the MSP430 that divides a 16-bit signed integer by an 8-bit signed integer using only repetitive successive subtraction .", "Nowadays MSP430 development happens in gcc itself .", "I m building a MSP430 project in code-composer studio .", "PWM output pins are a part of the timer modules on the MSP430 .", "What series of the MSP430 are you using .. . 2 .", "Please see : http : www.ti.com lit an spma014 spma014.pdf .. . .. . The following is handled by the compiler but is still relevant to the issue at hand : .. . .. . The MSP430 is a 16-bit microprocessor .", "NOTE : msp430 target is only avaible in 4.9 and I JUST want to build 4.9 for msp430 not for my host machine as I already have it installed .", "dividing binary to decimal all the time is a lot of overhead esp for an msp430 .", "Doesn t seem the MSP430 toolchain for VisualGDB has that compiler option .", "Do you know the msp430 platform sufficiently well to make such an assertion", "Then you d have better results using portable code in MSP430 projects .", "The MSP430 architecture itself has no concept of tasks i.e . there is only a single stack .", "What s the best way to put the MSP430 to sleep for 10 seconds .", "For some Contiki platforms there are macros or functions for controlling GPIO pins but not for msp430 .", "Sidenote : For the MSP430 you should avoid signed data types .", "It will be more convenient for me to use all the MSP430 ports as one port .", "MSP430 F6779A controller with 32.678 KHz frequency oscillator is connected .", "gcc msp430 .. . .. . If yes how can I do it and what is the procedure of doing that", "The hardware is based on the MSP430 http : www.ti.com lsds ti microcontrollers 16-bit 32-bit msp overview.page micro-controller .", "My question is that when using any micro-controller consider an example MSP430 .. . .. . You re not using any micro-controller you are using an MSP430 .", "I need to add python-msp430-tools 0.6 to my python .", "This makes sense because of my MacPorts install of msp430-gcc .", "This would presumably include everything in opt local lib gcc msp430 4.6.3 .", "This created the gcc config msp430 directory including the crt0.S and crt0ivtbl.S files .", "I aim to generate packets accoding to Poisson distribution in Contiki Cooja using MSP430 Experimenter board Exp430 platform same issue applies to Zolertia Z1 motes which also have MSP430-based MCU .", "I am collecting 2.4KB 600 bytes 4 of data from sensors over my MSP430 Controller .", "@DaanTimmer there are 200+ followers on the msp430 tag and from those surely there are quite a few active users .", "You could compile the latest version of gcc yourself or hope that your distribution has a MSP430 cross compiler or get it from TI http : www.ti.com tool msp430-gcc-opensource .", "I want to play a song via a buzzer connected to an MSP430 .", "I am working on MSP430 Series Controller and I have a buffer to be sent on UART via DMA .", "And MSP430 s sport a lot of cool peripherials but almost none of them sports all features at once .", "I limit myself to the MSP430 because I ve already implemented 9 of 10 features of my current project on it .", "Debugger Emulator Connected I understand that LPM doesnt entirely work with Emulator connected .. . .. . Tried this page : https : e2e.ti.com support microcontrollers msp430 f 166 t 131760 .. . .. . Also tried the ERRATA UCS11 error .", "The GIE SR bit in the MSP430 is generally not accessed using simple bitwise operator because there is no symbol defined in C that represents the status register .", "However beside many intrinsics for almost all other special features of the MSP430 core GCC does not provide intrinsics to the bit-manipulation instructions .", "In the msgpcc GCC for MSP430 microcontrollers manual http : mspgcc.sourceforge.net manual c1408.html authors wrote : .. . .. . Use int instead of char or unsigned char if you want a small integer within a function .", "Many of the assembly instructions of the MSP430 have similar names to the ones used on x86 assemblers so it is easy to think this might be x86 .", "Using modulus on MSP430 for wrap is a bad idea : too slow too much code .", "My understanding is the MSP430 guarantees one instruction after the jump before it can be interrupted again .", "All your questions are answered in the User s Guide of whatever MSP430 chip it is that you re using .", "do i have to use a logic level converter between gps module and msp430", "msp430 is a very hardware-limited platform so the complete C standard-library functionality is not supported .", "I know the MSP430 on my product will support this as this C program has been in service for years .", "Granted an MSP430 can be very resource limited but you have to initialize variables somewhere anyway .", "How I make sure that MSP430 is sending correct size over long run .", "See contiki cpu msp430 button.c for an example how the TelosB button interrupt handler is implemented it s pretty simple .", "I don t think there are many dedicated embedded programmers here with the exact knowledge of the MSP430 controller .", "I can see MSP430 assigned COM13 port in device manager but however I am not able to establish connection in hyperterminal .", "To do that pass the -mmcu parameter to the compiler and hope the library is small enough to at least compile for msp430 .", "I am trying to get an Intel Galileo to run Node.js and serialPort.js to collect data being sent from an MSP430 Launch pad Arduino based board .", "The code is a slightly modified version of the code here : https : e2e.ti.com support microcontrollers msp430 f 166 t 166345 .. . .. . Why can t I see output on the respective pin", "MSP430 has byte-oriented instructions and the compiler just will use the add.b instruction instead of add .", "Anyway a friend managed to compile it on a native machine using msp430-gcc-4.6 I will test it later .", "I am working on a project where I need to take multiple inputs to my TI Launchpad msp430 .", "Note : the MSP430 IIRC does not allow direct manipulation of the I O bits via So you should keep an image of the I O port in memory manipulate that image then write the whole port from that image .", "The details I found in MSP430 IAR C C++ Compiler : .. . .. . Does any one know", "I now use the msp430-elf-gcc executable to compile my sources and that seems to work perfectly fine", "I m trying to complete an assignment that requires me to make a music-player using the MSP430 microprocessor and Launchpad kit .", "Could someone post an example of outputting a beep or a HIGH to a buzzer connected to an MSP430 using only Assembly .", "To do it with a higher degree of precision however you could use a PWM pin on your MSP430 .", "When I click on the crt0.S component of the ELF the filename bar at the bottom of the Eclipse window shows opt local var macports build Volumes work mports dports cross msp430-gcc msp430-gcc work gcc-4.6.3 gcc config msp430 crt0.S .", "crt0.S is archived into opt local lib gcc msp430 4.6.3 libcrt0.a on my machine . .. . .. . What I want to be able to do is tell Eclipse to look elsewhere for the source files for the libraries that are automatically linked when I build with the msp430-gcc toolchain .", "This appears to allow me to do something like create a msp430-gcc-libsrc folder in my project and link it to Developer mspgcc-20120406 gcc-4.6.3 config msp430 which unfortunately I don t think will accomplish what I need ." ] }
{ "confidence": [ 57.8195686340332, 57.11885452270508, 52.62274932861328, 52.617469787597656, 52.240379333496094, 52.23832321166992, 50.087947845458984, 48.287452697753906, 47.74675369262695, 45.389522552490234, 45.314048767089844, 45.11300277709961, 44.687686920166016, 43.36865234375, 43.36186981201172, 42.9914436340332, 42.771820068359375, 42.597564697265625, 42.498023986816406, 42.38352966308594 ], "content": [ "Question : This question already has an answer here : .. . .. . MSP430G2553 Timer Intervals closed questions 38425854 msp430g2553-timer-intervals 3 answers .. . .. . Quick question . How do I set an interrupt for 10 seconds and a minute with this specific interrupt I have tried using the counter below but it does not work . As this program stands it interrupts 1 second . I would usually go to the professor in times like these however he is in Japan... . ... . ... . Comment : You are using define constants to initial registers without telling us what those define constants are so the help I can provide to the exact problem is limited . Is it only interrupting once and never again Is it continuous at every 1 second Do you want 1 interrupt at some common time base and then count up until your higher time Comment : Perhaps a long shot but doesn t TI have a dedicated forum to ask programming related questions on their microcontrollers I don t think there are many dedicated embedded programmers here with the exact knowledge of the MSP430 controller . Comment : I will answer this one as well as the other question has been put on hold . You may want to delete one or both and start again with a single question . Comment : @DaanTimmer there are 200+ followers on the msp430 tag and from those surely there are quite a few active users . .. . Answer : To achieve 10 second interrupt interval you need to apply input divider to the timer . It is not possible to achieve 1 minute without peripheral support but you can implement that with a software counter . The problem is that msp430 microcontrollers have 16-bit registers not capable of holding numerical values larger than 65535 . Using low-frequency oscillator running at 32768 Hz as is typical - you don t provide any details about the hardware clock sources of your system if they have a different frequency please mention that the register overflows once every 2 seconds unless an input divider is applied . The maximum value of input divider on MSP430x2xxx family MCUs is 8 so it s not possible to set a hardware timer more than 8 2 16 seconds in the future . Refer to MSP430x2xxx family user s guide http : www.ti.com lit ug slau144j slau144j.pdf for further details . This code calls the interrupt once 10 seconds :", "Question : In the msgpcc GCC for MSP430 microcontrollers manual http : mspgcc.sourceforge.net manual c1408.html authors wrote : .. . .. . Use int instead of char or unsigned char if you want a small integer within a function . The code produced will be more efficient and in most cases storage isn t actually wasted . Why int is more efficient UPD . And why u int fast8 t in the mspgcc defined to unsigned char not unsigned int . As I understand u int fast t should be defined to the most efficient type with a suffient size . Comment : afaik MSP430 has no difference in instruction latency between 8-bit and 16-bit operands . I m curious too . Comment : I would just like to add that the wonderful thing I love about u int fast least 8 16 32 t is that you can specify what sort of optimization you want and generally let the compiler handle it . If you want to use as little space as possible and you need to represent up to 20 000 use u int least16 t but if you are using something for heavy calculation that you want fast you can use u int fast16 t largely without having to worry about what type it ends up using under the hood . .. . Answer : int matches the native size of the processor in question 16 bits so when you ask for a store to an unsigned char variable the compiler may have to emit extra code to ensure that the value is between 0 and 255 . Comment : I think you are wrong . The compiler won t generate a code to wraps around from 255 to 0 . MSP430 has byte-oriented instructions and the compiler just will use the add.b instruction instead of add . Comment : @Corvus That is correct . The MSP430 has 27 instructions with most instructions available in .B 8-bit and .W 16-bit suffixed versions . Comment : OK good point in this case not so on other processors . It s been too long since I was MSP430ing I m sure there are other cases than just a simple increment where an extra AND would need to be issued though.. .", "Question : I am working on a simulator for the msp430 instruction-set . gnu assembler will let you encode instructions like these : .. . .. . My guess is that rrc 0x0200 will fetch from address 0x0200 perform the rotate then write the answer back to address 0x0200 correct But what would an rra 4 do The source would be an immediate 4 I assume but is there a destination after the operation The add 4 2 assembled into what you would expect as 2b10 source r2 ad 1b0 dest r3 the binutils disassembler though did not know what to do with that instruction . Are these valid instructions .. . Answer : Although there doesn t appears to be any definitive online reference to this effect I tend to agree with the OP that the two instructions shown and several others are likely not valid even though they conform to the format defined in the data sheets . In other words not all possible combinations of the various parts that make up a instruction word are valid . In particular many single operand instructions that use the immediate addressing-mode and many double operand instructions that have an immediate addressing-mode for the destination are probably not semantically viable . There are only a few hints to this effect in the documentation for example in the User s Guide section 3.3.7 on the immediate addressing-mode a comment indicates Valid only for a source operand . And BTW this is for all cases of immediate addressing-mode not just the short-hand cases allowed by the R2 or R3 constant generation trick . The fact that the disassembler doesn t know what to do with such codes is also another hint although.. . some disassemblers get tripped easily.. . . For sake of documentation I gathered below a few useful references for the MSP430 : .. . .. . TI s MSP430 User s Guide pdf http : focus.ti.com lit ug slau049f slau049f.pdf Chapter 3 is particularly relevant .. . The TI MSP430 microcontroller pdf http : eleceng.dit.ie frank msp430 msp430.pdf A shorter overview 11 pages .. . MSPGCC manual http : mspgcc.sourceforge.net manual x223.html A GNU Port of TI s tools for the MSP430 microcontrollers . Comment : The 2nd bullet item appears to be a broken link . Do you mean eleceng.dit.ie frank msp430 msp430.pdf Comment : @Dan - Your asking about a 2 year old google document link Comment : Dan : I updated the link thanks for identifying this issue . Ramhound : yep 2 years old - Good thing to try and keep it up to-date however .", "Question : null .. . Answer : I am working with MSP430 with FRAM Controller . And I Have to write a data from buffer over FRAM Location . I have gone through bundled example of writing to FRAM . But When I tested example It goes beyond the FRAM allocated section . Is there any other method for writing on to FRAM . Comment : Not clear for me . The posted code loop infinitely writing from 0xD000 but there is no limit on writing . I guess FRAM has its size then your code is exected to check their limits . Comment : This question was already answered on the E2E forum https : e2e.ti.com support microcontrollers msp430 f 166 t 485532 . Comment : thanks @CL . for pointing it out .", "Question : I am writing simulator to microcontroller msp430 . I cant understand when i should set carry bit . For example in add instruction : 1+0x7FFF setting carry bit or 1+0xFFFF Comment : 17th bit not 16th 0x7FFF+1 means the N bit is set but not the carry . 0xFFFF+1 sets the carry bit as does 0x8000 + 0x8000 . the carry bit is the carry out of the msbit . the real question is what do you do on a subtract you invert the second operand and carry in a 1 but do you invert the carry out some architectures you do some you dont . easiest just to get a 10 msp430 and try it . V flag is typically set if msbit carry in and carry out differ . and n is just bit 15 . Comment : oh right looking at my simulator if it is a byte operation then 0xFF+1 bit 9 out of the alu basically is the carry bit bit 7 is the n bit etc . if it is a word operation then it is like the above 0xFFFF+1 is 0x0000 with the carry bit set same as 0x8000+0x8000 . .. . Answer : For the ADD instruction the carry bit is set on unsigned overflow . You can deduce that from the examples in TI documents http : www.ti.com lit ug slau049f slau049f.pdf . In particular the second example in the documentation of ADD instruction page 3-22 http : www.ti.com lit ug slau049f slau049f.pdf says that carry occurs on ADD.B if the result is greater than 0xff and for ADD and ADDA the limits are 0xffff and 0xfffff respectively - 8 16 and 20 bits : .. . .. . The fact that there is a NEGATIVE bit in the msp430 status register in addition to the carry bit confirms this . There are at least a couple of existing open-source MSP430 emulators namely mspsim and Avrora . I suggest to use them as reference implementations . Comment : That makes sense . I thougth that if we have negative bit then range for signed for 16-bit number is -32768 to 32767 and when we cross this range then we set carry bit but this is wrong .", "Question : After reading the text about five times and googling I ve decided to reach out for help . I m currently in the process of using Timer A interrupt to turn on off two LEDS in intervals of 1 second 10 seconds 1 minute one at a time . The default program will turn on off the LEDS every second but I cannot find a way to turn them off after 10 seconds and a minute . I can use delay cycles xxxx to achieve this but apparently doing so would defeat the purpose of the timer . This is my code . Comment : Don t spam tags This is definitively not related to css http : stackoverflow.com questions tagged css and there is no Assembler in your code . Comment : Oh and - what was the question Comment : Sorry sorry . The question is : How do I edit this program to achieve a 10-second interval If I know that I m positive that I can code the 1 minute and so fourth . Comment : Increment a counter and do your stuff when it hits 10 Assuming you don t want to reprogram the timer that is . Comment : Too broad . Sorry but this is no coding tutoring site . Please state a specific problem . What is not working with the code See How to Ask http : stackoverflow.com questions how-to-ask . First you obviously need the frequency of the oscillator used then set the period of the timer accordingly . Note that it is good practice to disable channels not used in the interrupt handler if they do trigger by accident . defensive programming safeguarding . .. . Answer : To achieve 10 second interrupt interval you need to apply input divider to the timer . It is not possible to achieve 1 minute without peripheral support see the other answers on how to implement that with a software counter . The problem is that msp430 microcontrollers have 16-bit registers not capable of holding numerical values larger than 65535 . Using low-frequency oscillator running at 32768 Hz as is typical - you don t provide any details about the hardware clock sources of your system if they have a different frequency please mention that the register overflows once every 2 seconds unless an input divider is applied . The maximum value of input divider on MSP430x2xxx family MCUs is 8 so it s not possible to set a hardware timer more than 8 2 16 seconds in the future . Refer to MSP430x2xxx family user s guide http : www.ti.com lit ug slau144j slau144j.pdf for further details . This code calls the interrupt once 10 seconds : Comment : Note : the MSP430 IIRC does not allow direct manipulation of the I O bits via So you should keep an image of the I O port in memory manipulate that image then write the whole port from that image .", "Question : In the msgpcc GCC for MSP430 microcontrollers manual http : mspgcc.sourceforge.net manual c1408.html authors wrote : .. . .. . Use int instead of char or unsigned char if you want a small integer within a function . The code produced will be more efficient and in most cases storage isn t actually wasted . Why int is more efficient UPD . And why u int fast8 t in the mspgcc defined to unsigned char not unsigned int . As I understand u int fast t should be defined to the most efficient type with a suffient size . Comment : afaik MSP430 has no difference in instruction latency between 8-bit and 16-bit operands . I m curious too . Comment : I would just like to add that the wonderful thing I love about u int fast least 8 16 32 t is that you can specify what sort of optimization you want and generally let the compiler handle it . If you want to use as little space as possible and you need to represent up to 20 000 use u int least16 t but if you are using something for heavy calculation that you want fast you can use u int fast16 t largely without having to worry about what type it ends up using under the hood . .. . Answer : In general not necessarily specific to this processor it has to do with sign extension and masking requiring additional instructions to faithfully implement the C source code . A signed 8 bit value in a 16 or 32 or 64 bit processor MAY involve additional instructions to sign extend . An 8 bit add-on a 32-bit processor might involve extra instructions to and with 0xFF etc . You should do some simple experiments it took a few iterations but I quickly hit something that showed a difference . produces .. . .. . The msp430 has word and byte versions of the instructions so a simple add or subtract doesnt have to do the clipping or sign extension that you would expect when using smaller than register sized variables . As a programmer we might know that we were only going to feed sbfun some very small numbers but the compiler doesnt and has to faithfully implement our code as written generating more code between sfun and sbfun . It is not hard to do these experiements with different compilers and processors to see this in action the only trick is to create code that the processor doesnt have simple instructions to solve . another example .. . .. . produces Comment : +1 although it s worth noting that using larger types for parameters may lead to increased stack usage which I suppose might be an issue when resources are constrained . Comment : Yep it is all a performance and optimization game...Wanted to plant some tiny seeds about why smaller isnt necessarily better relative term .", "Question : In the msgpcc GCC for MSP430 microcontrollers manual http : mspgcc.sourceforge.net manual c1408.html authors wrote : .. . .. . Use int instead of char or unsigned char if you want a small integer within a function . The code produced will be more efficient and in most cases storage isn t actually wasted . Why int is more efficient UPD . And why u int fast8 t in the mspgcc defined to unsigned char not unsigned int . As I understand u int fast t should be defined to the most efficient type with a suffient size . Comment : afaik MSP430 has no difference in instruction latency between 8-bit and 16-bit operands . I m curious too . Comment : I would just like to add that the wonderful thing I love about u int fast least 8 16 32 t is that you can specify what sort of optimization you want and generally let the compiler handle it . If you want to use as little space as possible and you need to represent up to 20 000 use u int least16 t but if you are using something for heavy calculation that you want fast you can use u int fast16 t largely without having to worry about what type it ends up using under the hood . .. . Answer : TI has published an Application Note on the topic for their Tiva-C formally Stellaris MCUs . In the Introduction section a table provides a list of factors affecting performance and size . A factor label Variable size states that using variables smaller than optimal may mean extra instructions to sign or unsign extend.. . . Also under the section Size of Variables it states : .. . .. . When the local-variables are smaller than the register size then extra code is usually needed . On a Stellaris part this means that local-variables of size byte and halfword char and short int respectively require extra code . Since code ported from an 8-bit or 16-bit microcontroller may have had locals converted to smaller sizes to avoid the too large problem this means that such code will run slower and take more code space than is needed . Please see : http : www.ti.com lit an spma014 spma014.pdf .. . .. . The following is handled by the compiler but is still relevant to the issue at hand : .. . .. . The MSP430 is a 16-bit microprocessor . A char is only 8-bits and would require packing to ensure that all words are aligned . For instance 3 chars would not align properly in memory . Instead use an integer that is 16-bits and will always be aligned . When you use variable sizes that are multiples of 16 e.g . 16 and 32 you can also utilize memory more efficiently . You won t end up with padding to align the memory . Comment : The compiler s job is to ensure no alignment issues and it won t waste any more space than you would by using a 16-bit variable where an 8-bit one would have worked . You ve essentially moved the padding from an implicit process to an explicit one . Comment : @CoryNelson I agree - it is compiler-related and not run-time . However you re incorrect with your statement that it doesn t take more memory . Have you tried compiling with both GCC and IAR They both pad differently and you end up with radically different code-size if you aren t careful disregarding optimization . This seems to be due to padding .", "Question : In the msgpcc GCC for MSP430 microcontrollers manual http : mspgcc.sourceforge.net manual c1408.html authors wrote : .. . .. . Use int instead of char or unsigned char if you want a small integer within a function . The code produced will be more efficient and in most cases storage isn t actually wasted . Why int is more efficient UPD . And why u int fast8 t in the mspgcc defined to unsigned char not unsigned int . As I understand u int fast t should be defined to the most efficient type with a suffient size . Comment : afaik MSP430 has no difference in instruction latency between 8-bit and 16-bit operands . I m curious too . Comment : I would just like to add that the wonderful thing I love about u int fast least 8 16 32 t is that you can specify what sort of optimization you want and generally let the compiler handle it . If you want to use as little space as possible and you need to represent up to 20 000 use u int least16 t but if you are using something for heavy calculation that you want fast you can use u int fast16 t largely without having to worry about what type it ends up using under the hood . .. . Answer : A general rule of thumb is that CPUs are fastest at operating on integers of their native word size . This is of course entirely architecture dependent see the answers to this similar question http : stackoverflow.com questions 5069489 performance-of-built-in-types-char-vs-short-vs-int-vs-float-vs-double for more clarification on that point .", "Question : null .. . Answer : I m trying to build gcc-4.9 for msp430 . I ve already built the most recent version of binutils and have tried building gcc-4.9 with the basic configuration : .. . .. . configure --target msp430-elf --enable-languages c c++ --with-newlib yes .. . .. . The problem though is that gcc builds itself for my machine x86-unknown-linux then I think it started building the msp430 target with the new compiler but I already have gcc-4.8 installed and just want the msp430-elf target with the already installed 4.8 . NOTE : msp430 target is only avaible in 4.9 and I JUST want to build 4.9 for msp430 not for my host machine as I already have it installed . First of all the build failed second even if it did succeed I don t want to install for x86 and I am afraid make install will do this . The docs for configure are pretty vague and I would really appreciate some help .", "Question : The MSP430 series microcontrollers provide fast bit set bit clear machine instructions . These bit-manipulation comamnds are useful for some register or I O manipulations that have side effects or need atomic access to prevent glitches or race conditions . However beside many intrinsics for almost all other special features of the MSP430 core GCC does not provide intrinsics to the bit-manipulation instructions . Why is that Does GCC still issue those instructions and what C code would be neccessary to issue them .. . Answer : The C language already allows to express bit manipulations : Comment : Ok cool so the most likely style of bit-manipulation via bitwise-operators and a one-bit-mask is optimized into the apropriate hardware commands . Is this for granted What if the bit mask would be a variable Comment : That would be a different question . But I d suggest you ask a third question How can I check what machine instructions gcc generates Comment : Well it would be better to tell C to the bit set instead doing some plain C and check the build result if it fits every time.. . Comment : @dronus : if you want to write in assembly language do that . but don t use inline-asm for this https : gcc.gnu.org wiki DontUseInlineAsm that would be shooting yourself in the foot . If you want to write in C you have to either trust the compiler or check its output . Most of the time for most platforms gcc will do a good job of using the instruction-set . After checking a few times you ll probably become confident that it s doing a good job and not need to check every time . Comment : @dronus : If you want the compiler to be able to optimize your code which is part of the point of using C instead of asm an intrinsic for setting a bit would have to mean set this bit in whatever way is most efficient not I require a BIS.B instruction here with these operands . The former is very well expressed by P1IE BIT1 . Compilers understand that and know what it means and how to emit efficient code for it .", "Question : null .. . Answer : Is there an easy way to exactly wait for a timer overflow on the MSP430 The timer overflow interrupt is a little late and not exact depending on the timing of the currently executed instruction . A waiting loop doesn t snap on a single system cycle either . So I guess one would schedule a compare interrupt just before the timer overflows and then do some CPU based wait until the timer hits 0 . What instructions to use for Is this possible with C code only Comment : I run the MSP430 at 8Mhz . I need cycle stable latency for high resolution PWM operations . @dwelch well C does no magic and translate to machine instructions anyway . So we have less control while writing the code but if freasable instructions are issued the result will work the same way as assembly written code would . If in doubt one can check the assembly issued by the compiler . Question is if there is a single cycle instruction that jumps on itself for waiting and if can be issued in C . Or if there are other instructions that we can select depending on the cycles left to eat them . Comment : Unless you want a plethora of other features then usually one or two fall back to some software implementation . And MSP430 s sport a lot of cool peripherials but almost none of them sports all features at once . Even less do if one starts prototyping by LaunchPad boards . Comment : I guess if we talk about latencies and inaccuracies of about 10 cycles or more 16 vs 8 Mhz doesn t change the game . 160 MHz would then but that is far out of reach . I limit myself to the MSP430 because I ve already implemented 9 of 10 features of my current project on it . There are several controllers out there yes and several application notes how to run LCDs run from battery for years handle SD cards and touch sensors or provide a realtime clock . However stitching this all together requires quite some effort and now I just need accurate PWM in addidition to all that already running . Comment : For example even poor audio eg . 32000kHz 8 bit PCM requires over 8MHz timing resolution if played via PWM . Comment : Why aren t you using the timer output directly Or DMA", "Question : How can I enable and disable clear and set GIE SR bit in C using the mspgcc Comment : Possible duplicate : stackoverflow.com q 47981 694733 http : stackoverflow.com q 47981 694733 Comment : @user694733 : Not a duplicate . The GIE SR bit in the MSP430 is generally not accessed using simple bitwise operator because there is no symbol defined in C that represents the status register . Comment : This is not a duplicate as the status register SR is a processor register not a normal memory mapped register . I found the solution see below . .. . Answer : This is an example of interrupt http : importgeek.wordpress.com tag msp430-launchpad", "Question : I m trying to compile my MSP430 project using the Linux msp430-gcc compiler . When I try to compile it using the CCS IDE it works just fine but when I try to compile it using the msp430-gcc commandline tool I get linker errors about functions like calloc and no operation . The beginning of my source file looks like this : .. . .. . I compile the program using the following command : .. . .. . So it looks like I include the stdio.h and stdlib.h just fine but I still get linker errors about functions like calloc . I also tried using arguments like -lc but that doesn t seem to help . I read that both stdio and stdlib get included automatically by the compiler so I guess there is no need to use additional arguments for these files . Does anyone have any idea how I could fix this Thanks . Comment : Which version are you using What about -minrt Comment : @CL . You mean the msp430-gcc version That s 4.6.3 20120301 mspgcc LTS 20120406 unpatched . I tried the -minrt argument but it tells me it s an unrecognized option . Comment : msp430 gcc should use its toolchain includes and libs . .. . Answer : mspgcc was a fork of gcc by now it s horribly outdated . Nowadays MSP430 development happens in gcc itself . You could compile the latest version of gcc yourself or hope that your distribution has a MSP430 cross compiler or get it from TI http : www.ti.com tool msp430-gcc-opensource . Comment : Thanks I downloaded the .run pre-compiled one from TI s website . I now use the msp430-elf-gcc executable to compile my sources and that seems to work perfectly fine I did however have to manually direct the compiler to the MSP include files now eg . msp430g2553.h . Same goes for the msp430g2553 linker files msp430g2553.ld and msp430g2553 symbols.ld .", "Question : I am writing simulator to microcontroller msp430 . I cant understand when i should set carry bit . For example in add instruction : 1+0x7FFF setting carry bit or 1+0xFFFF Comment : 17th bit not 16th 0x7FFF+1 means the N bit is set but not the carry . 0xFFFF+1 sets the carry bit as does 0x8000 + 0x8000 . the carry bit is the carry out of the msbit . the real question is what do you do on a subtract you invert the second operand and carry in a 1 but do you invert the carry out some architectures you do some you dont . easiest just to get a 10 msp430 and try it . V flag is typically set if msbit carry in and carry out differ . and n is just bit 15 . Comment : oh right looking at my simulator if it is a byte operation then 0xFF+1 bit 9 out of the alu basically is the carry bit bit 7 is the n bit etc . if it is a word operation then it is like the above 0xFFFF+1 is 0x0000 with the carry bit set same as 0x8000+0x8000 . .. . Answer : There a two different instructions that implement JL jump if less and JLO jump if lower . The documentation of JL says that it .. . .. . allows comparison of signed integers . The documentation of JLO says that it .. . .. . is used for the comparison of unsigned numbers . JLO is the same as JNC therefore C is unsigned carry .", "Question : My z1 mote acts as the base station and it is connected directly to the gateway pc . I wanted to save the data coming on a text file using this code in the unicast-receiver.c : .. . .. . but I am getting this error : .. . .. . Eventhough stdio.h is included . Anyone faced the same kind of error before How do I fix it If there s no way to do this through z1 motes then is any other way to store the data Here are the includes in the program Comment : Did you include stdio.h Comment : Yes I did sir . @LPs Comment : Is your development SDK well installed Comment : I am using contiki http : zolertia.sourceforge.net wiki index.php Mainpage : Contiki that through it I can upload the program to the z1 motes . I am not sure about the SDK but supposedly it comes ready and this is the first time I face such problem with it . @LPs Comment : Have you got other includes before the stdio one Post the whole file if possible . .. . Answer : msp430 is a very hardware-limited platform so the complete C standard-library functionality is not supported . In particular there is no hard disk or even SD card on typical msp430 platforms so there s also little need to have a filesystem-related routines in software . If you look at msp430-libc source code https : sourceforge.net p mspgcc msp430-libc ci master tree include stdio.h you can clearly see that it only support for the printf function family . It s possible to use the xmem interface to store data on the onboard flash . The interface is defined in contiki core dev xmem.h . Using it is simple : first erase a whole sector then you can write in that sector . Call xmem erase with a flash address as an argument any address in the sector you want to erase then call xmem write passing a buffer which to write and a flash address start offset where write to . Flash addresses typically start from zero . It s also possible to use the Coffee Contiki file system . Comment : Oh makes sense then . How about alternative methods Is there a way to store the data coming if I can only use the printf function Comment : You can use the xmem interface defined to access the flash-memory directly contiki core dev xmem.h . FYI you need to erase a sector before writing in it if you know that it s pretty simple to use . Comment : Hmm I have to admit that I have no idea how to do that . Would you please help me or suggest a tutorial that I can follow to do this I tried to read data from the serial-port but I have been facing a lot of bugs and it is taking me a lot more than I thought . . Comment : Btw do you mean to erase a sector of the memory and then store the data in the memory of the z1", "Question : I ve installed the msp430-gcc compiler and associated tools to do some open-source msp430 development at home using Eclipse . I m developing on a slightly older Macbook Pro running OS X Lion and installed the tools using MacPorts . I m running Eclipse 3.7.2 with the CDT and GCC Cross Compiler Support plug-ins . I have a simple empty main written that compiles and links just fine . The ELF parser lets me view the contents of the ELF binary just fine with the exception of one component when I try to view the contents of the startup code in crt0.S it gives me a blank file . When I click on the crt0.S component of the ELF the filename bar at the bottom of the Eclipse window shows opt local var macports build Volumes work mports dports cross msp430-gcc msp430-gcc work gcc-4.6.3 gcc config msp430 crt0.S . This makes sense because of my MacPorts install of msp430-gcc . crt0.S is archived into opt local lib gcc msp430 4.6.3 libcrt0.a on my machine . .. . .. . What I want to be able to do is tell Eclipse to look elsewhere for the source files for the libraries that are automatically linked when I build with the msp430-gcc toolchain . This would presumably include everything in opt local lib gcc msp430 4.6.3 . I started by downloading the source for mspgcc-20120406 the version in my MacPorts install and applying the gcc patchfile to an empty directory tree . This created the gcc config msp430 directory including the crt0.S and crt0ivtbl.S files . What I have had no luck accomplishing is telling Eclipse to look in Developer mspgcc-20120406 gcc-4.6.3 config msp430 instead of the path that s in the already-built libcrt0.a . I tried playing around with the Project Preferences- Paths and Symbols- Source Location window but didn t have much luck . I searched through this website and on Google and the closest thing I came up with was this question http : stackoverflow.com questions 6784543 how-to-attach-source-to-the-libraries-on-eclipse-cdt but it doesn t smell like the right answer . I would like to avoid solutions that involve moving the library source into my project . I d rather have a solution that will work for multiple-projects . All help is greatly appreciated Thanks in advance . .. . Answer : Try and check if the Eclipse linked resource http : help.eclipse.org helios index.jsp topic org.eclipse.platform.doc.user concepts concepts-13.htm could help you declare that external directory from within your Eclipse project here . Linked resources are files and folders that are stored in locations in the file system outside of the project s location . These special resources can be used to add files and folders to your project that for some reason must be stored in a certain place outside of your project . For example a linked folder can be used to store build output separately from your source files . I find interesting how you can define that linked resource : .. . .. . Linked resource target paths can be either defined as absolute paths or relative to a path variable . linked resource relative to a path variable http : i.stack.imgur.com 4IVED.png .. . .. . Since you can define it relative to for instance your Eclipse project location PROJECT LOC you can then setup your resource in a way which won t change between two environments . Comment : Thanks for the tip . This appears to allow me to do something like create a msp430-gcc-libsrc folder in my project and link it to Developer mspgcc-20120406 gcc-4.6.3 config msp430 which unfortunately I don t think will accomplish what I need . I need some way to tell the ELF parser at a minimum that if it tries to look in opt local var macports build Volumes work mports dports cross msp430-gcc msp4 30-gcc work gcc-4.6.3 gcc config msp430 it should instead look in Developer mspgcc-20120406 gcc-4.6.3 config msp430 essentially I need to alias one to the other . Comment : Continuation of previous comment . I couldn t see a way in the Eclipse documentation on Linked Resources to make that happen Comment : @ryan OK it was worth mentioning just in case .", "Question : I need to calculate the distance between GPS co-ordinates to calculate distance being traveled . I ve tried both the Haversine and Vincenty algorithms which work fine on my desktop PC but when I use the same code for MSP430 chip using CCS IDE the IDE is throwing error saying that program will not fit into available memory . Is there any other alternative method or code to find the distance between two GPS co-ordinates which will fit in available memory of MSP430 Microcontroller Comment : Which chip are you using Comment : There is another method called Sferical Law of Cosines https : jsperf.com vincenty-vs-haversine-distance-calculations 2 but I don t know its memory requirement . Comment : I am using msp430f2274 microcontroller for this process . The issue is showing while trying to find the inverse of cos of a value . Comment : So msp430f2274 has 32KB Flash 1K RAM but after the essential stuff of your application what is the available memory Could you impose cope with a limit to the max arc distance What accuracy is acceptable Comment : @WeatherVane According to faqs.org faqs geography infosystems-faq http : www.faqs.org faqs geography infosystems-faq Question Q5.1 the Spherical Law of Cosines method is unreliable for short distances since the inverse cosine deteriorates in accuracy as the angle gets smaller . .. . Answer : It s not surprising that you re running out-of-memory because the microcontroller you are using the Texas Instruments MSP430F2274 has only 32kB of flash and 1kB of RAM . There are several approaches to solving your problem each with different tradeoffs . Here are three : .. . .. . Use another microcontroller that has more memory there are many in the MSP430 family . Optimize your code to fit in the available space . Use a simpler formula than the Vincenty or Haversine . I ll address the two latter approaches below . Optimize Your Code .. . .. . Depending on the accuracy requirements of your application optimizing your existing code might be a better approach than using a simpler formula than Vincenty or Haversine . A Simple Way to Optimize .. . .. . Perhaps simply setting the compiler to optimize for size will solve your problem . In the MSP430 toolset use the --opt for speed 0 switch . According to the MSP430 Optimizing C C++ Compiler User s Guide v15.9.0.STS http : www.ti.com lit ug slau132k slau132k.pdf page 62 this switch : .. . .. . enables optimizations geared towards improving the code-size with a high risk of worsening or impacting performance . So you might very easily get things to work by using this switch at the cost of trading away speed for memory space . A More Involved Way to Optimize .. . .. . Assuming you are using the floating-point math library provided with your compiler you might be able to still use Vincenty or Haversine if you replace the math library with a more space-efficient version . The CORDIC https : en.wikipedia.org wiki CORDIC fixed-point algorithms provide iterative approaches to calculating the trigonometric functions that trade away speed for space efficiency . If you roll your own math library you might achieve a good balance between space speed and accuracy . A 16-bit version of the CORDIC approach for sine and cosine for the MSP430 is here https : github.com the0b MSP430-CORDIC-sine-cosine you will need to determine whether it provides the degree of accuracy and precision you need . Use a Different Formula .. . .. . In general the various algorithms that calculate distance between two points on the earth represent a trade-off between accuracy and complexity . The Vincenty https : en.wikipedia.org wiki Vincenty 27s formulae algorithm you cited is much more accurate than the Haversine https : en.wikipedia.org wiki Haversine formula as it more correctly represents the earth as an oblate spheroid instead of as a sphere of radius R hence the math is more complex . For reference the Haversine method which assumes the earth is a perfect sphere is shown here : .. . .. . The intermediate result c is the distance in radians . The distance d is in the same units as R radius of the earth . As you can see the Haversine employs an arcsin in the calculation . You can simplify the math further by employing the Polar Coordinate Flat-Earth method : .. . .. . Notice that there is no arcsin in this calculation but there is a sqrt . A discussion of the accuracy tradeoffs between the Haversine and the Polar Coordinate Flat-Earth methods is here question Q5.1 http : www.faqs.org faqs geography infosystems-faq . See also .. . .. . How do I calculate distance between GPS co-ordinates on a processor with poor floating-point support http : stackoverflow.com questions 7062046 how-do-i-calculate-distance-between-gps-co-ordinates-on-a-processor-with-poor-fl rq 1 .. . http : www.faqs.org faqs geography infosystems-faq Question Q5.1 http : www.faqs.org faqs geography infosystems-faq .. . Geographical Distance Wikipedia https : en.wikipedia.org wiki Geographical distance", "Question : I installed python in Win7 . I need to add python-msp430-tools 0.6 to my python . Hence I downloaded python-msp430-tools 0.6 from https : pypi.python.org pypi python-msp430-tools . But there is a problem How can I add this tool to my python . By the way I downloaded msp-gcc for mingw and fixed PATH . I will appreciate any help . Best Regards . Comment : Have you considered finding some resources regarding on how to install packages on pypi.python.org pypi https : pypi.python.org pypi .. . Answer : You need to use easy install script from your PYTHON PATH bin folder . Like : .. . .. . It will download package from pypi and install it . You dont have to download it by hand . You also can use pip in the same way after installing it . So once : .. . .. . Then : .. . .. . Pip is much better in package management .", "Question : I installed python in Win7 . I need to add python-msp430-tools 0.6 to my python . Hence I downloaded python-msp430-tools 0.6 from https : pypi.python.org pypi python-msp430-tools . But there is a problem How can I add this tool to my python . By the way I downloaded msp-gcc for mingw and fixed PATH . I will appreciate any help . Best Regards . Comment : Have you considered finding some resources regarding on how to install packages on pypi.python.org pypi https : pypi.python.org pypi .. . Answer : for installing packages from pypi it is better to use pip in my idea . take a look at python on windows http : docs.python-guide.org en latest starting install win.html" ] }
[ "yes-answer-long", "yes-answer-short" ]
texas-instruments
UNK_RELATION
.net-core@osx@257
.net-core -- .net-core is a modular implementation of the .net framework that can be used in a wide variety of verticals scaling from the data center to touch based devices is available as open-source and is supported by microsoft on windows linux and mac @placeholder .
{ "confidence": [ 66.73686981201172, 65.79380798339844, 59.182743072509766, 58.879615783691406, 58.04153823852539, 57.358360290527344, 56.796470642089844, 56.024105072021484, 55.86372375488281, 54.86081314086914, 54.73277282714844, 54.24241638183594, 54.144554138183594, 53.845008850097656, 53.7766227722168, 53.653724670410156, 53.03511428833008, 52.99763488769531, 52.55498504638672, 52.50163650512695, 52.44195556640625, 52.41893005371094, 52.04832077026367, 51.49474334716797, 51.49474334716797, 51.470157623291016, 51.1922492980957, 50.61096954345703, 50.54542922973633, 50.26918029785156, 50.1064453125, 50.076805114746094, 49.951419830322266, 49.884681701660156, 49.80625915527344, 49.588470458984375, 49.430206298828125, 49.40764617919922, 49.19499969482422, 49.12205123901367, 49.11221694946289, 48.94874572753906, 48.8010139465332, 48.78999328613281, 48.760746002197266, 48.655155181884766, 48.65504455566406, 48.65504455566406, 48.65504455566406, 48.62628173828125, 48.42768859863281, 48.42768859863281, 48.3604621887207, 47.95826721191406, 47.7357177734375, 47.51726150512695, 47.484107971191406, 47.47837448120117, 47.212066650390625, 46.81666564941406, 46.62844467163086, 46.601741790771484, 46.595298767089844, 46.57411193847656, 46.498992919921875, 46.498992919921875, 46.37432861328125, 46.34757614135742, 46.34059143066406, 46.34059143066406, 46.34059143066406, 46.34059143066406, 46.28977966308594, 46.149436950683594, 46.13548278808594, 46.0181770324707, 46.010684967041016, 45.76732635498047, 45.69232940673828, 45.69148254394531, 45.67888259887695, 45.67888259887695, 45.45378112792969, 45.34485626220703, 45.3404655456543, 45.3404655456543, 45.3404655456543, 45.33448028564453, 45.33448028564453, 45.33448028564453, 45.33448028564453, 45.33448028564453, 45.30421829223633, 45.18589782714844, 45.15338897705078, 45.133262634277344, 45.10292053222656, 45.03484344482422, 44.98654556274414 ], "content": [ ".Net Core is a modular subset of the .Net framework .", ".NET Core is cross-platform .NET that can run on Windows Mac and Linux .", ".NET Core and .NET Framework", "I was looking at the possibility of porting a small project from Windows .NET framework to Ubuntu linux using open-source .NET Core .", "But .NET Core 5 is not .NET Framework .", "At this point ASP.NET Core web-applications are supported if they re targeting .NET Framework but are not supported if they re targeting .NET Core .", "I want to port this to .NET Core - but NLog can not be used with .NET Core .", "The full System.Drawing package is not available for .NET Core but is for the full .NET Framework .", ".NET Native -- Native compilation of the .NET Core framework .", ".NET Core is named Core since it contains the core features from the .NET Framework for both the runtime and framework libraries .", "We know that .NET Core the open-source components are only a subset of the full .NET Framework and that ASP.NET 5 and MVC 6 is built on .NET Core .", "Microsoft now has .NET Core .NET Framework and Xamarin Mono in its .NET family .", "Framework dependencies are available for .Net 4.5.x onwards .NET Core or UWP System.Runtime based library set in different versions .", "The NuGet dependency Microsoft.AspNet.Identity.EntityFramework is released in 2015 and based on the .NET Framework mscorlib based and not on .NET Standard .NET Core System.Runtime based .", "That works in both .NET Core and .NET Framework .", ".. . Both choices are open-source but .NET Core is directly and officially supported by Microsoft and will have a heavy investment moving forward .", "You can target the full .NET framework and not .NET Core like so :", "@mxmissile Regex is not available in .NET Core", "Recently in an official .NET Framework Blog http : blogs.msdn.com b dotnet it was announced that .NET Core is going open-source http : blogs.msdn.com b dotnet archive 2014 11 12 net-core-is-open-source.aspx .", ".NET Core 1.0 is not the next version of .NET 4.6.2 Full .NET Framework .", "confusing enought .Net core is not a part of .Net framework", "I am having a solution with two projects Asp.net core .net-core and asp.net-core .net framework .", "System.Drawing is now available for .NET Core .", "@DavidPine The .Net Framework 4.6.2 is normal application not .net Core", "ASP.NET 5 runs on both the .NET Framework and .NET Core .", "The difference is whether you will be targeting the .Net Core Framework or the Full .Net Framework .", "try using msi from here microsoft.com net core windows https : www.microsoft.com net core windows if that helps", "Eventually if you need to use any .NET Framework library that is not compatible with .NET Core there s no issue you can build that microservice with the .NET Framework and in the future you might be able to substitute it with the .NET Core .", "I am attempting to port some .NET Framework code to .NET Core .", ".NET Core : .. . .. . .NET Core is the small optimized runtime that is the basis of ASP.NET Core .", "If this app was based on .NET Framework I could launch a browser using System.Diagnostics.Process class which is not supported in .NET Core .", "Any dependencies of a .NET Core project must also support .NET Core .", "But the .Net Core Framework is not as feature rich as the Full Framework .", "When running ASP.NET Core on .NET Framework instead of .NET Core use net451 .", "The resulting assembly will be able to execute on any .NET Core 5-based framework including .NET Framework 4.6 ASP.NET 5 .NET Native .", "In the upper code section you are targeting .NET Core and .NET Framework But you still cannot use all of your bins libs of .NET Framework in .NET Core at least not yet and in the bottom you are referencing just .NET Framework not .NET Core .", "RandomNumberGenerator.Create is the only way to get an RNG instance on .NET Core and since it works on both .NET Core and .NET Framework is the most portable .", "We ll continue improving these components for both .NET Core and .NET Framework .", ".NET Core .", "But not on .NET Core just when targeting the full framework .", "SigningCredentials on .NET Core is different from .NET 4.0", "Summary : .. . .. . The .NET Core platform is a new .NET stack that is optimized for open-source development and agile delivery on NuGet .", "Is it possible to add a reference to a PCL targeting .NET 4.6 and .NET Core from a .NET Core project", "I m working with .NET Core on my Mac machine .", "I did install the : .NET Core SDK for Windows https : www.microsoft.com net core windows .", ".. . Remove previous .net-core versions from your system if any .. . .. . Then install .net-core sdk", "BinaryFormatter will be available in a future version of .Net Core .", "Is .net-core dnxcore50 available on Azure web apps", "Is or will .net-core be available to use on visual-studio-2013", "You should use .NET Core instead of .NET Framework or Xamarin in the following 6 typical scenarios according to the documentation here http : www.codechannels.com article microsoft when-should-i-use-net-core .", "Is there something equivalent in .NET Core", ".NET Core uses Roslyn .", ".. . As you know our current POR is to provide the WCF client-side libraries in .NET Core to enable UWP ASP.NET Core .NET Core applications to call .NET Framework based WCF Services .", "I see the following in almost every future .NET framework discussion : .. . .. . .NET Framework 4.6 Full .Net framework .. . .NET Native .. . .NET Core .. . .. . What is the difference between all of these", "If you want to write a library that can be consumed from .Net Core and .Net Framework you should use netstandard not dotnet .", "ISO10126 padding is not available in .NET Core 1.0 .", ".NET Core -- A subset framework that doesn t include everything in the full 4.6 Framework .", "That simply disables .NET core .", "I am trying to port a VB .net project from .net framework into .net-core and the new Windows universal platform apps .", "What you re doing is creating a library that will run only on .Net Framework and then trying to use it from an application that runs on .Net Core .", "I want to create an onion type architecture with the .net-core RC2 framework .", "This is explained in the Types of portability in .NET Core https : dotnet.github.io docs core-concepts app-types.html article in the .Net Core documentation .", ".NET Framework 4.6 .Net Native and .NET Core http : i.stack.imgur.com GQVQJ.png .. . .. . From the above we could easily deduce the following : .. . .. . .NET Framework 4.6 is a full framework for everything related to .NET but lacks libraries runtime optimized for multi-platform Windows Linux and Mac and cloud deployments .. . .NET Core on the other hand is a subset of .NET Framework 4.6 which is mainly optimized for multi-platform and cloud deployments .. . .NET Native is mainly used to develop Universal Apps which will be quite optimized to run on any device and platform natively not for the web apps though .. . .. . An interesting point is ASP.NET : .. . .. . If we need backward compatibility to the fullest extent say web forms or aspx support we need to go with .NET Framework 4.6 .. . If we develop MVC Web API or Razor web pages then we can deploy those web apps either in .NET Framework 4.6 or .NET Core environment", "Thanks for the link The goal of .NET Core is having a single code base that can be used to build and support all the platforms including Windows Linux and Mac OSX .", "I have updated my project from .NET 4.5 to .NET Core with ASP.NET Core .", "How do I make use of a .NET Core class-library from my .NET Core App", "Microsoft dotnet - GitHub https : github.com Microsoft dotnet : .. . .. . .NET Core and the .NET Framework have for the most part a subset-superset relationship .", "The middleware works fine when used with an ASP.NET Core Web app targetting .NET Core - based on the VS2015 RC2 template .", "What s the issue in .NET Core", ".NET Core UWP .", "There s .NET Core .", "Is .NET Core a Mono alternative", ".Net Core is expected in NLog 4.4 .", "http : www.codechannels.com article microsoft when-should-i-still-use-net-framework-4-x-instead-of-net-core .. . 3 .", "After you install RC2 Make sure your control panel shows ONLY these for .Net Core .. . .. . Microsoft .Net Core 1.0.0 RC2 - VS 2015 Tooling Preview 1 1.0.20513.14 .. . Microsoft .Net Core 1.0.0 RC2 - SDK Preview 1 x64 to be version 1.0.0.2702 .. . .. . Hope this helps .", "I am new to .net-core .", "ASP.NET Core https : docs.asp.net en latest intro.html can run on top of .NET Core https : dotnet.github.io or the full .NET Framework https : www.microsoft.com net framework .", "ASP.NET Core is a complete new and incompatible portable version based on .NET Core .", "Is there way to implement P Invoke dllimport in .NET Core on Linux", ".NET Core diagram http : i.stack.imgur.com AXmT6.png .. . .. . and articles text itself I would assume that .NET Core beside obvious things like being open-sourced is a NuGet-like modular re-implementation of full .NET .", "You trying to target 461 in the image so the packages rolling back from .net-core preview1 to .net framework 4.6.1 .", "That package is compiled for .Net Framework and Silverlight which means it s not usable from .Net Core .", "Update 2 : I ve logged this as an issue on the .Net Core github project https : github.com dotnet core issues 181 in case it is a problem with .Net Core or the docs .", "There s .NET 4.6 full framework as well as smaller .NET Core 5 framework .", "I start to learn .Net Core .", "As @Rytmis says there is no Color.FromArgb This is .NET core .", "Another one for example is .NET Core .", "When should I choose to use .NET Core in my project instead of .NET Framework or Xamarin", "When should I still use .NET Framework 4.x instead of .NET Core", "Nuget deployment : .. . .. . In contrast to the .NET Framework the .NET Core platform will be delivered as a set of NuGet packages .", "Relationship with current frameworks : .. . .. . For Visual Studio 2015 our goal is to make sure that .NET Core is a pure subset of the .NET Framework .", "After Visual Studio 2015 is released our expectation is that .NET Core will version faster than the .NET Framework .", "Does it mean that I can run my .net-core application on machine where only .net framework 4 is installed", "FYI I m using Mac with VSCode and .net-core rc1 update 2 .", "As such it forms the foundation for all future .NET verticals .", "I ve read that the .NET 5 Core framework library which has been open-sourced yesterday is not a superset of the .NET 4.5.x framework .", "I am trying to set up a continuous-integration server that is on Windows that builds .net-core applications after installing only the .net-core SDK from the .net-core download site without installing Visual Studio .", "I am working on .Net Core and trying to migrate the net 4.5 application into .Net core .", ".Net Core does not support Ninject instead of this we can use dependency-injection of .net-core ." ] }
{ "confidence": [ 81.98519897460938, 74.32389831542969, 71.87857818603516, 69.18291473388672, 65.82794189453125, 65.58084106445312, 61.225887298583984, 61.157493591308594, 60.84914779663086, 60.36402130126953, 60.26569366455078, 59.49460220336914, 59.447898864746094, 59.373565673828125, 58.83119201660156, 57.574893951416016, 57.5726203918457, 57.52058029174805, 57.11463165283203, 57.048301696777344 ], "content": [ "Question : Recently in an official .NET Framework Blog http : blogs.msdn.com b dotnet it was announced that .NET Core is going open-source http : blogs.msdn.com b dotnet archive 2014 11 12 net-core-is-open-source.aspx . Ironically author mentions that what .NET Core is will be explained in next post . Some more details are mentioned in another announce post http : blogs.msdn.com b dotnet archive 2014 11 12 announcing-net-2015-preview-a-new-era-for-net.aspx .NET Core 5 . From a supplied diagram : .. . .. . .NET Core diagram http : i.stack.imgur.com AXmT6.png .. . .. . and articles text itself I would assume that .NET Core beside obvious things like being open-sourced is a NuGet-like modular re-implementation of full .NET . I.e . framework components are loaded as necessary much like NuGet packages are loaded now . And now ASP.NET 5 is one of the modules that is already implemented . Is my understanding of this new .NET Core seems correct Maybe I m missing something Comment : There s a new blog post here about it blogs.msdn.com b dotnet archive 2014 12 04 http : blogs.msdn.com b dotnet archive 2014 12 04 introducing-net-core.aspx but its still hard to understand that diagram . Does it mean WPF and WinForms cannot use .NET Core for example Comment : @dodgy coder I think they will eventually it s just that Store Apps and ASP.NET 5 are the first to use new framework architecture . Comment : Good explanation here : docs.asp.net en latest conceptual-overview dotnetcore.html http : docs.asp.net en latest conceptual-overview dotnetcore.html Comment : @dodgy coder Its right . As of now WPF and WinForms apps are not portable to .net-core . They may be redeveloped into windows-universal apps . See this : blogs.msdn.microsoft.com dotnet 2016 02 10 porting-to-net-core https : blogs.msdn.microsoft.com dotnet 2016 02 10 porting-to-net-core Comment : @JennyO Reilly great link thanks .. . Answer : So based on latest official entry http : blogs.msdn.com b dotnet archive 2014 12 04 introducing-net-core.aspx on the subject here some key points as I see them : .. . .. . .NET Core is essentially a fork of the NET Framework whose implementation is also optimized around factoring concerns . .. . We think of .NET Core as not being specific to either .NET Native nor ASP.NET 5 the BCL and the runtimes are general purpose and designed to be modular . As such it forms the foundation for all future .NET verticals . So .NET Native and ASP.NET 5 are just a test subjects for new framework configuration partially this maybe because they are quite different : .. . .. . enter image description here http : i.stack.imgur.com teCF7.png .. . .. . see they even need separate low-level but major part of BCL is still common : .. . .. . We think of .NET Core as not being specific to either .NET Native nor ASP.NET 5 the BCL and the runtimes are general purpose and designed to be modular . As such it forms the foundation for all future .NET verticals . I.e . magenta rectangles on top will be added massively with new App Models but base will remain common . Nuget deployment : .. . .. . In contrast to the .NET Framework the .NET Core platform will be delivered as a set of NuGet packages . We ve settled on NuGet because that s where the majority of the library ecosystem already is . Relationship with current frameworks : .. . .. . For Visual Studio 2015 our goal is to make sure that .NET Core is a pure subset of the .NET Framework . In other words there wouldn t be any feature gaps . After Visual Studio 2015 is released our expectation is that .NET Core will version faster than the .NET Framework . This means that there will be points in time where a feature will only be available on the .NET Core based platforms . Summary : .. . .. . The .NET Core platform is a new .NET stack that is optimized for open-source development and agile delivery on NuGet . We re working with the Mono community to make it great on Windows Linux and Mac and Microsoft will support it on all three platforms . .. . We re retaining the values that the .NET Framework brings to enterprise class development . We ll offer .NET Core distributions that represent a set of NuGet packages that we tested and support together . Visual Studio remains your one- stop-shop for development . Consuming NuGet packages that are part of a distribution doesn t require an internet-connection . Basically this can be thought as a .NET 4.6 with changed distribution model which simultaneously is being in a process of becoming open-source .", "Question : Microsoft now has .NET Core .NET Framework and Xamarin Mono in its .NET family . There seems to be a lot of overlap here . What s the difference between these types of .NET When should I choose to use .NET Core in my project instead of .NET Framework or Xamarin .. . Answer : This is how Microsoft explains it : .. . .. . .NET Flavors http : i.stack.imgur.com sw8Ln.png .. . .. . .NET Framework is the full or traditional flavor of .NET that s distributed with Windows . Use this when you are building a desktop Windows app or working with ASP.NET 4.5 4.6 . .NET Core is cross-platform .NET that can run on Windows Mac and Linux . Use this when you want to build applications that can run on any platform including ASP.NET Core cross-platform web-applications . Xamarin Mono is used for building mobile apps that can run on iOS Android or Windows Phone devices .", "Question : I m confused on the distinction between these terms : .. . .. . ASP.NET 5 now renamed ASP.NET Core and released as 1.0 not 5.0 .. . ASP.NET Core 5 .. . .NET Core .. . .. . Can anyone briefly explain it .. . Answer : ASP.NET 5 now ASP.NET Core 1.0 .. . .. . Is the next generation of ASP.NET that provides a familiar and modern framework for web and cloud scenarios . It includes the next versions of ASP.NET MVC Web API Web Pages and SignalR . It is a high-performance and modular-design and supports full side-by-side to make it seamless to migrate from on premise to the cloud . These products are actively developed by the ASP.NET team in collaboration with a community of open-source developers . Together we are dedicated to creating the best possible platform for web development . Update : It has been renamed from ASP.NET 5 to ASP.Net Core 1.0 . .NET Core : .. . .. . .NET Core is the small optimized runtime that is the basis of ASP.NET Core . It currently runs on Windows Linux and Mac . It is a high-performance and modular-design and supports having several applications on a web server each one with its own copy of the .NET Core runtime enabling a full side-by-side experience and that will make it easy to adopt new .NET Core versions without affecting other apps and this makes .NET Core architecture a leap forward from the current classic .NET 4.6 . These products are actively developed by the .NET team and in collaboration with a community of open-source developers . Together we are dedicated to improving and extending the .NET platform with new features and for new scenarios . .NET Core has two major components . It includes a small runtime that is built from the same codebase as the .NET Framework CLR . The .NET Core runtime includes the same GC and JIT RyuJIT but doesn t include features like Application Domains or Code Access Security . The runtime is delivered on NuGet via the Microsoft.CoreCLR package . .NET Core also includes the base-class libraries . These libraries are largely the same code as the .NET Framework class libraries but have been factored removal of dependencies to enable us to ship a smaller set of libraries . These libraries are shipped as System . NuGet packages on NuGet.org . For more information see Introducing .NET Core http : blogs.msdn.com b dotnet archive 2014 12 04 introducing-net-core.aspx Comment : Thanks for the link The goal of .NET Core is having a single code base that can be used to build and support all the platforms including Windows Linux and Mac OSX . and check this http : www.c-sharpcorner.com news essence-of-dotnetconf-keynote and this http : web.ageofascent.com asp-net-core-exeeds-1-15-million-requests-12-6-gbps post it says .NET Core is faster than PHP is that true", "Question : Recently in an official .NET Framework Blog http : blogs.msdn.com b dotnet it was announced that .NET Core is going open-source http : blogs.msdn.com b dotnet archive 2014 11 12 net-core-is-open-source.aspx . Ironically author mentions that what .NET Core is will be explained in next post . Some more details are mentioned in another announce post http : blogs.msdn.com b dotnet archive 2014 11 12 announcing-net-2015-preview-a-new-era-for-net.aspx .NET Core 5 . From a supplied diagram : .. . .. . .NET Core diagram http : i.stack.imgur.com AXmT6.png .. . .. . and articles text itself I would assume that .NET Core beside obvious things like being open-sourced is a NuGet-like modular re-implementation of full .NET . I.e . framework components are loaded as necessary much like NuGet packages are loaded now . And now ASP.NET 5 is one of the modules that is already implemented . Is my understanding of this new .NET Core seems correct Maybe I m missing something Comment : There s a new blog post here about it blogs.msdn.com b dotnet archive 2014 12 04 http : blogs.msdn.com b dotnet archive 2014 12 04 introducing-net-core.aspx but its still hard to understand that diagram . Does it mean WPF and WinForms cannot use .NET Core for example Comment : @dodgy coder I think they will eventually it s just that Store Apps and ASP.NET 5 are the first to use new framework architecture . Comment : Good explanation here : docs.asp.net en latest conceptual-overview dotnetcore.html http : docs.asp.net en latest conceptual-overview dotnetcore.html Comment : @dodgy coder Its right . As of now WPF and WinForms apps are not portable to .net-core . They may be redeveloped into windows-universal apps . See this : blogs.msdn.microsoft.com dotnet 2016 02 10 porting-to-net-core https : blogs.msdn.microsoft.com dotnet 2016 02 10 porting-to-net-core Comment : @JennyO Reilly great link thanks .. . Answer : It is a sub-set of the .NET Framework started with the Compact Framework edition . Progressed into Silverlight Windows Store and Windows Phone . Focused on keeping the deployment small suitable for quick downloads and devices with limited storage capabilities . And easier to bring up on non-Windows platforms surely the reason it was chosen as the open sourced edition . The difficult and expensive parts of the CLR and the base-class libraries are omitted . Otherwise always easy to recognize when you target such a framework version lots of goodies will be missing . You ll be using a distinct set of reference assemblies that only expose what is supported by the runtime . Stored on your machine in the C : Program Files x86 Reference Assemblies Microsoft Framework .NETCore directory . Comment : From blog post I wouldn t say what this looks like another compact-framework version . Announced .NET Core is version 5.0 which is higher than latest full framework . I assume by that they mean that s something different . Comment : I just described the history of the .NETCore version . Nothing new under the sun it has been around for a long time . Changes in 5.0 are incremental the new RyuJIT x64 jitter is the only one I can think of right now . Only the license change is really new : Comment : I got your point . Though I still think that announcing framework subset as next era of .NET is a bit bold . Comment : Open sourcing it is a bold step... .", "Question : Is or will .net-core be available to use on visual-studio-2013 Or it will be available only on visual-studio-2015 Thanks Comment : Hmya that question doesn t make a lot of sense . Write a Silverlight Phone Store or Universal app they use .NETCore . Comment : So guessing from this I can write and run an asp.net 5 web site in Linux by creating a silverlight project using VS2010 this seems very odd by me . Comment : Get VS2013 running on Linux first come back when you re done . Comment : that is because i am refering to this . dotnetfoundation.org http : www.dotnetfoundation.org netcore5 Comment : That was clear . Open-sourcing .NETCore means squat to programmers that have access to VS2013 they have been able to use it for a long time . It was open-sourced so programmers that don t use Microsoft tools and runtime environments can take advantage of it . Eventually . .. . Answer : Yes it s possible to build against the .NET Core 5 contracts in Visual Studio 2013 by creating a Portable Class Library that targets .NET Framework 4.5 and Windows 8 . You ll need to manually edit the .csproj file and add the following . Then install the System.Runtime http : www.nuget.org packages System.Runtime NuGet package and other .NET Core 5 packages . The resulting assembly will be able to execute on any .NET Core 5-based framework including .NET Framework 4.6 ASP.NET 5 .NET Native . Note this is the same technique used to build the .NET Core assemblies in the corefx https : github.com dotnet corefx repository . Comment : Are you sure this is possible I have tried to build a .netcore console app in VS 2013 and I cannot install the .netcore package because it requires NuGet package manager version 3.0 or above . Version 3 of the package manager doesn t yet support VS 2013 . Comment : Things have changed A LOT since this post.. . Check out Getting started with .NET Core http : dotnet.github.io getting-started Comment : Yeah confusing : For ASP.NET Core 1.0 + .NET Core RC instructions please go to the Get ASP.NET Core 1.0 website . http : dotnet.github.io getting-started", "Question : Microsoft now has .NET Core .NET Framework and Xamarin Mono in its .NET family . There seems to be a lot of overlap here . What s the difference between these types of .NET When should I choose to use .NET Core in my project instead of .NET Framework or Xamarin .. . Answer : You should use .NET Core instead of .NET Framework or Xamarin in the following 6 typical scenarios according to the documentation here http : www.codechannels.com article microsoft when-should-i-use-net-core . 1 . Cross-Platform needs .. . .. . Clearly if your goal is to have an application web service that should be able to run across platforms Windows Linux and MacOS the best choice in the .NET ecosystem is to use .NET Core as its runtime CoreCLR and libraries are cross-platform . The other choice is to use the Mono Project . .. . Both choices are open-source but .NET Core is directly and officially supported by Microsoft and will have a heavy investment moving forward . .. . When using .NET Core across platforms the best development experience exists on Windows with the Visual Studio IDE which supports many productivity features including project-management debugging source control refactoring rich editing including Intellisense testing and much more . But rich development is also supported using Visual Studio Code on Mac Linux and Windows including intellisense and debugging . Even third party editors like Sublime Emacs VI and more work well and can get editor intellisense using the open-source Omnisharp project . .. . 2 . Microservices .. . .. . When you are building a microservices oriented system composed of multiple independent dynamically scalable stateful or stateless microservices the great advantage that you have here is that you can use different technologies frameworks languages at a microservice level . That allows you to use the best approach and technology per micro areas in your system so if you want to build very performant and scalable microservices you should use .NET Core . Eventually if you need to use any .NET Framework library that is not compatible with .NET Core there s no issue you can build that microservice with the .NET Framework and in the future you might be able to substitute it with the .NET Core . .. . The infrastructure platform you could use are many . Ideally for large and complex microservice systems you should use Azure Service Fabric . But for stateless microservices you can also use other products like Azure App Service or Azure Functions . .. . Note that as of June 2016 not every technology within Azure supports the .NET Core but .NET Core support in Azure will be increasing dramatically now that .NET Core is RTM released . .. . 3 . Best performant and scalable systems .. . .. . When your system needs the best possible performance and scalability so you get the best responsiveness no matter how many users you have then is where .NET Core and ASP.NET Core really shine . The more you can do with the same amount of infrastructure hardware the richer the experience you ll have for your end users at a lower cost . .. . The days of Moore s law performance improvements for single CPUs does not apply anymore yet you need to do more while your system is growing and need higher scalability and performance for everyday s more demanding users which are growing exponentially in numbers . You need to get more efficient optimize everywhere and scale better across clusters of machines VMs and CPU cores ultimately . It is not just a matter of user s satisfaction it can also make a huge difference in cost TCO . This is why it is important to strive for performance and scalability . .. . As mentioned if you can isolate small pieces of your system as microservices or any other loosely-coupled approach it ll be better as you ll be able to not just evolve each small piece microservice independently and have a better long-term agility and maintenance but also you ll be able to use any other technology at a microservice level if what you need to do is not compatible with .NET Core . And eventually you d be able to refactor it and bring it to .NET Core when possible . .. . 4 . Command line style development for Mac Linux or Windows . .. . This approach is optional when using .NET Core . You can also use the full Visual Studio IDE of course . But if you are a developer that wants to develop with lightweight editors and heavy use of command-line .NET Core is designed for CLI . It provides simple command-line tools available on all supported platforms enabling developers to build and test applications with a minimal installation on developer lab or production machines . Editors like Visual Studio Code use the same command-line tools for their development experiences . And IDE s like Visual Studio use the same CLI tools but hide them behind a rich IDE experience . Developers can now choose the level they want to interact with the tool chain from CLI to editor to IDE . .. . 5 . Need side-by-side of .NET versions per application level . .. . If you want to be able to install applications with dependencies on different versions of frameworks in .NET you need to use .NET Core which provides 100 side-by side as explained previously in this document . .. . 6 . Windows 10 UWP .NET apps . In addition you may also want to read : .. . .. . 1 . When should I NOT use .NET Core http : www.codechannels.com article microsoft when-should-i-not-use-net-core .. . 2 . When should I still use .NET Framework 4.x instead of .NET Core http : www.codechannels.com article microsoft when-should-i-still-use-net-framework-4-x-instead-of-net-core .. . 3 . When should I use Xamarin instead of .NET Core http : www.codechannels.com article microsoft when-should-i-use-xamarin-instead-of-net-core", "Question : Is there way to implement P Invoke dllimport in .NET Core on Linux Example : .. . .. . I have C++ MyLib.dll compiled with .net framework . If it is possible to use like this or it s not support to call native win api with linux using .net-core Comment : Have you tried it How did it fail Comment : A lot of PInvoke has been used by Microsoft to develop .NET Core itself so I am so surprised that you asked . .. . Answer : PInvoke is certainly supported that is how all of the code that interfaces with the OS works but not in the specific case you listed . You cannot PInvoke to a win32 binary on Linux unless you have somehow built a function-compatible version of it for Linux yourself . More realistically you need to find a Linux function from some other system binary which exposes similar functionality and then use that instead .", "Question : Recently in an official .NET Framework Blog http : blogs.msdn.com b dotnet it was announced that .NET Core is going open-source http : blogs.msdn.com b dotnet archive 2014 11 12 net-core-is-open-source.aspx . Ironically author mentions that what .NET Core is will be explained in next post . Some more details are mentioned in another announce post http : blogs.msdn.com b dotnet archive 2014 11 12 announcing-net-2015-preview-a-new-era-for-net.aspx .NET Core 5 . From a supplied diagram : .. . .. . .NET Core diagram http : i.stack.imgur.com AXmT6.png .. . .. . and articles text itself I would assume that .NET Core beside obvious things like being open-sourced is a NuGet-like modular re-implementation of full .NET . I.e . framework components are loaded as necessary much like NuGet packages are loaded now . And now ASP.NET 5 is one of the modules that is already implemented . Is my understanding of this new .NET Core seems correct Maybe I m missing something Comment : There s a new blog post here about it blogs.msdn.com b dotnet archive 2014 12 04 http : blogs.msdn.com b dotnet archive 2014 12 04 introducing-net-core.aspx but its still hard to understand that diagram . Does it mean WPF and WinForms cannot use .NET Core for example Comment : @dodgy coder I think they will eventually it s just that Store Apps and ASP.NET 5 are the first to use new framework architecture . Comment : Good explanation here : docs.asp.net en latest conceptual-overview dotnetcore.html http : docs.asp.net en latest conceptual-overview dotnetcore.html Comment : @dodgy coder Its right . As of now WPF and WinForms apps are not portable to .net-core . They may be redeveloped into windows-universal apps . See this : blogs.msdn.microsoft.com dotnet 2016 02 10 porting-to-net-core https : blogs.msdn.microsoft.com dotnet 2016 02 10 porting-to-net-core Comment : @JennyO Reilly great link thanks .. . Answer : Announcing .NET 2015 Preview : A New Era for .NET http : blogs.msdn.com b dotnet archive 2014 11 12 announcing-net-2015-preview-a-new-era-for-net.aspx .NET Core 5 : .. . .. . .NET Core has two major components . It includes a small runtime that is built from the same codebase as the .NET Framework CLR . The .NET Core runtime includes the same GC and JIT RyuJIT but doesn t include features like Application Domains or Code Access Security . The runtime is delivered via NuGet as part of the ASP.NET 5 core package . .. . .NET Core also includes the base-class libraries . These libraries are largely the same code as the .NET Framework class libraries but have been factored removal of dependencies to enable us to ship a smaller set of libraries . These libraries are shipped as System . NuGet packages on NuGet.org . And : .. . .. . ASP.NET 5 is the first workload that has adopted .NET Core . ASP.NET 5 runs on both the .NET Framework and .NET Core . A key-value of ASP.NET 5 is that it can run on multiple versions of .NET Core 5 on the same machine . Website A and website B can run on two different versions of .NET Core on the same machine or they can use the same version . Comment : Oh that s how I missed it It was actually below in timeline of the blog Such a shame. . Comment : It s all pretty new stuff and barely described I think you asked a good question . : Comment : On a second thought seems like it s not the next post since description is still pretty brief . Comment : Isn t this basically what vNext was bringing us Comment : We ve been doing that since they started publishing the framework via nuget . No need for the workaround in that post .", "Question : I was looking at the possibility of porting a small project from Windows .NET framework to Ubuntu linux using open-source .NET Core . But my project has a dependency from another much bigger .NET 4.0 project . Can I just add a reference to the .NET 4 DLL dependency Comment : You won t be able to create a netcoreapp1.0 if you have a dependency that require full .NET Framework . You could target net451+ in your app but since you want to run it on Linux you would have to use Mono . Unfortunately there are problems with Mono github.com dotnet corefx issues 9012 https : github.com dotnet corefx issues 9012 - making it work is hacky at best .. . Answer : Any dependencies of a .NET Core project must also support .NET Core . So if you have a dependency that requires .NET Framework 4 you won t be able to build your new project on .NET Core . You ll have to replace the dependency with one that supports netstandard1.X in order to use it in a .NET Core project .", "Question : is not available in .net-core so the question is about the alternative of this namespace . I need to read the file content for upload on server . in version 4.5 of .net i was doing like HttpPostedFile file Request.Files content but now this is not working in .net-core . I need to know if there is any alternative of best example of file uploading in .net-core please share . following is my old code . Comment : What middleware are you using From the docs : ASP.NET Core has a number of architectural changes that result in a much leaner and modular framework . ASP.NET Core is no longer based on System.Web.dll . It is based on a set of granular and well factored NuGet packages . This allows you to optimize your app to include just the NuGet packages you need . docs.asp.net en latest intro.html https : docs.asp.net en latest intro.html Comment : Possible duplicate of How to get HttpContext.Current in ASP.NET Core http : stackoverflow.com questions 38571032 how-to-get-httpcontext-current-in-asp-net-core .. . Answer : If you are using ASP.NET Core and enctype multipart form-data form then for reading uploaded file use IFormFile var file Request.Form.Files fileUpload and its CopyTo CopyToAsync or OpenReadStream methods https : docs.asp.net projects api en latest autoapi Microsoft AspNetCore Http IFormFile .", "Question : I ve read that the .NET 5 Core framework library which has been open-sourced yesterday is not a superset of the .NET 4.5.x framework . It will only feature around 10 of the framework library . What are the exact differences I couldn t find a comparison chart . Comment : to the close-voter - how is this question asking us to recommend or find a book tool software library tutorial or other off-site resource IMHO it is a perfectly valid .NET question . Comment : D.R . where did you read that Comment : @chiccodoro : Major german IT news site : heise.de newsticker meldung http : www.heise.de newsticker meldung Microsoft-NET-wird-zur-Cross-Entwicklungsplattform-2454712.html .. . Answer : Microsoft dotnet - GitHub https : github.com Microsoft dotnet : .. . .. . .NET Core and the .NET Framework have for the most part a subset-superset relationship . .NET Core is named Core since it contains the core features from the .NET Framework for both the runtime and framework libraries . For example .NET Core and the .NET Framework share the GC the JIT and types such as String and List . We ll continue improving these components for both .NET Core and .NET Framework . .NET Core is Open Source http : blogs.msdn.com b dotnet archive 2014 11 12 net-core-is-open-source.aspx : .. . .. . Consider the subset we have today a down-payment on what is to come . Our goal is to open-source the entire .NET Core library stack by Build 2015 . But it s not meant as a total replacement of .NET 4.5 and its predecessors yet . It will ultimately offer a lot of the same functionality as what we have now with .NET but then entirely open-source . Meanwhile .NET 4.6 is in the making . Core will however really form the core and other namespaces will be imported on-demand using NuGet packages . Comment : Doesn t to open-source the entire .NET Core library stack mean that they haven t yet open-sourced the Core completely by now but will do so in the near future How do you deduce that this means that the rest of the .NET Framework will be open-sourced ported to 5.0 as well Comment : You re right not the entire .NET stack as we know it will be open-sourced . There were things about WCF and WPF for example but I can t find links to where I read about those .", "Question : Could someone explain to me what is the current relationship between Mono and the open-source Linux portable .NET stack CoreCLR CoreFX Roslyn ASP.NET recently made available by Microsoft It s rather clear these projects overlap so I m curious what s the roadmap for both of them - will Mono somehow replace their own component with the new ones from Microsoft or are they going to coexist somehow .. . Answer : I think the answer may evolve over time but I understand Microsoft and the Mono Project will work together or at least Microsoft will allow Mono to work with their open-source .Net stack . http : www.mono-project.com docs about-mono releases 4.0.0 .. . .. . While Microsoft is working towards .NET Core : a redistributable and re-imagined version of .NET the project remains a work in progress . Mono at this point continues to provide an API that tracks the .NET desktop server version . .. . This means that most of the code that we have integrated comes from the ReferenceSource drop . In the future we will deliver a Mono Core along the same lines of .NET Core to allow the use of the Mono runtime with the new library distribution system that is being developed with CoreFX . And Miguel de Icaza CTO and Co-founder of Xamarin and founder of the Mono project has commented that : .. . .. . http : tirania.org blog archive 2014 Nov-12.html .. . .. . .NET is being open sourced under the MIT license . Not only is the code being released under this very permissive license but Microsoft is providing a patent promise to ensure that .NET will get the adoption it deserves . And for the two projects in particular : .. . .. . Mono will be able to use as much a it wants from this project . .. . .. . .. . .. . Microsoft has stated that they do not currently plan on taking patches back or engaging into a full open-source community style development of this code base as the requirements for backwards compatibility on Windows are very high .", "Question : I see the following in almost every future .NET framework discussion : .. . .. . .NET Framework 4.6 Full .Net framework .. . .NET Native .. . .NET Core .. . .. . What is the difference between all of these How do I know when to use the appropriate one Comment : This will be an interesting read for you : blogs.msdn.com b dotnet archive 2014 12 04 http : blogs.msdn.com b dotnet archive 2014 12 04 introducing-net-core.aspx Comment : blogs.msdn.microsoft.com dotnet 2014 12 04 introducing-net-core https : blogs.msdn.microsoft.com dotnet 2014 12 04 introducing-net-core .. . Answer : After going through various links and videos I found an interesting picture as a whole : .. . .. . .NET Framework 4.6 .Net Native and .NET Core http : i.stack.imgur.com GQVQJ.png .. . .. . From the above we could easily deduce the following : .. . .. . .NET Framework 4.6 is a full framework for everything related to .NET but lacks libraries runtime optimized for multi-platform Windows Linux and Mac and cloud deployments .. . .NET Core on the other hand is a subset of .NET Framework 4.6 which is mainly optimized for multi-platform and cloud deployments .. . .NET Native is mainly used to develop Universal Apps which will be quite optimized to run on any device and platform natively not for the web apps though .. . .. . An interesting point is ASP.NET : .. . .. . If we need backward compatibility to the fullest extent say web forms or aspx support we need to go with .NET Framework 4.6 .. . If we develop MVC Web API or Razor web pages then we can deploy those web apps either in .NET Framework 4.6 or .NET Core environment Comment : I m going to develop my website using MVC Razor angular js and SignalR so Can I use .Net Core One more thing I will use Azure cloud-hosting . Comment : @Chandru - that is a new question it seems : Comment : @Chandru - SignalR is on the To-Do list of .Net Core team . Unfortunately not implemented till the time of this comment .", "Question : I have updated my project from .NET 4.5 to .NET Core with ASP.NET Core . I had some very simple code in my previous version that used the bitmap object from System.Drawing to resize an image . As I understand System.Drawing cannot be used in .NET Core because it is not cross-platform but what can be used instead I have googled this and cannot find anything . The only thing I can find is this https : github.com imazen Graphics-vNext post which has no code on it what so ever . Comment : Found this http : imageresizing.net on the github you linked . Helpful Comment : Possible duplicate of Resize images with MVC 6 on Ubuntu running ASP.NET 5 on Mono http : stackoverflow.com questions 36643720 resize-images-with-mvc-6-on-ubuntu-running-asp-net-5-on-mono Comment : To my understanding the .NET Core team is still discussing this with the Xamarin team . Xamarin built a library called SkiaSharp which is a wrapper for the cross-platform Skia library which again is the graphic library of Google Chrome . It runs under Android iOS Linux Windows etc . which would make it a perfect match for .NET Core . But as of today they have not finished it for .NET Core blog.xamarin.com cross-platform-2d-graphics-with-skiasharp https : blog.xamarin.com cross-platform-2d-graphics-with-skiasharp . My bets go that this library will be the future story for .NET Core and drawing . Comment : Questions asking us to recommend or find a book tool software library tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam . Instead describe the problem and what has been done so far to solve it . Comment : Add more facts to assist @Thomas SkiaSharp can be dated back to 2012 as part of XobotOS http : corefx.strikingly.com . Xamarin made it available recently so it can be used individually or used as the basis for future 2D rendering framework such as System.Drawing on SkiaSharp instead of GDI+ libgdiplus . .NET Core support is tracked in github.com mono SkiaSharp issues 20 https : github.com mono SkiaSharp issues 20 .. . Answer : System.Drawing.Primitives is available from ASP.NET Core RC2 and above . It can be referenced as below but it gives you a few very basic types and no image-manipulation types . See announcements made here https : blogs.msdn.microsoft.com dotnet 2016 02 10 porting-to-net-core and here https : blogs.msdn.microsoft.com dotnet 2016 05 16 announcing-net-core-rc2 . The full System.Drawing package is not available for .NET Core but is for the full .NET Framework . You can target the full .NET framework and not .NET Core like so : Comment : That simply disables .NET core . Comment : Yes it s the only current way to use System.Drawing . Comment : The question is specifically asking about .NET Core . Comment : System.Drawing is now available for .NET Core . See updated answer . Comment : @J r meM vel I believe I have answered your question with full references . You asked but what can be used instead 1 . For .NET Core it s not fully supported but you can add System.Drawing.Primitives for basic support . 2 . You can use the full .NET framework to use it . Now you are asking about a RC2 project but there are two types in the File- New Project window one targeting .NET Core and the other the full .NET 4.6.1 .", "Question : This question already has an answer here : .. . .. . Parse and modify a query-string in .NET Core questions 29992848 parse-and-modify-a-query-string-in-net-core 2 answers .. . .. . I am developing a simple app to consume a web API using this new fantastic .Net core framework . In one of my previous projects I use HttpUtility.ParseQueryString to parse the query-string . But I couldn t find any reference to this method in new Asp.Net core RC2 assemblies and packages . It may happen that there is new method available which I don t know yet . I my current project I have referenced following packages- .. . .. . Is there any other package that I need to reference in order to access this Method Comment : Thanks Tom that is helpful .. . Answer : ASP.NET Core has a number of architectural changes that result in a much leaner and modular framework . ASP.NET Core is no longer based on System.Web.dll . It is based on a set of granular and well factored NuGet packages . Introduction to ASP.NET Core https : docs.asp.net en latest intro.html why-build-asp-net-core .. . .. . Now you can find it in the Microsoft.AspNetCore.WebUtilities assembly with the signature : Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery https : docs.asp.net projects api en latest autoapi Microsoft AspNetCore WebUtilities QueryHelpers meth-Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery", "Question : null .. . Answer : I am having a solution with two projects Asp.net core .net-core and asp.net-core .net framework . Now I want to create a project that will have common models between these two . I ve created a third project of type portable-class-library that supports asp.net-core-1.0 and .net framework 4.6 . After referencing this project I am getting a following error when trying to build asp.net-core on .net framework project : The type Directory exists in both System.IO.FileSystem ... . and mscorlib . I tried to use extern alias but there is no option like that . Anyway why it doesn t work out of the box Comment : .Net Core is a modular subset of the .Net framework . Meaning they shared many classes . I m pretty sure they aren t made to be used in the way you specify", "Question : Could someone explain to me what is the current relationship between Mono and the open-source Linux portable .NET stack CoreCLR CoreFX Roslyn ASP.NET recently made available by Microsoft It s rather clear these projects overlap so I m curious what s the roadmap for both of them - will Mono somehow replace their own component with the new ones from Microsoft or are they going to coexist somehow .. . Answer : From a Mono contributor on reddit : http : www.infoq.com news 2015 05 Mono-4-RTM .. . .. . I think people have the wrong mindset about this whole Mono CoreCLR situation . Why should one VM becoming open-source and being ported to other OSs mean that another VM can t exist It d be like saying that there should only be one Python implementation or one JVM . That is not a good thing . Competition is healthy . .. . Mono happens to have a lot of features that CoreCLR doesn t : LLVM full AOT NaCl tasklets cross-VM GC bridge various profiler modules etc . Mono s startup time and runtime memory-footprint are also optimized for platforms devices that CoreCLR isn t at least presently even targeting . OTOH CoreCLR has a more mature GC and generally better code generation hence the slower startup time . The two VMs are good at different things and there is no reason both cannot exist . .. . It s not like we insist on keeping our own code either . We re happy to switch to CoreCLR reference source code when there are clear benefits to doing so less maintenance more correct still portable enough . We ve imported tons of reference source code already and we re also importing certain parts of the CoreCLR VM : .. . https : github.com mono mono blob master mono metadata decimal-ms.c .. . https : github.com mono mono blob master mono metadata threadpool-ms.c .. . .. . From a .NET member on HN : https : news.ycombinator.com item id 9922558 .. . .. . The core framework libraries CoreFX - https : github.com dotnet corefx - are used for all .NET Core scenarios including .NET Native UWP . This means that your code does the same thing in all of these different environments since it s using the same underlying framework libraries . Separately the Mono project is taking a lot of the same code which means that the base framework for Xamarin apps are becoming more compatible with CoreFX too . Yeahh We hope to make this more formal in the future . We talk to @migueldeicaza about this frequently . Basically there s a lot of code sharing happening between them and I wont be surprised if they converge in future . Now that since MS has acquired Xamarin I dont think they will be terribly interested in maintaining two runtimes .", "Question : I see the following in almost every future .NET framework discussion : .. . .. . .NET Framework 4.6 Full .Net framework .. . .NET Native .. . .NET Core .. . .. . What is the difference between all of these How do I know when to use the appropriate one Comment : This will be an interesting read for you : blogs.msdn.com b dotnet archive 2014 12 04 http : blogs.msdn.com b dotnet archive 2014 12 04 introducing-net-core.aspx Comment : blogs.msdn.microsoft.com dotnet 2014 12 04 introducing-net-core https : blogs.msdn.microsoft.com dotnet 2014 12 04 introducing-net-core .. . Answer : .NET Framework v4.6 -- The full framework that can only run on Windows . However because this is the full framework that means you get WCF WPF and all functionality . You can think of this as your normal .NET Windows development that you re probably doing today . It does include ASP.NET WebForms MVC Core and SignalR . If you re using .NET 4.5 today this is your next natural upgrade path . .NET Core -- A subset framework that doesn t include everything in the full 4.6 Framework . However it is intended to run cross-platform on Windows Mac or Linux . You do lose some functionality however such as WCF WPF . But you ll still have ASP.NET Core no WebForms but not SignalR yet . SignalR support is intended to come in a later version . This uses the dotnet CLI command-line interface for compiling applications or if you re on Windows then you can use Visual Studio . .NET Native -- Native compilation of the .NET Core framework . Instead of doing normal JIT compiling at runtime of your .exe this will do an AOT compilation https : en.wikipedia.org wiki Ahead-of-time compilation that can potentially do some better optimizations of your code using the C++ backend compiler http : blogs.microsoft.co.il sasha 2014 04 28 net-native-performance-internals or LLVM using LLILC https : github.com dotnet llilc blob master Documentation Background.md . When you do this you are targeting a specific platform such as Linux 64-bit . The benefits are quicker start-up times potentially smaller memory requirements hopefully better runtime performance and emits only one single binary file you won t need to install the .NET Framework on the target machine . The tradeoff however is portability to other platforms--you ll have separate binaries for Linux MacOS Windows 32-bit 64-bit etc . This currently only works for Windows Store apps but more work is being done so it ll work on normal .NET apps including ASP.NET apps . Currently not slated to be part of the .NET Core 1.0 release . ASP.NET Core -- The new way of doing web development on .NET Core or Full Framework . It includes a customizable HTTP pipeline Kestrel web server and better performance http : web.ageofascent.com asp-net-core-exeeds-1-15-million-requests-12-6-gbps profiles than the previous ASP.NET 4.x version . This is cross-platform compatible across both the full framework and the Core framework . It does not include WebForms or SignalR support yet https : github.com aspnet Home wiki Roadmap . It is not backwards compatible with ASP.NET 4 although if you re using MVC WebAPI now then MVC WebAPI going forward should be fairly close since there will only be one Controller class . If you re wanting to use WebForms then you have no choice but to stick with the full 4.6 Framework . Entity Framework Core -- The new framework for ORM development . Once called EF7 it is the cross-platform ORM framework that works for both the full 4.6 stack and also the new Core stack . It is not backwards compatible with EF6 . It only supports a code-first model . There may be tooling in the future to help upgrade existing EF6 .edmx files to generate the classes for code-first EFCore implementation . TLDR : If it s Core it s a subset of functionality so it can be ran cross-plat . Anything you can run on Core can be ran on the full 4.6 framework for Windows .", "Question : I m confused on the distinction between these terms : .. . .. . ASP.NET 5 now renamed ASP.NET Core and released as 1.0 not 5.0 .. . ASP.NET Core 5 .. . .NET Core .. . .. . Can anyone briefly explain it .. . Answer : ASP.NET 5 is a new platform based on DNX .NET Execution Environment . DNX is on duty for loading CLR . There re two kind of DNX now : for Full .NET CLR from .NET Framework and for CoreCLR . CoreCLR is a new cross-platform light CLR runs on Win Linux Mac . ASP.NET 5 works seamlessly on CLR CoreCLR as DNX abstracts it from runtime being used . IL assemblies build for old .NET still be used with new CoreCLR and DNX . So ASP.NET 5 functionality is a bunch of nuget packages . Strictly speaking there re no such things as asp.net-core 5 and .net-core now as CLR .NET . There s ASP.NET 5 running on CoreCLR . IMO it s better to consider ASP.NET 5 as .NET 5 . Comment : There s .NET Core . There s .NET 4.6 full framework as well as smaller .NET Core 5 framework . .NET Core CoreCLR runtime + CoreFX base libraries . Comment : If you mean that what is now called .NET Core 1.0 will be the future of all of .NET and not just then yes I agree with you but it may be a very long time before we see winforms or wpf or any other desktop GUI toolkit for .Net Core though . .NET 4.6 is a mature desktop AND web platform and .NET Core 1.0 is clearly NOT a desktop platform . On the web side .NET core is a 1.0 release production ready yet immature .", "Question : Is there a strong reason why Microsoft chose not to support AppDomains in .NET Core 5 upcoming version of .NET CLR v4.6 AppDomains are particularly useful when building long running server apps where we may want to update the assemblies loaded by the server is a graceful manner without shutting down the server . Without AppDomains how are we going to replace our assemblies in a long running server process AppDomains also provide us a way to isolate different parts of server code . Like a custom websocket server can have socket code in primary appdomain while our services run in secondary appdomain . Without AppDomains the above scenario is not possible . I can see an argument that may talk about using VMs concept of Cloud for handling assembly changes and not having to incur the overhead of AppDomains . But is this what Microsoft thinks or says or they have a specific reason and alternatives for the above scenarios Comment : But .NET Core 5 is not .NET Framework . It s not upcoming version of .NET CLR 4.6 but another separate thing then don t worry AppDomain is here to stay . Comment : I see that but if Microsoft is claiming that .NET Core 5 is going to be multi platform Windows Linux Unix then I m curious about why they want to remove a core feature like AppDomain . Comment : I guess but it s just my opinion they re harder to implement in a multi-platform manner they slow down many things and add complexity . Not so many people uses them at least most people doesn t do it directly . If you don t need them you may use .NET Core . If you need them...don t use it think ReFS vs NTFS . Simply .NET Core isn t .NET future so far but a separate project . Maybe a workbench but for sure not a migration path or 1 : 1 alternative at least now . Comment : @AdrianoRepetti : Consider adding this as an answer since I think it is useful as such . Comment : @PatrickHofman it s just my opinion 2nd comment I could answer as community wiki but I leave this duty to someone with a more fluent English .. . Answer : First I need to tell that absence of AppDomain has nothing with size . .NET Core is not meant to be installed as a full package anyway as .NET Framework is but only parts needed so the size of particular packages does not play role here . Nevertheless if you need a package you will use it no matter it s size . The main purpose of .NET Core DNX is to be truly multi-platform and to run not only on Windows but also Linux.. . Once we understand that it becomes obvious why there s no AppDomain : Application domains are exclusively Windows concept and there s no similar thing in other OS . For example in Linux there is process but nothing like application domain within the process . So it does not make any sense to develop abstractions on something that does not exist in the first place . AppDomain as many other Windows-specific APIs for example WMI will not be part of .NET Core DNX-like platforms . Hopefully all the other APIs will be implemented in core sunner or later so that they can be used by apps running on other OS even if this will cause download sizes above 6.6 MB Comment : I dont think this reason is valid Application Domain is a concept created by .NET framework and is not bound to the OS so it could be implemented in some kind of way in Linux as Well seems that there are should be another reason for killing this concept and maybe replaced by another similar feature or simply declared it as obsoleted by starting the docker concept ." ] }
[ "yes-answer-long", "yes-answer-short" ]
osx
UNK_RELATION
antixsslibrary@web@82
antixsslibrary -- the antixss library is a .net-assembly provided as part of the @placeholder protection library a microsoft open-source project .
{ "confidence": [ 51.233036041259766, 39.902374267578125, 37.12519836425781, 37.12519836425781, 32.65044403076172, 31.475814819335938, 30.853662490844727, 30.32928466796875, 30.203083038330078, 29.16164207458496, 28.876850128173828, 27.4492244720459, 27.42848014831543, 27.295513153076172, 26.284542083740234, 25.04839324951172, 24.76773452758789, 24.588871002197266, 23.905017852783203, 23.36447525024414, 22.632286071777344, 22.448698043823242, 21.969646453857422, 21.672039031982422, 19.046653747558594, 18.973468780517578, 18.357269287109375, 18.066059112548828, 17.920894622802734, 17.920894622802734, 17.61507225036621, 17.370590209960938, 16.9187068939209, 16.828752517700195, 16.828752517700195, 16.40667152404785, 16.071182250976562, 15.9425687789917, 15.643014907836914, 15.005125045776367, 14.906778335571289, 14.459153175354004, 14.410072326660156, 13.655054092407227, 13.215757369995117, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 12.597925186157227, 11.355135917663574, 11.355135917663574, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684, 11.325194358825684 ], "content": [ "AntiXSS in fact is a part of the Web Protection Library .", "I ve also tried each version of the AntiXssLibrary in my project I only have the following AntiXss Encoder UnicodeCharacterEncoder", "Currently I ve tried the AntiXSS library from MS .", "The AntiXss library is meant to be a tool to be used not a substitute for knowledge .", "I came across ANtiXSS library does it provide the one I need .", "You are conflicting your asp.net validation with a dangerous input though it comes via antixss library .", "http : stackoverflow.com questions 1608854 what-is-the-difference-between-antixss-htmlencode-and-httputility-htmlencode .. . .. . I suggest you evaluate your options with the antixss library html-encode .", "I use AntiXSS but I still can hack page http : stackoverflow.com questions 14612875 i-use-antixss-but-i-still-can-hack-page .. . ValidateRequest false doesn t work in Asp.Net 4 http : stackoverflow.com questions 2673850 validaterequest-false-doesnt-work-in-asp-net-4 .. . Why use Microsoft AntiXSS library", "I just ran across a question with an answer suggesting the AntiXss library to avoid cross site scripting .", "http : stackoverflow.com questions 2022289 why-use-microsoft-antixss-library .. . A potentially dangerous Request.Form value was detected from the client textboxError Responses Response.. . http : stackoverflow.com questions 17591429 a-potentially-dangerous-request-form-value-was-detected-from-the-client-textbox .. . HttpUtility.HtmlEncode HttpUtility.HtmlDecode the AntiXSS library and correctly formatting user-entered input http : stackoverflow.com questions 15131855 httputility-htmlencode-httputility-htmldecode-the-antixss-library-and-correctl .. . Filtering Encoded XSS in Classic ASP http : stackoverflow.com questions 7598783 filtering-encoded-xss-in-classic-asp", "In terms of why you d use one over the other consider that the AntiXSS library gets released more often than the ASP.NET framework - since someone is always trying to think of new ways of breaking in when someone does come up with one the AntiXSS library is more likely to get an updated release to defend against it .", "Normally I would turn to the Microsoft Web Protection Library http : wpl.codeplex.com however in this case I am developing an application running in minimal trust .", "Attack value : - uff1cinput onclick alert 1 uff1e .. . .. . uff1c uff1e .. . .. . I know Antixss library can be used to resolve the issue.But anybody can show a sample code on how to implement Antixss for input filtering and output encoding Please suggest a solution for this .", "While I am not content that all any of the refactormycode submissions are anywhere as tight secure as the Microsoft Web Protection Library implementation I did ultimately adapt one of them for my project so the answer goes to you .", "While saving to the database use antixss GetSafeHtmlFragment method to sanitize your input .", "Also the newer version of the AntiXss library has a nice new function : .GetSafeHtmlFragment which is nice for those cases where you want to store HTML in the database and have it displayed to the user as HTML .", "AntiXss WPL is now end-of-life .", "In terms of why you d use one over the other consider that the AntiXSS library gets released more often than the ASP.NET framework - since as David Stratton says someone is always trying to think of new ways of breaking in when someone does come up with one the AntiXSS library is much more likely to get an updated release to defend against it .", "Also please note that antixss version 4.2.1 is known for strict escaping http : wpl.codeplex.com releases view 80289 RateReview true .", "Now the point of using an antixss library is when you have a situation like what you have now - take user input as such with potentially dangerous input save it somewhere and display it back to the user - you need to turn of ASP.Net s Validate Request .", "Are there examples of cases where the AntiXss implementation would prevent an attack that the HttpUtility implementation would not", "Use antixss I would prefer Html Agility pack though before saving to your database and use HtmlEncode before displaying in the html context of the page .", "Found this library in a reply http : stackoverflow.com a 19022242 2059308 elsewhere : .. . .. . HtmlSanitizer a .NET library for cleaning HTML fragments from constructs that can lead to XSS attacks .", "This is the current library I m using there is no sanitize method .", "Note : I have restricted it through the AntiXss and Sanitizer but when i am using the Sanitizer the Script is neglected by the Sanitizer Can any one give me a solution to display the script as a text should avoid the execution of the script too .", "This is what I would suggest without knowing more details : AntiXSS 4.0 released 10 5 2010 : http : www.microsoft.com download en details.aspx id 5242 .. . .. . In the following post I demonstrate how to execute a simple XSS but you ll notice that it only works in .Net 2.0 projects .", "Unfortunately this library seems to be useless in its current state .", "I m trying to Use Microsoft AntiXss.HtmlEncode while merging html tags with server-side-scripting .", "Sounded interesting reading the msdn blog http : msdn.microsoft.com en-us library aa973813.aspx it appears to just provide an HtmlEncode method .", "Relying on the library to do it right for you would be expecting a really good paintbrush to turn out good paintings without a good artist .", "Anti-XSS uses the white-listing technique sometimes referred to as the principle of inclusions to provide protection against Cross-Site Scripting XSS attacks .", "You can use a js library to encrypt client-side with the public-key and decrypt server-side with the private key .", "This is strange I do not see the Sanitizer class I ve looked in the Assembly Explorer Object Browser and using the auto complete .", "I don t care so much about the performance of 0.1ms and I don t really feel like downloading and adding another library dependency for functionality that I already have .", "Anti-XSS library has been designed specially to mitigate XSS attacks whereas HttpUtility encoding methods are created to ensure that ASP.NET output does not break HTML .", "Default.aspx .. . .. . Default.aspx.cs .. . .. . I keep getting the following warning in my project : .. . .. . Microsoft.Security.Application.AntiXss.HtmlEncode string is obsolete : This method has been deprecated .", "Rick Strahl has a sample implementation with Html Agility Pack here - http : weblog.west-wind.com posts 2012 Jul 19 NET-HTML-Sanitation-for-rich-HTML-Input .", "And indeed Google turns up some http : blogs.msdn.com dansellers archive 2006 02 23 538187.aspx answers http : blogs.msdn.com securitytools archive 2009 07 09 differences-between-antixss-htmlencode-and-httputility-htmlencode-methods.aspx mainly .. . .. . A white-list instead of black-list approach .. . A 0.1ms performance improvement .. . .. . Well that s nice but what does it mean for me", "Also as for the bug if you re coding properly and following all the security guidelines you re using parameterized stored-procedures so the single quotes will be handled correctly If you re not coding properly no off the shelf library is going to protect you fully .", "Can you explain more about your project", "Part of the WPL requires medium trust and the rest seems to require full trust .", "I use AntiXss Encoder on serverside for XSS atacks so all response includes html unescape characters like lt : script gt : alert 1 lt : script gt : replaced as : .. . .. . on binding i use sanitize with ng-bind-html there is no problem wih that .", "I am working on a project that requires some HTML sanitization .", "So I was wondering if is this project active", "Project site : https : github.com mganss HtmlSanitizer", "I am trying to avoid an cross side scripting in my Application but my requirement is i have to save the data including the script to my database but when displaying the same data it it should be visible as a text not as a script for eg : .. . .. . Step 1 : i have a textbox in a website i am trying to inject through the below code as .. . .. . test data alert Malicious Code .. . .. . Step 2 : i am saving the exact content of the text in my db note the validateRequest is set to false .", "Step 3 : Then i am dispaying the content in the web page that time the script should not execute .", "In your case .. . .. . They are not supposed to work together .", "Validate Request true is the ASP.Net security mechanism .", "It is intended to safeguard you from XSS attacks by filtering using heuristics or white list I am not sure potentially dangerous tags in the input .", "For instance if you create an ASP.Net application and if Validate Request true and when you try to input a query-string parameter like .. . .. . you are gonna get A potentially dangerous Request.Form value was detected from the cliet. . blah blah blah .", "That is Validate Request true in action either set at page level or web.config .", "And by doing that you are telling ASP.Net to leave the security of the web application to you .", "And you are responsible for handling XSS vulnerabilities not ASP.Net .", "While displaying the content to the user that has vulnerabilities you have to HTML Encode it to the context .", "For example if you are going to output the potentially dangerous string in a javascript css or html then you have to encode it according to javascript css or html encoding .", "More information - What is the difference between AntiXss.HtmlEncode and HttpUtility.HtmlEncode", "But your solution here is to turn off Validate Request .", "Be sure to read through the below questions for solid understanding and correct implementation .", "I have developed an application in Asp.net mvc 5.I am facing cross site scripting issues with Full width unicode characters .", "Possible duplicate of Anti XSS and Classic ASP http : stackoverflow.com questions 725875 anti-xss-and-classic-asp", "Oliver my Question is different.How to protect the site from Fullwidth character xss .", "Please use Encoder.HtmlEncode instead .", "It is just a warning do you think it will make any security issues in the future", "Jeff Atwood s sanitizer is here http : refactormycode.com codes 333-sanitize-html And a C Sanitizer that works better based on my limited testing is here http : roberto.open-lab.com 2010 03 04 a-html-sanitizer-for-c I took the c and converted to vbnet and am using it a project now and it seems to catch html and javascript i dont want getting through .", "I m making and setting AntiXssEncoder for my web project which uses mvc3 and .net4 and I ve done these steps : .. . .. . add AxtiXSSLibrary reference .. . create AntiXSSEncoder derived from HttpEncoder .. . override the HtmlEncode method : output.Write Encoder.HtmlEncode value .. . set encoderType in web.config to httpRuntime encoderType AntiXSSEncoder MyDll .. . .. . But I still can see the alert popup by xss input XssTest script alert test script .", "I m current trying to secure my site from XSS attacks in the Url .", "For example if the attacker is using Firefox they can do the following .. . .. . And the script will be run .", "I ve been searching around for a couple days now and can t seem to find a solution that works .", "I don t think it s working correctly I m encoding the whole url like so .. . .. . I ve tried all the other methods in this class as well and the script is still being executed before the page loads .", "I m using ASP.net 3.5 with Webforms and I can t upgrade .", "owasp.org index.php https : www.owasp.org index.php Testing for Reflected Cross site scripting OTG-INPVAL-001", "To provide a complete answer it s necessary to see where and how exactly you re using the encoded value .", "The encoded path is then sent to app.Context.RewritePath which returns to the Init method of the IHttpModule class .", "XSS only occurs when you insert malicious content into a Web page .", "Where is this occurring", "as stated in the initial question it s occurring in the firefox url .", "https : www.microsoft.com en-us download details.aspx id 28589 .. . .. . they have this dll that basically all you need to do is use the sanitize method and if there is a change between the original value and the sanitized value that means that there might be an attempt for XSS and you either throw it all or just use the sanitized value .", "dont use any encoding method there is a method called something with sanitize .", "EDIT : code example .. . .. . EDIT 2 : https : www.nuget.org packages HtmlSanitizationLibrary .. . .. . the dll i am using is HtmlSanitizationLibrary.dll", "edited code example", "you re right the dll is HtmlSanitizationLibrary.dll my bad added new link", "awesome got it thanks", "But I already use HttpUtility.HtmlEncode .", "Why would I want to use AntiXss.HtmlEncode over HttpUtility.HtmlEncode", ".. . .. . Indeed I am not the first to ask this question .", ".. . .. . If I continue to use the HttpUtility implementation am I at risk", "What about this bug http : connect.microsoft.com VisualStudio feedback ViewFeedback.aspx FeedbackID 252514", "I don t have an answer specifically to your question but I would like to point out that the white list vs black list approach not just nice .", "It s important .", "Very important .", "When it comes to security every little thing is important .", "Remember that with cross-site scripting and cross-site request forgery http : www.codinghorror.com blog archives 001175.html even if your site is not showing sensitive data a hacker could infect your site by injecting javascript and use it to get sensitive data from another site .", "So doing it right is critical .", "OWASP guidelines specify using a white list approach http : www.owasp.org index.php SQL Injection Prevention Cheat Sheet White List Input Validation .", "PCI Compliance guidelines also specify this in coding standards since they refer tot he OWASP guidelines .", "Edit - Added .. . .. . As asked in the question an example of where the anti xss will protect you and HttpUtility will not : .. . .. . HttpUtility.HtmlEncode and Server .", "HtmlEncode do not prevent Cross Site Scripting http : caught-in-a-web.blogspot.com 2007 01 httputilityhtmlencode-and-server.html .. . .. . That s according to the author though .", "I haven t tested it personally .", ".. . .. . It sounds like you re up on your security guidelines so this may not be something I need to tell you but just in case a less experienced developer is out there reading this the reason I say that the white-list approach is critical is this ." ] }
{ "confidence": [ 47.17986297607422, 46.45598220825195, 43.40671157836914, 36.60342025756836, 36.399757385253906, 35.66762161254883, 35.3138542175293, 33.848365783691406, 33.12190246582031, 33.12190246582031, 27.81053924560547, 27.040191650390625, 20.722537994384766, 17.307130813598633, 13.354961395263672, 11.323556900024414, 11.243668556213379 ], "content": [ "Question : I am working on a project that requires some HTML sanitization . Normally I would turn to the Microsoft Web Protection Library http : wpl.codeplex.com however in this case I am developing an application running in minimal trust . Part of the WPL requires medium trust and the rest seems to require full trust . Can anyone suggest a good HTML sanitizer that can operate in a minimal trust environment .. . Answer : Can you explain more about your project Like what framework are you in This is what I would suggest without knowing more details : AntiXSS 4.0 released 10 5 2010 : http : www.microsoft.com download en details.aspx id 5242 .. . .. . In the following post I demonstrate how to execute a simple XSS but you ll notice that it only works in .Net 2.0 projects . Once you re above that certain security measures are taken on your behalf and it will warn anytime unsafe text is put into user input fields . http : mdukehall.wordpress.com 2011 11 03 intro-to-xss-for-web-developers .. . .. . Here is an alternative blog on it : .. . .. . http : jimbojw.com wiki index.php title Sanitizing user input against XSS Comment : Thank you Mike . AntiXSS in fact is a part of the Web Protection Library . I m not especially interested in the framework . Anything v2.0 on up will do . Comment : OWASP has the other thing I came across for XSS : owasp.org index.php ESAPI https : www.owasp.org index.php ESAPI Comment : Security Ninja did 3 posts on implementing ESAPI starting here : securityninja.co.uk application-security http : www.securityninja.co.uk application-security input-validation-using-the-owasp-esapi Comment : Thanks Mike . This was all good reading however it does not address my need . I am interested in sanitizing HTML rather than encoding HTML . While these articles serve well to show some Anti-XSS solutions they do not deal with my scenario . You have my vote anyway for providing such useful references .", "Question : I m current trying to secure my site from XSS attacks in the Url . For example if the attacker is using Firefox they can do the following .. . .. . And the script will be run . I ve been searching around for a couple days now and can t seem to find a solution that works . Currently I ve tried the AntiXSS library from MS . I don t think it s working correctly I m encoding the whole url like so .. . .. . I ve tried all the other methods in this class as well and the script is still being executed before the page loads . I m using ASP.net 3.5 with Webforms and I can t upgrade . Comment : owasp.org index.php https : www.owasp.org index.php Testing for Reflected Cross site scripting OTG-INPVAL-001 Comment : To provide a complete answer it s necessary to see where and how exactly you re using the encoded value . Comment : The encoded path is then sent to app.Context.RewritePath which returns to the Init method of the IHttpModule class . Comment : XSS only occurs when you insert malicious content into a Web page . Where is this occurring Comment : as stated in the initial question it s occurring in the firefox url . .. . Answer : https : www.microsoft.com en-us download details.aspx id 28589 .. . .. . they have this dll that basically all you need to do is use the sanitize method and if there is a change between the original value and the sanitized value that means that there might be an attempt for XSS and you either throw it all or just use the sanitized value . dont use any encoding method there is a method called something with sanitize . EDIT : code example .. . .. . EDIT 2 : https : www.nuget.org packages HtmlSanitizationLibrary .. . .. . the dll i am using is HtmlSanitizationLibrary.dll Comment : This is the current library I m using there is no sanitize method . Comment : edited code example Comment : This is strange I do not see the Sanitizer class I ve looked in the Assembly Explorer Object Browser and using the auto complete . I ve also tried each version of the AntiXssLibrary in my project I only have the following AntiXss Encoder UnicodeCharacterEncoder Comment : you re right the dll is HtmlSanitizationLibrary.dll my bad added new link Comment : awesome got it thanks", "Question : I am trying to avoid an cross side scripting in my Application but my requirement is i have to save the data including the script to my database but when displaying the same data it it should be visible as a text not as a script for eg : .. . .. . Step 1 : i have a textbox in a website i am trying to inject through the below code as .. . .. . test data alert Malicious Code .. . .. . Step 2 : i am saving the exact content of the text in my db note the validateRequest is set to false . Step 3 : Then i am dispaying the content in the web page that time the script should not execute . Note : I have restricted it through the AntiXss and Sanitizer but when i am using the Sanitizer the Script is neglected by the Sanitizer Can any one give me a solution to display the script as a text should avoid the execution of the script too . .. . Answer : In your case .. . .. . They are not supposed to work together . You are conflicting your asp.net validation with a dangerous input though it comes via antixss library . Validate Request true is the ASP.Net security mechanism . It is intended to safeguard you from XSS attacks by filtering using heuristics or white list I am not sure potentially dangerous tags in the input . For instance if you create an ASP.Net application and if Validate Request true and when you try to input a query-string parameter like .. . .. . you are gonna get A potentially dangerous Request.Form value was detected from the cliet. . blah blah blah . That is Validate Request true in action either set at page level or web.config . Now the point of using an antixss library is when you have a situation like what you have now - take user input as such with potentially dangerous input save it somewhere and display it back to the user - you need to turn of ASP.Net s Validate Request . And by doing that you are telling ASP.Net to leave the security of the web application to you . And you are responsible for handling XSS vulnerabilities not ASP.Net . While saving to the database use antixss GetSafeHtmlFragment method to sanitize your input . Also please note that antixss version 4.2.1 is known for strict escaping http : wpl.codeplex.com releases view 80289 RateReview true . While displaying the content to the user that has vulnerabilities you have to HTML Encode it to the context . For example if you are going to output the potentially dangerous string in a javascript css or html then you have to encode it according to javascript css or html encoding . More information - What is the difference between AntiXss.HtmlEncode and HttpUtility.HtmlEncode http : stackoverflow.com questions 1608854 what-is-the-difference-between-antixss-htmlencode-and-httputility-htmlencode .. . .. . I suggest you evaluate your options with the antixss library html-encode . But your solution here is to turn off Validate Request . Use antixss I would prefer Html Agility pack though before saving to your database and use HtmlEncode before displaying in the html context of the page . Rick Strahl has a sample implementation with Html Agility Pack here - http : weblog.west-wind.com posts 2012 Jul 19 NET-HTML-Sanitation-for-rich-HTML-Input . Be sure to read through the below questions for solid understanding and correct implementation . I use AntiXSS but I still can hack page http : stackoverflow.com questions 14612875 i-use-antixss-but-i-still-can-hack-page .. . ValidateRequest false doesn t work in Asp.Net 4 http : stackoverflow.com questions 2673850 validaterequest-false-doesnt-work-in-asp-net-4 .. . Why use Microsoft AntiXSS library http : stackoverflow.com questions 2022289 why-use-microsoft-antixss-library .. . A potentially dangerous Request.Form value was detected from the client textboxError Responses Response.. . http : stackoverflow.com questions 17591429 a-potentially-dangerous-request-form-value-was-detected-from-the-client-textbox .. . HttpUtility.HtmlEncode HttpUtility.HtmlDecode the AntiXSS library and correctly formatting user-entered input http : stackoverflow.com questions 15131855 httputility-htmlencode-httputility-htmldecode-the-antixss-library-and-correctl .. . Filtering Encoded XSS in Classic ASP http : stackoverflow.com questions 7598783 filtering-encoded-xss-in-classic-asp", "Question : I just ran across a question with an answer suggesting the AntiXss library to avoid cross site scripting . Sounded interesting reading the msdn blog http : msdn.microsoft.com en-us library aa973813.aspx it appears to just provide an HtmlEncode method . But I already use HttpUtility.HtmlEncode . Why would I want to use AntiXss.HtmlEncode over HttpUtility.HtmlEncode .. . .. . Indeed I am not the first to ask this question . And indeed Google turns up some http : blogs.msdn.com dansellers archive 2006 02 23 538187.aspx answers http : blogs.msdn.com securitytools archive 2009 07 09 differences-between-antixss-htmlencode-and-httputility-htmlencode-methods.aspx mainly .. . .. . A white-list instead of black-list approach .. . A 0.1ms performance improvement .. . .. . Well that s nice but what does it mean for me I don t care so much about the performance of 0.1ms and I don t really feel like downloading and adding another library dependency for functionality that I already have . Are there examples of cases where the AntiXss implementation would prevent an attack that the HttpUtility implementation would not .. . .. . If I continue to use the HttpUtility implementation am I at risk What about this bug http : connect.microsoft.com VisualStudio feedback ViewFeedback.aspx FeedbackID 252514 .. . Answer : In terms of why you d use one over the other consider that the AntiXSS library gets released more often than the ASP.NET framework - since as David Stratton says someone is always trying to think of new ways of breaking in when someone does come up with one the AntiXSS library is much more likely to get an updated release to defend against it .", "Question : I just ran across a question with an answer suggesting the AntiXss library to avoid cross site scripting . Sounded interesting reading the msdn blog http : msdn.microsoft.com en-us library aa973813.aspx it appears to just provide an HtmlEncode method . But I already use HttpUtility.HtmlEncode . Why would I want to use AntiXss.HtmlEncode over HttpUtility.HtmlEncode .. . .. . Indeed I am not the first to ask this question . And indeed Google turns up some http : blogs.msdn.com dansellers archive 2006 02 23 538187.aspx answers http : blogs.msdn.com securitytools archive 2009 07 09 differences-between-antixss-htmlencode-and-httputility-htmlencode-methods.aspx mainly .. . .. . A white-list instead of black-list approach .. . A 0.1ms performance improvement .. . .. . Well that s nice but what does it mean for me I don t care so much about the performance of 0.1ms and I don t really feel like downloading and adding another library dependency for functionality that I already have . Are there examples of cases where the AntiXss implementation would prevent an attack that the HttpUtility implementation would not .. . .. . If I continue to use the HttpUtility implementation am I at risk What about this bug http : connect.microsoft.com VisualStudio feedback ViewFeedback.aspx FeedbackID 252514 .. . Answer : The following are the differences between Microsoft.Security.Application.AntiXss.HtmlEncode and System.Web.HttpUtility.HtmlEncode methods : .. . .. . 1 . Anti-XSS uses the white-listing technique sometimes referred to as the principle of inclusions to provide protection against Cross-Site Scripting XSS attacks . This approach works by first defining a valid or allowable set of characters and encodes anything outside this set invalid characters or potential attacks . System.Web.HttpUtility.HtmlEncode and other encoding methods in that namespace use principle of exclusions and encode only certain characters designated as potentially dangerous such as and characters . 2 . The Anti-XSS Library s list of white or safe characters support more than a dozen languages Greek and Coptic Cyrillic Cyrillic Supplement Armenian Hebrew Arabic Syriac Arabic Supplement Thaana NKo and more .. . .. . 3 . Anti-XSS library has been designed specially to mitigate XSS attacks whereas HttpUtility encoding methods are created to ensure that ASP.NET output does not break HTML . 4 . Performance - the average delta between AntiXss.HtmlEncode and HttpUtility.HtmlEncode is +0.1 milliseconds per transaction . 5 . Anti-XSS Version 3.0 provides a test harness which allows developers to run both XSS validation and performance tests .", "Question : null .. . Answer : I have developed an application in Asp.net mvc 5.I am facing cross site scripting issues with Full width unicode characters . Attack value : - uff1cinput onclick alert 1 uff1e .. . .. . uff1c uff1e .. . .. . I know Antixss library can be used to resolve the issue.But anybody can show a sample code on how to implement Antixss for input filtering and output encoding Please suggest a solution for this . Comment : Possible duplicate of Anti XSS and Classic ASP http : stackoverflow.com questions 725875 anti-xss-and-classic-asp Comment : Oliver my Question is different.How to protect the site from Fullwidth character xss .", "Question : I am working on a project that requires some HTML sanitization . Normally I would turn to the Microsoft Web Protection Library http : wpl.codeplex.com however in this case I am developing an application running in minimal trust . Part of the WPL requires medium trust and the rest seems to require full trust . Can anyone suggest a good HTML sanitizer that can operate in a minimal trust environment .. . Answer : Jeff Atwood s sanitizer is here http : refactormycode.com codes 333-sanitize-html And a C Sanitizer that works better based on my limited testing is here http : roberto.open-lab.com 2010 03 04 a-html-sanitizer-for-c I took the c and converted to vbnet and am using it a project now and it seems to catch html and javascript i dont want getting through . Comment : While I am not content that all any of the refactormycode submissions are anywhere as tight secure as the Microsoft Web Protection Library implementation I did ultimately adapt one of them for my project so the answer goes to you . Thanks", "Question : I just ran across a question with an answer suggesting the AntiXss library to avoid cross site scripting . Sounded interesting reading the msdn blog http : msdn.microsoft.com en-us library aa973813.aspx it appears to just provide an HtmlEncode method . But I already use HttpUtility.HtmlEncode . Why would I want to use AntiXss.HtmlEncode over HttpUtility.HtmlEncode .. . .. . Indeed I am not the first to ask this question . And indeed Google turns up some http : blogs.msdn.com dansellers archive 2006 02 23 538187.aspx answers http : blogs.msdn.com securitytools archive 2009 07 09 differences-between-antixss-htmlencode-and-httputility-htmlencode-methods.aspx mainly .. . .. . A white-list instead of black-list approach .. . A 0.1ms performance improvement .. . .. . Well that s nice but what does it mean for me I don t care so much about the performance of 0.1ms and I don t really feel like downloading and adding another library dependency for functionality that I already have . Are there examples of cases where the AntiXss implementation would prevent an attack that the HttpUtility implementation would not .. . .. . If I continue to use the HttpUtility implementation am I at risk What about this bug http : connect.microsoft.com VisualStudio feedback ViewFeedback.aspx FeedbackID 252514 .. . Answer : I don t have an answer specifically to your question but I would like to point out that the white list vs black list approach not just nice . It s important . Very important . When it comes to security every little thing is important . Remember that with cross-site scripting and cross-site request forgery http : www.codinghorror.com blog archives 001175.html even if your site is not showing sensitive data a hacker could infect your site by injecting javascript and use it to get sensitive data from another site . So doing it right is critical . OWASP guidelines specify using a white list approach http : www.owasp.org index.php SQL Injection Prevention Cheat Sheet White List Input Validation . PCI Compliance guidelines also specify this in coding standards since they refer tot he OWASP guidelines . Also the newer version of the AntiXss library has a nice new function : .GetSafeHtmlFragment which is nice for those cases where you want to store HTML in the database and have it displayed to the user as HTML . Also as for the bug if you re coding properly and following all the security guidelines you re using parameterized stored-procedures so the single quotes will be handled correctly If you re not coding properly no off the shelf library is going to protect you fully . The AntiXss library is meant to be a tool to be used not a substitute for knowledge . Relying on the library to do it right for you would be expecting a really good paintbrush to turn out good paintings without a good artist . Edit - Added .. . .. . As asked in the question an example of where the anti xss will protect you and HttpUtility will not : .. . .. . HttpUtility.HtmlEncode and Server . HtmlEncode do not prevent Cross Site Scripting http : caught-in-a-web.blogspot.com 2007 01 httputilityhtmlencode-and-server.html .. . .. . That s according to the author though . I haven t tested it personally . .. . .. . It sounds like you re up on your security guidelines so this may not be something I need to tell you but just in case a less experienced developer is out there reading this the reason I say that the white-list approach is critical is this . Right now today HttpUtility.HtmlEncode may successfully block every attack out there simply by removing encoding and plus a few other known potentially unsafe characters but someone is always trying to think of new ways of breaking in . Allowing only known-safe white list content is a lot easier than trying to think of every possible unsafe bit of input an attacker could possibly throw at you black-list approach . Comment : Sorry . You hit a sore point with me . You re probably very capable and very good at secure coding . I tend to be a bit um hardcore in my approach to security after inheriting a very insecure web site in dire need of improvements . Comment : Great to have your input David . I am particular about security but never thought about the implementation of HtmlEncode . I want to really understand the impact that the different implementations can have . Comment : Fair enough. . I found an example that you had asked for and included it in my answer above . Comment : In terms of why you d use one over the other consider that the AntiXSS library gets released more often than the ASP.NET framework - since someone is always trying to think of new ways of breaking in when someone does come up with one the AntiXSS library is more likely to get an updated release to defend against it . Comment : @PhilPursglove you should post that as an answer . @g may have already accepted an answer but that s a good enough point that I d give you an upvote on it .", "Question : I just ran across a question with an answer suggesting the AntiXss library to avoid cross site scripting . Sounded interesting reading the msdn blog http : msdn.microsoft.com en-us library aa973813.aspx it appears to just provide an HtmlEncode method . But I already use HttpUtility.HtmlEncode . Why would I want to use AntiXss.HtmlEncode over HttpUtility.HtmlEncode .. . .. . Indeed I am not the first to ask this question . And indeed Google turns up some http : blogs.msdn.com dansellers archive 2006 02 23 538187.aspx answers http : blogs.msdn.com securitytools archive 2009 07 09 differences-between-antixss-htmlencode-and-httputility-htmlencode-methods.aspx mainly .. . .. . A white-list instead of black-list approach .. . A 0.1ms performance improvement .. . .. . Well that s nice but what does it mean for me I don t care so much about the performance of 0.1ms and I don t really feel like downloading and adding another library dependency for functionality that I already have . Are there examples of cases where the AntiXss implementation would prevent an attack that the HttpUtility implementation would not .. . .. . If I continue to use the HttpUtility implementation am I at risk What about this bug http : connect.microsoft.com VisualStudio feedback ViewFeedback.aspx FeedbackID 252514 .. . Answer : Most XSS vulnerabilities any type of vulnerability actually are based purely on the fact that existing security did not expect certain things to happen . Whitelist-only approaches are more apt to handle these scenarios by default .", "Question : I just ran across a question with an answer suggesting the AntiXss library to avoid cross site scripting . Sounded interesting reading the msdn blog http : msdn.microsoft.com en-us library aa973813.aspx it appears to just provide an HtmlEncode method . But I already use HttpUtility.HtmlEncode . Why would I want to use AntiXss.HtmlEncode over HttpUtility.HtmlEncode .. . .. . Indeed I am not the first to ask this question . And indeed Google turns up some http : blogs.msdn.com dansellers archive 2006 02 23 538187.aspx answers http : blogs.msdn.com securitytools archive 2009 07 09 differences-between-antixss-htmlencode-and-httputility-htmlencode-methods.aspx mainly .. . .. . A white-list instead of black-list approach .. . A 0.1ms performance improvement .. . .. . Well that s nice but what does it mean for me I don t care so much about the performance of 0.1ms and I don t really feel like downloading and adding another library dependency for functionality that I already have . Are there examples of cases where the AntiXss implementation would prevent an attack that the HttpUtility implementation would not .. . .. . If I continue to use the HttpUtility implementation am I at risk What about this bug http : connect.microsoft.com VisualStudio feedback ViewFeedback.aspx FeedbackID 252514 .. . Answer : We use the white-list approach for Microsoft s Windows Live sites . I m sure that there are any number of security attacks that we haven t thought of yet so I m more comfortable with the paranoid approach . I suspect there have been cases where the black-list exposed vulnerabilities that the white-list did not but I couldn t tell you the details .", "Question : I know that lot of questions about HTML sanitizers have appeared in SO but I don t know if they do what I want I have a little mess since some of the recommended approaches have more than 4 years old . I have a page with the TinyMCE editor . Of course this editor send HTML to the server and expect HTML so I have created a entity with a String property decorated with the AllowHtml attribute . It works well . Now I want to ensure that nobody tries to send a script-tag or a img onerror or whatever way of execute JS or add CSS that point to external urls . What is the best solution at the moment WPL http : wpl.codeplex.com has the HtmlSanitizationLibrary but how can I know what tags are considered secure WPL has not released anything from last April and it was the beta . So I was wondering if is this project active Cheers . Comment : It s still active . The Sanitizer however well it s languishing these days . As folks have moved to XHTML the sanitizer isn t up to the job and a rewrite isn t on the table . As TinyMCE does produce correct XHTML markup you can use Linq2Xml to query the DOM and sanitize to your hearts content . That s probably a better long term solution and hmm gives me an idea for a blog or two .. . Answer : AntiXss WPL is now end-of-life . Found this library in a reply http : stackoverflow.com a 19022242 2059308 elsewhere : .. . .. . HtmlSanitizer a .NET library for cleaning HTML fragments from constructs that can lead to XSS attacks . Project site : https : github.com mganss HtmlSanitizer", "Question : While making POST request using Jquery Ajax for a controller s action What would be the better to encrypt the URL in the POST request and decrypt at Controller action without involving the SSL . I came across ANtiXSS library does it provide the one I need . Regards Qureshi Comment : Why do you want to do this Comment : I dont think you can actually do this . How would the request know where to go You will be able to encrypt the POST data if needed but ideally you would use SSL even though you have said you dont want to . .. . Answer : Start simple - you can t encrypt the URL but you can encrypt the query-string . I d start with something simple like q value1 value2 value3 and use a simple Base64 encoded value so that the query-string becomes q dmFsdWUxfHZhbHVlMnx2YWx1ZTM . Then you can decode and parse out the values by splitting on a separator like the pipe . If that s not enough then search on public private key encryption . You can use a js library to encrypt client-side with the public-key and decrypt server-side with the private key .", "Question : null .. . Answer : I m trying to Use Microsoft AntiXss.HtmlEncode while merging html tags with server-side-scripting . Default.aspx .. . .. . Default.aspx.cs .. . .. . I keep getting the following warning in my project : .. . .. . Microsoft.Security.Application.AntiXss.HtmlEncode string is obsolete : This method has been deprecated . Please use Encoder.HtmlEncode instead . It is just a warning do you think it will make any security issues in the future", "Question : null .. . Answer : I use AntiXss Encoder on serverside for XSS atacks so all response includes html unescape characters like lt : script gt : alert 1 lt : script gt : replaced as : .. . .. . on binding i use sanitize with ng-bind-html there is no problem wih that . There is an other control input for update mode . When user needs to update text they click update icon then i show textarea and hide binded tag with ng-if . textarea has ng-model attr . i cant escape html characters on textarea like ng-bind-html here is the snippet pls help im getting creazy. . .. . .. . in fiddle edit mode textarea must display script alert 1 script with no alert action and data will be sent to the server must display same too.. . .. . .. . here is the fiddle http : jsfiddle.net bugd67e3 33 .. . .. . .. . var app angular.module myApp ngSanitize .. . .. . app.controller MyCtrl function scope sce sanitize .. . scope.post1 lt script gt alert 1 lt script gt .. . scope.post2 sce.parseAsHtml h1 alert 1 h1 .. . scope.logs log created .. . scope.log function val .. . scope.logs.push val .. . .. . .. . .. . .. . .label .. . text-decoration : underline .. . color : red .. . .. . .. . .. . script src https : ajax.googleapis.com ajax libs angularjs 1.4.8 angular.min.js script .. . script src https : ajax.googleapis.com ajax libs angularjs 1.4.8 angular-sanitize.min.js script .. . .. . div ng-app myApp .. . div ng-controller MyCtrl .. . div class label Edit mode : div .. . textarea ng-model post1 style width : 100 rows 5 textarea br .. . div class label Binding mode : div .. . div ng-bind-html post1 div br .. . div class label Data will be send to the server : div .. . div post1 div br .. . div class label Logs if needed : div .. . div ng-repeat d in logs .. . p index+1 + . + d p .. . div .. . div .. . div", "Question : I know that lot of questions about HTML sanitizers have appeared in SO but I don t know if they do what I want I have a little mess since some of the recommended approaches have more than 4 years old . I have a page with the TinyMCE editor . Of course this editor send HTML to the server and expect HTML so I have created a entity with a String property decorated with the AllowHtml attribute . It works well . Now I want to ensure that nobody tries to send a script-tag or a img onerror or whatever way of execute JS or add CSS that point to external urls . What is the best solution at the moment WPL http : wpl.codeplex.com has the HtmlSanitizationLibrary but how can I know what tags are considered secure WPL has not released anything from last April and it was the beta . So I was wondering if is this project active Cheers . Comment : It s still active . The Sanitizer however well it s languishing these days . As folks have moved to XHTML the sanitizer isn t up to the job and a rewrite isn t on the table . As TinyMCE does produce correct XHTML markup you can use Linq2Xml to query the DOM and sanitize to your hearts content . That s probably a better long term solution and hmm gives me an idea for a blog or two .. . Answer : WPL http : wpl.codeplex.com is the de-facto standard . Run the string through it and you are safe to print it unencoded : Comment : Yes I use the Html.Raw method already . But my question is which tags attributes are striped down Comment : @vtortola the script tags as well as attributes on any tag that might call javascript functions . Things like onclick .. . basically anything that could execute javascript . Comment : The safe list isn t documented I m afraid outside of you delving into the code Comment : Unfortunately this library seems to be useless in its current state . See the current reviews http : wpl.codeplex.com releases view 80289 ReviewsAnchor Comment : @Trevor The newest review was for May 16 and the 4.3.0 version date is June 2 so are you sure about the useless of the last version", "Question : null .. . Answer : I m making and setting AntiXssEncoder for my web project which uses mvc3 and .net4 and I ve done these steps : .. . .. . add AxtiXSSLibrary reference .. . create AntiXSSEncoder derived from HttpEncoder .. . override the HtmlEncode method : output.Write Encoder.HtmlEncode value .. . set encoderType in web.config to httpRuntime encoderType AntiXSSEncoder MyDll .. . .. . But I still can see the alert popup by xss input XssTest script alert test script . So I tested and found out the default encoder doesn t encode values which are assigned to ViewBag . My test code is below and it shows one isn t encoded . Can any one give me an answer or clue Comment : You are calling @Html.Raw which is supposed to not encode ths string . Why do you need a custom encoder in the first place Everything output by Razor is encoded unless passed to @Html.Raw . You could simply write @ViewBag.DisplayInput in the view and that would be encoded without any custom encoders . Comment : Well even though calling @Html.Raw the DisplayEncodedInput works exact what I expect . I don t think that s the problem . And I just want to allow html-input to users and make application safe from xss . Thanks anyway . Comment : DisplayEncodedInput works because you manually encode the value if the controller then Raw displays it without additional actions . With Razor you simply output the user input this is how it is designed . It is safe unless you pass it to the unsafe Html.Raw and funnily you are trying to use Raw to make it safe . See yourself - remove your custom encoder and replace calls to @Html.Raw with @ViewBag.DisplayInput and @ViewBag.DisplayEncodedInput . Comment : You are right . I manually encoded the value but that s the point why I m trying to use my encoder instead of default encoder I assumed that registering my encoder as default encoder would help me to encode every html before it s rendered so I wouldn t need to encode manually . However it isn t working as I expected so I m asking how to do it . Comment : Every HTML is encoded before it is rendered unless you pass it to Html.Raw . You pass it to Html.Raw so it is not encoded . You do not need a custom encoder to make this work . However if you do provide a custom encoder even though you don t need to Html.Raw will still not use it .", "Question : null .. . Answer : there is a situation where I want to encode Leteral text data which is coming from Resource file . Webpage is not allowing this since there are two tag . Please help Thanks in advance ." ] }
[ "yes-answer-long", "yes-answer-short" ]
web
UNK_RELATION
simple-openni@openni@61
simple-openni -- simpleopenni is the processing wrapper for @placeholder and nite .
{ "confidence": [ 60.29305648803711, 59.201454162597656, 56.2473030090332, 54.0998420715332, 51.08561706542969, 49.57408905029297, 48.39419174194336, 44.85774230957031, 44.85774230957031, 44.47496032714844, 44.37350082397461, 42.66879653930664, 42.09064483642578, 40.398895263671875, 40.33317947387695, 39.96090316772461, 39.533470153808594, 39.010440826416016, 38.54140853881836, 38.36548614501953, 37.98805236816406, 37.749908447265625, 37.327980041503906, 36.99982452392578, 35.82865905761719, 35.695491790771484, 35.24558639526367, 35.24558639526367, 35.169918060302734, 35.00027084350586, 34.98420715332031, 34.98420715332031, 34.951133728027344, 34.48030090332031, 34.270263671875, 34.270263671875, 34.03942108154297, 34.03942108154297, 34.03942108154297, 33.81065368652344, 33.81065368652344, 33.53147888183594, 32.77056121826172, 32.77056121826172, 32.47848892211914, 32.47848892211914, 32.47848892211914, 32.14064025878906, 32.14064025878906, 32.12938690185547, 31.98094940185547, 31.7119140625, 31.42811393737793, 31.291553497314453, 31.05181884765625, 31.04494857788086, 31.04494857788086, 30.911113739013672, 30.872291564941406, 30.872291564941406, 30.872291564941406, 30.34886932373047, 30.331005096435547, 30.100162506103516, 29.75539207458496, 29.636341094970703, 29.388771057128906, 29.080520629882812, 28.942039489746094, 28.892059326171875, 28.8671932220459, 28.831302642822266, 28.782358169555664, 28.73668670654297, 28.201385498046875, 28.201385498046875, 28.1768741607666, 28.041690826416016, 28.02022933959961, 27.963619232177734, 27.872783660888672, 27.83652114868164, 27.772655487060547, 27.72469139099121, 27.578781127929688, 27.578781127929688, 27.55016326904297, 27.347721099853516, 27.076663970947266, 26.944915771484375, 26.944915771484375, 26.944915771484375, 26.90723419189453, 26.7844181060791, 26.234575271606445, 25.742584228515625, 25.732784271240234, 25.732784271240234, 25.732784271240234, 25.725296020507812 ], "content": [ "If Nite is not implemented in SimpleOpenNI how will skeleton tracking work", "I installed KinectSDK OpenNi NiTe SimpleOpenNi lib tried on 3 differents versions of processing 1.5.1 2.0.1 x86 2.0.2 x64 with win7 win8 .", "OpenNI provides skeleton tracking through the proprietary NiTE .", "I have OpenNi SDK v1.5.7.10 + NITE NITE-Bin-Dev-MacOSX-v1.5.2.21 + SensorKinect-unstablev5.1.2.1 .", "You have to follow the instruction here : https : simple-openni.googlecode.com and also install OpenNI-NITE as driver .", "could this be a problem with Nite", "Otherwise if you can you should rather use the previous SimpleOpenNi version where Nite was implemented .", "Software : I have installed XCode XQuartz MaxPorts CMake then libtool libusb OpenNI SDK v1.5.4.0 SensorKinect and NiTE v1.5.2.21 .", "I believe OpenNI does not do skeletons leaving that to NITE which is closed source .", "I am using Processing 2.2.1 and the SimpleOpenNI 1.9.6 library for Processing along with OpenNI on Windows 7 x64 .", "I ve been following this tutorial in order to get SimpleOpenNI installed on my mac but I keep getting stuck at installing the OpenNI and NITE components because it requires me to navigate to the folders in Terminal and then run sudo . install.sh .", "Since the big update of OpenNi Nite SimpleOpenNi is totally different : .. . .. . enableHands is now enableHand .. . .. . addGesture String is now startGesture int gesture .. . .. . removeGesture String is endGesture int gesture .. . .. . startTrackingHands PVector is startTrackingHand float pos .. . .. . Nite is not yet implemented in simpleOpenNi 1.96 so as far as I know I think there are only 3 gestures you can use GESTURE CLICK GESTURE HAND RAISE GESTURE WAVE", "However when I try to utilize the SimpleOpenNI library via Processing it tells me I need to install OpenNI first .", "Does anyone know of a previous version s processing OpenNI NITE etc that will work with my MacOS a link-to a tutorial or have had the same problem but fixed it somehow", "in some case Processing-1.5.1 is not suitable with SimpleOpenNI-1.96", "Resources : SimpleOpenNI Souce http : code.google.com p simple-openni source browse trunk SimpleOpenNI src p5 src SimpleOpenNI.java My pde :", "Nite is not implemented yet in SimpleOpenNi 1.96 and I suspect it never will so you sadly have to try with what there is for the moment and I think these functions are quite different of what they were before. .", "Processing code .. . .. . the old code : .. . .. . i have changed some line such as : .. . .. . SimpleOpenNI kinect -- SimpleOpenNI context kinect .", "Which version of Processing and SimpleOpenNI are you using", "I am unable to either install the SimpleOpenNI 1.96 wrapper for processing 2.0.1 or my code doesn t run .", "I m comapring these Kinect libraries on windows : .. . .. . a Kinect for Windows SDK for Processing http : www.magicandlove.com blog 2012 09 05 kinect-for-processing-library-page .. . .. . b SimpleOpenNI http : code.google.com p simple-openni .. . .. .", "Im trying to make an app with processing using kinect and SimpleOpenNi .", "i am trying to find out documentation of simple-openni 1.96 because the old code is not suitable with simple-openni 1.96 .", "SimpleOpenNI is the wrapper for OpenNI which allows access to the RGB IR Depth streams and the middleware for body hand detection but does not allow access to hardware like the LED accelerometer or motor .", ".. . .. . testet with : Processing 2.2.1 and processing 3 Kinect v1 model 1414 SimpleOpenNI 1.96 .. . .. . .. . .. . error message : .. . .. . SimpleOpenNI Version 1.96 After initialization : .. . .. . SimpleOpenNI Error : Can t open device : DeviceOpen using default : no devices found .. . .. . Kinect not connected", "I have created a program related to kinect in Processing IDE using SimpleOpenNI library in which a simple image is displayed inside the user s silhouette .", "Nite http : www.openni.org software cat slug file-cat1 .Ud3JGD-d8ns to get the coordinates of the joints of the body such as shoulder elbow fingertip .", "The Microsoft SDK provides skeleton tracking as well it basically the same as the skeleton tracking through NiTE .", "How can I track multiple users using getUserPixels from Simple OpenNI for Processing", "I ve used one of the examples provided with SimpleOpenNI the SimpleOpenNI DepthImage Test and some code I found on stackoverflow : How to read oni file in Processing 2", "do the simpleopenni examples work", "I m using simpleOpenNI with the Kinect .", "The documentation is very poor so I suggest you to look the Hand example in Processing- File- Examples- ContributedLibraries- SimpleOpenNi- OpenNi which provide an example the user has to do the Wave gesture and then can draw with his hands .", "I m running with the 2nd to latest processing 2.0 build the link-to processing 2.0.1 doesn t work and the latest SImpleOpenNI package I could download .", "I am currently making a project on kinect using SimpleOpenNI and Processing and am new to it .", "Recently I have created a sketch in Processing-1.5.1 using SimpleOpenNI-1.96 library .", "what version of SimpleOpenNI are you using", "What version of SimpleOpenNI are you using", "which version of simpleopenni are you using", "Note that to use SimpleOpenNI it is required an old processing version without Java .", "I am running Processing 2.0.8 with SimpleOpenNI 0.27 library .", "If you want to align the depth map with the RGB map you need to simply tell OpenNI to do so fo you in setup : .. . .. . Have a look at the AlternativeViewpoint3d sketch in Examples SimpleOpenNI OpenNI .. . .. . OpenNI has the registration done already so all you need to do is enable it when you need it .", "gesture .. . .. . removeGesture String which is now endGesture SimpleOpenNI .", "i think this is because of the simpleopenni version you are using .", "I am trying to use the simpleopenni library to access data from my Kinect in Processing .", "I m running Processing 2.2.1 along with SimpleOpenNI 1.96 based on instructions at http : shiffman.net p5 kinect .", "I ve just tested on OSX 10.10.5 with Processing 2.2.1 and SimpleOpenNI Version 1.96 and it seems to work .", "I ve never been able to get it to work either.. . have you posted on the Processing Forum and or the SimpleOpenNI Google Code page btw", "I am working on Windows System 64bit-OS with Processing-1.5.1 framework SimpleOpenNI-1.96 library Microsoft kinect xbox 360 .", "For reference here is my complete working code Processing+OpenNI :", "because I am using OpenNI .", "I m hacking the Kinect using some simple-openni based processing apps for a talk I plan to give soon and I found an API that appears to control the motor .", "The zipped library in the project s download list https : code.google.com p simple-openni downloads list should contain a documentation directory .", "i m using processing 1.5.1 with simpleopenNI 0.27 .. . .. . Thanks for your attention", "kinect sketches of Prcocessing library SimpleOpenNI-1.96 does not run .", "The SimpleOpenNI is installed as 64bit-version .", "ie : SimpleOpenNI library win64", "Sure right in the release notes for OpenNI2 : openni.org openni-sdk openni-sdk-release-notes .UWODXeejNBk http : www.openni.org openni-sdk openni-sdk-release-notes .UWODXeejNBk Check the last item in the changelog .", "Is it CL NUI SDK works with openNI in the first place", "You haven t setup the callbacks for OpenNI user events .", "The automatic scene segmentation in OpenNI is nice but not perfect .", "I have a kinect working with processing using SimpleOpenNi library and i just want the kinect send the position of a skeleton only 2 in 2 seconds for example .", "I have installed openni2.2 nite2.2 and kinect SDK 1.6 along with Simpleopenni library for processing .", "Is it possible to get better image in SimpleOpenNI", "im using processing 2.2.1 simpleOpenNI 1.96 this code is from the book making things see but i changed the last few lines under user-tracking callbacks", "An issue was filed http : code.google.com p simple-openni issues detail id 61 hopefully it will be resolved .", "But for skeleton tracking you would need to get NiTE from some unofficial source since the official source PrimeSense doesn t exist anymore was bought by Apple and shut down .", "In the meantime try using OpenNI in a different language framework .", "I have tried in vain everywhere to find and properly install an OpenNI version that is compatible with OS 10.11.5 AND can be used by Processing", "I think they talk about the same issue in this thread : SimpleOpenNI Record and Replay User Tracking Data http : stackoverflow.com questions 19534014 simpleopenni-record-and-replay-user-tracking-data .. . .. . Seems there is an issue with the current way SimpleOpenNI v1.96 records the data .", "I d go with OpenNI .", "SimpleOpenNI is more pixelated and has more noises .", "We decided to use SimpleOpenNI with Processing to read the sensor and leJOS to control the robot for a simple reason : since both is in Java we can specifiy a kind of RoboHandler and call its methods from the sensor reading class .", "context.enableScene must be changed to context.enableUser context.sceneImage must be changed to context.userImage .. . .. . i ve tried to find an odler version of the simpleopenni but failed .", "In order to achieve that we downloaded the leJOS plugin for eclipse created a new leJOS NXT project and put the processing and SimpleOpenNI libraries in the build path .", "I keep getting this error when I run a example code from SimpleOpenNI such as NoSuchMethodError : You may be using a library that s incompatible with this version of Processing .", "Thus far I ve followed all the directions on this page with no errors a very helpful page by the way : http : blog.nelga.com setup-microsoft-kinect-on-mac-os-x-10-8-mountain-lion .. . .. . Once completed I was able to use Kinect via Terminal NiTE SensorKinect without a problem .", "Make sure that OpenNI support is enabled .", "I am trying to change some line from the code using old version of simple-openni to the code using simple opennni 1.96 .. . .. . The aim of this program is to have the brightness of two LEDs driven by the position of your hand a simple example arduino and kinect project .", "In Processing I can successfully draw depth maps from 2 Kinects using SimpleOpenNI but I m now trying to draw 2 scenes from enableScene vs enableDepth .", "Before I get comments about the version of Simple-OpenNI that I m using I installed the only one that was on the Google Downloads page v 1.96 .", "I want to do a simple kinect aplication in processing I just want to when kinect detect a skeleton show a simple jpeg image just that .", "This is a bit late but for others finding this problem that I also found try installing OpenKinect within Processing and running one of the sample sketches like Average Point Tracking for a moment closing then trying your Simple OpenNI sketch .", "Well I m making a sketch that uses the SimpleOpenNI library in Processing and I m mounting a 3D design over the skeleton but I have been thinking that if a different person stands in front of the Kinect the model will be different if the person is taller or smaller than me since I m doing the tests and I want to know if there s a way to scale the skeleton made by the SimpleOpenNI so I can make that the standard in my sketch so anyone that stands in front will be the same height in the sketch and all the parts of the 3D will remain in the same place .", "OpenNI seems to be ok as its reader can open .oni files .", "Given that OpenNI is already installed in the steps above I m not sure what s wrong .", "As you said the official website of PrimeSense and OpenNI are closed and the download links on the OpenNI website are no more available .", "I am implementing an algorithm for finger detection using OpenNI and OpenCv 2.4 and Kinect .", "Finally I installed a fresh copy of Ubuntu and installed libfreenect libraries using synaptic I m kinda newbie and I also installed the following packages .. . .. . https : code.google.com p simple-openni downloads detail name OpenNI NITE Installer-Linux64-0.27.zip can 4 q https : code.google.com p simple-openni downloads detail name OpenNI NITE Installer-Linux64-0.27.zip can 4 q .. . .. . along with Processing 2.0 and SimpleOpenNi-0.27 .. . .. . I start Processing - examples - OpenNi - DepthImage RUN and the kinect starts for 3 to 10 seconds giving the image below some times along with the RGB image and some times with out it then the frame freezes and when I try listing the USB devices lsusb there is no Kinect camera or audio devices listed so the Kinect must be unplugged from the Adaptor and USB and then re-inserted and the problem still occur after running the sketch .", "On my machine old macbook SimpleOpenNI can t generate the 2nd Kinect s depth map .", "I m not sure if it s a USB bus limitation or a problem with the SimpleOpenNI library itself at this point though .", "Be sure to start your code with .. . .. . Then you use methods which don t exist anymore in SimpleOpenNI 1.96 check the doc .", "We ve run it on several brand new machines with the Kinects on separate busses and the simple depth images from enableDepth work but the enableScene on both cams consistently produces the same scene so I reckon it s something in SimpleOpenNI .", "I know OpenCV has compatibility with OpenNI if you set the flag but although I tried hard CMake couldn t find the path to OpenNI2 so I couldn t build OpenCV with OpenNI .", "In OpenNI you can access the depth points of the tracked players so what I thought about it adding one more limb to the skeleton Is it possible with OpenNI", "Processing uses libraries under Documents Processing Library .", "Here a basic example : .. . .. . You can see some handy SimpleOpenNI samples in this Kinect article http : ruairiglynn.co.uk teaching index.php title Kinect Workshop 2012 Tutorial3 which is part of a workshop I held last year .", "whether it s .. . .. . kinect.enableGesture .. . .. . or .. . .. . context.enableGesture .. . .. . it doesn t matter it just depends on the variable your code chose in this line .. . .. . The function enableGesture is out of date .. . .. . All you have to do is change enableGesture to startGesture SimpleOpenNI .", "gesture .. . .. . Where gesture can be either GESTURE CLICK GESTURE HAND RAISE or GESTURE WAVE .. . .. . And it is most likely that you will encounter other out of date functions such as : .. . .. . enableHands which is now enableHand .. . .. . addGesture String which is now startGesture SimpleOpenNI .", "You ll need to set the DLL file as native library for your SimpleOpenNI.jar .. . .. . See this tutorial http : code.google.com p simple-openni wiki IDE ." ] }
{ "confidence": [ 88.99171447753906, 85.99275207519531, 79.209228515625, 78.12850952148438, 72.97869873046875, 63.070648193359375, 62.444313049316406, 58.96692657470703, 58.96692657470703, 58.96692657470703, 56.10021209716797, 55.86491394042969, 54.89515686035156, 53.660709381103516, 53.450096130371094, 49.58220672607422, 47.7370491027832, 46.43272399902344, 45.543434143066406, 45.46869659423828 ], "content": [ "Question : Before I get comments about the version of Simple-OpenNI that I m using I installed the only one that was on the Google Downloads page v 1.96 . I saw in another thread that I have to replace the line kinect.enableGesture with kinect.startGesture .. . but then the other methods get messed up . I am following the book Arduino and Kinect Projects by Enrique Ramos Melgar but that code doesn t seem to be up-to-date . My affected code is as follows : .. . .. . With the following errors : .. . Answer : Be sure to start your code with .. . .. . Then you use methods which don t exist anymore in SimpleOpenNI 1.96 check the doc . Since the big update of OpenNi Nite SimpleOpenNi is totally different : .. . .. . enableHands is now enableHand .. . .. . addGesture String is now startGesture int gesture .. . .. . removeGesture String is endGesture int gesture .. . .. . startTrackingHands PVector is startTrackingHand float pos .. . .. . Nite is not yet implemented in simpleOpenNi 1.96 so as far as I know I think there are only 3 gestures you can use GESTURE CLICK GESTURE HAND RAISE GESTURE WAVE Comment : Thanks my program runs now but its not doing what I expect . Firstly the IR image displayed during Draw loop seems to lag . Objects appear in the image even after having been moved . Also it can t track my hand . I tried each of the 3 gestures but it doesn t recognize any of them . could this be a problem with Nite Comment : Nite is not implemented yet in SimpleOpenNi 1.96 and I suspect it never will so you sadly have to try with what there is for the moment and I think these functions are quite different of what they were before. . The documentation is very poor so I suggest you to look the Hand example in Processing- File- Examples- ContributedLibraries- SimpleOpenNi- OpenNi which provide an example the user has to do the Wave gesture and then can draw with his hands . Otherwise if you can you should rather use the previous SimpleOpenNi version where Nite was implemented . Comment : Oh I didn t know there were examples . Thank you . If Nite is not implemented in SimpleOpenNI how will skeleton tracking work", "Question : I m trying to connect Kinect to Processing on a Mac running OSX Yosemite 10.10 . Perhaps someone can help Thus far I ve followed all the directions on this page with no errors a very helpful page by the way : http : blog.nelga.com setup-microsoft-kinect-on-mac-os-x-10-8-mountain-lion .. . .. . Once completed I was able to use Kinect via Terminal NiTE SensorKinect without a problem . However when I try to utilize the SimpleOpenNI library via Processing it tells me I need to install OpenNI first . Given that OpenNI is already installed in the steps above I m not sure what s wrong . I ve tried restarting and whatnot . Has anyone else encountered this Comment : Which version of Processing and SimpleOpenNI are you using I ve just tested on OSX 10.10.5 with Processing 2.2.1 and SimpleOpenNI Version 1.96 and it seems to work . .. . Answer : Processing uses libraries under Documents Processing Library . You have to follow the instruction here : https : simple-openni.googlecode.com and also install OpenNI-NITE as driver . There is an open-source example you can follow and all required libraries are given with links : https : github.com ningt slide2d", "Question : Im trying to make an app with processing using kinect and SimpleOpenNi . I tried to follow this tutorial http : www.creativeapplications.net processing kinect-physics-tutorial-for-processing but i m stuck at the very beginning : when i launch the first script processing returns me this error : The function enableScene does not exist Also the function sceneImage doen t work . I installed KinectSDK OpenNi NiTe SimpleOpenNi lib tried on 3 differents versions of processing 1.5.1 2.0.1 x86 2.0.2 x64 with win7 win8 . I really can t find any solution on the web if someone have some any clue i d be glad Thanks Comment : what version of SimpleOpenNI are you using .. . Answer : What version of SimpleOpenNI are you using The most recent addition to my knowledge lacks the enableScene method . Use the wayback machine and download an earlier version .", "Question : Im trying to make an app with processing using kinect and SimpleOpenNi . I tried to follow this tutorial http : www.creativeapplications.net processing kinect-physics-tutorial-for-processing but i m stuck at the very beginning : when i launch the first script processing returns me this error : The function enableScene does not exist Also the function sceneImage doen t work . I installed KinectSDK OpenNi NiTe SimpleOpenNi lib tried on 3 differents versions of processing 1.5.1 2.0.1 x86 2.0.2 x64 with win7 win8 . I really can t find any solution on the web if someone have some any clue i d be glad Thanks Comment : what version of SimpleOpenNI are you using .. . Answer : Change enableScene to isInit and replace draw with", "Question : I keep getting this error when I run a example code from SimpleOpenNI such as NoSuchMethodError : You may be using a library that s incompatible with this version of Processing . I have tried in vain everywhere to find and properly install an OpenNI version that is compatible with OS 10.11.5 AND can be used by Processing I have OpenNi SDK v1.5.7.10 + NITE NITE-Bin-Dev-MacOSX-v1.5.2.21 + SensorKinect-unstablev5.1.2.1 . + libtool + libusb but as read here : https : github.com processing processing wiki Supported-Platforms and here : https : github.com processing processing wiki Changes a lot of things have changed with Processing 3.1.1 . Does anyone know of a previous version s processing OpenNI NITE etc that will work with my MacOS a link-to a tutorial or have had the same problem but fixed it somehow .. . Answer : The first thing I would try is downgrading your Processing to version 2.2.1 . You can get it here https : processing.org download processing . Comment : Cool ok . I did it it works but now when I run I get this error : Error : This Java instance does not support a 32-bit JVM . 1 Please install the desired version . Any ideas Searched all over for forcing Mac to run JDK 1.6.0 Comment : @EricReyna I would start out by googling that error . If you still can t figure it out feel free to ask a new question with your updated information . Comment : This worked by installing 2.2.1 I had installed 1.5.1 and now I installed 2.2.1 and it works . Thanks", "Question : I am using Kinect for Windows not for XBOX on Apple iMac 3GHz 4GB 10.8.3 . The Kinect is connected with USB cable to iMac and with power supply . Software : I have installed XCode XQuartz MaxPorts CMake then libtool libusb OpenNI SDK v1.5.4.0 SensorKinect and NiTE v1.5.2.21 . I am running Processing 2.0.8 with SimpleOpenNI 0.27 library . Any example from SimpleOpenNI runs but after approximatly 20sec Kinect stops working and freezes . I need to say that the green led is blinking constantly but Kinect is still working since at least for short period time I can get e.g . the depth image etc . Any ideas why is not working constantly Maybe I need Kinect for Xbox in the end Is there any power supply issues with Apple computer I have tested the same Kinect device on PC and it worked fine Comment : I used these instructions http : decyborg.wordpress.com 2013 01 19 kinect-on-os-x-10-8-and-processing to get up and running and face the same issue . .. . Answer : This is a bit late but for others finding this problem that I also found try installing OpenKinect within Processing and running one of the sample sketches like Average Point Tracking for a moment closing then trying your Simple OpenNI sketch . I m also using .27 because I couldn t get later versions to work and this fixes the problem but you have to do it every time you plug the camera back in or restart the OS . Hope this helps someone else .", "Question : I m interested in developing an AR application that needs the Kinect sensor for tracking a human body . This application will use the skeleton tracking data to make live video-processing on the human body . Because of this I need a powerful live and fast skeleton tracking SDK . Could you please provide me with the differences between these SDKs What I found from searching I didn t find much information or direct answers about my question.I found that the OpenNI framework support skeleton tracking algorithm . But I don t know it s performance or if it will be useful with my application or not . Here is some information that I found from searching : enter image description here http : i.stack.imgur.com YqcTX.png I m also interested in a general comparison between these SDKs . Actually I found a post that made a comparison between them . And it s written that the openkinect is less powerful in skeleton tracking . But this post was written in 2011 . Official Kinect SDK vs . Open-source alternatives http : stackoverflow.com questions 7706448 official-kinect-sdk-vs-open-source-alternatives .. . .. . Could you please help .. . Answer : You pretty much answered your own question : .. . .. . OpenKinect libfreenect does not provide skeleton tracking . OpenNI provides skeleton tracking through the proprietary NiTE . The Microsoft SDK provides skeleton tracking as well it basically the same as the skeleton tracking through NiTE . I d go with OpenNI . It is the one most widely supported with wrappers for other frameworks e.g . OpenCV and PCL and many others and is cross-platform . But for skeleton tracking you would need to get NiTE from some unofficial source since the official source PrimeSense doesn t exist anymore was bought by Apple and shut down . Comment : Thank you for this useful information . Actually I m surprized from the very useful middleware libraries wrappers and tools that OpenNI support . As you said the official website of PrimeSense and OpenNI are closed and the download links on the OpenNI website are no more available . Anyway they are still available through other sites . I will wait for a short time in order to see other answers before accepting your answer .", "Question : I ve been following this tutorial in order to get SimpleOpenNI installed on my mac but I keep getting stuck at installing the OpenNI and NITE components because it requires me to navigate to the folders in Terminal and then run sudo . install.sh . I do this and I get this error : .. . .. . sudo : . install.sh : command not found .. . .. . I ve installed Command Line Tools in Xcode and everything . Thanks Comment : Sorry here is the link-to the tutorial : creativec0d1ng.blogspot.ca 2012 08 http : creativec0d1ng.blogspot.ca 2012 08 installing-openni-on-osx-lionmountain.html Comment : Which step fails I see two with sudo . install.sh . Comment : The very first step with that command in it . But really running that command for any of the steps comes up with the same error . Comment : right before you do the sudo thing type in ls in Terminal . That prints out a list of files . Do you see install.sh in that list of files If not type in pwd and tell us where you are . Comment : If you do as above and there is an install.sh do ls -l and check that it is actually executable -rwxr-xr-x .. . Answer : The reason why that happens is because the script you are trying to execute needs the right permissions . Type : .. . .. . and then try again . Comment : You are a magician. .", "Question : I ve been following this tutorial in order to get SimpleOpenNI installed on my mac but I keep getting stuck at installing the OpenNI and NITE components because it requires me to navigate to the folders in Terminal and then run sudo . install.sh . I do this and I get this error : .. . .. . sudo : . install.sh : command not found .. . .. . I ve installed Command Line Tools in Xcode and everything . Thanks Comment : Sorry here is the link-to the tutorial : creativec0d1ng.blogspot.ca 2012 08 http : creativec0d1ng.blogspot.ca 2012 08 installing-openni-on-osx-lionmountain.html Comment : Which step fails I see two with sudo . install.sh . Comment : The very first step with that command in it . But really running that command for any of the steps comes up with the same error . Comment : right before you do the sudo thing type in ls in Terminal . That prints out a list of files . Do you see install.sh in that list of files If not type in pwd and tell us where you are . Comment : If you do as above and there is an install.sh do ls -l and check that it is actually executable -rwxr-xr-x .. . Answer : first open Terminal type cd and than drag the map into Terminal and press enter . Now type sudo . install.sh and it will work . Took me very long to find out . Hope it helps . Comment : Thanks this did the trick", "Question : I ve been following this tutorial in order to get SimpleOpenNI installed on my mac but I keep getting stuck at installing the OpenNI and NITE components because it requires me to navigate to the folders in Terminal and then run sudo . install.sh . I do this and I get this error : .. . .. . sudo : . install.sh : command not found .. . .. . I ve installed Command Line Tools in Xcode and everything . Thanks Comment : Sorry here is the link-to the tutorial : creativec0d1ng.blogspot.ca 2012 08 http : creativec0d1ng.blogspot.ca 2012 08 installing-openni-on-osx-lionmountain.html Comment : Which step fails I see two with sudo . install.sh . Comment : The very first step with that command in it . But really running that command for any of the steps comes up with the same error . Comment : right before you do the sudo thing type in ls in Terminal . That prints out a list of files . Do you see install.sh in that list of files If not type in pwd and tell us where you are . Comment : If you do as above and there is an install.sh do ls -l and check that it is actually executable -rwxr-xr-x .. . Answer : .sh scripts should have n line-breaks . Command not found also occurs if r n line-breaks are used . Well at least this is the case on FreeBSD .", "Question : I m hacking the Kinect using some simple-openni based processing apps for a talk I plan to give soon and I found an API that appears to control the motor . There is a moveKinect method that appears to be added to the main ContextWrapper interface but I can t seem to get it to work . Looking through the svn history and release notes it appears to have been added last year with a note that explains it doesn t work with the newest drivers 5.1.02 Linux64 . I ve tried calling the method giving it values in degress and radians but nothing happens . I get no error and no movement . Has anyone else played with this I m running with the 2nd to latest processing 2.0 build the link-to processing 2.0.1 doesn t work and the latest SImpleOpenNI package I could download . Comment : I ve never been able to get it to work either.. . have you posted on the Processing Forum and or the SimpleOpenNI Google Code page btw .. . Answer : SimpleOpenNI is the wrapper for OpenNI which allows access to the RGB IR Depth streams and the middleware for body hand detection but does not allow access to hardware like the LED accelerometer or motor . You should try Kinect P5 http : shiffman.net p5 kinect which uses libfreenect behind the scenes and supports motor control . Bare in mind you won t have support for the middleware . If you need both middleware and hardware access you can try OpenFrameworks http : openframeworks.cc with the ofxOpenNI addon https : github.com roymacdonald ofxOpenNI . It has a has a hardware class https : github.com roymacdonald ofxOpenNI blob master src ofxHardwareDriver.h that works on OSX and Linux as sudo allowing use of both the middleware and motor .", "Question : I am trying to open an .oni file to test some stuff without having a Kinect connected to my computer . I ve used one of the examples provided with SimpleOpenNI the SimpleOpenNI DepthImage Test and some code I found on stackoverflow : How to read oni file in Processing 2 http : stackoverflow.com questions 17044116 how-to-read-oni-file-in-processing-2 .. . .. . The error is : .. . .. . Technically when no device is found it should just open up the file but I can t figure out why it doesn t happen that way . I am using Processing 2.2.1 and the SimpleOpenNI 1.9.6 library for Processing along with OpenNI on Windows 7 x64 . OpenNI seems to be ok as its reader can open .oni files . The problem seems to be somewhere in Processing but I can t figure it out . Is there a way to make Processing work without connecting a Kinect to my computer just by opening .oni files What am I doing wrong .. . Answer : I think they talk about the same issue in this thread : SimpleOpenNI Record and Replay User Tracking Data http : stackoverflow.com questions 19534014 simpleopenni-record-and-replay-user-tracking-data .. . .. . Seems there is an issue with the current way SimpleOpenNI v1.96 records the data . IN the thread they say if you use ONI files that were recorded with v0.27 the playback works .", "Question : null .. . Answer : I am trying to change some line from the code using old version of simple-openni to the code using simple opennni 1.96 .. . .. . The aim of this program is to have the brightness of two LEDs driven by the position of your hand a simple example arduino and kinect project . here s the code : .. . .. . a . arduino code .. . .. . b . Processing code .. . .. . the old code : .. . .. . i have changed some line such as : .. . .. . SimpleOpenNI kinect -- SimpleOpenNI context kinect . --- context . .. . kinect.enableHands -- context.enableHand .. . kinect.enableGesture + kinect.addGesture Wave -- context.startGesture SimpleOpenNI.GESTURE WAVE .. . kinect.removeGesture strGesture -- context.endGesture SimpleOpenNI.GESTURE WAVE .. . kinect.startTrackingHands endPosition -- context.startTrackingHand endPosition .. . .. . the result : .. . .. . there is no error but kinect doesn t get hand tracking from my hand .. . .. . thank you for attention Comment : do the simpleopenni examples work Comment : yes it do . I have tried some example such as hand hand3d user user3d etc . all of them are working . do you have any idea about this @PetrosKoutsolampros", "Question : null .. . Answer : I am trying to use the simpleopenni library to access data from my Kinect in Processing . However when I try to access my Kinect using the library I get errors like Can t open the depthMap maybe the camera is not connected . I have followed all installation instructions and have verified that openNI2 64-bit is functional by successfully running and interacting with the NI Viewer included with the install . I have verified that NITE2 64 bit is functional by successfully running and interacting with the simple user tracker included with the install . I have the official MS Kinect for Windows SDK 1.6 installed on my system and I understand that v2 of open ni and simpleopenni are able to work with the official SDK instead of libfreenect . I m not sure how to debug further from here...any input would be appreciated . Thanks . Comment : Can you point to where you read that OpenNI can use the Kinect for Windows SDK libraries instead of libfreenect I ve not read this before and not sure it is the case . Comment : Sure right in the release notes for OpenNI2 : openni.org openni-sdk openni-sdk-release-notes .UWODXeejNBk http : www.openni.org openni-sdk openni-sdk-release-notes .UWODXeejNBk Check the last item in the changelog . Comment : Wow there it is I m off to check it all out I hadn t known about this previously .", "Question : null .. . Answer : I m comapring these Kinect libraries on windows : .. . .. . a Kinect for Windows SDK for Processing http : www.magicandlove.com blog 2012 09 05 kinect-for-processing-library-page .. . .. . b SimpleOpenNI http : code.google.com p simple-openni .. . .. . enter image description here http : i.stack.imgur.com JM8md.jpg .. . .. . Link to full image : http : i.imgur.com mghSM.jpg .. . .. . Does anyone noticed the difference in RGB image coming out of these wrappers SimpleOpenNI is more pixelated and has more noises . Is it possible to get better image in SimpleOpenNI Thanks for any tips", "Question : In Processing I can successfully draw depth maps from 2 Kinects using SimpleOpenNI but I m now trying to draw 2 scenes from enableScene vs enableDepth . Both Kinects are detected but when I draw the output I see the same scene is drawn twice whereas using enableDepth always gave me 2 different depth images . Any ideas what I m doing wrong Thanks in advance . Comment : There were couple of syntax errors with your code which are now fixed but still the problems persist . On my machine old macbook SimpleOpenNI can t generate the 2nd Kinect s depth map . I m not sure if it s a USB bus limitation or a problem with the SimpleOpenNI library itself at this point though . Comment : Very interesting . We ve run it on several brand new machines with the Kinects on separate busses and the simple depth images from enableDepth work but the enableScene on both cams consistently produces the same scene so I reckon it s something in SimpleOpenNI . Oh well . Thanks for taking a look . .. . Answer : I ve done another text using the sceneMap functionality but it looks like there is indeed an issue with SimpleOpenNI not updating properly internally : .. . .. . Using something like .. . .. . rather than .. . .. . doesn t change anything . An issue was filed http : code.google.com p simple-openni issues detail id 61 hopefully it will be resolved . In the meantime try using OpenNI in a different language framework . OpenFrameworks has-many similarities to Processing and many differences as well to be honest but it s not rocket science . Try the experimental ofxOpenNI addon to test multiple cameras https : github.com gameoverhack ofxOpenNI blob experimental examples opeNI-SimpleExamples src-ImageAndDepthMutltDevice-Medium testApp.cpp hopefully it will resolve your issue . Comment : Ah good thinking . One of my coworkers tried this same thing today and got the same results but that was a good idea . At any rate I ve been wanting to take a look at something like OpenFrameworks or Cinder so this might be a good opportunity . Thanks again for taking a look at this . Incidentally to solve what we were trying to do in the long run with multiple cameras we went with TSPS as a helper app for the multiple camera stuff and it worked great . opentsps.com http : opentsps.com", "Question : I m new to Image Processing . How can I track multiple users using getUserPixels from Simple OpenNI for Processing What does this take as parameters How would I set up this code .. . Answer : The idea is to keep track of detected users . The sceneImage sceneMap functions are handy to keep track of user pixels but I also prefer enabling the SKEL PROFILE NONE profile for tracking users . This works with the onNewUser and onLostUser events which return an integer : the id of that user . This id is important to keep track total users or the most recent user detected . Once you have the user s id you can plug that into other SimpleOpenNI functionalities like getCoM which returns the user s centre of mass the x y z position of it s body centre . So you would use the above mentioned user events to update an internal list of users : .. . .. . HTH", "Question : I m asking if there is any ideas how to expand the skeleton extracted by OpenNI or Microsoft SDK from the Kinect device to add more joints to it For example if a man is holding a stick then the skeleton will add one extra joint representing the stick If you could please let me know if there is any solution to solve this Many Thanks .. . Answer : No...ish . You can not add or delete joints that are reported from the SDK . Those that are tracked by default are the only ones you have immediate access to throw the SDK . It is possibly to analyze the skeleton and or depth data to determine where additional joints are with libraries such as OpenCV but it is a much more complicated process . You would end up with another skeleton data structure with your unique data in it however you decided to store it . I m not familiar with any examples that demonstrate the process . The source code to one of the open-source Kinect drivers may be a good source . Comment : Thanks I was pretty sure that it is not possible with windows SDK . In OpenNI you can access the depth points of the tracked players so what I thought about it adding one more limb to the skeleton Is it possible with OpenNI I just need a clue or a guide of the steps needed to accomplish what I want so if you could please assist or guide me . Many Thanks Comment : You can access the depth data in the official SDK too . It is not a lack of data that is the problem it is knowing how to process that data . Both SDKs do a lot of stuff with the depth data and other data to create the skeleton and do not provide an add joint function because niether would now how to process the data to . Generate that point . You will need to do all that work yourself with whatever data gives you what you need . You can try the source to OpenNI or freenect for clues on how to produce skeleton points . Comment : and is the source code of creating the normal skeleton accessible Comment : In one of the open-source libraries that would be your best bet . I believe OpenNI does not do skeletons leaving that to NITE which is closed source . But it is worth a scan of the code .", "Question : I am doing a project relating to the Kinect . I am using Processing and the code works fine . I wanted to use Eclipse instead so I installed the revelant processing tools that enable me to do this . I am using the SimpleOpenNi library and when I run the code I get the error : .. . .. . I have the location of the dll file in my PATH under Environment Variables and also in the folder of my project . Tried to add it to the build path to no avail . If anyone can shed any light on this issue that would be great . Thanks in advanced . .. . Answer : You ll need to set the DLL file as native library for your SimpleOpenNI.jar .. . .. . See this tutorial http : code.google.com p simple-openni wiki IDE . Comment : I have this done still same error . I restarted eclipse as well still the same . I am using Windows 7 and this tutorial seems to be for MAC I am having an issue locating the Java Preferences . Is this done within Eclipse as I cannot find the path Applications Utilities Java Preferences . Comment : I don t think this has to do with your Java version . Please show a screenshot of your Build Path dialog including the path to the native DLL . Comment : It won t let me add an image as reputation too low as I only just joined the site . I have added the screenshot to my public dropbox here is the link link dl.dropboxusercontent.com u 62320123 BUILD 20PATH.png https : dl.dropboxusercontent.com u 62320123 BUILD 20PATH.png Comment : Here is the screenshot of the folder path link https : dl.dropboxusercontent.com u 62320123 path.png I have also tried putting the folder in here that matches the error above . ie : SimpleOpenNI library win64 Comment : Ok your setup looks good . It seems this is a bug of the library . You might want to try downloading the patched version from here https : code.google.com p simple-openni issues detail id 73 and test if that works .", "Question : I have installed openni2.2 nite2.2 and kinect SDK 1.6 along with Simpleopenni library for processing . Everything working fine except infrared image - it is simply not there . That is really strange since at the same time I can clearly see the depth image and depthimage logically need the infra camera and projector working to run . So I assume there is a problem with drivers or software I would like to use kinect as infrared camera . Please help below I attach my test code : Comment : image showing the error : i.imgur.com jzdqbXN.jpg 1 http : i.imgur.com jzdqbXN.jpg 1 .. . Answer : user3550091 is right For reference here is my complete working code Processing+OpenNI :" ] }
[ "yes-answer-long", "yes-answer-short" ]
openni
UNK_RELATION
digital-certificate@digital-signature@51
digital-certificate -- a certificate which uses a @placeholder to bind together a public-key with an identity or information .
{ "confidence": [ 42.680179595947266, 42.49515914916992, 42.149024963378906, 41.86354446411133, 40.70757293701172, 39.83842468261719, 38.82670593261719, 38.82670593261719, 37.67200469970703, 37.67200469970703, 37.392845153808594, 37.281166076660156, 37.263004302978516, 35.8401985168457, 35.42879867553711, 35.42879867553711, 35.09454345703125, 35.0527458190918, 34.736106872558594, 34.46704864501953, 33.98265075683594, 33.538387298583984, 33.255592346191406, 33.19140625, 33.19140625, 33.19140625, 33.19140625, 32.86928939819336, 32.64573669433594, 32.598121643066406, 32.24216842651367, 32.24216842651367, 31.686017990112305, 31.686017990112305, 31.660839080810547, 31.50099754333496, 31.48190689086914, 31.48190689086914, 31.462879180908203, 31.338199615478516, 31.2512149810791, 30.807422637939453, 30.466760635375977, 30.466760635375977, 30.466760635375977, 30.44918441772461, 30.339176177978516, 30.339176177978516, 30.326932907104492, 29.93636703491211, 29.93636703491211, 29.862947463989258, 29.631858825683594, 29.631858825683594, 29.631858825683594, 29.449792861938477, 29.449792861938477, 29.428524017333984, 29.328081130981445, 29.165283203125, 28.871566772460938, 28.844261169433594, 28.844261169433594, 28.844261169433594, 28.844261169433594, 28.844261169433594, 28.844261169433594, 28.3956298828125, 28.3956298828125, 28.3956298828125, 28.29930877685547, 28.25105094909668, 28.191526412963867, 28.08399772644043, 28.08399772644043, 28.08399772644043, 28.08399772644043, 28.08399772644043, 28.08399772644043, 28.08399772644043, 28.08399772644043, 28.08399772644043, 28.08399772644043, 28.08399772644043, 28.08399772644043, 28.061784744262695, 28.010578155517578, 27.975255966186523, 27.708959579467773, 27.56298828125, 27.377796173095703, 27.223539352416992, 27.223539352416992, 27.223539352416992, 27.223539352416992, 27.223539352416992, 27.223539352416992, 27.1866455078125 ], "content": [ "So We generated the CSR from PingFederate under Digital signing certificate - certificate signing from that particular certificate .", "Enter the path filename for the Digital Certificate File the Certificate Password and specify which output files you want to sign .", "So now we are going back to Ping Federate click on the certificate under Digital signing certificate - certificate signing from that particular certificate .", "If other words that does not properly deploy the digital-certificate .", "No I mean signing with a digital-certificate .", "I have went through the Admin Manual but it does not mention this part on the certificate management digital signing certificate section .", "I have a digital-certificate that I want to add to the installation program .", "Can I get access to the msi file to add the digital-certificate to it", "From this certificate I can extract the user s Public Key .", "Send a public-key and a signed token by the server s private certificate to the native application .", "It seems however that I must attach the digital-certificate to an msi file which is embedded within setup.exe by Install Shield .", "I have bought a Digital Signature Certificate with USB token .", "However if you only got the public-key you need to have the signing certificate at hand to match the public-key against .", "You need code sign certificate with private key .", "How to create a digital-certificate and export to .p12 file in PHP", "Other problem is that I need to read a digital-certificate to have access to that site .", "Any certificate has a public and a private part .", "Send a public-key a signed token by the server s private certificate and a symmetric key to encrypt websocket communications to the native application .", "I have found that placing the digital-certificate on setup.exe results in telling the user that the publisher is unknown when running the installation program .", "I am having client Certificate A which is signed by the CA1 certificate .", "CA1 certificate is signed by the Root certificate .", "Generate request send it to CA buy code sign certificate place certificate into certificate store and use signtool .", "This creates a minimal SSL TLS server that responds to HTTP requests on port 8080 : .. . .. . yourcert.pem is the X.509 certificate yourcert.key is your private key and chain.pem contains the chain of trust between your certificate and a root certificate .", "it depends whether your SAML response contains the signing certificate ds : X509Data .. . ds : X509Data or just the public-key ds : KeyValue .. . ds : KeyValue of it .", "You could provide a web service that returns the corresponding signing certificate for the requested public-key .", "In order to do this it needs a certificate that contains the public-key and the name of the IdP with a signature from a trusted entity in this case the CA .", "Now I want to verify that the signature against the signed text string and the user s certificate and public-key .", "I want to install this certificate into the certificate store Windows .", "It is a comodo certificate which is apparently covered by the certificate Addtrust external CA root which is present on the device .", "I am attempting to create a certificate with a private key .pfx that I can use within my application to create and verify digital signatures .", "I tried creating a temporary certificate using makecert and creating a spc from the certificate using cert2spc .", "Convert a certificate from DER to PEM with : .. . .. . ALSO : You should not specify the same certificate as -in and -certfile .", "Using these extensions from the signing certificate to the trusted CA certificate you would be able to build the trusted certificate chain .", "The certificate chain is checked starting with the deepest nesting level the root CA certificate and worked upward to the peer s certificate .", "This command let you download the certificate to a file namend certfile.txt : openssl s client -connect HOSTNAME : PORTNUM 2 1 sed -ne -BEGIN CERTIFICATE- -END CERTIFICATE- p certfile.txt --- Then use keytool to import it in your trust store", "If the signing certificate is embedded it may contain the AuthorityInfoAccess extension which usually contains an http or ldap URL to the issuing CA certificate .", "Meaning make sure that the certificate file is valid and not expired .", "Yes - it immediately updates the current signing certificate .", "You shouldn t need the server certificate in your key store .", "However in order to sign with a digital-certificate users should input their privates keys on the system .", "I want to know the number of certificate authorities in that chain and not the size of the certificate chain .", "Verification of a digital-signature requires posession of the public-key whose corresponding private key was used to create the signature .", "Creating a self-signed-certificate :", "hash of certificate data .", "Receive the certificate and save-as pfx .", "The approach with a centralized provisioning mechanism works also w o the public-key info e.g . via a well-known URL that provides the current validation certificate .", "You can find the proper certificate by comparing the root certificate fingerprint A SHA1 hash of the BASE64 65 chr line encoded certificate excluding the header and footer and the serial-number of the certificate .", "You can find the proper certificate by comparing the root certificate fingerprint a SHA1 hash of the BASE64 65 chr line encoded certificate excluding the header and footer and the serial-number of the certificate .", "This http : knowledge-oracle.blogspot.com 2009 02 import-private-key-and-certificate-in.html could also be usful at the bottom there is a class which is able to import a certificate during runtime .", "The certificate is never in the store of the machine that does the signing .", "Specify thumbprint of codesign certificate when using signtool .", "I would like to show android APK certificate information like the openssl command does .", "You can download the certificate of any SSL secured website in your browser .", "We have submitted the CSR for 3rd party CA to request for the certificate .", "Does it immediately replace the current certificate that we used to generate CSR and import", "This is a der encoded PKCS 7 certificate .", "Here is the Certificate from the sketch above .", "Since posting my question I found that the limited edition of Install Shield in Visual Studio 2012 can be setup to sign the installation program if you have a proper digital-certificate .", "They say it comes up with the message A certificate chain processed but terminated in a root certificate which is not trusted by the trust provider .", "They implement the RSA algorithm but they dont have a way to access digital certificates on the client certificate store .", "You can store the public certificate safeBag.type forge.pki.oids.certBag safeBag.attributes.localKeyId in PEM format Base64 encoded .", "Now I know that I have to use a certificate from the X509Store to get the signer certificate and use a .cer file as the verifier .", "If you only have the CA s certificate but not the certificate of the IdP or SP you cannot validate the signature of IdP or SP .", "Proper validation is a complex procedure that involves CRL certificate revocation list and OCSP online certificate status checking .", "Now I have the CA1 certificate trusted and received Client certificate non trusted .", "Why can t you get a Root certificate offline and cancatenate it to CA1 certificate to let verify work fine .", "So before this you have to check if the certificate is issued by a trusted Certificate Authority CA .", "The CA SHOULD use the same issuing key to issue a delegation certificate as that used to sign the certificate being checked for revocation . In my case OCSP isn t issued by the client Issuer but by the Root", "I m trying to sign an XML file using a x.509 certificate I can use the private key to sign the document and then use the CheckSignature method it has an overload that receives a certificate as parameter to verify the signature .", "The problem is that the user who validates the signature must have the certificate my concern is if the user has the certificate then he has access to the private key and as I understand this is private and should be available only to the user who signs .", "I always receive an error : .. . .. . error : 0408D077 : rsa routines : FIPS RSA VERIFY : wrong signature length .. . .. . I have the certificate and it is OK .. . I have the public-key extracted from the certificate and it is also verified and OK .. . I have the signature BASE64 decoded .. . .. . Unfortunately I can t verify the signature", "I m trying to improve upon what was done with the prior certificate which was mass-distribution of the PFX file and its password...ugh .", "When a signed SAML assertion is passed to SP this handler uses the IdP s certificate to validate the signature .", "This is caused of non-conforming to RFC6960 or RFC2560 OCSP certificate .", "A X509 STORE CTX is used while validating a single certificate .", "The X509 STORE then calls a function to actually verify the certificate chain .", "and it successfully added certificate to my exe file .", "This process assumes that SP has the IdP s certificate for validation .", "A select certificate dialog box is a very vague description .", "Essentially then it will only start the programs with the same certificate as itself .", "I don t want to ship the certificate itself .", "I assume the root certificate of the sign is not know on the device : .. . .. .", "I dont have receive the Root certificate .", "From the SSL HTTPS I receive the user s certificate .", "Submit the CSR to Microsoft Certificate Services 3 .", "Ah I ve put the private key and the certificate into a new file rm bundle.pem - let me update my post sec .", "The file has extension .p12 .. . .. . I would like to read the information in it first and last name and check if the certificate is valid .", "The format of this file must be as follows : .. . A header -----BEGIN CERTIFICATE----- .. . BASE64 encoded certificate .. . A footer -----END CERTIFICATE----- .. . empty line .. . If you have more than one trusted CA root - each certificate must start with a header and end with a footer string .", "SSL TLS which powers HTTPS would not be possible without digital signatures .", "To verify identity of server and avoid a ManInTheMiddel attach you need also to set a trustore for your application with the server certificate .. . .. . Your server needs also to verify identity of client .", "If the signature algorithm is based on RSA you can retrieve the document digest value by decoding the value using the signer s public-key from his certificate and extracting the digest from the decoded DigestInfo object .", "In the documentation they provide I need to download a certificate a .p12 file import this onto my Windows machine - this is pretty straightforward using the Certificate Import Wizard .", "how I can extract this message digest from the certificate and use this for my manual check - But you don t want to extract a message digest from a certificate .", "..But when I try to list the my certificates I only get one entry and is not my new certificate : .. . .. . Then where is stored my new certificate", "Because my web server requires SSL certificate authentication I wanted that the user signs the text string with the same certificate he is logged in .", "Under Internet Explorer using CAPICOM it is possible to send only one certificate object to the signing object so it will not open the dialog to select a certificate from a list .", "Under Internet Explorer using CAPICOM it is possible to send only one certificate object to the signing object so it will not open the dialog to select a certificate from a list .", "i am looking for j2ME or Android code through which i can send OCSP request containing a leaf certificate to be validated its root certificate etc all sent to the cert s OCSP server URL ." ] }
{ "confidence": [ 52.332969665527344, 47.88855743408203, 47.6632080078125, 46.970191955566406, 46.56206130981445, 45.618186950683594, 43.796382904052734, 42.960731506347656, 41.66253662109375, 41.23828887939453, 41.05492401123047, 40.887596130371094, 40.79264831542969, 40.55255889892578, 39.289207458496094, 39.202762603759766, 38.9947509765625, 38.87123107910156, 38.768768310546875, 38.487701416015625 ], "content": [ "Question : PingFederate 7.3 We have expiring digital signing certificates . So We generated the CSR from PingFederate under Digital signing certificate - certificate signing from that particular certificate . We have submitted the CSR for 3rd party CA to request for the certificate . The CA has responded with the .p7b file . So now we are going back to Ping Federate click on the certificate under Digital signing certificate - certificate signing from that particular certificate . This time we selected import CSR . Question : After import CSR done and save . Does it immediately replace the current certificate that we used to generate CSR and import I have went through the Admin Manual but it does not mention this part on the certificate management digital signing certificate section . Because we need to send this certificate to the SP connection partners first before replace it . Thanks in advance . .. . Answer : Yes - it immediately updates the current signing certificate . You should share the new public-key prior to uploading the CSR . Most federation partners with full federation SSO applications can support a current future certificate if they are not using the anchored trust model . That way they can load your new cert without breaking the connection . Quite frankly for signing I generally say to use a long-lived self-signed certificate.. . Like 10-20 years . You only need replace it if standards change or the private key is compromised . You re using it for signing not encryption .", "Question : null .. . Answer : In order to sign crypt email in my Company i have installed Verisign S-Mime Certificate and exported it form IE as a .pfx PKCS 12 my problem is when i try to Import it in Security My Identity your Certification Import certificate i got in error message The signature on the server is invalid detail can be found in protocol .. . .. . This Problem is resolved after imported the Internet certificate in Security Identity Of Other Certifications by checking the Verisign Internet certificate checkbox form All Internet Trustworthy .. . .. . Actually when i verifiy in my Notes Adresse Book Internet Certificate i see my Internet certificate and i see the trusted root certificate in my Contacts .. . .. . BUT today i try to test my Digital signature before testing the Encryption and when i want to send a signed Email to an external adress email yahoo Gmail .. . Lotus Notes Show a message saying that You try to send a signed email but your ID contains no Internet Certificate .. . .. . .. . i check in IBM Docu but i dont found my issue . has somebody any Information about this issue Thank you Comment : This question belongs on SuperUser not StackOverflow .", "Question : Is it possible to validate a signature only having an ancestor or root certificate in the hierarchy .. . .. . Disclaimer : I m a newbie to the certificates handling so please forgive the naive terminology . .. . .. . Consider the following situation . We have two parties let s call them IdP for Identity Provider and SP for service provider and some central certificate-authority CA which is definitely trusted by both IdP and SP . CA has it s own certificate CertCA known to both IdP and SP imported into IdP s and SP s keystore under some alias .. . Out CA issues one certificate for IdP CertIdP and one for SP CertSP . IdP has CertIdP in its keystore and knows password for it so IdP can sign messages with CertIdP .. . Same for SP CertSP .. . Now let s assume that SP does not know CertIdP and IdP does not know CertSP . They only know CertCA which was used to sign CertIdP and CertSP . As I understand we have a certificate hierarchy CertIdP -- CertCA -- CertSP here- .. . IdP wants to send a signed message to SP . It creates a message and then uses CertIdP to sign it . SP receives the message signed by the IdP using CertIdP . As noted above SP does not have the CertIdP only the parent certificat CertCA . My question is : Can SP validate the signature of the message signed by CertIdP only having its parent certificate CertCA .. . .. . Backstory why want it . .. . .. . We re implementing SAML-Based SSO with PicketLink . We re using PicketLink s SAML2SignatureValidationHandler https : docs.jboss.org author display PLINK SAML2SignatureValidationHandler to validate signatures . To achieve this Service Provider SP needs to have IdP s certificate in its keystore . When a signed SAML assertion is passed to SP this handler uses the IdP s certificate to validate the signature . The process above works well but we have some organisational concerns . This process assumes that SP has the IdP s certificate for validation . In case something changes IdP s certificate must be replaced on the SP side . We may have a large number of SPs hunreds when not thousands so this is quite an effort . Since both CertIdP and CertSP are issued by the same authority CA which is definitely trusted by both IdP and SP we had the idea that we may use the CA s certificate for signature validation . If this works this might eliminate the need to exchange certificates between IdP and SP . The CA s certificate is also very long-living so if only have to be exchanged once in eternity eternity in our case is around 10-20 years . However I am not sure if it is technically possible to validate the signature signed with CertIdP only having the parent CertCA . Is it possible Or are we on completely wrong track here If it s relevant we re on Java JBoss platform on SP side IdP is a third-party software . Update : .. . .. . This is the signature I get at the moment from IdP : .. . Answer : The short answer is No . If you only have the CA s certificate but not the certificate of the IdP or SP you cannot validate the signature of IdP or SP . The longer answer : To validate the signature of the IdP by the SP the SP first has to identify the correct public-key associated with the IdP . Validation involves comparing the public-key-encrypted signature value with the hash of the content and checking that they are the same . Without the public-key of the IdP the SP cannot perform this operation . Suppose the SP has a public-key that makes the validation above work and it now wants to validate that this public-key in fact belongs-to the IdP . In order to do this it needs a certificate that contains the public-key and the name of the IdP with a signature from a trusted entity in this case the CA . Since you don t have this you can t validate that the signature was performed by the IdP .", "Question : Is it possible to validate a signature only having an ancestor or root certificate in the hierarchy .. . .. . Disclaimer : I m a newbie to the certificates handling so please forgive the naive terminology . .. . .. . Consider the following situation . We have two parties let s call them IdP for Identity Provider and SP for service provider and some central certificate-authority CA which is definitely trusted by both IdP and SP . CA has it s own certificate CertCA known to both IdP and SP imported into IdP s and SP s keystore under some alias .. . Out CA issues one certificate for IdP CertIdP and one for SP CertSP . IdP has CertIdP in its keystore and knows password for it so IdP can sign messages with CertIdP .. . Same for SP CertSP .. . Now let s assume that SP does not know CertIdP and IdP does not know CertSP . They only know CertCA which was used to sign CertIdP and CertSP . As I understand we have a certificate hierarchy CertIdP -- CertCA -- CertSP here- .. . IdP wants to send a signed message to SP . It creates a message and then uses CertIdP to sign it . SP receives the message signed by the IdP using CertIdP . As noted above SP does not have the CertIdP only the parent certificat CertCA . My question is : Can SP validate the signature of the message signed by CertIdP only having its parent certificate CertCA .. . .. . Backstory why want it . .. . .. . We re implementing SAML-Based SSO with PicketLink . We re using PicketLink s SAML2SignatureValidationHandler https : docs.jboss.org author display PLINK SAML2SignatureValidationHandler to validate signatures . To achieve this Service Provider SP needs to have IdP s certificate in its keystore . When a signed SAML assertion is passed to SP this handler uses the IdP s certificate to validate the signature . The process above works well but we have some organisational concerns . This process assumes that SP has the IdP s certificate for validation . In case something changes IdP s certificate must be replaced on the SP side . We may have a large number of SPs hunreds when not thousands so this is quite an effort . Since both CertIdP and CertSP are issued by the same authority CA which is definitely trusted by both IdP and SP we had the idea that we may use the CA s certificate for signature validation . If this works this might eliminate the need to exchange certificates between IdP and SP . The CA s certificate is also very long-living so if only have to be exchanged once in eternity eternity in our case is around 10-20 years . However I am not sure if it is technically possible to validate the signature signed with CertIdP only having the parent CertCA . Is it possible Or are we on completely wrong track here If it s relevant we re on Java JBoss platform on SP side IdP is a third-party software . Update : .. . .. . This is the signature I get at the moment from IdP : .. . Answer : I ll start with some small introduction - the verification of digital signatures is done in two stages .. . .. . first signature verification - which checks that the signature value is actually corresponding to the content it protects and that the content therefore wasn t tampered with .. . trust verification - check that the signature was made by someone trusted by the verifier . Verification of a digital-signature requires posession of the public-key whose corresponding private key was used to create the signature . There s no way around this . But there s one use-case for verification of trust which allows usage of CA certificates - and it should be helpful for your case . It works so that you only include your CA and possibly intermediate CA signing certificates in the metadata generated for your SPs and IDPs . You then include the precise leaf key issued by the CA used to create the signature as part of the SAML message in KeyInfo element inside the Signature . The SP IDP is then able to verify that the leaf key which was unknown to it beforehand is trusted by constructing and verifying Certification Path using the CA certificates it already has . It s useful for rollovers of keys e.g . when they expire - as SP and IDP can change their signing key without need to notify the other party . SAML products sometimes call this feature anchored or PKIX trust mode . Please note that this approach doesn t work for digital encryption as encryption requires beforehand knowledge of the precise leaf key of the other party .", "Question : I have an installation program created using the limited version of Install Shield within Visual Studio 2012 . I have a digital-certificate that I want to add to the installation program . I d like to use the SingleImage feature of Install Shield to create and deliver a single installation file e.g . setup.exe to my customers . It seems however that I must attach the digital-certificate to an msi file which is embedded within setup.exe by Install Shield . I have found that placing the digital-certificate on setup.exe results in telling the user that the publisher is unknown when running the installation program . If other words that does not properly deploy the digital-certificate . Can I get access to the msi file to add the digital-certificate to it If so how .. . Answer : I going to answer my own question . Since posting my question I found that the limited edition of Install Shield in Visual Studio 2012 can be setup to sign the installation program if you have a proper digital-certificate . This is found under : Builds Express SingleImage . There is a tab named Signing . Enter the path filename for the Digital Certificate File the Certificate Password and specify which output files you want to sign . Install Shield then signs the installation program upon a build . My apologies for asking this question too soon . I should have done more research first . Comment : In InstallShield 2013 LE open the setup-project . Under Step 6 Prepare for Release double-click Releases . In the resulting window you are presented with the tree-view that contains the Builds Express SingleImage node referred to by the answer . Comment : Be sure to choose to sign both setup.exe and Windows Installer Package since you ll still get unknown publisher if you only sign setup.exe", "Question : Is it possible to validate a signature only having an ancestor or root certificate in the hierarchy .. . .. . Disclaimer : I m a newbie to the certificates handling so please forgive the naive terminology . .. . .. . Consider the following situation . We have two parties let s call them IdP for Identity Provider and SP for service provider and some central certificate-authority CA which is definitely trusted by both IdP and SP . CA has it s own certificate CertCA known to both IdP and SP imported into IdP s and SP s keystore under some alias .. . Out CA issues one certificate for IdP CertIdP and one for SP CertSP . IdP has CertIdP in its keystore and knows password for it so IdP can sign messages with CertIdP .. . Same for SP CertSP .. . Now let s assume that SP does not know CertIdP and IdP does not know CertSP . They only know CertCA which was used to sign CertIdP and CertSP . As I understand we have a certificate hierarchy CertIdP -- CertCA -- CertSP here- .. . IdP wants to send a signed message to SP . It creates a message and then uses CertIdP to sign it . SP receives the message signed by the IdP using CertIdP . As noted above SP does not have the CertIdP only the parent certificat CertCA . My question is : Can SP validate the signature of the message signed by CertIdP only having its parent certificate CertCA .. . .. . Backstory why want it . .. . .. . We re implementing SAML-Based SSO with PicketLink . We re using PicketLink s SAML2SignatureValidationHandler https : docs.jboss.org author display PLINK SAML2SignatureValidationHandler to validate signatures . To achieve this Service Provider SP needs to have IdP s certificate in its keystore . When a signed SAML assertion is passed to SP this handler uses the IdP s certificate to validate the signature . The process above works well but we have some organisational concerns . This process assumes that SP has the IdP s certificate for validation . In case something changes IdP s certificate must be replaced on the SP side . We may have a large number of SPs hunreds when not thousands so this is quite an effort . Since both CertIdP and CertSP are issued by the same authority CA which is definitely trusted by both IdP and SP we had the idea that we may use the CA s certificate for signature validation . If this works this might eliminate the need to exchange certificates between IdP and SP . The CA s certificate is also very long-living so if only have to be exchanged once in eternity eternity in our case is around 10-20 years . However I am not sure if it is technically possible to validate the signature signed with CertIdP only having the parent CertCA . Is it possible Or are we on completely wrong track here If it s relevant we re on Java JBoss platform on SP side IdP is a third-party software . Update : .. . .. . This is the signature I get at the moment from IdP : .. . Answer : it depends whether your SAML response contains the signing certificate ds : X509Data .. . ds : X509Data or just the public-key ds : KeyValue .. . ds : KeyValue of it . vs . If the signing certificate is embedded it may contain the AuthorityInfoAccess extension which usually contains an http or ldap URL to the issuing CA certificate . Using these extensions from the signing certificate to the trusted CA certificate you would be able to build the trusted certificate chain . Note : If the CertCA is actually the direct issuer of CertIdP and CertSP you already have the required trusted certificate chain . However if you only got the public-key you need to have the signing certificate at hand to match the public-key against . So then it comes down to a provisioning distribution problem . You could provide a web service that returns the corresponding signing certificate for the requested public-key . If the signing certificate was not found in the SP s local keystore it would contact the web service to retrieve the new CertIdP and add it to the local keystore . Keeping the local keystore is performance availability and privacy relevant . Comment : At the moment I get only SignedInfo and SignedValue please see the update in the question . But what you re saying is that if I have the X509Data with the certificate then I could validate it using the CA cert right Comment : I ve just learned that the ds : KeyInfo element is optional in the xmldsig schema as well as in the SAML 2.0 core standard . Yes you just have to get the signing certificate whether via ds : X509Data or via other means depends on the use-case . The approach with a centralized provisioning mechanism works also w o the public-key info e.g . via a well-known URL that provides the current validation certificate . Comment : @lexicore you will always need the certificate that was used to do the signature to verify it . The verification can t be done with only CA cert because you don t know if the signature has been made using certificate issued by this CA or any other CA . If you can set your IdP to put signing IdP certificate in the SAML in the ds : KeyInfo element . Comment : Thank you Awarded the bounty as this was the first - and correct answer .", "Question : I have an installation program created using the limited version of Install Shield within Visual Studio 2012 . I have a digital-certificate that I want to add to the installation program . I d like to use the SingleImage feature of Install Shield to create and deliver a single installation file e.g . setup.exe to my customers . It seems however that I must attach the digital-certificate to an msi file which is embedded within setup.exe by Install Shield . I have found that placing the digital-certificate on setup.exe results in telling the user that the publisher is unknown when running the installation program . If other words that does not properly deploy the digital-certificate . Can I get access to the msi file to add the digital-certificate to it If so how .. . Answer : InstallShield versions prior to IS 2015 do not support SHA-256 certs . So while Mike s answer is correct it no longer does you any good without the new IS because Microsoft requires SHA-256 as of January 1st 2016 . But.. . IS let out a little secret a while back about this before they must have known what they were doing . See this thread on the IS forum https : community.flexerasoftware.com showthread.php 218163-Codesigning-using-SHA-2-SHA256 . In case they take that down here s the important part : .. . .. . If you need this kind of signature immediately you can either sign files yourself at a later point or create a wrapper for signtool.exe that intercepts the command-line-arguments we pass to System signtool.exe and does something else instead . So as Mike said you can t simply sign the outer exe but by replacing their signtool.exe you should be able to sign the inner msi as well . I m looking into implementing this work around now . If anyone else tries this let us know your results .", "Question : How to create a digital-certificate and export to .p12 file in PHP I want the .p12 file to have private key included . And also want to check whether the key pair is already issued logged in database . I found a function called openssl pkcs12 export to file but don t know where to start . Seems that I need an X509 cert and a private key first . .. . Answer : Creating a self-signed-certificate :", "Question : I was recommended coSign for c to sign and verify documents . I can t find anything helpful on the subject of using .cer and .pfx files to sign pdf files . I was assuming it would be as easy as loading a .cer file as a X509Certificate2 and then coSign could just import it . Samples for coSign seem limited . I was able to get coSign to verify if a document had a signature already on it but I have no idea if it can verify if that is the same one based on the digital-certificate . I ve also used another library to sign documents with those type of certificate files . It is not able to verify digital signatures though . .. . Answer : With CoSign you can import externally-issued certificates and keys to your CoSign account . However it is important to note that typically every CoSign account whether CoSign on-premise or CoSign Cloud by default already includes a key and a certificate that can be used for signing . If you do want to use a different signature key and certificate issued on a PFX file for example you can follow the procedure below : .. . .. . From a command-line run the utility C : Program Files ARX ARX CryptoKit utils pkcs12util.exe You will need to specify the PFX filename and PFX file password .. . .. . Your CoSign account should now include the key and certificate from the PFX file and you can use CoSign SAPI for signing with it .", "Question : I was recommended coSign for c to sign and verify documents . I can t find anything helpful on the subject of using .cer and .pfx files to sign pdf files . I was assuming it would be as easy as loading a .cer file as a X509Certificate2 and then coSign could just import it . Samples for coSign seem limited . I was able to get coSign to verify if a document had a signature already on it but I have no idea if it can verify if that is the same one based on the digital-certificate . I ve also used another library to sign documents with those type of certificate files . It is not able to verify digital signatures though . .. . Answer : When you create a CoSign Trial or Cloud account the certificate is created on the CoSign Appliance for you . You cannot import your own certificate to the appliance nor do you need to . The API calls should be made to the CoSign appliance in order to function at no time can signatures be made if the CoSign appliance is not being used otherwise it wouldn t be so secure . You will notice that even with your CoSign user certificate that you cannot export a PFX or P12 file because you can never export the private key from the appliance . Regards .. . .. . Dave Strang .. . .. . The Digital Signature Company Phone : 866 327-9754 Email : [email protected] Website : www.arx.com", "Question : I have a Javascript that is signing a text string in the browser . It uses CAPICOM under Internet Explorer and window.crypto under Mozilla browsers . After the signing process I receive a BASE64 encoded signature . Using HTTPS I upload the signature and the text string to a webserver with a PHP application . From the SSL HTTPS I receive the user s certificate . From this certificate I can extract the user s Public Key . Now I want to verify that the signature against the signed text string and the user s certificate and public-key . I have tried with openssl verify http : www.php.net openssl verify PHP function with no success . I always receive an error : .. . .. . error : 0408D077 : rsa routines : FIPS RSA VERIFY : wrong signature length .. . .. . I have the certificate and it is OK .. . I have the public-key extracted from the certificate and it is also verified and OK .. . I have the signature BASE64 decoded .. . .. . Unfortunately I can t verify the signature I can t provide a demo or sample because it is only in the local network at the moment . Comment : The return values of the PHP function are : 1 if the signature is correct 0 if it is incorrect and -1 on error . What is your return-value Also did you use the correct Signature Algorithm i.e . the fourth parameter of the function.. . Comment : I get 0 - incorrect . Then I request openssl error string and receive the mentioned above error . Comment : At the moment I m trying to verify the signature with openssl smime -verify from the command-line but I always get Verification failure message . I m reading this article : 10552724 http : stackoverflow.com questions 10552724 .. . Answer : OK finally I have found a workaround . 1 . I have a web page encoded in UTF-8 this will be very important on some next steps .. . 2 . Generate the signature : .. . If the user uses Mozilla Firefox Chrome - the signature is generated using the window.crypto . For more information read this http : docs.oracle.com cd E19957-01 816-6152-10 index.htm .. . If the user uses Internet Explorer - the signature is generated using the CAPICOM Crypot Application Interface COM object . For more information read read MSDN http : msdn.microsoft.com en-us library windows desktop aa375732 28v vs.85 29.aspx Both - window.crypto and CAPICOM are not very well documented for web using CAPICOM is not only for web 3 . The text string and the signature are being sent to the webserver by POST request . 4 . The sever Linux Apache and PHP have to verify the signature . Now the problems : .. . .. . 1 . The openssl verify function of PHP is also not well documented and always returns zero - signature not valid . 2 . The CMD tool openssl also is not validating the signature . 3 . Because my web server requires SSL certificate authentication I wanted that the user signs the text string with the same certificate he is logged in . So what is the workaround : .. . .. . 1 . I found that CAPICOM is converting the signed string to UTF-16LE before signing it . Unfortunately the webbrowser sends the text string to the webserver encoded in UTF-8 . It means you have to convert the string from UTF-8 to UTF-16LE before verifying the signature . But this is valid only if the signature was generated by CAPICOM . 2 . The openssl CMD tool is working proper now . The difference between the CMD tool and the PHP function are : .. . The signature and the source are sent to PHP function as strings . In case of using the CMD tool the signature and the source are sent as file paths . So if you are using the CMD instead of PHP function you have first to save the signature and the source as files . Remember to convert the encoding if needed . The PHP function expects as a parameter to receive the public-key of the signer . So before this you have to check if the certificate is issued by a trusted Certificate Authority CA . Instead - the CMD tool expects as a parameter to receive a file which contains a list of root certificates of trusted Certificate Authorities . This means - you have to check the signer before verifying . 3 . It seems that under Firefox Mozilla Chrome browsers it is not possible to limit the user exactly which certificate to use for signing . But it is possible to limit the options . Of course this is not documented at all or I didn t find any proper information about this . So the signText function expects a third parameter which must be the trusted Certificate Authority names . First I expected that this must be the CN of the issuer of the client s certificate . But actually it is not . It must be all the issuer string separated with comas like : C Country ST State L Location O Organization CN CommonName STREET Address Unfortunately this string is slightly different from the issuer string from openssl which looks like issuer streetAddress Address CN CommonName O Organization L Location ST State C Country . If someone have a Firefox under Linux it will be very interesting to check if this string is formatted the same way . I don t know how to separate more CA names in a single string . 4 . Under Internet Explorer using CAPICOM it is possible to send only one certificate object to the signing object so it will not open the dialog to select a certificate from a list . You can find the proper certificate by comparing the root certificate fingerprint A SHA1 hash of the BASE64 65 chr line encoded certificate excluding the header and footer and the serial-number of the certificate . Just read the MSDN it is well documented . Now . What my source code looks like : .. . .. . 1 . If the signature was generated by CAPICOM of window.crypto I receive an additional parameter from the webbrowser how the signature was generated If CAPICOM is used I convert the source data like this : POST source iconv UTF-8 UTF-16LE POST source .. . 2 . I generate 2 temporary files . The names of the files can be generated using the PHP function uniqid http : php.net manual en function.uniqid.php . The default temp directory can be found using the sys get temp dir http : php.net manual en function.sys-get-temp-dir.php . 3 . The source file is saved exactly as received from the POST array . If the signature was generated by CAPICOM it must be converted to UTF-16LE . 4 . The signature comes from the web browser BASE64 encoded . Do not decode it . Just save it in a new file and add a special header and footer like this : -----BEGIN PKCS7----- n . POST signature . n-----END PKSC7----- Note that the header and footer must be on separate lines . The lines separator must be only n ASCII 10 not r ASCII 13 of r n ASCII 13 10 . 5 . You must have a file which contains all trusted CA root certificates . The format of this file must be as follows : .. . A header -----BEGIN CERTIFICATE----- .. . BASE64 encoded certificate .. . A footer -----END CERTIFICATE----- .. . empty line .. . If you have more than one trusted CA root - each certificate must start with a header and end with a footer string . All certificates are stored in a single file .. . 6 . Run the CMD tool openssl using next parameters : .. . smime - to use the SMIME function of the CMD tool .. . -verify - to do a verification .. . -in filepath - the path to the signature file created in step 4 .. . -inform PEM - the forat of the signature is BASE64 encoded file with header and footer .. . -binary - prevents translation of the source from binary to text .. . -content filepath - the path to the source file created in step 3 .. . -CAfile filepath - the path to the trusted CA root certificates file created in step 5 So the final command looks like this : openssl smime -verify -in file.pem -inform PEM -binary -content source.txt -CAfile root.pem .. . 7 . Now call this from PHP using the shell-exec http : bg2.php.net manual en function.shell-exec.php function and read the output . If the output string starts with Verification successful - the signature is OK .. . If the output string starts with Verification failure - the signature is not OK .. . If the output string is different - some error have occurred . The error description is stored in the output string . The above works for me . Unfortunately openssl CAPICOM and window.crypto are very tricky and it is always possible that a problem occurs . Hope this will help somebody . Best Regards Comment : I think that this will not work in Google Chrome Comment : @Babailiica did you try to use openssl verify from php to validate with the pkcs7 signature Or it has to be done with command-line openssl", "Question : I tried creating a temporary certificate using makecert and creating a spc from the certificate using cert2spc . I signed some exe with the generated spc . I then use the binary editor in VS 2008 to flip some bits tampered it in the exe . To my surprise I was able to execute the application . I was expecting that the system will detect the tampering and will complain . Hence the question . Any guidance would be appreciated . .. . Answer : No because any code in the binary to check the signature can also be tampered with . I recommend obtaining a copy of IDA Pro and disassembling one of your binaries . After you have the raw assembler you can edit specific opcodes using a hex editor . In short this is the tactic that the cracker community uses . I don t believe that there will ever be a way to stop this the ps3 and xbox360 both use digital signatures to protect their binaries but this doesn t stop piracy . Comment : Thanks for the response . I wonder about what kind of tampering attack the digital signatures can with stand . Am I doing anything wrong in a way I am assigning signatures to my binaries . I am doing this just for the purpose of learning . Comment : Learning is awesome I totally support that . The problem with this scenario is that the attacker has full control over the system he owns the computer and processor and the binary so as a software developer you don t have the control . Where digital-signature works exceedingly well is in network communications . SSL TLS which powers HTTPS would not be possible without digital signatures . The difference is that the attacker is on the outside looking in on 2 people that want to communicate in a secure manner .", "Question : I m trying to sign an XML file using a x.509 certificate I can use the private key to sign the document and then use the CheckSignature method it has an overload that receives a certificate as parameter to verify the signature . The problem is that the user who validates the signature must have the certificate my concern is if the user has the certificate then he has access to the private key and as I understand this is private and should be available only to the user who signs . What am I missing Thanks for your help . .. . Answer : Any certificate has a public and a private part . You only send around the public part . Just open any SSL enabled website in your browser click on the padlock symbol and have a look at their certificate . Comment : Thank you that s exactly what I didn t have clear . Now I know that I have to use a certificate from the X509Store to get the signer certificate and use a .cer file as the verifier .", "Question : I have a Javascript that is signing a text string in the browser . It uses CAPICOM under Internet Explorer and window.crypto under Mozilla browsers . After the signing process I receive a BASE64 encoded signature . Using HTTPS I upload the signature and the text string to a webserver with a PHP application . From the SSL HTTPS I receive the user s certificate . From this certificate I can extract the user s Public Key . Now I want to verify that the signature against the signed text string and the user s certificate and public-key . I have tried with openssl verify http : www.php.net openssl verify PHP function with no success . I always receive an error : .. . .. . error : 0408D077 : rsa routines : FIPS RSA VERIFY : wrong signature length .. . .. . I have the certificate and it is OK .. . I have the public-key extracted from the certificate and it is also verified and OK .. . I have the signature BASE64 decoded .. . .. . Unfortunately I can t verify the signature I can t provide a demo or sample because it is only in the local network at the moment . Comment : The return values of the PHP function are : 1 if the signature is correct 0 if it is incorrect and -1 on error . What is your return-value Also did you use the correct Signature Algorithm i.e . the fourth parameter of the function.. . Comment : I get 0 - incorrect . Then I request openssl error string and receive the mentioned above error . Comment : At the moment I m trying to verify the signature with openssl smime -verify from the command-line but I always get Verification failure message . I m reading this article : 10552724 http : stackoverflow.com questions 10552724 .. . Answer : OK finally I have found a workaround . I have a web page encoded in UTF-8 this will be very important on some next steps Generate the signature : If the user uses Mozilla Firefox Chrome - the signature is generated using the window.crypto . For more information read this If the user uses Internet Explorer - the signature is generated using the CAPICOM Crypto Application Interface COM object . For more information read read MSDN Both - window.crypto and CAPICOM are not very well documented for web using CAPICOM is not only for web The text string and the signature are being sent to the web server by POST request . The server Linux Apache and PHP have to verify the signature . Now the problems : .. . .. . The openssl verify function of PHP is also not well documented and always returns zero - signature not valid . The CMD tool openssl also is not validating the signature . Because my web server requires SSL certificate authentication I wanted that the user signs the text string with the same certificate he is logged in . So what is the workaround : .. . .. . I found that CAPICOM is converting the signed string to UTF-16LE before signing it . Unfortunately the web browser sends the text string to the web server encoded in UTF-8 . It means you have to convert the string from UTF-8 to UTF-16LE before verifying the signature . But this is valid only if the signature was generated by CAPICOM . The openssl CMD tool is working proper now . The difference between the CMD tool and the PHP function are : .. . .. . The signature and the source are sent to PHP function as strings . In case of using the CMD tool the signature and the source are sent as file paths . So if you are using the CMD instead of PHP function you have first to save the signature and the source as files . Remember to convert the encoding if needed . The PHP function expects as a parameter to receive the public-key of the signer . So before this you have to check if the certificate is issued by a trusted Certificate Authority CA . Instead - the CMD tool expects as a parameter to receive a file which contains a list of root certificates of trusted Certificate Authorities . This means - you have to check the signer before verifying . It seems that under Firefox Mozilla Chrome browsers it is not possible to limit the user exactly which certificate to use for signing . But it is possible to limit the options . Of course this is not documented at all or I didn t find any proper information about this . So the signText function expects a third parameter which must be the trusted Certificate Authority names . First I expected that this must be the CN of the issuer of the client s certificate . But actually it is not . It must be all the issuer string separated with commas like : .. . .. . Unfortunately this string is slightly different from the issuer string from openssl which looks like .. . .. . If someone have a Firefox under Linux it will be very interesting to check if this string is formatted the same way . I don t know how to separate more CA names in a single string . Under Internet Explorer using CAPICOM it is possible to send only one certificate object to the signing object so it will not open the dialog to select a certificate from a list . You can find the proper certificate by comparing the root certificate fingerprint a SHA1 hash of the BASE64 65 chr line encoded certificate excluding the header and footer and the serial-number of the certificate . Just read the MSDN it is well documented . Now . What my source code looks like : .. . .. . If the signature was generated by CAPICOM of window.crypto I receive an additional parameter from the web browser how the signature was generated If CAPICOM is used I convert the source data like this : .. . .. . I generate 2 temporary files . The names of the files can be generated using the PHP function uniqid . The default temp directory can be found using the sys get temp dir . The source file is saved exactly as received from the POST array . If the signature was generated by CAPICOM it must be converted to UTF-16LE . The signature comes from the web browser BASE64 encoded . Do not decode it . Just save it in a new file and add a special header and footer like this : .. . .. . Note that the header and footer must be on separate lines . The lines separator must be only n ASCII 10 not r ASCII 13 or r n ASCII 13 10 . You must have a file which contains all trusted CA root certificates . The format of this file must be as follows : .. . .. . If you have more than one trusted CA root - each certificate must start with a header and end with a footer string . All certificates are stored in a single file Run the CMD tool openssl using next parameters : .. . .. . smime - to use the SMIME function of the CMD tool .. . -verify - to do a verification .. . -in filepath - the path to the signature file created in step 4 .. . -inform PEM - the forat of the signature is BASE64 encoded file with header and footer .. . -binary - prevents translation of the source from binary to text .. . -content filepath - the path to the source file created in step 3 .. . -CAfile filepath - the path to the trusted CA root certificates file created in step 5 .. . .. . So the final command looks like this : .. . .. . Now call this from PHP using the shell-exec function and read the output . If the output string starts with Verification successful - the signature is OK . If the output string starts with Verification failure - the signature is not OK . If the output string is different - some error have occurred . The error description is stored in the output string . The above works for me . Unfortunately openssl CAPICOM and window.crypto are very tricky and it is always possible that a problem occurs . Hope this will help somebody .", "Question : I am attempting to create a certificate with a private key .pfx that I can use within my application to create and verify digital signatures . I want to install this certificate into the certificate store Windows . I am having issues importing the certificate onto my local machine . The certificate import wizard is always reporting The password you entered is incorrect . This is referring to the password for the private key in the pfx file I have created . Now I know for a fact that the password is correct so there must be some other factor in play here . The script I am using to create the key is with a batch-file and contains the following command : .. . .. . Does anyone know what could be causing the import wizard to tell me The password you entered is incorrect Comment : I trust the computer more than I trust you . The password you enter is incorrect . There may be differences in white space invisible characters or case . Comment : Yes I would think the same . I have tried this with a single character password to try and remove any possibility of me fumbling the password . When you enter the password in the import wizard you can specify display password . I am 100 certain I have specified the password correctly - It still fails . Comment : For anyone who gets a similar problem : The problem is with the pvk2pfx.exe command . When using this to package a key with a password you need to specify the -pi command-line argument with the password of the private key . .. . Answer : As MarkW pointed out try entering the password into the command-line instead of typing into the dialog eg : .. . .. . pvk2pfx -pvk Test.pvk -pi p4sswd -spc Test.cer -pfx Test.pfx -po p4sswd", "Question : I m trying to sign an XML file using a x.509 certificate I can use the private key to sign the document and then use the CheckSignature method it has an overload that receives a certificate as parameter to verify the signature . The problem is that the user who validates the signature must have the certificate my concern is if the user has the certificate then he has access to the private key and as I understand this is private and should be available only to the user who signs . What am I missing Thanks for your help . .. . Answer : In .NET If you get your X509 cert from a .pfx file like this : .. . .. . Then you can export the public-key portion like so : .. . .. . The false part says only export the public piece don t export the private piece . doc for RSA.ToXmlString http : msdn.microsoft.com en-us library system.security.cryptography.rsa.toxmlstring.aspx .. . .. . And then in the verifying application use .. . .. . And the VerifyXml calls CheckSignature . It looks something like this : Comment : The code seems to be from msdn.microsoft.com en-us library ms229950 v vs.110 .aspx http : msdn.microsoft.com en-us library ms229950 v vs.110 .aspx . I think it s cool that you include the code here instead of just linking to it though but give credit where it s due .", "Question : My scenario is we have one program exe that will start other programs if found in a particular folder . I want to ensure it only ever starts programs which are signed with our Corporate certificate Verisign approved etc . Essentially then it will only start the programs with the same certificate as itself . I don t want to ship the certificate itself . I ve been searching the web and the system namespace and haven t found a clear example that reads the certificate data from a file and also validates it and can check against another file . The closest I ve found is Signtool and and having this verification in a separate exe is kind of point less . I know the Strong Naming stuff wont help because a digitally signed file is different as helpfully explained here http : blog.codingoutloud.com 2010 03 13 three-ways-to-tell-whether-an-assembly-dl-is-strong-named Also some other examples in SO showing encryption and verification of raw data but not an assembly where it s packaged up together in some way . Any ideas or suggestions .. . Answer : You can try three option here . 1 The first one is using Assembly load like here : .. . .. . You can print the hexadecimal format of the public-key and public-key token for a specific assembly by using the following Strong Name Sn.exe command : .. . .. . If you have a public-key file you can use the following command instead note the difference in case on the command-line option : .. . .. . 2 The second one is mentioned here http : stackoverflow.com questions 308756 checking-an-assembly-for-a-strong-name 309429 309429 . And use p Invoke for such issue . 3 Also exists third more agile and more complex way for doing this . This is a Binding Policy . You can take it into account in the case-when you should to provide upgrades for an application that s already deployed . When a new version of a shared component comes out that your application can benefit from an application policy file will allow you to provide these benefits without recompiling or replacing existing installations . You can find more about this feature here : .. . .. . http : msdn.microsoft.com en-us library aa309359 28v vs.71 29.aspx .. . .. . http : ondotnet.com pub a dotnet 2003 03 17 bindingpolicy.html", "Question : I am still new to security issues so my problem may actually be just a misunderstanding . The system I am working has the requirement that users should sign timestamp data somewhere in the web application . However in order to sign with a digital-certificate users should input their privates keys on the system . Giving the fact that a third party is involved we as a company should guarantee that only the end user is allowed to sign timestamp data . The only way I see out of this is to create a desktop application that can certificate data . But still I should need somewhere the ability of timestamping and this would require communication with an external server which could be a way of our company stealing their private keys . Is there a pattern for signing timestamping data on the Internet and specifically on a web app How could this be implemented Comment : No I mean signing with a digital-certificate . By third party you mean someone to say my code is safe Comment : How homogenous are the private keys you re talking about Shall your users be able to bring their own anything accepted or do you somehow limit the type What about smart cards or USB tokens In those cases you obviously cannot extract the private key but the card or token has to do the signing which most likely means that it hsa to happen at the computer at which the user himself works . This would point towards a desktop application indeed but also indicate a wide range of hardware to support.. . Comment : @mkl Users are supposed to use a certain kind of certificate we will point out which authorities they can contact . Still studying smart cards and tokens . The point is that our company should not touch and see the users private key . Comment : In that case a solution as depicted by Eugene Mayevski in his answer is quite apropos . The only question is how your company shall guarantee that the private keys are only used for signing their respective owner s data . Does it suffice that your company presents the solution and promisses to use the private key only like that and especially not to transmit it elsewhere Or do you require some kind of certification In the former case a solution built by you is ok . In the latter case it might be easier to buy a third party product for this task which already is appropriately certified . Comment : @mkl I would need to certify that our application isn t going to use the private keys for anything else so we really can t see these private keys . I don t know any kind of application certification about private key usage but I will look for it . Anyway it would be much easier to let the user choose the application he wants to certify though we would still need to timestamp the data . .. . Answer : So you have a server and users . Users perform digital signing of data on their systems . Timestamping is done together with signing it proves the signing time . Timestamping is performed by trusted thirdparty TSA Timestamping Authorities . The code which will do signing will contact the TSA usually using HTTP or HTTPS protocol and timestamping will be performed that way . TSA s certificate is included with the timestamp so that the timestamp can be validated later . Now about technical side . For web application your best option is to create an applet or ActiveX control which will be downloaded to user s browser and which will do signing . Our company offers pre-created solution for this and I described it in details in this answer http : stackoverflow.com a 10656679 47961 . Of course you can let the user download the document and sign it using Acrobat stuff or some other client-side application then upload the document back . If you decide to write such application yourself you would need signing components eg . IText or our SecureBlackbox http : www.eldos.com sbb desc-pdf.php . Comment : +1 to implement the analogous applications using iText have a look at the white paper Digital Signatures for PDF documents http : itextpdf.com book digitalsignatures especially section 4.3 Client server architectures for signing . PS : iText can be licensed either commercially or within the terms of the AGPL", "Question : I m trying to sign data using the WebCrypto API but instead of creating a private public-key and exporting it to pkcs 1 or 8 I would really like to use a user s PKCS 12 to sign data . I ve read the W3C spec but cannot make much of it and can t find any good material on how to do this . Right now I want to leave ActiveX and Java Applets aside . Is there a way to tweak the following : .. . .. . Any pointers UPDATE Here s the code I ve been working Comment : At the moment WebCrypto is not yet ready for such things . Comment : @Eugene Mayevski EldoS Corp ok pkcs8 it is thx .. . Answer : Web cryptography api does not support PKCS 12 . You can use a third party library to decode the p12 as forge https : github.com digitalbazaar forge pkcs12 and load privateKey in webcrypto .. . .. . Reading the PKCS 12 certificate .. . .. . PKCS 12 is stored in DER so first read it from a File or use a pre-stored base64 .. . .. . Decode PKCS 12 with forge and extract private key .. . .. . Then decode DER format to ASN1 and let forge reads the content .. . .. . Then get the private key from pkcs12 of the desired certificate see forge doc and convert to PKCS 8 to be imported with webcrypto .. . .. . Convert to PKCS 8 .. . .. . Import key in Webcrypto .. . .. . And finally import the key in webcrypto .. . .. . Digital signature .. . .. . With the imported cryptoKey returned from the above method you can sign with webcrypto . I include coding from base64 because data conversions are not trivial .. . .. . In pkc12 you also have the certification chain if you need to build advanced formats like AdES Comment : Is there a predefined html+css template I have to follow with the forge library . I get error like : Uncaught TypeError : Cannot read property Class of undefined pkcs12.js : 109 Comment : also : util.js : 1569 Uncaught TypeError : input.replace is not a function util.js.1569 and several other errors . I downloaded a recent version from github Comment : Forge is pure javascript . You do not need html or css . have you built the minified .js Do not import the source files one by one because are dependencies . Please also provide details of the code you are executing Comment : I ve updated the code I ve been working on I have now the minified version of forge and get a different error I went into the code and found this line where it happens t.decode64 function e e e.replace A-Za-z0-9 + g Comment : You can store the public certificate safeBag.type forge.pki.oids.certBag safeBag.attributes.localKeyId in PEM format Base64 encoded . Use the following forge function : forge.pki.certificateToPem safeBag.cert To decode the cert use forge.pki.certificateFromPem certificatePem", "Question : why PDF Reader doesn t show the embedded OCSP Response I haven t even used crlClient : .. . .. . PDF revocation tab details shows : .. . .. . The selected certificate is considered valid because it does not appear in the Certificate Revocation List CRL that is contained in the local cache . .. . The CRL was signed by B-Trust Operational CA QES hidden email on 2014 02 19 07 : 53 : 35 +02 00 and is valid until 2014 03 21 07 : 53 : 35 +02 00 . I want to achieve the Figure 3.8 A digital-signature with an embedded OCSP response from Bruno Lowagie s free White Paper document . What do I do wrong or miss Here is the Certification path http : dox.bg files dw a 2cf7f3b7aa and sample pdf http : dox.bg files dw a 377345bb48 . Best Regards Valentino Comment : I guess you re not getting an answer because there s nothing to test : you didn t use the LoggerFactory that writes all actions taken during the signing process . If you had done so and posted the output we could have seen if 1 the certificate supports OCSP and 2 if the OCSP server was successfully contacted . We also didn t get a PDF to check if there s actually an OCSP response inside the PDF . As for the message shown by Adobe Reader : it clearly says that the CRL is read from the local cache . This means that the CRL isn t stored in the PDF . It was downloaded and cached by Adobe Reader . Comment : I have edited my post by adding links to PDF sample and certificate chain . When I use LoggerFactory.getInstance .setLogger new SysoLogger I got only : INFO Getting OCSP from ocsp.b-trust.org http : ocsp.b-trust.org Comment : The signature contains exactly one OCSP response and no CRL . Interestingly Adobe Readers on my machines say that they used the embedded CRL to check revocation of the CA certificate . I assume there is some mix-up and they actually mean OCSP responses . That all being said though don t count on a verifying software to use the information you provide in a PDF . If it for which reasons ever prefers other input it is free to use that . Comment : I have some doubts.That s why I intentionally gave link-to overview of the certification chain . RFC6960 http : tools.ietf.org html rfc6960 section-4.2.2.2 which is about OCSP states in 2.6 . OCSP Signature Authority Delegation and 4.2.2.2 . Authorized Responders : This certificate MUST be issued directly by the CA that is identified in the request . The CA SHOULD use the same issuing key to issue a delegation certificate as that used to sign the certificate being checked for revocation . In my case OCSP isn t issued by the client Issuer but by the Root Could that be the reason @Bruno Comment : I would like to confirm that the problem is due to non-conforming OCSP certificate . As @Mkl suggested me I create OCSP certificate that conform to OCSP RFC6960 and Acrobat Reader revocation tab shows the embedded OCSP response correctly . Thank Michael and Bruno . .. . Answer : The actual issue is that even when PDF has embedded only OCSP response Acrobat Reader doesn t show it but shows local CRL instead . This is caused of non-conforming to RFC6960 or RFC2560 OCSP certificate . Wrong OCSP certificate path : .. . .. . Right OCSP certification path :" ] }
[ "yes-answer-long", "yes-answer-short" ]
digital-signature
UNK_RELATION
alchemy@flash-player@153
alchemy -- alchemy is a research project from adobe systems that allows for the compilation of c and c++ code to avm2 bytecode so that it can be run on @placeholder or adobe air .
{ "confidence": [ 66.11959838867188, 64.8153305053711, 61.14434814453125, 59.0720329284668, 55.51716232299805, 53.93311309814453, 53.34154510498047, 50.65898513793945, 50.57452392578125, 50.268436431884766, 49.57434844970703, 49.40242004394531, 48.39315414428711, 48.103904724121094, 45.105186462402344, 44.05426788330078, 43.57527542114258, 42.78058624267578, 42.12859344482422, 41.96067810058594, 41.70488739013672, 41.57833480834961, 41.07231140136719, 40.650230407714844, 40.602874755859375, 40.33916091918945, 40.11056137084961, 39.566104888916016, 39.11787414550781, 38.75616455078125, 38.74794006347656, 38.660919189453125, 38.18876647949219, 38.16144943237305, 38.16144943237305, 38.09762191772461, 37.945613861083984, 37.945613861083984, 37.945613861083984, 37.90565872192383, 37.87879180908203, 37.740535736083984, 37.653038024902344, 37.62261199951172, 37.405487060546875, 37.169288635253906, 37.105342864990234, 36.96302032470703, 36.691104888916016, 36.528324127197266, 36.528324127197266, 36.3240966796875, 36.06817626953125, 35.90641784667969, 35.82164764404297, 35.73646545410156, 35.56068420410156, 35.477020263671875, 35.21161651611328, 35.15635299682617, 34.97976303100586, 34.95582580566406, 34.95582580566406, 34.67604064941406, 34.40943908691406, 34.082557678222656, 33.9005126953125, 33.749942779541016, 33.68623733520508, 33.68623733520508, 33.679630279541016, 33.679630279541016, 33.679630279541016, 33.669708251953125, 33.578487396240234, 33.578487396240234, 33.578487396240234, 33.578487396240234, 33.578487396240234, 33.578487396240234, 33.578487396240234, 33.578487396240234, 33.578487396240234, 33.513343811035156, 33.41382598876953, 33.366668701171875, 33.26851272583008, 32.89897537231445, 32.7744140625, 32.49506378173828, 32.49506378173828, 32.49506378173828, 32.49506378173828, 32.49506378173828, 32.49506378173828, 32.49506378173828, 32.49506378173828, 32.25712203979492, 32.03657913208008, 32.03657913208008 ], "content": [ "I trying to use Adobe Alchemy Compiled C++ code to swc .", "It is about Adobe Alchemy a framework to compile C and C++ code to Flash bytecode so this is a client-side only question .", "Is it possible to do this with Adobe Alchemy", "How can i generate swc files from swf or abs been made with avm2 assembly adobe alchemy compiler .", "I m using Adobe Alchemy http : labs.adobe.com technologies alchemy in a project that uses UnitTest++ http : unittest-cpp.sourceforge.net .", "So I downloaded Speex Library from speex.org installed Adobe Alchemy .", "It seems that Adobe Alchemy http : labs.adobe.com technologies alchemy isn t running global constructors .", "WCK creators have provided an instruction about how to recompile c++ Box2D library using Adobe Alchemy .", "Passing a ByteArray from Flex to C++ http : nexus.zteo.com blog 2008 12 22 adobe-alchemy-passing-a-bytearray-from-flex-to-c", "I have a C project that I m using with Alchemy http : labs.adobe.com technologies alchemy .", "Im aware that it is possible to use C++ audio digital signal-processing in adobe flash using Alchemy as a way to compile the C++ code .", "I convert bitmapData to Big-endian ByteArray and then push it into memory with Adobe Alchemy .", "I read that Alchemy allows compiling c++ libs for Flash .", "Anyway it sounds like Adobe will get an official version of Alchemy out in 2012 .", "I have a project that is using alchemy-cms and alchemy-devise gem .", "I think we need to see the AS3 that calls the Alchemy C code .", "Adobe says specifically not to rely on Alchemy yet so there s no official way to do it on the client-side as far as I know .", "I will try alchemy in windows version", "I try to use Alchemy so C C++ are welcome : I found already Mesa3d .", "class string is broken in alchemy .", "That fixed the spree routes but not alchemy", "I m new to alchemy-cms http : alchemy-cms.com about .", "Open a file and assign it to a global variable on the C side of alchemy .", "I am using alchemy API for my project .", "With Alchemy most builds are static swc builds .", "This problem was the reason I abandoned Alchemy .", "The Alchemy is not mounted", "I added Alchemy CMS to my Spree project that was previously functioning ok .", "If I try any of the Alchemy admin routes I get Alchemy : : Page not found login", "But I need to compile ffmpeg with custom compiler opensource gcc analog called Adobe Alchemy http : labs.adobe.com technologies alchemy lets us compile C c++ into Flash .. . .. . It gives me errors on nearly each and every file during standart Make : .. . .. . So what shall I do - how to compile ffmpeg at least smallest part of it via alchemy", "You can compile C++ libs but watch out for std : : string http : stackoverflow.com questions 7421832 using-stl-with-alchemy .", "It uses the C C++ Game Music Emu library and was originally compiled with Alchemy but I want to see if there is a performance increase with FlasCC .", "i am trying to integrate alchemy api in my project which is in php .", "However when compiled with alchemy it will print test1 : 3 .", "Fortunately the Alchemy distro leaves some breadcrumbs for us .", "See this SO post http : stackoverflow.com questions 7421832 using-stl-with-alchemy", "The rest is handled by the Alchemy magic .", "This is the recommended way to mount Alchemy .", "2 Using Alchemy", "Alchemy has a very strong catch all route .", "I m not try to include Alchemy CMS https : github.com AlchemyCMS alchemy-cms in the project .", "Static initializers are broken in Alchemy http : stackoverflow.com questions 4169892 globals-broken-with-alchemy .", "But getting exception like anchordate is not a valid attribute in alchemy language .", "Using alchemy-devise for user auth .", "As the alchemy C code is running within the Flash VM you can t do anything with C that you can t already do with ActionScript .", "It turns out that UnitTest++ depends on a feature of C++ that isn t implemented in Alchemy http : stackoverflow.com questions 4169892 globals-broken-with-alchemy namely instantiating static-classes and or calling functions to initialize global vars .", "@robin you need to use the alchemy executable to create a new project .", "https : github.com magiclabs alchemy-devise blob master app controllers alchemy users controller.rb .. . .. . line 6 and block on line 40 .. . .. . this code comes directly from the gem how can i stop it from been executed", "We have licensed a library written in C which is being provided as an Alchemy-compiled SWC .", "For this I am using Python library given by alchemy .", "I have no prior experience with Flash or Alchemy .", "How did you installed Alchemy", "How can I display elements with the same tag in Alchemy CMS", "However my questions is is it possible to use Flash Alchemy dsp and package that as an Air app for IOS Android", "From the docs http : labs.adobe.com wiki index.php Alchemy 3aDocumentation 3aDeveloping with Alchemy 3aAS3 API : .. . .. . supplyFile path : String data : ByteArray : This method allows you to provide a file at a specified path for the C code .", "You can embed an arbitrary number of Alchemy libraries this way each running in its own ApplicationDomain .", "Have you run the Alchemy rake command on your Heroku server", "The Flash VM itself is Little Endian as is code running in Alchemy .", "Is it possible to assign an Alchemy stored image path into a CSS background property", "My plan is to create a new page in alchemy-cms i did the following steps .. . .. . How to display this page on Alchemy-cms backend", "While Alchemy supports compiling C++ it seems that using the using the STL is trouble mostly due to a problem with std : : string http : forums.adobe.com thread 487570 .", "No I m not able to access any Alchemy routes including admin .", "Also maps spree home and index maps to the alchemy index .", "I think your question is not how to access the main apps routes from within the Alchemy engine because you are working in your main app not in Alchemy - Alchemy just comes in as a gem .", "I use this example code http : blog.debit.nl 2009 03 using-bytearrays-in-actionscript-and-alchemy Memory allocation in C with direct access in Actionscript FAST", "So I think there s no way to tell Alchemy API where to search .", "Note that after unpacking alchemy gnucpp3-4library 121008.zip you ll need to edit two atomicity.h files : .. . .. . ALCHEMY HOME avm2-libc include c++ 3.4 bits atomicity.h .. . ALCHEMY HOME avm2-libc libstdc++ include bits atomicity.h .. . .. . Here is the code : .. . .. . Here is some test code to run to make sure the rebuilt STL works : .. . .. . Note that the rebuilt STL appears to fix some related issues with map http : stackoverflow.com questions 3756250 stdmap-broken-in-alchemy and ifstream http : forums.adobe.com thread 487828 .", "Copy the contents from VCAP SERVICES and paste in a local text file inside your eclipse project called home leoks git qi qi.json for example of course you can change that .. . .. . Notice that Alchemy API may take some minutes to activate and you can only have 1 Alchemy API module in Bluemix .", "You can create a controller that sits in front of Alchemy API + Dialog .", "I am not sure you can train a model using alchemy API .", "This would give all libraries their own memory and would allow you to load multiple Alchemy libraries .", "The problem is that we want to dynamically load the Alchemy lib but if we build the library as a SWF it won t work as that makes a standalone app .", "Use the initializer like you normally would http : labs.adobe.com wiki index.php Alchemy 3aDocumentation 3aDeveloping with Alchemy 3aAS3 API CLibInit .", "Running these same tests with the same files via regular Alchemy e.g . not using swfbridge but using supplyFile from AS is very fast .", "This http : labs.byhook.com tag alchemy is a good tutorial to get you going .", "I am using Alchemy API for named entity extraction .", "The point is you can t recompile the SWC into an SWF if you don t use alchemy .", "I use Box2D Alchemy port in one of my Flash gaming projects .", "Where to find that old Alchemy which was used by WCK creators", "Broadcast in parallel not available with alchemy and Timeout for a specific client is not possible .", "What I m doing is retrieving data using the alchemy api .", "I would like to ask you about Alchemy API on Bluemix .", "This will add the Alchemy API credentials to your Bluemix App VCAP SERVICES system variable .", "As I can understand this feature will be implemented in Alchemy 4 by Nodes even the Page model will be registered as Alchemy : : Node and developer will be able to create own Nodes which will behave like custom-post-type in WordPress .", "Step 4 : Add to your Bluemix Project using the Bluemix web UI an Alchemy component .", "So to access Spree admin you need to use shop admin while Alchemy routes are all accessible directly under .", "When trying to install Alchemy bundle exec rake alchemy : install .", "I think is use Alchemy to analyze our web site and have a chat bot that can answer random questions using general knowledge as well as what Alchemy has learnt from our site .", "I have used the Alchemy Language API demo : .. . .. . https : alchemy-language-demo.mybluemix.net .. . .. . ...to deploy on Bluemix dashboard and now it is successfully built and deployed .", "I am developing a Rails 4.1 application that sits alongside Alchemy CMS .", "I get this error : uninitialized constant Alchemy : : Seeder NameError .", "You need to add require alchemy seeder into your spec helper.rb", "Seems like a problem with the Assets Pipeline of Rails and is not particular Alchemy related .", "After installation of Alchemy cms Ruby getting error as Root page not found . .", "Alchemy maintainer here : .. . .. . Did you setup your Database", "should ve added Alchemy : : Seeder.seed into your app s db seeds.rb .", "Perhaps Alchemy Websocket does something the client-side of the websocket does not expect .", "The Alchemy CMS is being mounted inside of my config routes.rb : .. . .. . But when I run git-push heroku master I receive this output : .. . .. . I check the logs and it was telling me that Alchemy was not mounted .", "By the way you should really move on from Alchemy to FlasCC http : gaming.adobe.com technologies flascc .", "But Alchemy has been transformed to Crossbridge Flascc and the recompiling instructions from WCK are not working with it ." ] }
{ "confidence": [ 73.09046936035156, 72.8940658569336, 70.51793670654297, 69.81243133544922, 65.84513854980469, 63.50469207763672, 63.38301467895508, 63.133689880371094, 62.38658142089844, 62.20744323730469, 61.7686767578125, 61.571571350097656, 58.034088134765625, 56.90159606933594, 56.53034210205078, 55.93157196044922, 55.342811584472656, 55.03655242919922, 54.756980895996094, 54.32775115966797 ], "content": [ "Question : Im aware that it is possible to use C++ audio digital signal-processing in adobe flash using Alchemy as a way to compile the C++ code . However my questions is is it possible to use Flash Alchemy dsp and package that as an Air app for IOS Android Cheers .. . Answer : Yes I used myself as3Crypto wrapper Alchemy version without problem on both Android and iOS others also successfully used Box2D Alchemy port in mobile games hence it might work in your case too you ll just process byteArray sound data . Anyway before starting your project you can test ex : Ogg Vorbis Alchemy functionality here is good article with sourse codes http : labs.byhook.com 2011 02 22 ogg-vorbis-encoder-decoder-for-flash", "Question : How can i generate swc files from swf or abs been made with avm2 assembly adobe alchemy compiler . this code generated the swf and the abc files : .. . .. . does anybody know how to use any option in this code to make swc . .. . Answer : You can pass -swc instead of -swf . By the way you should really move on from Alchemy to FlasCC http : gaming.adobe.com technologies flascc .", "Question : Im aware that it is possible to use C++ audio digital signal-processing in adobe flash using Alchemy as a way to compile the C++ code . However my questions is is it possible to use Flash Alchemy dsp and package that as an Air app for IOS Android Cheers .. . Answer : I ve tried ALF Library http : music.ece.drexel.edu ALFdocs files Flash ALF-as.html - it works just fine in simulator on the dev machine but whenever I launch it on mobile device in release-mode -- the performance is disastrous .", "Question : While Alchemy supports compiling C++ it seems that using the using the STL is trouble mostly due to a problem with std : : string http : forums.adobe.com thread 487570 . What s strange is that Alchemy seems to be using GNU libstd++ v3.4.6 http : ftp.gnu.org pub pub gnu gcc gcc-3.4.6 . It s hard to believe that std : : string is broken in GNU s STL . Has anyone figured out any workarounds for this problem C++ without the STL is like a fish without water . .. . Answer : The problem isn t in the STL as such . The GNU implementation of std : : string is reference-counted using the thread-safe functions gnu cxx : : exchange and add and gnu cxx : : atomic add . The problem is that exchange and add atomic add are broken . The solution is to rebuild the STL with good implementations of these functions . Fortunately the Alchemy distro leaves some breadcrumbs for us . See ALCHEMY HOME avm2-libc README which tells us how to do it : .. . .. . Normally I d expect to find the implementations of exchange and add atomic add-in libstd++ ALCHEMY HOME avm2-libc lib avm2-libstdc++.l.bc but for some reason they re defined in libc ALCHEMY HOME avm2-libc lib avm2-libc.l.bc . I m not sure why this is the case but we can work around it by hacking atomicity.h where the prototypes are kept . Note that after unpacking alchemy gnucpp3-4library 121008.zip you ll need to edit two atomicity.h files : .. . .. . ALCHEMY HOME avm2-libc include c++ 3.4 bits atomicity.h .. . ALCHEMY HOME avm2-libc libstdc++ include bits atomicity.h .. . .. . Here is the code : .. . .. . Here is some test code to run to make sure the rebuilt STL works : .. . .. . Note that the rebuilt STL appears to fix some related issues with map http : stackoverflow.com questions 3756250 stdmap-broken-in-alchemy and ifstream http : forums.adobe.com thread 487828 . Comment : This problem was the reason I abandoned Alchemy . Thanks for sharing . Comment : @Gunslinger47 : If you re up for rebuilding the STL it seems like you might be able to start using Alchemy again . Assuming you didn t move on to some other technology . :", "Question : I want to pass a byte array object from flex code to C code.How to do that .. . Answer : You can use AMF to pass an ActionScript ByteArray . So you re set on the Actionscript side . On the server-side there are slim pickings for AMF server implementations in C++ . I use BlazeDS for Java but the only one I can seem to find for C++ is AMFPP http : sourceforge.net projects amfpp . Comment : Scott I think you misunderstood the question . It is about Adobe Alchemy a framework to compile C and C++ code to Flash bytecode so this is a client-side only question .", "Question : So I created ffmpeg configuration file that makes it pure C platform independent but only theoretically .. . .. . So my config is simple 0.6.1 0.6.3 tested : .. . .. . Compiling this on Linux will resolve in 4 libs with totall size of 1 mb . But I need to compile ffmpeg with custom compiler opensource gcc analog called Adobe Alchemy http : labs.adobe.com technologies alchemy lets us compile C c++ into Flash .. . .. . It gives me errors on nearly each and every file during standart Make : .. . .. . So what shall I do - how to compile ffmpeg at least smallest part of it via alchemy Update If we would fix that errors manually 2 in configure.mak and one in alchemy gcc we would get a really messy and long output like : .. . Answer : Try it with the new flash c compiler Adobe Flash cc http : gaming.adobe.com technologies flascc . I hope it may help you to compile ffmpeg in flash .", "Question : I trying to use Adobe Alchemy Compiled C++ code to swc . At the beginning it work pertty good but when I add more c++ code Unfortunately getting it to link ends up producing a link-time error : .. . .. . Java heap space means Java heap speace not enough it need to set jave option like java -Xms128M -Xmx512M -jar. . but I can t find where to set the option in alchemy . Please help me Thanks in advance . Oldmannt .. . Answer : Some things to try : .. . .. . Don t compile with debugging flags -g and friends . This causes it to generate a ton of extra code and often causes it to run out-of-memory . Increase the heap-space arg jmemmax in ALCHEMY HOME achacks gcc . Comment : to paleozogt : Thank you very much I have checked There is no debugging flags in my compile . I increase the heap-space as you said but the link error appear all the same . It hit me down.. . I will try alchemy in windows version", "Question : So I created ffmpeg configuration file that makes it pure C platform independent but only theoretically .. . .. . So my config is simple 0.6.1 0.6.3 tested : .. . .. . Compiling this on Linux will resolve in 4 libs with totall size of 1 mb . But I need to compile ffmpeg with custom compiler opensource gcc analog called Adobe Alchemy http : labs.adobe.com technologies alchemy lets us compile C c++ into Flash .. . .. . It gives me errors on nearly each and every file during standart Make : .. . .. . So what shall I do - how to compile ffmpeg at least smallest part of it via alchemy Update If we would fix that errors manually 2 in configure.mak and one in alchemy gcc we would get a really messy and long output like : .. . Answer : There was some discussion about this on the Adobe Forums here http : forums.adobe.com message 1004051 . It seems rather involved though some folks seem to have made some progress . Comment : So.. . I see some of them came to situation close to mine actually I was looking all day long onto that post. .", "Question : I have a C project that I m using with Alchemy http : labs.adobe.com technologies alchemy . The project has some post-build command-line tests that I d like to run using the swfbridge . These tests run but they re extremely slow . The problem is that they read some moderately large-files 3MB into memory . Running these same tests with the same files via regular Alchemy e.g . not using swfbridge but using supplyFile from AS is very fast . I think the bottleneck is the swfbridge . More specicially in the way that swfbridge loads files . It reads them in and transmits them in 1024 byte chunks across the localhost connection to the main alchemy swf . You can see this happening in the swfbridge.log . My question is : is there a way to make swfbridge more efficient Can I make it use a different chunk size for example Here is an example of the file-reading code . If you give this code a 3MB file it will run very slowly . .. . Answer : I figured out a workaround to this problem . When running a swf from the command-line the file i o is really slow because the swf process is getting the file from the swfbridge process via localhost sockets . Something about this is unoptimized the Alchemy guys probably didn t expect anyone to use this in a serious way . swfbridge is used so that stdin and stdout will work . But I m not completely clear on why its used for file i o-- the swf is running in adl Air after all-- it has file system access . Anyway the fact that the swf is running in Air can be used . We can route fread fwrite through Air methods rather than through swfbridge by using the wonderful funopen . Its actually a good bit of code but here s an idea of it : .. . .. . where air read is like this : .. . .. . The other air fwrite air fweek air fclose are similar . Note that some of these functions like AS3 FileFromPath AS3 GetInProperty AS3 NewObject etc are my own simple wrappers around the AS3 api . This approach removes the swfbridge bottleneck and makes command-line swfs just as fast as normal ones .", "Question : How to convert Little-endian ByteArray to Big-endian in AS3 I convert bitmapData to Big-endian ByteArray and then push it into memory with Adobe Alchemy . And then when i read it from memory i get Little-endian ByteArray . How to get Big-endian . I use this example code http : blog.debit.nl 2009 03 using-bytearrays-in-actionscript-and-alchemy Memory allocation in C with direct access in Actionscript FAST Code : .. . Answer : A while back I asked about this on the Adobe Forums http : forums.adobe.com message 2894943 . The Flash VM itself is Little Endian as is code running in Alchemy . For reasons that are unclear many Flash APIs return bytes as Big Endian . How bizarre . Perhaps this is a legacy API thing from the Macromedia days . Who knows Setting ByteArray.endian does not change the bytes stored in the ByteArray . It affects the way that readXXX writeXXX works that is they will flip the bytes as they re read written . However since your Alchemy code is looking at the bytes directly ie not using the ByteArray methods it has to handle the flipping manually . Note that this is true for incoming bytes as well outgoing bytes . Some more info about flipping byte order is here http : www.codeproject.com KB cpp endianness.aspx .", "Question : null .. . Answer : In fact I have few questions caused by one problem . I use Box2D Alchemy port in one of my Flash gaming projects . This port is compiled from original C++ Box2D v.2.2.0 by guys who made World Construction Kit . However version 2.2.0 has a nasty bug which is fixed in 2.2.1 . Native AS3 Box2D ports have this bug as well . WCK creators have provided an instruction about how to recompile c++ Box2D library using Adobe Alchemy . But Alchemy has been transformed to Crossbridge Flascc and the recompiling instructions from WCK are not working with it . Thus I have these questions : 1 . Where to find that old Alchemy which was used by WCK creators I believe it is still present on someone s HDD . Or 2 . Where to find WORKING Crossbridge Box2D port Crossbridge package has Box2D library which can be compiled but I m unable to use that SWC in my project it seems that only flash-player-11 is supported . Or 3 . Is there another way to use Box2D 2.2.1 in Flash Comment : did you ever get anywhere with this", "Question : I want to pass a byte array object from flex code to C code.How to do that .. . Answer : Passing a ByteArray from Flex to C++ http : nexus.zteo.com blog 2008 12 22 adobe-alchemy-passing-a-bytearray-from-flex-to-c", "Question : So I created ffmpeg configuration file that makes it pure C platform independent but only theoretically .. . .. . So my config is simple 0.6.1 0.6.3 tested : .. . .. . Compiling this on Linux will resolve in 4 libs with totall size of 1 mb . But I need to compile ffmpeg with custom compiler opensource gcc analog called Adobe Alchemy http : labs.adobe.com technologies alchemy lets us compile C c++ into Flash .. . .. . It gives me errors on nearly each and every file during standart Make : .. . .. . So what shall I do - how to compile ffmpeg at least smallest part of it via alchemy Update If we would fix that errors manually 2 in configure.mak and one in alchemy gcc we would get a really messy and long output like : .. . Answer : FlasCC Alchemy 2 does compile ffmpeg fine - for anyone who is trying basically you need to download ffmpeg source . Go to ffmpeg directory do .. . .. . Now it s good if you run configure with some restrictions so it doesn t include every codec or filter there is takes ages . Additional configure params from my use-case : .. . .. . Important is to --disable-everything and then enable only what you need . Then run . make and . make install with the PATH in front of those commands it should produce and install ffmpeg libs . When I built a test swf all seemed to work . I ve used their modified sample where they encode 25 dummy mpeg frames . I m tracing the encoding progress at least and seeing the frames being encoded . SWC is a problem though if you would want to use that . I m getting strange errors - first it couldn t find codec got NULL when using the find codec function when I specified it by name it can t allocate codec context also got NULL . Then I compiled it in pure Flex and it got over this one but couldn t open the codec basically all of those are av something library functions . I really don t understand why SWC doesn t work with these as with emit-swf all works perfectly fine . Maybe someone could enlighten on the SWC SWF differences .", "Question : I want to play .spx files which encoded by Speex http : www.speex.org on the Web . But I have no knowledge of Flash Flex or any Flash Audio codec . After Google search for a whole day I got some solutions that is : .. . .. . 1 . Do something wrapping Speex files with a FLV container because that the Speex is only playable as the audio codec in a FLV container . Now I can play a SPX-Audio-Only FLV file in Flex I use netStream.play audio-only-speex.flv But I donot know how to wrap a Spx file with FLV container using ActionScript . Any example project 2 . Decode Spx using AS . I checked out the fllowing pages that they all decoded OGG Vorbis but no Speex : .. . http : barelyfocused.net blog 2008 10 03 flash-vorbis-player .. . http : www.exswap.com p 132 .. . http : mauft.com 2010 11 ogg-vorbis-in-flash .. . Adobe also provides a AS3 OggVorbis Library which ported by Alchemy : .. . http : labs.adobe.com wiki index.php Alchemy : Libraries .. . .. . 3 . FMS : do a server streaming using FMS or Red Xuggle . I have never heard FMS stuffs before as well as I m not sure whether my virtual host can support or not.. . .. . .. . 4 . Convert every Spx files to MP3 . I think the best solution is decoding Spx in AS3 Yes I d like to make a Spx Flash Player . So I downloaded Speex Library from speex.org installed Adobe Alchemy . After . configure make the libspeex build libspeex speex.c out a libspeex.swc via Alchemy . then I donot know how to do next . How can I decode the speex audio with AS3 My libspeex.swc : http : demo.0x123.com libspeex.swc .. . .. . In addtion should I rewrite the libspeex using Alchemy API http : labs.adobe.com wiki index.php Alchemy 3aDocumentation 3aDeveloping with Alchemy 3aC API before build the libspeex.swc Although I am not professional in AS but I have a strong ability to learn . Any advice will be greatly appreciated Thanks very much . Comment : I m not sure about future compatibility of alchemy : ncannasse.fr blog adobe make some alchemy http : ncannasse.fr blog adobe make some alchemy Comment : @kapep : if you compile against FP 10.x Alchemy will work in FP 11.x . To quote the release notes http : blogs.adobe.com flashplayer 2011 09 updates-from-the-lab.html : Existing Alchemy experiments targeting Flash Player 10.x and AIR 2.x are unaffected Comment : @kapep Thank you for editing my question I do not have permission to add three more links . .. . Answer : Adobe says specifically not to rely on Alchemy yet so there s no official way to do it on the client-side as far as I know . It s absurd given that there is clearly a speex decoder being used . Can you use Xuggle s tricked-out version of ffmpeg http : code.google.com p xuggle-ffmpeg to embed the speex in FLVs If you can run xuggle in batch or on the fly then regardless of the original audio format you can serve a speex encoded FLV playable from netStream.play . For basic playing you wouldn t even need a flash-media-server . Comment : Thank you very much I ve known how to convert spx to other formats file then server them or stream them but I really wanna a directly speex codec for flash to make a spx flash-player just like jwPlayer or Google s mp3 player : Anyway thank you for answering my question . Comment : So you want to play speex without wrapping it in the FLV container Are these speex files that you don t have control over Anyway it sounds like Adobe will get an official version of Alchemy out in 2012 . They say it will be free for non-commercial use . Comment : I can wrap these spx files using FMS Red but I just want to make a standalone flash-player . I will try this : Comment : Yeah I try to avoid Flash media servers too : - . After wrapping with Xuggle I think using any web server should work.. . netStream.play http : my.web.server speex.flv . I think jwPlayer support speex-wrapped FLVs too .", "Question : I want to play .spx files which encoded by Speex http : www.speex.org on the Web . But I have no knowledge of Flash Flex or any Flash Audio codec . After Google search for a whole day I got some solutions that is : .. . .. . 1 . Do something wrapping Speex files with a FLV container because that the Speex is only playable as the audio codec in a FLV container . Now I can play a SPX-Audio-Only FLV file in Flex I use netStream.play audio-only-speex.flv But I donot know how to wrap a Spx file with FLV container using ActionScript . Any example project 2 . Decode Spx using AS . I checked out the fllowing pages that they all decoded OGG Vorbis but no Speex : .. . http : barelyfocused.net blog 2008 10 03 flash-vorbis-player .. . http : www.exswap.com p 132 .. . http : mauft.com 2010 11 ogg-vorbis-in-flash .. . Adobe also provides a AS3 OggVorbis Library which ported by Alchemy : .. . http : labs.adobe.com wiki index.php Alchemy : Libraries .. . .. . 3 . FMS : do a server streaming using FMS or Red Xuggle . I have never heard FMS stuffs before as well as I m not sure whether my virtual host can support or not.. . .. . .. . 4 . Convert every Spx files to MP3 . I think the best solution is decoding Spx in AS3 Yes I d like to make a Spx Flash Player . So I downloaded Speex Library from speex.org installed Adobe Alchemy . After . configure make the libspeex build libspeex speex.c out a libspeex.swc via Alchemy . then I donot know how to do next . How can I decode the speex audio with AS3 My libspeex.swc : http : demo.0x123.com libspeex.swc .. . .. . In addtion should I rewrite the libspeex using Alchemy API http : labs.adobe.com wiki index.php Alchemy 3aDocumentation 3aDeveloping with Alchemy 3aC API before build the libspeex.swc Although I am not professional in AS but I have a strong ability to learn . Any advice will be greatly appreciated Thanks very much . Comment : I m not sure about future compatibility of alchemy : ncannasse.fr blog adobe make some alchemy http : ncannasse.fr blog adobe make some alchemy Comment : @kapep : if you compile against FP 10.x Alchemy will work in FP 11.x . To quote the release notes http : blogs.adobe.com flashplayer 2011 09 updates-from-the-lab.html : Existing Alchemy experiments targeting Flash Player 10.x and AIR 2.x are unaffected Comment : @kapep Thank you for editing my question I do not have permission to add three more links . .. . Answer : Now I ve known that I must rewrite the speex library using alchemy API : .. . http : labs.adobe.com wiki index.php Alchemy : Documentation : Developing with Alchemy : C API .. . http : labs.adobe.com wiki index.php Alchemy : Documentation : Developing with Alchemy : AS3 API .. . .. . .. . I ve done a simple helloWorld . It is the first step that is troublesome . : .. . .. . Main.c .. . .. . .. . compile using main.c -O3 -Wall -swc -o HelloAlchemy.swc .. . .. . .. . AS code :", "Question : I have C++ application that use OpenGL . Need to convert this app to flash app . Is it possible to do this with Adobe Alchemy Is it will be possible to get from that swc current image for example with glDrawPixels and print it on screen .. . Answer : There s a similar thread http : stackoverflow.com questions 3086901 simple-opengl-implementatione here on SO already seems that Mesa3D http : www.mesa3d.org could be a good starting point but it s going to be a lot of work :", "Question : Short version : .. . .. . I see there is an alchemy method called supplyFile but the second arg is a ByteArray.. . what in the world is that for Longer version : .. . .. . I would like to do the following : .. . .. . 1 . Open a file and assign it to a global variable on the C side of alchemy . 2 . Read in and process a chunk of bytes on the C side .. . .. . 3 . Send them to Actionscript for display .. . .. . 4 . Go to step 2 until EOF or notification from Actionscript .. . .. . 5 . Close the file .. . .. . I m able to do this right now by opening the file and reading the chunks into a ByteArray on the Actionscript side and then passing it to C for processing and back- but this calls some unnecessary overhead by needing to do AS3 ByteArray writeBytes AS3 ByteArray readBytes on the C side in order to manipulate the data in a char . Is there any way to simply fopen a file on the C side and read in some bytes .. . .. . Asssume we are talking about a very large file on disk 4GB . .. . Answer : From the docs http : labs.adobe.com wiki index.php Alchemy 3aDocumentation 3aDeveloping with Alchemy 3aAS3 API : .. . .. . supplyFile path : String data : ByteArray : This method allows you to provide a file at a specified path for the C code . This is useful if your C code expects a configuration file at a specific location that is not accessible to the runtime due to security restrictions . In other words supplyFile lets you create a virtual file that can be accessed from C with fopen . You call supplyFile with a string that represents the path to the virtual file this can be anything you want it to be and a ByteArray that is the contents of that virtual file . Then on the C side you call fopen with the virtual file path and use fread and friends just like an ordinary file . Comment : Oh.. . so is there no way to fread a real file on disk on the C side Comment : Can you read a real file on disk with ActionScript As the alchemy C code is running within the Flash VM you can t do anything with C that you can t already do with ActionScript . Comment : Yes.. . I can read a file into a ByteArray but C can t process a ByteArray directly . It needs to then read that ByteArray into a char buffer . That means the usual C read into buffer is turned into a read into bytearray then read that into buffer . The second read is probably much faster since its in memory but since this is for something which will repeated often in a loop.. . there s got to be a better way which avoids two reads Comment : Are you using AIR Anyway if you have the file in a ByteArray-- you can pass it into C via supplyFile where C can then use fopen fread to read it . Comment : If you re using AIR you can use funopen to bind fread and friends to AIR s file-io stuff : stackoverflow.com a 4368865 89218 http : stackoverflow.com a 4368865 89218", "Question : With Alchemy most builds are static swc builds . These are great for linking directly against a library but if you try to use more than one at a time you usually always run into problems with the shared-memory space . One solution I ve read about is to build swf s instead and load those dynamically into their own ApplicationDomain . This would give all libraries their own memory and would allow you to load multiple Alchemy libraries . As mentioned in these threads on the adobe forums : http : forums.adobe.com message 3665801 and http : forums.adobe.com message 3927791 .. . .. . My question is : how do I load these swf s and get to the code inside of them There doesn t seem to be any documentation on this issue and although I do know how to load an swf I don t know how to get to the code because I don t have any interface to the swf . .. . Answer : The problem is that we want to dynamically load the Alchemy lib but if we build the library as a SWF it won t work as that makes a standalone app . But we can t dynamically load a SWC-- or can we Here s what to do assuming a library named mylib : .. . .. . 1 . Build mylib as a SWC . 2 . Unzip mylib.swc and extract the library.swf file-rename it to mylib.swf .. . 3 . Embed mylib.swf as a binary asset http : dispatchevent.org roger embed-almost-anything-in-your-swf .. . 4 . At runtime instantiate the asset as a ByteArray .. . 5 . Pass the asset ByteArray to Loader loadBytes http : help.adobe.com en US FlashPlatform reference actionscript-3 flash display Loader.html loadBytes 28 29 .. . 6 . When the loader fires COMPLETE use Loader contentLoaderInfo http : help.adobe.com en US FlashPlatform reference actionscript-3 flash display Loader.html contentLoaderInfo to get the ApplicationDomain of the loaded SWF .. . 7 . Use ApplicationDomain getDefinition http : help.adobe.com en US FlashPlatform reference actionscript-3 flash system ApplicationDomain.html getDefinition 28 29 to look up the Alchemy initializer class . e.g . cmodule.mylib.CLibInit .. . 8 . Use the initializer like you normally would http : labs.adobe.com wiki index.php Alchemy 3aDocumentation 3aDeveloping with Alchemy 3aAS3 API CLibInit . e.g . call init etc . 9 . ...profit You can embed an arbitrary number of Alchemy libraries this way each running in its own ApplicationDomain . Comment : Thanks that sent me in the right direction .", "Question : I m using Adobe Alchemy http : labs.adobe.com technologies alchemy in a project that uses UnitTest++ http : unittest-cpp.sourceforge.net . The unit tests run as part of the build-process . It turns out that UnitTest++ depends on a feature of C++ that isn t implemented in Alchemy http : stackoverflow.com questions 4169892 globals-broken-with-alchemy namely instantiating static-classes and or calling functions to initialize global vars . The great thing about UnitTest++ is that you don t have to remember to add your tests to the list of tests to run . It happens automatically using some macro-magic to create test-case classes and add them to a global list of tests . So this : .. . .. . becomes this : .. . .. . where the constructor for ListAdder adds testMyTestInstance to the global list of tests . The problem is that because of the Alchemy bug the ListAdder constructor never runs so the list of tests is always empty . To prove that the ListAdder constructor is never getting called you can instrument it to crash when it gets called : .. . .. . This will crash when compiled natively but won t when compiled with Alchemy . A less drastic way to see it is to just add a printf : .. . .. . When compiled natively you ll see ListAdder .. . for each test but when compiled under Alchemy it won t print anything . My question is : how can I modify UnitTest++ so that the tests will run The workarounds described here http : stackoverflow.com questions 4169892 globals-broken-with-alchemy don t seem to apply . .. . Answer : It took some doing but I figured it out . The trick is that static initializer functions will work e.g . .. . .. . as long as they don t call any constructors or use new malloc or use printf . It took me a while to realize that Gunslinger47 was right about the printfs screwing things up . The fact that static initializer functions work is just enough to let us get UnitTest++ working . What we do is use a variation of the Pointers workaround described here http : stackoverflow.com questions 4169892 globals-broken-with-alchemy 4171120 4171120 : .. . .. . Instead of being allocated statically each test class has an allocator function .. . A pointer to each allocator function is added to a list of function-pointers .. . In main this list of function-pointers is then iterated through and each function called . The gritty details are below : .. . .. . 1 In TestMacros.h change the TEST EX macro to use a static initializer function rather than a constructor : .. . .. . 2 Change TEST FIXTURE EX in a similar manner as TEST EX . I ll spare you the verbosity . 3 At the bottom of TestList.cpp add the functions that the TEST EX TEST FIXTURE EX macros call : .. . .. . and of course add their prototypes to TestList.h : .. . .. . 4 Finally in your unit test runner you must call initializeAllTests : .. . .. . But that s not all There are a few other tidbits that need to be done before it ll work : .. . .. . 1 Make sure UNITTEST USE CUSTOM STREAMS is defined in Config.h : .. . .. . The reason for this is that if its not defined MemoryOutStream.h will include sstream which will break static initialization I suspect that it does some kind of global constructor or something . 2 In SignalTranslator.h make sure that the UNITTEST THROW SIGNALS macro is a noop . I do this by injecting a -D ALCHEMY into my builds and checking for it : .. . .. . If this isn t done the sigsetjmp call will fail at runtime .", "Question : I have a project that uses quite a few opencv libs to do some image-processing tasks . Now I need to build a Flash app for it . I read that Alchemy allows compiling c++ libs for Flash . I wonder if anyone has tried to build flash apps using opencv libs and dlls Thanks . Comment : There is a project on github about this : https : github.com bonext flash-opencv .. . Answer : You can compile C++ libs but watch out for std : : string http : stackoverflow.com questions 7421832 using-stl-with-alchemy . Also you won t be able to use DLLs-- everything has to be statically compiled into one SWC . Comment : can you please provide some pointers about how to do this I searched the web but couldn t find much on this topic . Thanks . Comment : This http : labs.byhook.com tag alchemy is a good tutorial to get you going ." ] }
[ "yes-answer-long", "yes-answer-short" ]
flash-player
UNK_RELATION
portaudio@audio@61
portaudio -- portaudio is a free cross-platform open-source @placeholder i o library .
{ "confidence": [ 74.92888641357422, 61.31602096557617, 46.72443389892578, 44.83916091918945, 44.637916564941406, 42.25720977783203, 42.027923583984375, 42.027923583984375, 41.75558090209961, 40.78931427001953, 40.78931427001953, 40.78931427001953, 40.70310592651367, 39.765968322753906, 39.65254211425781, 39.19747543334961, 39.19747543334961, 39.109928131103516, 39.109928131103516, 39.109928131103516, 38.67443084716797, 38.38141632080078, 38.38141632080078, 38.34076690673828, 38.34076690673828, 38.34076690673828, 38.34076690673828, 38.1099739074707, 38.08658218383789, 38.08658218383789, 37.358070373535156, 37.353126525878906, 37.317420959472656, 37.08662796020508, 36.97613525390625, 36.860076904296875, 36.860076904296875, 36.8545036315918, 36.8545036315918, 36.8545036315918, 36.83949279785156, 36.6583251953125, 36.090911865234375, 36.090911865234375, 36.067481994628906, 35.83115768432617, 35.83115768432617, 35.80031967163086, 35.57653045654297, 35.42919921875, 35.34196472167969, 35.34196472167969, 35.34196472167969, 35.11575698852539, 35.11575698852539, 35.11575698852539, 35.11575698852539, 35.11575698852539, 35.11575698852539, 35.106597900390625, 35.04413604736328, 35.04413604736328, 34.620296478271484, 34.620296478271484, 34.60464859008789, 34.60464859008789, 34.60464859008789, 34.60464859008789, 34.41022491455078, 34.092411041259766, 34.092411041259766, 34.01909637451172, 34.00232696533203, 33.89557647705078, 33.799400329589844, 33.799400329589844, 33.799400329589844, 33.799400329589844, 33.799400329589844, 33.799400329589844, 33.799400329589844, 33.799400329589844, 33.799400329589844, 33.799400329589844, 33.53374481201172, 33.46958923339844, 33.46958923339844, 33.46958923339844, 33.46958923339844, 33.46958923339844, 33.43899154663086, 33.37638473510742, 32.86590576171875, 32.80807876586914, 32.782840728759766, 32.77605438232422, 32.77605438232422, 32.77605438232422, 32.77605438232422, 32.77605438232422 ], "content": [ "try to install PortAudio a free cross-platform open-source audio I O library .", "PyAudio provides Python bindings for PortAudio the cross-platform audio I O library .", "Is it a problem from portaudio library", "PortAudio .", "This query is regarding the Portaudio framework .", "why portaudio headers from D : Dokumenty Downloads portaudio are being used .. . .. . These represent the source as compiled into libportaudio .", "MATLAb ships the portaudio library as part of its install .", "I m thinking that the problem could be in the underlying PortAudio library .", "Someone should probably open an issue with the portaudio developers .", "The portaudio stuff is not in a standard path .", "Resampling is not a capability of PortAudio .", "yes PortAudio is installed .", "It was because portaudio was built with only support for OSS .", "what s the reason of using PortAudio", "The internal buffering models used by the various PortAudio host API backends are described in some detail on the PortAudio wiki .", "I d like to use ASIO which is provided by PortAudio so I built PortAudio with ASIO support without errors .", "I also do not really understand why portaudio headers from D : Dokumenty Downloads portaudio are being used .", "Although it uses PortAudio the initialization worked there .", "Is there a way to help PortAudio find the devices", "Notice that you need PortAudio v19 .", "Then i use Eclipse s Pkg-config to add portaudio dev library .", "I m trying to play simple wave file using portaudio library .", "I m trying to compile a Qt project with Portaudio library and Steinberg s ASIO SDK .", "I am trying to get started with PortAudio .", "Could there be a mixer in PortAudio that I also have to unmute", "I think it s a bug from portaudio .", "I don t have experience on portaudio or mac .", "This will give you access to each frame of data that PortAudio delivers during its callback called from the PortAudio thread .", "Are you sure this is how it works with PortAudio", "the setup is meant for compiling the complete portaudio .", "I m implementing a low pass filter in C wih the PortAudio library .", "I have found the problem when I have installed Portaudio portaudio libraries has been included in usr local lib path meanwhile my project search Portaudio libraries in usr lib path .", "I am working on a sound application with PortAudio .", "And why other examples from Portaudio are does not need anything unusual it is my error Eclipse error or Portaudio error ..Thanks .", "Under some circumstances PortAudio will request larger buffers from the native audio API and then invoke the PortAudio user callback multiple times in quick succession .", "The PortAudio error was something entirely unrelated .", "But still Portaudio is trying to build for ppc .", "How to change pitch samplerate at run-time with portaudio", "However when running it can t find portaudio .", "Have somebody luck with compilation of espeak-portaudio in Windows", "the original question I found is contained in the link below .. . .. . Can t Build PortAudio - LNK1104 : cannot open file ksguid.lib http : stackoverflow.com questions 29550887 cant-build-portaudio-lnk1104-cannot-open-file-ksguid-lib", "I want to run a PortAudio test program of generating and playing a Sine Wave .", "I found a sample C code that uses portaudio .", "I use PortAudio libs to talk to h w .", "Like the native audio i o APIs that PortAudio wraps PA streams run at a constant sample rate .", "PortAudio request a latency possibly with some constraints .", "There must be a way to build PortAudio so that it works with DAQmxBase no", "PortAudio callback-based : pastebin.com MrHpkXEA http : pastebin.com MrHpkXEA PortAudio blocking I O : pastebin.com MDdUZ8W3 http : pastebin.com MDdUZ8W3 RtAudio callback-based : pastebin.com YCQ0JpSR http : pastebin.com YCQ0JpSR", "As I am new to PortAudio I tried an example program from the internet .", "There is always the same problem Warning : Linking the shared library libsounddevice.la against the static library home daniele Desktop Sviluppo Portaudio portaudio lib .libs libportaudio.a is not portable", "As a first step check whether PortAudio has detected any devices .", "pa devs will give you the list of devices that PortAudio has detected .", "Another possibility is that the native audio subsystem is signalling PortAudio irregularly .", "I would like to install portaudio on OSX El Capitan 10.11 .", "I am not sure why you need to install PortAudio separately .", "I am struggling with outputting user selected audio tones with portaudio .", "Is there a way to get around this or should I just not use PortAudio", "Ugh time to go compile PortAudio v19 then I guess : P", "I have written a function to play a sound file using portaudio and sndfile .", "To record and play sound I currently use Portaudio to open 2 Directsound streams .", "Input and output via USB audio interface blocking I O on PortAudio with 1024 samples buffer size ALSA backend .", "Input and output via USB audio interface blocking I O on PortAudio with 1024 samples buffer size JACK backend .", "A little background before I ask the question : I am working on an application in PortAudio to output audio through a multichannel 8 device .", "On searching for an approach to handle this I got to know that WinMME in PortAudio supports multiple devices .", "I m developing a simple synth using C++ and PortAudio .", "There you have your libportaudio.la in the portaudio lib directory .", "Finally you can mess around with Portaudio", "I m using PortAudioSharp as a C wrapper for PortAudio PA .", "As in this example http : stackoverflow.com questions 259451 how-to-extract-frequency-information-from-an-input-audio-stream-using-portaudio I m curious about portaudio and numpy.. .", "I record my microphone input with a script from PortAudio itself .", "I am dealing with a legacy code that uses portaudio on windows .", "The fact that PortAudio can t open streams to multiple ASIO devices simultaneously has no bearing on enumerating device info .", "Before I was doing recording with portaudio but the library does not support it and that I have to manually format it myself .", "I edited the Octave source code in order to include two dependencies : libsndfile and portaudio .", "I m working on an audio visualizer in C with OpenGL Libsamplerate portaudio and libsndfile .", "Is there a way to do this in PortAudio and if not please point me in the right direction .", "Is there anyway to specify to pyaudio portaudio where to look for my input-devices .", "Download http : www.portaudio.com download.html the latest version 19 of PortAudio .", "This is strange because portaudio should give ASIO devices as well right", "http : people.csail.mit.edu hubert pyaudio .. . .. . Did you install the PortAudio software", "The problem lies with Enthoughts portaudio since the pyaudio modules are identical .", "I m trying to play audio in Go asynchronously using PortAudio .", "I m using OSX 10.10.5 with Go 1.3.3 and the libsndfile and portaudio from Homebrew .", "The eSpeak sources contain both a v18 and v19 header for portaudio .", "I m trying to build the PortAudio library so I can use it in one of my project .", "Or use some other high-level approach with PortAudio or another library with Python bindings .", "I m attempting to build an example code from portaudio using the library from this page .", "Do you have or can you write in C a simple utility that accesses the PortAudio library and tries to perform this same listing", "That library is espeak a voice synthesizer which uses portaudio lib to access audio port .", "hope you can help me : .. . .. . I m trying to get audio data from a multichannel ASIO device with PortAudio library .", "I am very sure my audio works .. . .. . but pa devs which is a official provided execuatble file in portaudio reports 0 device as below .. . .. . And I can get devices number with pyAudio .. . .. . Should I install something or re-built portaudio with some special settings", "Also googling for portaudio asio reveals this tidbit from the official PortAudio docs http : portaudio.com docs v19-doxydocs api overview.html : .. . .. . There are cases where PortAudio is limited by the capabilities of the underlying native audio API.. . the ASIO SDK only allows one device to be open at a time so PortAudio ASIO doesn t currently support opening multiple ASIO devices simultaneously .", "I select Portaudio due to many audio-recording examples exist for it .", "How it can be fixed using Eclipse BUT without copying all Portaudio source tree to my project", "If I attempt to build PortAudio using the .sln file included in the latest download I get these errors .", "The end result will be that PortAudio selects the lowest available ASIO buffer size .", "About the Asio control panel : There isn t one when the device is loaded with portaudio .", "What I ve tried : .. . .. . The following scenarios were tried out with PortAudio .", "portaudio allows to record data in float format 32 bits floating-point .", "I ve freshly installed portaudio with brew and install the most recent pyaudio with pip ." ] }
{ "confidence": [ 66.2977523803711, 52.696250915527344, 51.841896057128906, 51.23625183105469, 50.89727783203125, 50.82428741455078, 50.682090759277344, 50.355690002441406, 50.3174934387207, 49.91518783569336, 48.329071044921875, 46.832733154296875, 46.35466003417969, 45.96830368041992, 45.61484909057617, 45.499595642089844, 45.41254806518555, 45.300418853759766, 45.26823806762695, 45.238372802734375 ], "content": [ "Question : I m using PyAudio under the Enthought Python Distribution Python 2.6.6 in Ubuntu 10.10 x64 . This is the same error I get if I try to open an input stream . There is the corresponding error IOError : No Default Output Device Available Comment : What do you get if you try pa.get device count Comment : @mtrw pa.get device count returns 0 Comment : pyaudio installed via sudo apt-get install python-pyaudio works on Ubuntu-11.10 Comment : so it tells you don t have what you ask for or it cannot find what you ask for or you don t have permissions to access what you ask for . seems reasonable to me . perhaps you really don t have input-devices Comment : DIY FIY . Get sources - compile - .. . - profit .. . Answer : PyAudio provides Python bindings for PortAudio the cross-platform audio I O library . http : people.csail.mit.edu hubert pyaudio .. . .. . Did you install the PortAudio software It is required fot the pyaudio to work . Comment : yes PortAudio is installed . This is an oddity to do with the Enthought Python Distribution I think . Under the standard distribution PyAudio works fine . Comment : The problem lies with Enthoughts portaudio since the pyaudio modules are identical .", "Question : How to change pitch samplerate at run-time with portaudio Many thanks . .. . Answer : Resampling is not a capability of PortAudio . Like the native audio i o APIs that PortAudio wraps PA streams run at a constant sample rate . To change the pitch playback rate of a sample you need perform on the fly sample rate conversion . You can do this by interpolating the original signal using a phase index that increments at some non-unity rate . Depending on your requirements you can investigate either resampling interpolation or pitch-time modification . Commonly used low to medium quality high performance polynomial interpolation algorithms for audio http : www.student.oulu.fi oniemita dsp deip.pdf are linear-interpolation and cubic hermite interpolation http : www.musicdsp.org archive.php classid 5 93 . Higher quality interpolation can be performed with some variant of windowed sinc interpolation https : ccrma.stanford.edu jos Interpolation Windowed Sinc Interpolation.html . A library you could use for sinc interpolation is Secret Rabbit Code http : www.mega-nerd.com SRC . For pitch time transformation a.k.a . pitch-shifting or time stretching you might consider using the DIRAC http : dirac.dspdimension.com Dirac3 Technology Home Page Dirac3 Technology.html library which has an open-source version for mono signals . There are other commercial libraries available e.g . from z-plane research .", "Question : I decided to port my audio project to C and succeeded with using SDL library . I d like to use ASIO which is provided by PortAudio so I built PortAudio with ASIO support without errors . When I include portaudio.h add library -lportaudio to linker build everything and run there is no problem . But when I try to call any of the portaudio functions Pa Initialize for example I get this output : .. . .. . I use 32bit MinGW with Eclipse on Windows 10 64bit . I also do not really understand why portaudio headers from D : Dokumenty Downloads portaudio are being used . When building with MSYS I used . configure --prefix mingw libraries and includes are present in my MinGW directories . Thanks in advance for any hints . Comment : welcome to SO . Please take the help tour to see how an what to ask here . What you have is not a question but only a very broad problem description . Comment : OK thank you for your notice : I will try to be more specific next time : .. . Answer : when I try to call any of the portaudio functions Pa Initialize I get link errors .. . .. . Ok the link errors in general are just missing libraries . .. . can be fixed by adding your C++ standard-library probably -lstdc++ .. . .. . and undefined-reference to waveOutGetNumDevs@0 .. . .. . .. . can be fixed by adding libwinmm.a or similar . why portaudio headers from D : Dokumenty Downloads portaudio are being used .. . .. . These represent the source as compiled into libportaudio . When it was built it contained source files like D : Dokumenty Downloads portaudio src hostapi wmme pa win wmme.c that made reference to functions like waveOutWrite . Now that you re using libportaudio to make an executable you must give the linker the libraries necessary to resolve all of these dependencies . Comment : I was first discouraged by how many undefined references there was . Beside stdc++ and winmm I also figured out that library ole32 was also missing . Thank you very much :", "Question : I was wondering if it is possible to read data that is going from the sound card to the speakers with the PortAudio API . After looking through the documentation I found an example http : portaudio.com docs v19-doxydocs paex record 8c source.html where they read data from the microphone . However I would like to be able to capture the audio that is coming from the sound card . Is there a way to do this in PortAudio and if not please point me in the right direction . Also it is important that this works on Windows Mac and Linux computers and I would prefer to write this in C . .. . Answer : This cannot be done . Someone recently submitted a patch that allows this to be done on one of the windows APIs but that is a special case and you would have to ask on the mailing list . It cannot be done cross-platform from a simple single library . For example on OS X you need to install special system extensions or whatever they are called . Comment : Thanks Bjorn Roche for answer my question", "Question : I m new at python .. . .. . I m trying to run a simple code about pyaudio . I just copied and pasted a code that I found on the pyaudio web site . I get this error : .. . .. . I can not figure out how to solve this error . I don t know if this has something to do with audio driver or if the code needs an output declaration . I mean if I have to select an output . The code : .. . .. . I m using python3 on Jupyter notebook . .. . Answer : check the following steps : .. . .. . make sure you have a default input device if not you can refer to here http : stackoverflow.com questions 4672155 pyaudio-ioerror-no-default-input-device-available rq 1 .. . .. . I want it s useful for you Comment : The environment on my computer is Python 3.4 PyAudio 0.2.9 demo works well . Comment : When I ran the line pa.get default input device info I got an error : home gustavolg anaconda3 lib python3.5 site-packages pyaudio.py in get default input device info self 947 948 -- 949 device index pa.get default input device 950 return self.get device info by index device index 951 OSError : No Default Input Device Available - seems I don t have Input Device Comment : How do I add an Input device I already have the packages python-pyaudio and python3-pyaudio installed . Comment : try to install PortAudio a free cross-platform open-source audio I O library . download from here http : www.portaudio.com archives pa stable v19 20140130.tgz perhaps it s useful .", "Question : I m considering RTAudio http : www.music.mcgill.ca gary rtaudio + RTMidi http : www.music.mcgill.ca gary rtmidi classRtMidi.html details and PortAudio http : www.portaudio.com + PortMidi http : portmedia.sourceforge.net portmidi for a new project that requires realtime audio and midi procesing . Can anyone with experience using both libraries recommend one over the other why I prefer a C++ API over a C API but this is not enough for me to make a decision . Comment : Did you eventually find a good library I have exactly the same problem.. . I just did little experiments with PortAudio and it seems quite complex very low-level it lacks of an official forum I hate mail list . RTAudio lacks of documentation . STK https : ccrma.stanford.edu software stk has annoying include policy . Juce http : www.rawmaterialsoftware.com juce.php does too things and it is not really focused on realtime audio midi . I d like to rely on a maintained cross-platform library supported by a big community documentation . Comment : I m using RTAudio and it s been working fine but I still want to take PortAudio for a spin . The main reason to choose RTAudio was that it has a c++ api instead of c and it s used by open frameworks which sometimes I use . .. . Answer : Here s a relevant thread that came up on the Linux audio devel list . The approach I ll take for my new app s is to code for jack and do all my debugging in linux+jack and then use RTAudio for the ports I end up releasing . Salud http : lists.linuxaudio.org pipermail linux-audio-dev 2012-March 031944.html Comment : The link is dead . Can you find a new reference I d like to read it . Sorry got it : lists.linuxaudio.org pipermail linux-audio-dev 2012-March http : lists.linuxaudio.org pipermail linux-audio-dev 2012-March 031944.html Comment : Updated the link . Hopefully it s the right one .", "Question : I tried .. . .. . but I don t get the full list of all devices : for example I don t get ASIO devices in this list . This is strange because portaudio should give ASIO devices as well right How can I list all audio devices with pyaudio Comment : I tried your code with a pyaudio binary from : lfd.uci.edu gohlke pythonlibs pyaudio http : www.lfd.uci.edu gohlke pythonlibs pyaudio for me it prints all my ASIO devices Comment : Yes @EmileVrijdags I contacted M . Gohlke a few months ago and he updated his binaries with ASIO support . my original post was in Dec 2013 Comment : cool I ll make good use of it .. . Answer : I m thinking that the problem could be in the underlying PortAudio library . Do you have or can you write in C a simple utility that accesses the PortAudio library and tries to perform this same listing Also googling for portaudio asio reveals this tidbit from the official PortAudio docs http : portaudio.com docs v19-doxydocs api overview.html : .. . .. . There are cases where PortAudio is limited by the capabilities of the underlying native audio API.. . the ASIO SDK only allows one device to be open at a time so PortAudio ASIO doesn t currently support opening multiple ASIO devices simultaneously . Comment : I need to study this . I don t have a C compiler linker installed and those libraries neither right now and quite no knowledge about this.. . Would you have such tools @MultimediaMike Comment : The fact that PortAudio can t open streams to multiple ASIO devices simultaneously has no bearing on enumerating device info .", "Question : I am trying to create a music visualizer application in PortAudio I did some basic research and found some examples on how to record from a mic to a temporary file . But there was no example where the data is not used runtime during the recording . So how can I start a continuous audio-stream where I can catch the data from the current frame This is how I tried to do it : .. . .. . But it gives the following output : Comment : What platform are you working on Comment : I am working on Debian Linux 64 bit .. . Answer : To interact with the data-stream real-time you ll need a mechanism that either sleeps busy waits on Windows for the frame period sample rate samples per frame or uses a thread-synchronization primitive to trigger your thread int main that there is audio ready to be processed . This will give you access to each frame of data that PortAudio delivers during its callback called from the PortAudio thread . Here s how the concept works using boost : : condition and boost : : mutex . Generally this technique is cross-platform however this specific implementation may only work on Linux . On Windows use SetEvent eventVar in-place of condition : : notify one and WaitForSingleObject eventVar duration instead of condition : : timed wait lock duration .", "Question : I need to compile PortAudio s paex record file.c file using Eclipse and CDT on Ubuntu 12.04.5 LTS . Dev libraries libportaudio-dev was installed via Synaptic . I create new Eclipse project and create copy this only file to it so project contains only one user source file paex record file.c 1752 2011-09-08 03 : 21 : 55 . Then i use Eclipse s Pkg-config to add portaudio dev library . But it not compiles with error .. . .. . Then source branch taken from git .. . .. . But still get same error no pa ringbuffer.h . Then during blind trials and errors i use Project - Properties - C build - Settings - Tool settings - Includes and add home test portaudio src common path which contains needed .h file and this error disappear . Question 1 : Is this step is correct use of Eclipse settings in this case i believe not because i never need to use this setting before . But then it shows multiple errors like .. . .. . and this is unrecoverable . Question 2 . How it can be fixed using Eclipse BUT without copying all Portaudio source tree to my project I have pa ringbuffer.o file somewhere in system but no any something like pa ringbuffer.so files . I have compiled and running under Eclipse other PA apps which are do not use PA s ring buffer and just .. . .. . and adding PA lib via PkgConfig is enough . Thanks . .. . Answer : Please have a look into the portaudio.git : .. . .. . .. . so you will have to copy the header to location where it can be found . But : Do not expect to compile a single file often not possible with a complex application . I.e . the setup is meant for compiling the complete portaudio . Comment : When i try this way Eclipse s driven linker becomes more hungry and need more and more source .h and even .c files . Is this really correct and professional way to copy part of source tree to my project Can i use .o files placed at separate Portaudio folder using only link-to these to avoid recompiling already compiled parts And why other examples from Portaudio are does not need anything unusual it is my error Eclipse error or Portaudio error ..Thanks . Comment : So copying one by one source files and how having half of source tree in my project i ended up with pa front.c which have Pa GetDefaultInputDevice which in turn replaces one comes from dev libs - and it is not work no any audio device it sees . So even having a fork of PA source it is not work in case of .paex record file.c", "Question : I am dealing with a legacy code that uses portaudio on windows . The code grabs audio from desktop mic and has ability to configure input volume . It worked perfectly under windows-xp but tuning audio input level is broken under windows-7 changing the parameter has no effect on output audio stream . Code do the following to adjust volume .. . .. . I have discovered that underling winmme functions does not work in Windows Vista and newer . I have updated to last version of portaudio pa stable v19 20140130 in which Mixer functions are not available anymore . I can t find alternative way to adjust input volume in portsound Is there any Comment : Why can t you just adjust it manually Loop through the data and multiply each value in your buffer . That s all the mixer really does anyway just multiply the values by a certain degree . Comment : @benjgorman are you sure There s the separate concept of input gain . This controls the analog preamplifier before sampling . It can have a big effect on your signal-to-noise ratio . .. . Answer : I think you are going to have to use the Audio Endpoint Device API . http : msdn.microsoft.com en-us library windows desktop dd370793 v vs.85 .aspx .. . .. . Like you said the WMME mixer API is no longer supported . The API isn t too bad . Just make sure you use the portaudio API device index to identify the device in the mixer API . Comment : Someone should probably open an issue with the portaudio developers . Since their goal is to provide a cross-platform API they would want to know about this .", "Question : I have made a simple Makefile project using Portaudio libraries and the project has been working fine with the following Makefile : .. . .. . I ll try to integrate Portaudio libraries into another project created with Automake tools . I added library in Makefile.am file in this way : .. . .. . but I obtained the following error : Comment : Why not do as advised in the error message and recompile with -fPIC flag Comment : The program is already compiled with -fPIC and -DPIC . There is always the same problem Warning : Linking the shared library libsounddevice.la against the static library home daniele Desktop Sviluppo Portaudio portaudio lib .libs libportaudio.a is not portable .. . Answer : I have found the problem when I have installed Portaudio portaudio libraries has been included in usr local lib path meanwhile my project search Portaudio libraries in usr lib path . Thus I have copied libraries from usr local lib to usr lib and I solved the problem linking with -lportadio . Thanks .. . .. . Regards Daniele Elia", "Question : null .. . Answer : I would like to install portaudio on OSX El Capitan 10.11 . I have downloaded the latest snapshot and tried to install and I got something about frameworks not being available . I hacked the configure script to help xcodebuild find the framework for 10.11 and now I get : 1 .. . .. . I now understand that is because carbon is no longer available in 10.11 . Is there any way around this or any way to install the previous frameworks Or should I be using something else . I want portaudio to work so that I can install playrec and get duplex audio on matlab on a mac . Comment : MATLAb ships the portaudio library as part of its install . I am not sure why you need to install PortAudio separately . Comment : Yes you are right . I ended up solving my problem with dsp.AudioPlayer and dsp.AudioRecorder from the signal-processing toolbox . Thanks for your help .", "Question : I m trying to write a little C C++ program that both acquires data from an NI USB DAQ and plays audio with PortAudio . The problem is it appears that the NI DAQ library for Mac Linux DAQmxBase has to be built under i386 and I just can t get PortAudio to build for i386 . I have tried setting CFLAGS and LDFLAGS to -arch i386 before running . configure --disable-mac-universal make make install but the NI DAQmxBase example code still won t build when I add calls to PortAudio to it : .. . .. . The NI DAQmxBase Makefile looks like this : .. . .. . Changing the -arch flag in the DAQmxBase Makefile doesn t work : .. . .. . I assume this is because DAQmxBase is written with i386 data types in mind . The lines the above error references from NIDAQmxBase.h are : .. . .. . I can build some of the normal PortAudio examples on their own just fine but I want to put PortAudio and DAQmxBase in the same program together and have them get along . There must be a way to build PortAudio so that it works with DAQmxBase no Thanks .. . Answer : DAQmx Base versions 14.0 and 15.0 support 64-bit applications so you should now be able to upgrade the driver and try again . DAQmx Base 15.0 for Mac http : www.ni.com download ni-daqmx-base-15.0 5648 en", "Question : null .. . Answer : I m learning how to use PortAudio and so far it seems like a pretty straight forward Library to implement in a project . Thing is I m trying to figure out how to get a really low-latency I O stream going in my Mac OS X program . I know there is a specific header file pa mac core.h included for the Mac platform to do specific things but the documentation seems a little fuzzy to me . Ultimately I m trying to get 10ms latency using a thunderbolt audio interface I have at my disposal.Any help would be appreciated", "Question : I am still having trouble building the Portaudio library on my system which is OSX 10.7.5 with Xcode 4.3.2 having Command Line Tools installed and having SDK10.6 and SDK10.7 under .. . .. . I describe shortly also for others that run into the same problem what I have done so far following different solutions I have found on the web . 1 I downloaded Portaudio pa stable v19 20111121.tgz last stable release from : .. . .. . www.portaudio.com download.html .. . .. . 2 I read the instructions on building Portaudio here : .. . .. . www.portaudio.com docs v19-doxydocs compile mac coreaudio.html .. . .. . and tried to compile from a Terminal window with the suggested command : .. . .. . . configure make .. . .. . This resulted not so surprisingly in a lot of errors ending with : .. . .. . llvm-gcc-4.2 : error trying to exec usr bin . . llvm-gcc-4.2 bin powerpc-apple-darwin11-llvm-gcc-4.2 : execvp : No such file or directory lipo : can t open input file : var folders 1 xkp08ky561jg02zjjrpsxg940000gn T ccPxCTrJ.out No such file or directory make : src hostapi coreaudio pa mac core.lo Error 1 .. . .. . This happens because ppc is not supported anymore since OSX 10.5 . Moreover the Developer folder doesn t exist on OSX 10.7 and everything that was in the Developer folder has moved to .. . .. . 3 I downloaded a patch mac configure patch.txt to fix configure from : .. . .. . https : www.assembla.com spaces portaudio tickets 216 activity ticket : .. . .. . and copied it to the portaudio directory and applied it by typing in Terminal : .. . .. . patch mac configure patch.txt .. . .. . A confirmation message said : .. . .. . patching file configure.in .. . .. . So everything seems fine . But still Portaudio is trying to build for ppc . 4 Now I set the ARCHFLAGS CFLAGS LDFLAGS to only build for architecture i386 as follows disabling universal build : .. . .. . MACOSX DEPLOYMENT TARGET 10.7 ARCHFLAGS -arch i386 CFLAGS -O2 -g -Wall -isysroot Applications Xcode.app Contents Developer Platforms MacOSX.platform Developer SDKs MacOSX10.7.sdk -arch i386 -mmacosx-version-min 10.7 LDFLAGS -isysroot Applications Xcode.app Contents Developer Platforms MacOSX.platform Developer SDKs MacOSX10.7.sd -arch i386 -mmacosx-version-min 10.7 . configure --disable-mac-universal .. . .. . 5 Further I found that : .. . .. . A : include AudioToolbox.h in .include pa mac core.h should be UNCOMMENTED .. . .. . B : that -wError from Makefile not Makefile.in should be removed . accoding to : http : www.fluxforge.com blog building-portaudio-under-os-x-107-lion .. . .. . 6 Now I try to build using : sudo make compilation starts but but fails with : .. . .. . ld : framework not found CoreAudio .. . .. . collect2 : ld returned 1 exit status .. . .. . make : lib libportaudio.la Error 1 .. . .. . 7 So I try to point to the framework using -F System Library Frameworks -framework CoreAudio .. . .. . leading to the following Terminal command : .. . .. . MACOSX DEPLOYMENT TARGET 10.7 ARCHFLAGS -arch i386 CFLAGS -O2 -g -Wall -isysroot Applications Xcode.app Contents Developer Platforms MacOSX.platform Developer SDKs MacOSX10.7.sdk -arch i386 -mmacosx-version-min 10.7 LDFLAGS -isysroot Applications Xcode.app Contents Developer Platforms MacOSX.platform Developer SDKs MacOSX10.7.sd -arch i386 -mmacosx-version-min 10.7 -F System Library Frameworks -framework CoreAudio . configure --disable-mac-universal .. . .. . which seems to fix the CoreAudio framework issue but results in another error saying : .. . .. . ld : library not found for -lSystem .. . .. . collect2 : ld returned 1 exit status .. . .. . make : lib libportaudio.la Error 1 .. . .. . I am now stuck at this point . Did anyone experience the same problems when trying to build Portaudio on OSX 10.7 using SDK10.6 or SDK10.7 . Did anyone find a solution to how to build Portaudio from Terminal I am very thankful for any hints Thanks in advance .. . Answer : OK finally I solved the issue . Hope the solution will help others as well . I just forgot to also add the path to the CoreAudio framework to the CFLAGS . Here is the final configure build command for building portaudio on OSX 10.7.5 using SDK10.7 for architecture i386 x86-64 : .. . .. . Open a Terminal window in the portaudio directory and type : .. . .. . MACOSX DEPLOYMENT TARGET 10.7 ARCHFLAGS -arch i386 CFLAGS -O2 -g -Wall -isysroot Applications Xcode.app Contents Developer Platforms MacOSX.platform Developer SDKs MacOSX10.7.sdk -arch i386 -mmacosx-version-min 10.7 -F System Library Frameworks -framework CoreAudio LDFLAGS -isysroot Applications Xcode.app Contents Developer Platforms MacOSX.platform Developer SDKs MacOSX10.7.sdk -arch i386 -mmacosx-version-min 10.7 -F System Library Frameworks -framework CoreAudio . configure --disable-mac-universal .. . .. . If this has finished you need to edit Makefile and change the mention of -Werror to -Wall . Then : .. . .. . make .. . .. . Voila . There you have your libportaudio.la in the portaudio lib directory . You can now type .. . .. . sudo make install .. . .. . you ll be asked to confirm using your password .. . .. . to put the library in the system directory . Finally you can mess around with Portaudio Have fun Comment : This almost works . I edited the sudo from the make it s not necessary . Also I had to edit the Makefile after the compile step and change -Werror to -Wall : there s probably a CFLAGS which fixes this but I couldn t get it to work . Comment : shouldn t the sudo be at the install step Comment : @robw do you have admin priviledge on the system you did the build on Comment : The sudo is more likely to be required at make install but it is system-dependent . I ve never compiled a project which required sudo at the compilation make stage .", "Question : I m currently experimenting with real-time signal-processing so I went and tried out PortAudio from C . I have two audio interfaces on my computer onboard sound Intel HD Audio and a USB audio interface . Both generally work fine under ALSA on Linux . I also tried the USB audio interface under JACK on Linux and this also works perfectly . What I do : .. . .. . My code just initializes PortAudio opens and starts a stream one channel paInt32 sample format defaultLowInputLatency defaultLowOutputLatency though I tried changing to paFloat32 or defaultHighInputLatency defaultHighOutputLatency which didn t improve anything . On each invocation of the callback it copies sizeof int32 t frameCount bytes via memcpy from the input to the output buffer then returns paContinue . It does nothing else in the callback . No memory allocation no system calls nothing it could block on . It just outputs what it has read . The code is very simple still I can t get it running . Replacing the memcpy with a loop copying frameCount elements of type int32 t over from the input to the output buffer didn t change anything . What I ve tried : .. . .. . The following scenarios were tried out with PortAudio . 1 . Input and output via USB audio interface callback mechanism on PortAudio ALSA backend . 2 . Input and output via USB audio interface blocking I O on PortAudio with 1024 samples buffer size ALSA backend . 3 . Input via USB audio interface output via onboard sound callback mechanism on PortAudio ALSA backend . 4 . Input via USB audio interface output via onboard sound blocking I O on PortAudio with 1024 samples buffer size ALSA backend . 5 . Input and output via USB audio interface callback mechanism on PortAudio JACK backend . 6 . Input and output via USB audio interface blocking I O on PortAudio with 1024 samples buffer size JACK backend . The problems I encountered : .. . .. . The results were as follows . Numbers represent the scenarios described above . 1 . No output from device . 2 . Output from device unsteady interrupted . All the time lots of buffer underruns . 3 . No output from device . 4 . Output from device unrealiable . Sometimes it works sometimes it doesn t . Without changing anything just running the executable multiple times . When it works latency starts off low but increases over time and gets very noticeable . 5 . No output from device . 6 . No output from device . Between each try ALSA has been tested if it s still responsive sometimes it got completely locked up so that no application could output sound any longer and rebooted the system in case ALSA got locked up then continued the testing . More details that might be useful when tracking the problem down : .. . .. . In the scenarios where there is no output at all I get the following error messages when using ALSA as backend . I get the following error message when using JACK as backend . In addition no matter what method I use I always get these warnings . When using ALSA I also get one or two complaints about underruns . The PortAudio functions that I call Pa Initialize Pa OpenStream Pa StartStream Pa StopStream Pa CloseStream Pa Terminate in this order all return paNoError . The paex read-write wire.c blocking I O example that comes with PortAudio can usually access the device but also experiences lots of underruns like my test case 2 . In either case there s nothing interesting showing up in dmesg . Just checked that since ALSA has a kernel-level component . My question : .. . .. . Anyone knows what s the problem here and how I could fix it Or at least how I could narrow it down a bit more Comment : Please show your code . Comment : Here you go Thanks a lot for your time and efforts PortAudio callback-based : pastebin.com MrHpkXEA http : pastebin.com MrHpkXEA PortAudio blocking I O : pastebin.com MDdUZ8W3 http : pastebin.com MDdUZ8W3 RtAudio callback-based : pastebin.com YCQ0JpSR http : pastebin.com YCQ0JpSR .. . Answer : When you write only a single block of samples the playback device will run out of samples just when you re about to write the next block . You should fill up the playback device s buffer with zero samples before you start the read-write loop . Comment : Thanks Are you sure this is how it works with PortAudio It s a realtime API . The callback gives you an input and an output buffer and a number of frames and as far as I understand expects you to read EXACTLY this number of frames from the one and write this number of frames to the other . I expected the API to call me on each block then output what I ve written into the output buffer just after I return . So call on each block and 1 block delay as the block I process is always output in the next iteration . This is also how it s done in examples . I don t think there s a buffer involved . Comment : In theory the realtime API should take care of that . Do PortAudio s example programs work Comment : Like I said I tried the paex read-write wire.c example since like my application it does both input and output but it uses blocking I O . It doesn t drop out like mine but it underruns all the time and output is grossly distorted . There s sample code in paex saw.c that outputs a sawtooth wave using callback mechanism but has no input and this works on the onboard sound but also outputs ALSA warnings about no channel map but causes lots of underruns and distortion on the USB interface . Note that the USB interface works fine with normal applications under ALSA . Comment : If PA does not work in the first place there s nothing your program can do . Comment : So the library itself is broken Ain t that unlikely given that it s pretty common What should I do Try yet another library I just came from plain ALSA where I had severe latency problems so people told me to use a callback-based API . Also ALSA contains bugs . Already stumbled upon them but worked around . - I did some research and found that PortAudio seems to be pretty widely used and is designed for realtime processing which suits my needs . I d like to develop some audio processing algorithms yet all I m dealing with are broken APIs . : -", "Question : I have made a simple Makefile project using Portaudio libraries and the project has been working fine with the following Makefile : .. . .. . I ll try to integrate Portaudio libraries into another project created with Automake tools . I added library in Makefile.am file in this way : .. . .. . but I obtained the following error : Comment : Why not do as advised in the error message and recompile with -fPIC flag Comment : The program is already compiled with -fPIC and -DPIC . There is always the same problem Warning : Linking the shared library libsounddevice.la against the static library home daniele Desktop Sviluppo Portaudio portaudio lib .libs libportaudio.a is not portable .. . Answer : Don t link with -shared against a static library . Use the shared one -lportaudio .. . .. . See also Why is fPIC absolutely necessary on 64 and not on 32bit platforms https : stackoverflow.com questions 7216244 why-is-fpic-absolutely-necessary-on-64-and-not-on-32bit-platforms Comment : I have already used -lportaudio and the program compiles correctly but when I log Pa GetDeviceCount I have 0 audio devices instead they should be 7 as shows other program compiled with libportaudio.a library . Any ideas about this issue Thanks", "Question : I m trying to compile portaudio in visual-studio-2015 and I encountered this common problem with the missing ksguid.lib file I found this question on stackoverflow which suggested to create a link-to the file in windows sdks directory . The problem is that I don t have ksguid.lib in my windows sdks folder and now I m stuck is there an easy way to fix this the original question I found is contained in the link below .. . .. . Can t Build PortAudio - LNK1104 : cannot open file ksguid.lib http : stackoverflow.com questions 29550887 cant-build-portaudio-lnk1104-cannot-open-file-ksguid-lib Comment : It is not an SDK file anymore . It was moved into the WDK the device-driver development kit . Which you probably don t have installed start here https : msdn.microsoft.com en-us windows hardware hh852365.aspx . Or use the version 7.1 SDK as recommended in that duplicate . .. . Answer : after following the link posted by Hans Passant I managed to download the latest drivers and by linking ksguid.lib to my portaudio project I was able to build the solution .", "Question : This query is regarding the Portaudio framework . A little background before I ask the question : I am working on an application in PortAudio to output audio through a multichannel 8 device . However the device I am using does not expose itself as a single 8-channel device but instead shows up in my device-list as 4 stereo devices . On searching for an approach to handle this I got to know that WinMME in PortAudio supports multiple devices . Now I went through the appropriate header file pa win wmme.h and followed the suggestions present . But I get the Invalid device error error number -9996 after calling PA OpenStream . In the above mentioned header file they have in fact specified the right parameter s to use when configuring multiple devices to avoid this error but in-spite of following them I still get the error . So I wanted to know if anybody has faced a similar issue and whether I have missed wrongly configured anything . I am pasting the required snippets of code below for reference : .. . .. . The device id 3 was obtained through .. . .. . I hope I have made the query clear enough . Will be happy to provide more details if required . Thanks . .. . Answer : Based on the code pasted above it looks like you are trying to call open on a single 8-channel device . Instead you will have to get the Pa index of all four devices and call open 4 times . Once for each stereo device . You will then have 4 interleaved stereo streams to maintain . My guess is that changing channelCount 8 to channelCount 2 will allow the first stream to open . Comment : @trukvl. . Thanks for the reply . The system does work if I use a single device i.e . if I set outputParameters.channelCount to 2 as you have mentioned and deviceCount to 1 . The only catch is it ll be stereo output which is of course expected . Now extending this to play 8-channel by modifying the stereo configuration to be as given in the question seems to be giving the problem. . I shall try out your suggestion about opening 4 streams and get back .", "Question : I m a beginner in C C++ so please bear with me . I m trying to build the PortAudio library so I can use it in one of my project . I m using VS 2013 the preset project-file for builds had to be converted to my version . I ve been able to fix all the many problems that occurred on my long way here except one : .. . .. . I ve seen this https : bitbucket.org undergraver codetrainer wiki Building 20portaudio 20with 20Visual 20Studio and this http : music.columbia.edu pipermail portaudio 2011-August 012848.html site . All of them address exactly this problem yet non of them has been able to solve it . Here are the solutions these sites suggest : .. . .. . Add WASAPI - symbol to portaudio.def .. . Add PA WDMKS NO KSGUID LIB - definition to the preprocessor .. . Answer : ksguid.lib is included in the Windows 7 8 8.1 and windows-10 sdk . The answer provided by @Nearoo is perfectly valid . This alternative answer involves modifying what directories the portaudio Visual Studio project looks for library files . For reference I m using Visual Studio 2013 on a Windows 8.1 PC . Navigate to : Project - Properties - VC++ Directories At the top of the window .. . .. . 1 . change Configuration to All Configurations . 2 . change Platform to All Platforms .. . 3 . In the Library Directories portion add the following path : .. . .. . WindowsSdkDir Lib winv6.3 km PlatformTarget .. . .. . This nice thing is that this one path uses macros so it will work with Debug Release 32-bit and 64 bit builds of portaudio ." ] }
[ "yes-answer-long", "yes-answer-short" ]
audio
UNK_RELATION
hadoop@distributed-computing@100
hadoop -- hadoop is an apache open-source project that provides software for reliable and scalable @placeholder .
{ "confidence": [ 43.97544479370117, 43.08086013793945, 41.734859466552734, 38.962257385253906, 38.82756423950195, 37.83015823364258, 37.70738220214844, 37.55781555175781, 37.00409698486328, 36.958351135253906, 36.94434356689453, 36.937705993652344, 36.786895751953125, 36.476924896240234, 36.328941345214844, 36.1478157043457, 36.07566452026367, 36.07566452026367, 35.479705810546875, 35.47916030883789, 35.28192138671875, 35.232421875, 35.12398147583008, 35.087730407714844, 35.08747100830078, 35.08656692504883, 35.07880401611328, 35.0091552734375, 34.97303771972656, 34.97303771972656, 34.906185150146484, 34.79730987548828, 34.749027252197266, 34.73221206665039, 34.70185470581055, 34.65855026245117, 34.638824462890625, 34.635318756103516, 34.635318756103516, 34.53285217285156, 34.50648498535156, 34.479732513427734, 34.45779037475586, 34.40595626831055, 34.395782470703125, 34.389835357666016, 34.37943649291992, 34.32566833496094, 34.249298095703125, 34.229671478271484, 34.18796157836914, 34.162818908691406, 34.101470947265625, 34.06364440917969, 34.05694580078125, 34.03211975097656, 33.9691276550293, 33.860103607177734, 33.860103607177734, 33.780818939208984, 33.767478942871094, 33.72665786743164, 33.72665786743164, 33.64425277709961, 33.56105041503906, 33.38563537597656, 33.36733627319336, 33.33027648925781, 33.30264663696289, 33.21672821044922, 33.057212829589844, 33.04928207397461, 33.04928207397461, 33.04928207397461, 33.04928207397461, 33.02791976928711, 33.02791976928711, 33.00478744506836, 33.001914978027344, 32.96128845214844, 32.95798110961914, 32.91463851928711, 32.88399124145508, 32.88123321533203, 32.791996002197266, 32.767330169677734, 32.73625564575195, 32.55685043334961, 32.49238586425781, 32.490543365478516, 32.4217414855957, 32.38309097290039, 32.38249969482422, 32.36552047729492, 32.311336517333984, 32.304771423339844, 32.304771423339844, 32.266265869140625, 32.266265869140625, 32.258766174316406 ], "content": [ "To Begin with Vanilla Apache Hadoop is 100 open-source .", "Why are there two separate packages map-reduce package in Apache s hadoop package tree : .. . .. . http : javasourcecode.org html open-source hadoop hadoop-1.0.3 org apache hadoop mapred .. . .. . http : javasourcecode.org html open-source hadoop hadoop-1.0.3 org apache hadoop mapreduce .. . .. . Why are they separated out", "Hadoop is open-source .", "See the Hadoop ArrayWritable https : github.com apache hadoop blob trunk hadoop-common-project hadoop-common src main java org apache hadoop io ArrayWritable.java for a reference .", "Apache Hadoop and HBase are open-source products and available free of charge .", "dfs.blocksize : hadoop.apache.org docs current hadoop-project-dist hadoop-hdfs http : hadoop.apache.org docs current hadoop-project-dist hadoop-hdfs hdfs-default.xml", "An update .. . .. . .. . We have now introduced a beta plan under BigInsights for Apache Hadoop on Bluemix which will now let you spin up IBM Open Platform clusters with open-source Apache Hadoop and Apache Spark .", "I m talking in terms of Apache Hadoop .", "If you are concerned about the size of the dependencies you could at least take the source from the hadoop-auth client https : github.com apache hadoop blob trunk hadoop-common-project hadoop-auth src main java org apache hadoop security authentication client AuthenticatedURL.java and use that .", "http : javasourcecode.org html open-source hadoop hadoop-0.20.203.0 org apache hadoop hdfs server namenode ReplicationTargetChooser.java.html .. . .. . .. . Its main method is chooseTarget line 67 .", "Apache Hadoop 2.5.2 .", "Line 59 of javasourcecode.org html open-source hadoop hadoop-1.0.3 org http : javasourcecode.org html open-source hadoop hadoop-1.0.3 org apache hadoop mapreduce lib input LineRecordReader.java.html doesn t seek to Start - 1.. .", "numPartition in partition class http : search-hadoop.com c Hadoop : hadoop-mapreduce-project hadoop-mapreduce-client hadoop-mapreduce-client-core src main java org apache hadoop mapreduce Partitioner.java 7C 7CnumPartitions .", "The IBM Analytics for Apache Hadoop BETA service has been replaced by the Biginsights for Apache Hadoop https : console.ng.bluemix.net catalog services biginsights-for-apache-hadoop service .", "Refer this hadoop.apache.org docs r2.5.2 hadoop-project-dist hadoop-hdfs https : hadoop.apache.org docs r2.5.2 hadoop-project-dist hadoop-hdfs HdfsUserGuide.html", "I believe EMR has some own modifications to the JobClient https : github.com apache hadoop-common blob trunk hadoop-mapreduce-project hadoop-mapreduce-client hadoop-mapreduce-client-core src main java org apache hadoop mapred JobClient.java class of Hadoop which outputs this particular line .", "To do that Hadoop provides something called as SequenceFiles http : wiki.apache.org hadoop SequenceFile .", ".. . The Hadoop subproject Hive provides a SQL interface and relational model for Hadoop .", "Will Apache Flink replace Hadoop", "The current default size in Apache Hadoop http : hadoop.apache.org docs current hadoop-project-dist hadoop-hdfs hdfs-default.xml is is 128 MB .", "org apache hadoop hbase HBaseConfiguration", "I open the hadoop code .", "Go to the Hadoop 2.2 Apache download page https : archive.apache.org dist hadoop core hadoop-2.2.0 and download hadoop-2.2.0-src.tar.gz", "Take a look at the example https : github.com apache hadoop-common blob trunk hadoop-mapreduce-project hadoop-mapreduce-examples src main java org apache hadoop examples pi DistSum.java shipped with hadoop s source code lines 391 405 .", "Cloudera Hadoop Distribution don t even uses those script and provides init.d scripts to do the starting stopping of Hadoop daemons .", "note the new change in hadoop 2.0.4 : dfs.blocksize hadoop.apache.org docs r2.0.4-alpha hadoop-project-dist http : hadoop.apache.org docs r2.0.4-alpha hadoop-project-dist hadoop-common DeprecatedProperties.html", "I downloaded the source of hadoop 1.0.3 and found this code in hadoop-1.0.3 src contrib streaming src java org apache hadoop-streaming PipeReducer.java : .. . .. . So I tried passing -D stream.reduce.output.field.separator as an argument to the job with no luck .", "Tool chain Eco system .. . .. . .. . .. . Hadoop .. . Hadoop and HDFS integrate well with many other open-source tools .", "https : hadoop.apache.org docs r2.7.2 hadoop-project-dist hadoop-common HttpAuthentication.html", "http : hadoop.apache.org docs r2.2.0 hadoop-project-dist hadoop-common FileSystemShell.html", "Software version : Cloudera hadoop CDH5.3.3 Apache version 0.13.1 .", "Hadoop provides a couple of REST interfaces .", "Apache Hadoop is an open-source software framework for distributed storage and distributed processing of very large-data sets on computer clusters built from commodity hardware .", "It appears to be part of a google-code project named hadoop-gpl-compression - code.google.com a apache-extras.org p hadoop-gpl-compression https : code.google.com a apache-extras.org p hadoop-gpl-compression", "Error launching Analytics for Apache Hadoop in Bluemix .", "URL updated to hadoop.apache.org docs r2.6.0 hadoop-project-dist hadoop-hdfs https : hadoop.apache.org docs r2.6.0 hadoop-project-dist hadoop-hdfs HDFSHighAvailabilityWithQJM.html", "Let s check the implementation https : github.com apache hadoop-common blob 1f2a21ff9b812ec9667ce7561f9c02a45dfe5674 hadoop-mapreduce-project hadoop-mapreduce-client hadoop-mapreduce-client-core src main java org apache hadoop mapreduce lib input TextInputFormat.java L42 .", "Hadoop is an Apache project being built and used by a global community of contributors and users .", "It is basically an updated and expanded version of the Analytics for Apache Hadoop project .", "Hadoop provides two fs interfaces - FileSystem https : hadoop.apache.org docs current api index.html org apache hadoop fs FileSystem.html and AbstractFileSystem https : hadoop.apache.org docs current api org apache hadoop fs AbstractFileSystem.html .", "Check the code in the org.apache.hadoop.streaming.HadoopStreaming http : svn.apache.org repos asf hadoop common trunk hadoop-tools hadoop-streaming src main java org apache hadoop-streaming HadoopStreaming.java java class to know the API details .", "You can read more about the YARN architecture at Apache Hadoop YARN http : hadoop.apache.org docs r2.2.0 hadoop-yarn hadoop-yarn-site YARN.html", "Here s hadoop-common-2.7.1 http : central.maven.org maven2 org apache hadoop hadoop-common 2.7.1 hadoop-common-2.7.1.jar .", "Looking at the Distcp code the relevant part is around line 237 https : github.com apache hadoop blob trunk hadoop-tools hadoop-distcp src main java org apache hadoop tools DistCp.java L237 at createJob .", "The Hadoop distributed file system HDFS is a distributed scalable and portable file-system written in Java for the Hadoop framework .", "Source and destination are in different versions of Hadoop", "Also this post http : svn.apache.org repos asf hadoop common trunk hadoop-mapreduce-project hadoop-mapreduce-examples src main java org apache hadoop examples QuasiMonteCarlo.java http : svn.apache.org repos asf hadoop common trunk hadoop-mapreduce-project hadoop-mapreduce-examples src main java org apache hadoop examples QuasiMonteCarlo.java 5D example program .", "hadoop .", "Hadoop is an open-source software framework for storage and large-scale processing of data-sets on clusters of commodity hardware .", "It is easy to misunderstand this because Hadoop YARN is too broadly used as a synonym for Apache Hadoop MapReduce V2 .", "for hadoop-2.x : hadoop-home-path etc hadoop hadoop-env.sh", "c : hadoop-2.3.0 bin hadoop command is working but c : hadoop-2.3.0 bin hadoop namenode -format command is not working .", "You will need to attach the BigInsights for Apache Hadoop service https : console.ng.bluemix.net catalog biginsights-for-apache-hadoop service to your app .", "Then I saw Hadoop provides a plugin for Eclipse .", "From Apache documentation https : hadoop.apache.org docs r2.4.1 hadoop-project-dist hadoop-hdfs hdfs-default.xml which provides HDFS properties .. . .. . dfs.heartbeat.interval with a default-value of 3 determines datanode heartbeat interval in seconds .", "Project directory : .. . .. . hadoop-2.2.0-src hadoop-common-project hadoop-common src main winutils .. . .. . My OS : Windows 7 .", "Apache Hadoop https : hadoop.apache.org project includes four key modules .. . .. . 1 .", "hadoop.apache.org docs stable hadoop-project-dist hadoop-hdfs https : hadoop.apache.org docs stable hadoop-project-dist hadoop-hdfs ArchivalStorage.html", "See hadoop.apache.org docs r2.7.1 hadoop-project-dist hadoop-hdfs https : hadoop.apache.org docs r2.7.1 hadoop-project-dist hadoop-hdfs HDFSHighAvailabilityWithQJM.html", "You should be able to use the BigQuery connector for Hadoop see https : cloud.google.com hadoop bigquery-connector which provides an implementation of the Hadoop OutputFormat class .", "winutils.exe are required for hadoop to perform hadoop related commands .", "there should be a HADOOP HOME bin hadoop.dll which contains the native method https : github.com apache hadoop blob c1d50a91f7c05e4aaf4655380c8dcd11703ff158 hadoop-common-project hadoop-common src main native src org apache hadoop io nativeio NativeIO.c .", "If you look at the history of the native method https : github.com apache hadoop blame c1d50a91f7c05e4aaf4655380c8dcd11703ff158 hadoop-common-project hadoop-common src main native src org apache hadoop io nativeio NativeIO.c that is missing here you will see that it was added recently .", "HDFS is scalable reliable and fault tolerant distributed file system since Hadoop 2.x release .", "Apache Hadoop 2.7.1 - Configurations for ResourceManager http : hadoop.apache.org docs current hadoop-project-dist hadoop-common ClusterSetup.html Configuring Environment of Hadoop Daemons .. . .. . Parameter : yarn.resourcemanager.hostname .. . Value : ResourceManager host .", "Does this mean that these is an error in hadoop source", "There is a as per today open jira for this issues.apache.org jira browse HADOOP-10051 https : issues.apache.org jira browse HADOOP-10051", "BTW according with hadoop documentation the correct command to work with HDFS is hdfs dfs instead hadoop fs https : hadoop.apache.org docs current hadoop-project-dist hadoop-hdfs HDFSCommands.html .", "You have to change the project dependences hadoop-core and hadoop-tools .", "Point is : Hadoop provides both - storage + processing .", "I am working on Hadoop but searching for a better open-source HDFS explorer .", "The Apache Hadoop framework is composed of the following modules .. . .. . 1 .", "I used Apache Phoenix 4.7 on Hadoop 2.4 .", "My Hadoop distribution is Apache one not cloudera CDH .", "I understand that Apache Apex runs on Hadoop and YARN .", "I don t see it mentioned on hadoop.apache.org docs current hadoop-project-dist http : hadoop.apache.org docs current hadoop-project-dist hadoop-common ClusterSetup.html", "Details - hadoop.apache.org docs current hadoop-project-dist https : hadoop.apache.org docs current hadoop-project-dist hadoop-common FileSystemShell.html setrep", "In Hadoop 2.x.x hadoop-env.sh can be found at etc hadoop conf hadoop-env.sh", "Configure Hadoop .. . .. . C : hadoop etc hadoop core-site.xml .. . .. . C : hadoop etc hadoop hdfs-site.xml .. . .. . C : hadoop etc hadoop mapred-site.xml .. . .. . C : hadoop etc hadoop yarn-site.xml .. . .. . Format namenode .. . .. . For the first time only namenode needs to be formatted .", "Source : Map Reduce Tutorial https : hadoop.apache.org docs current hadoop-mapreduce-client hadoop-mapreduce-client-core MapReduceTutorial.html from Apache .", "I downloaded a release of 2.3 at one of the mirrors http : mirrors.koehn.com apache hadoop common hadoop-2.3.0 .", "Hadoop streaming will be using the Hadoop OutputFormatters such as TextOutputFormat .", "There is a Hadoop project that promises just that - Hive .", "You can also use hadoop-daemons.sh or hadoop-daemon.sh to accomplish the same things logging into as your hadoop user .", "First method should work on Hadoop 0.22 : .. . .. . I also found this Java wrapper https : github.com lohitvijayarenu hadoop-common blob trunk hadoop-tools hadoop-streaming src main java org apache hadoop-streaming HadoopStreaming.java which you should be able to run .", "Some woodoo magic here goes : open .. . .. . hadoop-2.2.0-src hadoop-common-project hadoop-common src main native native.sln .. . .. . in MS VS right-click on solution - build .", "I manually downloaded it added to the folders : .. . .. . C : hadoop-2.7.1-src hadoop-common-project hadoop-kms downloads .. . C : hadoop-2.7.1-src hadoop-hdfs-project hadoop-hdfs-httpfs downloads .. . and deleted from the files : .. . C : hadoop-2.7.1-src hadoop-common-project hadoop-kms target antrun build-main.xml .. . C : hadoop-2.7.1-src hadoop-hdfs-project hadoop-hdfs-httpfs target antrun build-main.xml .. . the following lines-of-code : .. . .. . Note that I am also using proxy I have set the proxy in the settings.xml and set PATH to MAVEN OPTS as suggested in the same answer from @tiho .", "Seeing that Apache Hadoop 2.6.0 http : hadoop.apache.org docs r2.6.0 hadoop-project-dist hadoop-common FileSystemShell.html have no split command how am I able to do it without having to download the file .", "So you need to build windows native binary distribution of hadoop from source codes following BUILD.txt file located inside the source distribution of hadoop .", "There is no official eclipse-plugin from hadoop project .", "I started following the instructions on the Hadoop 2.3 docs http : hadoop.apache.org docs r2.3.0 hadoop-project-dist hadoop-common SingleNodeSetup.html .", "I only read web on apache hadoop .", "When the Hadoop streaming job is run as .. . .. . hadoop jar home training Installations hadoop-1.0.3 contrib streaming hadoop-streaming-1.0.3.jar -input input4 -output output4 -mapper home training Code Streaming max temperature map.rb -reducer home training Code Streaming max temperature reduce.rb .. . .. . then org.apache.hadoop.streaming.HadoopStreaming http : svn.apache.org repos asf hadoop common trunk hadoop-tools hadoop-streaming src main java org apache hadoop-streaming HadoopStreaming.java is executed .", "for hadoop-1.x : hadoop-home-path conf hadoop-env.sh .. . 2 .", "Try including the following external jars that you downloaded with Hadoop : .. . .. . HADOOP HOME share hadoop mapreduce hadoop-mapreduce-client-core-2.2.0.jar .. . HADOOP HOME share hadoop mapreduce hadoop-mapreduce-client-common-2.2.0.jar .. . HADOOP HOME share hadoop common hadoop-common-2.2.0.jar", "Is it treating the source IP as another node in the Hadoop cluster", "meanwhile i already have source of hadoop classes .", "wiki.apache.org hadoop ConnectionRefused http : wiki.apache.org hadoop ConnectionRefused", "These packages install hadoop configuration-files into etc hadoop .", "Shark is an open-source distributed SQL query-engine for Hadoop data ." ] }
{ "confidence": [ 47.68836212158203, 47.4262809753418, 44.65576171875, 43.826507568359375, 43.677978515625, 43.646705627441406, 43.352474212646484, 43.15570831298828, 42.3681755065918, 42.15204620361328, 42.13856506347656, 41.877567291259766, 41.67001724243164, 41.34113311767578, 40.860389709472656, 40.70539093017578, 40.67878341674805, 40.66368103027344, 40.57707595825195, 40.521339416503906 ], "content": [ "Question : I hear lot about Hadoop but when it comes for defining what it is i get confused . Because definition defers form point-to-point . Is Hadoop something that serves files from server to client Ex : If we implement Hadoop for a MAILDIR where emails are stored Can Hadoop help in accessing the emails and serving it to client in super fast speed Is this how it can be used Can you tell me in simple words what is Hadoop and its uses Comment : hover the mouse over the hadoop tag and you ll get it in simple words . .. . Answer : Dude You are messing this up . Hadoop is an open-source software framework for storage and large-scale processing of data-sets on clusters of commodity hardware . Hadoop is an Apache project being built and used by a global community of contributors and users . The Apache Hadoop framework is composed of the following modules .. . .. . 1 . Hadoop Common contains libraries and utilities needed by other Hadoop modules .. . .. . 2 . Hadoop Distributed File System HDFS a distributed file-system that stores data on commodity machines providing very high aggregate bandwidth across the cluster . 3 . Hadoop YARN a resource-management platform responsible for managing compute resources in clusters and using them for scheduling of users applications . 4 . Hadoop MapReduce a programming model for large scale data-processing . For the end-users though MapReduce Java code is common any programming language can be used with Hadoop Streaming to implement the map and reduce parts of the user s program.Apache Pig Apache Hive Apache Spark among other related projects expose higher level user interfaces like Pig Latin and a SQL variant respectively . The Hadoop framework itself is mostly written in the Java programming language with some native-code in C and command-line utilities written as shell-scripts . The Hadoop distributed file system HDFS is a distributed scalable and portable file-system written in Java for the Hadoop framework . Each node in a Hadoop instance typically has a single namenode a cluster of datanodes form the HDFS cluster . The situation is typical because each node does not require a datanode to be present . Each datanode serves up blocks of data over the network using a block protocol specific to HDFS . The file system uses TCP IP sockets for communication . Clients use remote procedure call RPC to communicate between each other . HDFS stores large-files typically in the range of gigabytes to terabytes across multiple machines . It achieves reliability by replicating the data across multiple hosts and hence theoretically does not require RAID storage on hosts but to increase I O performance some RAID configurations are still useful . With the default replication value 3 data is stored on three nodes : two on the same rack and one on a different rack . Data nodes can talk to each other to rebalance data to move copies around and to keep the replication of data high . The HDFS file system is not restricted to MapReduce jobs.It can be used for other applications including the HBase database the Apache Mahout machine-learning system and the Apache Hive Data Warehouse system . Hadoop can in theory be used for any sort of work that is batch-oriented rather than real-time that is very data-intensive and able to work on pieces of the data in parallel . Commercial applications of Hadoop includes : .. . .. . 1 . Log and or clickstream analysis of various kinds .. . 2 . Marketing analytics .. . 3 . Machine learning and or sophisticated data-mining .. . 4 . Image processing .. . 5 . Processing of XML messages .. . 6 . Web crawling and or text-processing .. . 7 . General archiving including of relational tabular data e.g . for compliance .. . .. . You can refer to YDN https : developer.yahoo.com hadoop tutorial to have a good startup in understanding the hadoop framework .", "Question : What s the difference between BOINC https : en.wikipedia.org wiki Berkeley Open Infrastructure for Network Computing .. . .. . vs . General Hadoop Spark etc . big data framework They all seem to be distributed-computing frameworks - are there places where I can read about the differences or BOINC in particular Seems the Large Hadron Collider in EU is using BOINC why not Hadoop Thanks . Comment : CERN does in fact utilize Hadoop + Spark . Example : openlab.web.cern.ch technical-area data-analytics http : openlab.web.cern.ch technical-area data-analytics .. . Answer : BOINC is software that can use the unused CPU and GPU cycles on a computer to do scientific-computing .. . .. . BOINC is strictly a single application that enables grid-computing using unused computation cycles . Apache Hadoop is an open-source software framework for distributed storage and distributed processing of very large-data sets on computer clusters built from commodity hardware . All the modules in Hadoop are designed with a fundamental assumption that hardware failures are common and should be automatically handled by the framework . .. . The core of Apache Hadoop consists of a storage part known as Hadoop Distributed File System HDFS and a processing part called MapReduce . emphasis added to framework and it s dual functionality .. . .. . Here you see Hadoop is a framework also referred to as an ecosystem that has both storage and computing capabilities . Hadoop vendors such as Cloudera and Hortonworks bundle in additional functionality into that Hive Hbase Pig Spark etc as well as a few security auditing tools . Additionally hardware failure is handled differently by these two clusters . If a BOINC node dies there is no fault tolerance those resources are lost . In the case of Hadoop data is replicated and tasks are re-ran a certain number of times before eventually failing but these steps are traceable as long as the logging services built into the framework are running . Seems the Large Hadron Collider in EU is using BOINC why not Hadoop Because BOINC provides a software that anyone in the world can install to join the cluster they gain a large range of computing power from anywhere practically for free . They might be using Hadoop internally to do some storage and perhaps Spark to do additional computing but buying commodity hardware in bulk and building maintaining that cluster seems cost prohibitive .", "Question : I am getting the following error while starting namenode for latest hadoop-2.2 release . I didn t find winutils exe file in hadoop bin folder . I tried below commands Comment : See stackoverflow.com questions 18630019 http : stackoverflow.com questions 18630019 running-apache-hadoop-2-1-0-on-windows Comment : Trying to get rid of that error message I set -Dhadoop.home.dir to a meaningful value . Now I am getting something like local path replaced by variable name : Could not locate executable HADOOP HOME bin winutils.exe in the Hadoop binaries . And guess what : Setting the variable did not make that binary appear . Also the priority ERROR is wrong as the application seems to continue . In my eyes that is a bug in Hadoop 2.2.0 . Comment : There is a as per today open jira for this issues.apache.org jira browse HADOOP-10051 https : issues.apache.org jira browse HADOOP-10051 Comment : There is a HADOOP-11003 https : issues.apache.org jira browse HADOOP-11003 . Comment : Please accept answer given by Prasad D . He has provided readymade files to be used thus avoiding efforts . .. . Answer : If we directly take the binary distribution of Apache Hadoop 2.2.0 release and try to run it on Microsoft Windows then we ll encounter ERROR util.Shell : Failed to locate the winutils binary in the hadoop binary path . The binary distribution of Apache Hadoop 2.2.0 release does not contain some windows native components like winutils.exe hadoop.dll etc . These are required not optional to run Hadoop on Windows . So you need to build windows native binary distribution of hadoop from source codes following BUILD.txt file located inside the source distribution of hadoop . You can follow the following posts as well for step by step guide with screen shot .. . .. . Build Install Configure and Run Apache Hadoop 2.2.0 in Microsoft Windows OS http : www.srccodes.com p article 38 build-install-configure-run-apache-hadoop-2.2.0-microsoft-windows-os .. . .. . ERROR util.Shell : Failed to locate the winutils binary in the hadoop binary path http : www.srccodes.com p article 39 error-util-shell-failed-locate-winutils-binary-hadoop-binary-path Comment : Hi Abhijit . Have you followed your own directions Hadoop is not supported on Windows . Actually it is only supported on certain versions of Windows Server . That is very lousy by Microsoft and HortonWorks .", "Question : I am getting the following error while starting namenode for latest hadoop-2.2 release . I didn t find winutils exe file in hadoop bin folder . I tried below commands Comment : See stackoverflow.com questions 18630019 http : stackoverflow.com questions 18630019 running-apache-hadoop-2-1-0-on-windows Comment : Trying to get rid of that error message I set -Dhadoop.home.dir to a meaningful value . Now I am getting something like local path replaced by variable name : Could not locate executable HADOOP HOME bin winutils.exe in the Hadoop binaries . And guess what : Setting the variable did not make that binary appear . Also the priority ERROR is wrong as the application seems to continue . In my eyes that is a bug in Hadoop 2.2.0 . Comment : There is a as per today open jira for this issues.apache.org jira browse HADOOP-10051 https : issues.apache.org jira browse HADOOP-10051 Comment : There is a HADOOP-11003 https : issues.apache.org jira browse HADOOP-11003 . Comment : Please accept answer given by Prasad D . He has provided readymade files to be used thus avoiding efforts . .. . Answer : If you face this problem when running a self-contained local application with Spark i.e . after adding spark-assembly-x.x.x-hadoopx.x.x.jar or the Maven dependency to the project a simpler solution would be to put winutils.exe download from here https : github.com srccodes hadoop-common-2.2.0-bin archive master.zip in C : winutil bin . Then you can add winutils.exe to the hadoop home-directory by adding the following line to the code : .. . .. . Source : Click here http : nanxiao.me en build-apache-spark-application-in-intellij-idea-14-1", "Question : Is there any update on a replacement service for IBM Analytics for Hadoop on Bluemix I understand the service was decommissioned in February and a beta for a replacement is in the works . I am a member of the IBM Academic Initiative who was planning on using this service for a course starting in May and I and my university s academic IT group are concerned that we have no news on whether an equivalent service will be available by then . Can anyone provide updates or advice Are there alternative cloud-based Hadoop services we should be considering Thanks in advance . .. . Answer : An update .. . .. . .. . We have now introduced a beta plan under BigInsights for Apache Hadoop on Bluemix which will now let you spin up IBM Open Platform clusters with open-source Apache Hadoop and Apache Spark . This is free to use in the beta period . Please refer to this blog http : www.ibmbigdatahub.com blog introducing-biginsights-apache-hadoop-basic-plan-bluemix for more information and context on this update .", "Question : I am new to distributed systems . I know that solrcloud provides distributed search capabilities . From what I know hadoop is a distributed processing framework for big data . why then do we integrate two distributed frameworks together Is it for indexing and searching files in hdfs format What are the advantages in using hadoop with solrcloud If anyone could explain in detail or give me links to better understand both it would really helpful . .. . Answer : Solr is mainly for storage and searching Hadoop is mainly for distributed processing . They solve different problems . The most common thing is to use Solr with HDFS to store load its index files https : cwiki.apache.org confluence display solr Running+Solr+on+HDFS either for using existing functionality in your HDFS cluster or for allowing a processed Hadoop result https : www.cloudera.com documentation archive search 1-3-0 Cloudera-Search-User-Guide csug mapreduceindexertool.html to be searchable through Solr . If you do a few searches on Google you ll find quite a few use cases presentations and libraries available such as LucidWorks Hadoop integrations https : lucidworks.com blog 2015 12 17 open-source-hadoop-for-solr Solr+Hadoop http : www.slideshare.net cloudera solrhadoopbigdatasearch or Hortonworks Indexing and searching data in Apache Solr http : hortonworks.com hadoop-tutorial searching-data-solr .", "Question : Why are there two separate packages map-reduce package in Apache s hadoop package tree : .. . .. . http : javasourcecode.org html open-source hadoop hadoop-1.0.3 org apache hadoop mapred .. . .. . http : javasourcecode.org html open-source hadoop hadoop-1.0.3 org apache hadoop mapreduce .. . .. . Why are they separated out Is there documentation that clarifies this Comment : some more references mapred or mapreduce 1 to help mapred api vs mapreduce 1 : stackoverflow.com questions 7598422 http : stackoverflow.com questions 7598422 is-it-better-to-use-the-mapred-or-the-mapreduce-package-to-create-a-hadoop-job 7600339 7600339 Comment : Possible duplicate stackoverflow.com questions 7598422 http : stackoverflow.com questions 7598422 is-it-better-to-use-the-mapred-or-the-mapreduce-package-to-create-a-hadoop-job .. . Answer : They are separated out because both of these packages represent 2 different APIs . org.apache.hadoop.mapred is the older API and org.apache.hadoop.mapreduce is the new one . And it was done to allow programmers write MapReduce jobs in a more convenient easier and sophisticated fashion . You might find this presentation http : www.slideshare.net sh1mmer upgrading-to-the-new-map-reduce-api useful which talks about the differences in detail . Hope this answers your question . Comment : If I have the option for something things between mapred and mapreduce but some only have the option for mapred should I use mapred everywhere", "Question : I m trying to set hadoop up on Ubuntu to develop a project . I m using Ubuntu 12 hadoop 0.18 java6 and Eclipse . Ubuntu OS is running on a virtual-machine VMware . I installed hadoop by following this guide : http : www.michael-noll.com tutorials running-hadoop-on-ubuntu-linux-single-node-cluster and everything works fine . Then I saw Hadoop provides a plugin for Eclipse . So by following this guide : http : v-lad.org Tutorials Hadoop 13.5 20- 20copy 20hadoop 20plugin.html even if it s for Windows I copied the plugin from hadoop contrib eclipse-plugin to usr share eclipse plugins . Here s the problem : when I start Eclipse as root it looks like the plugin is not loaded In fact inside Eclipse s open perspective window the voice mapReduce is not showing up as the guide states . Can anyone help me Thanks .. . Answer : As you are using hadoop 0.18 - you should go for hadoop 0.18 plugin for eclipse and not for a hadoop 0.19 . For the plugin jar you can goto this site : - http : code.google.com p hadoopcs492 source browse ben single node hadoop-0.18.0 contrib eclipse-plugin", "Question : How many seconds once the data node sends heart beat and block report to name node and task tracker sends heart beat and block report to job tracker Comment : dfs.heartbeat.interval : It determines datanode heartbeat interval in seconds . Comment : dfs.blockreport.intervalMsec is one more param .. . Answer : From Apache documentation https : hadoop.apache.org docs r2.4.1 hadoop-project-dist hadoop-hdfs hdfs-default.xml which provides HDFS properties .. . .. . dfs.heartbeat.interval with a default-value of 3 determines datanode heartbeat interval in seconds . dfs.blockreport.intervalMsec with default-value of 21600000 determines block reporting interval in milliseconds . Have a look at above article https : hadoop.apache.org docs r2.4.1 hadoop-project-dist hadoop-hdfs hdfs-default.xml to understanding various HDFS properties .", "Question : I m trying to set hadoop up on Ubuntu to develop a project . I m using Ubuntu 12 hadoop 0.18 java6 and Eclipse . Ubuntu OS is running on a virtual-machine VMware . I installed hadoop by following this guide : http : www.michael-noll.com tutorials running-hadoop-on-ubuntu-linux-single-node-cluster and everything works fine . Then I saw Hadoop provides a plugin for Eclipse . So by following this guide : http : v-lad.org Tutorials Hadoop 13.5 20- 20copy 20hadoop 20plugin.html even if it s for Windows I copied the plugin from hadoop contrib eclipse-plugin to usr share eclipse plugins . Here s the problem : when I start Eclipse as root it looks like the plugin is not loaded In fact inside Eclipse s open perspective window the voice mapReduce is not showing up as the guide states . Can anyone help me Thanks .. . Answer : Sounds like you have an eclipse-plugin which is not compatible with your eclipse . Try this SO Link http : stackoverflow.com questions 21541820 download-hadoop-source-configure-it-on-eclipse 21591847 21591847", "Question : This is kind of naive question but I am new to NoSQL paradigm and don t know much about it . So if somebody can help me clearly understand difference between the HBase and Hadoop or if give some pointers which might help me understand the difference . Till now I did some research and acc . to my understanding Hadoop provides framework to work with raw chunk of data files in HDFS and HBase is database engine above Hadoop which basically works with structured-data instead of raw data chunk . Hbase provides a logical layer over HDFS just as SQL does . Is it correct Pls feel free to correct me . Thanks . Comment : Perhaps the question title should be Difference between HBase and HDFS then Comment : Why is that so .. . Answer : Apache Hadoop https : hadoop.apache.org project includes four key modules .. . .. . 1 . Hadoop Common : The common utilities that support the other Hadoop modules . 2 . Hadoop Distributed File System HDFS : A distributed file system that provides high-throughput access to application data . 3 . Hadoop YARN : A framework for job-scheduling and cluster resource management . 4 . Hadoop MapReduce : A YARN -based system for parallel-processing of large-data sets . HBase is A scalable distributed-database that supports structured-data storage for large tables . Just as Bigtable leverages the distributed data-storage provided by the Google File System Apache HBase provides Bigtable-like capabilities on top of Hadoop and HDFS . When to use HBase : .. . .. . 1 . If your application has a variable schema where each row is slightly different .. . 2 . If you find that your data is stored in collections that is all keyed on the same value .. . 3 . If you need random real-time read-write access to your Big Data . 4 . If you need key based access to data when storing or retrieving . 5 . If you have huge amount of data with existing Hadoop cluster .. . .. . But HBase has some limitations .. . .. . 1 . It can t be used for classic transactional applications or even relational analytics . 2 . It is also not a complete substitute for HDFS when doing large batch MapReduce . 3 . It doesn t talk SQL have an optimizer support cross record transactions or joins . 4 . It can t be used with complicated access patterns such as joins .. . .. . Summary : .. . .. . Consider HBase when you re loading data by key searching data by key or range serving data by key querying data by key or when storing data by row that doesn t conform well to a schema . Have a look at Do s and Don t of HBase from cloudera https : blog.cloudera.com blog 2011 04 hbase-dos-and-donts blog . Comment : what about using hbase as datalake for very large amounts of data small files can he manage as much data as hdfs Comment : If you are producing lots of small files then depending on the access pattern a different type of storage might be more appropriate.HBase stores data in MapFiles indexed SequenceFiles and is a good choice if you need to do MapReduce style streaming analyses with the occasional random look up", "Question : I am new to hadoop . I recently read about basics of Apache Hadoop Pig Hive HBase . Then I came across term Hadoop distribution and examples were Cloudera MAPR HortonWorks . So what is relation of Apache Hadoop its echo-system with Hadoop Distribution .. . .. . Is it like Java Virtual machine specification a document and Oracle JVM IBM JVM working implementation of the document But we get zips from Apache which are actually logic implemented . So I am bit confused . Comment : Is the same relation Linux vs . Debian Ububtu RedHat Fedora SuSe . They re all Linux distributions . Comment : It s not echo-system it s ecosystem - a set of interconnected Hadoop tools and products . .. . Answer : Vendor distributions are of course designed to overcome issues with the open-source edition and provide additional value to customers with a focus on things such as : .. . .. . Reliability : The vendors react faster when bugs are detected . They promptly deliver fixes and patches which makes their solutions more stable . Support : A variety of companies provide technical assistance which makes it possible to adopt the platforms for mission-critical and enterprise-grade tasks . Completeness : Very often Hadoop distributions are supplemented with other tools to address specific tasks . Have a look at this top-hadoop-distributions http : www.networkworld.com article 2369327 software comparing-the-top-hadoop-distributions.html article and this presentation http : www.slideshare.net dougIT hadoop-benchmark-evaluating-cloudera-hortonworks-and-mapr for benchmarking analysis among top three Hadoop distributions .", "Question : Are there any dependencies between Spark and Hadoop If not are there any features I ll miss when I run Spark without Hadoop Thanks in advance . .. . Answer : No Spark is independent . By default there is no storage mechanism in Spark so to store data need fast and scalable file system . you can use S3 or HDFS or any other file system but if you use Hadoop it s very low cost . Additionally if you use Tachyon it s boost performance with Hadoop . It s highly recommended Hadoop for apache-spark http : bigdataanalyst.in apache-spark-training processing . enter image description here http : i.stack.imgur.com 36ufx.png", "Question : I have installed configured Hadoop on windows hadoop-2.7.0 .. . .. . I could successfully start sbin start-dfs run command . DataNode and NameNode started . I could create directory add file into hadoop system . But now when I try sbin start-yarn on resourcemanager window I do not see error . But it failes on yarn s namenode .. . .. . it fails with this error : - .. . .. . I had faced similar problem while sbin start-dfs . I tried different things . It looks like it was solved when I added hadoop s bin and sbin in path . Can you please suggest the solution for Yarn problem . .. . Answer : there should be a HADOOP HOME bin hadoop.dll which contains the native method https : github.com apache hadoop blob c1d50a91f7c05e4aaf4655380c8dcd11703ff158 hadoop-common-project hadoop-common src main native src org apache hadoop io nativeio NativeIO.c . HADOOP HOME bin should be in the path . If you built from source make sure the hadoop.dll was built and placed .", "Question : I am getting the following error while starting namenode for latest hadoop-2.2 release . I didn t find winutils exe file in hadoop bin folder . I tried below commands Comment : See stackoverflow.com questions 18630019 http : stackoverflow.com questions 18630019 running-apache-hadoop-2-1-0-on-windows Comment : Trying to get rid of that error message I set -Dhadoop.home.dir to a meaningful value . Now I am getting something like local path replaced by variable name : Could not locate executable HADOOP HOME bin winutils.exe in the Hadoop binaries . And guess what : Setting the variable did not make that binary appear . Also the priority ERROR is wrong as the application seems to continue . In my eyes that is a bug in Hadoop 2.2.0 . Comment : There is a as per today open jira for this issues.apache.org jira browse HADOOP-10051 https : issues.apache.org jira browse HADOOP-10051 Comment : There is a HADOOP-11003 https : issues.apache.org jira browse HADOOP-11003 . Comment : Please accept answer given by Prasad D . He has provided readymade files to be used thus avoiding efforts . .. . Answer : winutils.exe are required for hadoop to perform hadoop related commands . please download hadoop-common-2.2.0 zip file . winutils.exe can be found in bin folder . Extract the zip file and copy it in the local hadoop bin folder .", "Question : I am getting the following error while starting namenode for latest hadoop-2.2 release . I didn t find winutils exe file in hadoop bin folder . I tried below commands Comment : See stackoverflow.com questions 18630019 http : stackoverflow.com questions 18630019 running-apache-hadoop-2-1-0-on-windows Comment : Trying to get rid of that error message I set -Dhadoop.home.dir to a meaningful value . Now I am getting something like local path replaced by variable name : Could not locate executable HADOOP HOME bin winutils.exe in the Hadoop binaries . And guess what : Setting the variable did not make that binary appear . Also the priority ERROR is wrong as the application seems to continue . In my eyes that is a bug in Hadoop 2.2.0 . Comment : There is a as per today open jira for this issues.apache.org jira browse HADOOP-10051 https : issues.apache.org jira browse HADOOP-10051 Comment : There is a HADOOP-11003 https : issues.apache.org jira browse HADOOP-11003 . Comment : Please accept answer given by Prasad D . He has provided readymade files to be used thus avoiding efforts . .. . Answer : Simple Solution : Download it from here https : github.com srccodes hadoop-common-2.2.0-bin archive master.zip and add to HADOOP HOME bin .. . .. . Source : Click here http : www.srccodes.com p article 39 error-util-shell-failed-locate-winutils-binary-hadoop-binary-path .. . .. . EDIT : .. . .. . For hadoop-2.6.0 you can download binaries from Titus Barik blog http : www.barik.net archive 2015 01 19 172716 . I have not only needed to point HADOOP HOME to extracted directory path but also provide system property -Djava.library.path path bin to load native libs dll . Comment : This helps to start the hdfs but when I try to put a text file into hdfs it gives error Exception in thread main java.lang.UnsatisfiedLinkError : org.apache.hadoop.util.NativeCrc32.nativeComputeChunkedSumsBy teArray II BI BIILjava lang String JZ V", "Question : Reading the syslog generated by Hadoop I can see lines similar to this one. . Does anyone know how this value is computed And how can I get this value in my program Comment : Which Hadoop version are you using Do you use Amazon Elastic MapReduce on AWS Comment : Yes I m using Amazon Elastic MapReduce on AWS . Hadoop version 1.0.4 .. . Answer : I grepped the source code of Hadoop and did not find the string Setting default number of map tasks based on cluster size to at all whereas I find other strings which are being printed when running MR jobs . Furthermore this string is not being printed anywhere in my local installation . A google-search for it listed problems on AWS with EMR . As you confirmed your re in fact using Amazon Elastic MapReduce . I believe EMR has some own modifications to the JobClient https : github.com apache hadoop-common blob trunk hadoop-mapreduce-project hadoop-mapreduce-client hadoop-mapreduce-client-core src main java org apache hadoop mapred JobClient.java class of Hadoop which outputs this particular line . As far as computing this number is concerned I would suspect it to be computed based on characteristics like total number of active nodes in cluster N and number of map slots per node M i.e . N M . However additional AWS-specific resource memory constraints may also be taken into account . You d have to ask in EMR-related forums for the exact formula . Additionaly the JobClient exposes a set of information about the cluster . Using the method JobClient getClusterStatus http : hadoop.apache.org docs stable api org apache hadoop mapred JobClient.html getClusterStatus 28 29 you can access information like : .. . .. . Size of the cluster . Name of the trackers . Number of blacklisted active trackers . Task capacity of the cluster . The number of currently running map reduce tasks . via the ClusterStatus http : hadoop.apache.org docs stable api org apache hadoop mapred ClusterStatus.html class object so you can try and compute the desired number in your program manually . Comment : This seems to be useful but JobClient belong to the old package org.apache.hadoop.mapred and I m trying to figure out how to obtain a JobClient from a org.apache.hadoop.mapreduce.Job object . I found also the org.apache.hadoop.mapred.JobTracker class which has the method getClusterMetrics . It returns the information I need. . but again didn t find a way to obtain an instance of this object . Comment : I think you re stuck with using JobClient here . Alternatively you could try access the JobTracker via JMX . However I m not sure whether it will provide all needed metrics . Retrieving gets much easier in hadoop 2.0 . Take a look at the example https : github.com apache hadoop-common blob trunk hadoop-mapreduce-project hadoop-mapreduce-examples src main java org apache hadoop examples pi DistSum.java shipped with hadoop s source code lines 391 405 . It uses Cluster getClusterStatus to obtain a ClusterMetrics instance . Cluster instances are constructed via URLs like JobClient .", "Question : From the Apache doc on the Hadoop MapReduce InputFormat https : hadoop.apache.org docs current api org apache hadoop mapred InputFormat.html Interface : .. . .. . L ogical splits based on input-size is insufficient for many applications since record boundaries are to be respected . In such cases the application has to also implement a RecordReader https : hadoop.apache.org docs current api org apache hadoop mapred RecordReader.html on whom lies the responsibilty to respect record-boundaries and present a record-oriented view of the logical InputSplit https : hadoop.apache.org docs current api org apache hadoop mapred InputSplit.html to the individual task . Is the WordCount https : hadoop.apache.org docs stable hadoop-mapreduce-client hadoop-mapreduce-client-core MapReduceTutorial.html Example : WordCount v1.0 example application one in which logical splits based on input size are insufficient If so where-in the source code is the implementation of a RecordReader found .. . Answer : Input splits are logical references to data . If you look at the API https : hadoop.apache.org docs current api org apache hadoop mapred InputSplit.html you can see that it doesn t know anything about the record boundaries . A mapper is launched for every input split . A mapper s map is run for every record In a WordCount program every line in a file . But how does a mapper know where the record boundaries are This is where your quote from Hadoop MapReduce InputFormat https : hadoop.apache.org docs current api org apache hadoop mapred InputFormat.html Interface comes in - .. . .. . the application has to also implement a RecordReader on whom lies the responsibilty to respect record-boundaries and present a record-oriented view of the logical InputSplit to the individual task .. . .. . Every mapper is associated with an InputFormat . That InputFormat has information on which RecordReader to use . Look at the API https : hadoop.apache.org docs current api org apache hadoop mapred InputFormat.html you will find that it knows about the input splits and what record reader to use . If you want to know some more about input splits and Record reader you should read this http : stackoverflow.com a 14540272 1101823 answer . A RecordReader defines what the record boundaries are The InputFormat defines what RecordReader is used . The WordCount program does not specify any InputFormat it therefore defaults to TextInputFormat which uses LineRecordReader https : github.com apache hadoop blob trunk hadoop-mapreduce-project hadoop-mapreduce-client hadoop-mapreduce-client-core src main java org apache hadoop mapreduce lib input LineRecordReader.java and gives out every line as a different record . And this https : github.com apache hadoop blob trunk hadoop-mapreduce-project hadoop-mapreduce-client hadoop-mapreduce-client-core src main java org apache hadoop mapreduce lib input LineRecordReader.java your source code .. . .. . .. . .. . L ogical splits based on input-size is insufficient for many applications since record boundaries are to be respected . What this means is that for an example file such as .. . .. . and we want every line to be a record . when the logical splits are based on input size it is possible there may be two splits such as : .. . .. . and .. . .. . If it wasn t for the RecordReader it would ve considered f g and h i j to be different records Clearly this isn t what most applications want . Answering your question in the WordCount program it does not really matter what the record boundaries are but there is a possibility that the same word is split into different logical splits . Therefore logical splits based on size are not sufficient for WordCount program . Every MapReduce program respects record boundaries . Otherwise it is of not much use .", "Question : I m trying to build a simple WordCount jar project which utilizes Hadoop-lzo library but cannot seem to get the following command to work even though the class I m referencing is within hadoop classpath : .. . .. . Any ideas Comment : I don t think that LzoTextInputFormat is part of the hadoop distro which version are you using It appears to be part of a google-code project named hadoop-gpl-compression - code.google.com a apache-extras.org p hadoop-gpl-compression https : code.google.com a apache-extras.org p hadoop-gpl-compression Comment : I am using Hadoop 2.0.0-cdh4.3.0 . How would I include the correct .java or .class for my code to build Comment : LzotextInputFormat isn t listed in the Javadocs for CDH4u4 : archive.cloudera.com cdh4 cdh 4 hadoop api http : archive.cloudera.com cdh4 cdh 4 hadoop api - Where did you acquire the class from Comment : I followed : cloudera.com content cloudera-content cloudera-docs CM4Ent http : www.cloudera.com content cloudera-content cloudera-docs CM4Ent latest Cloudera-Manager-Installation-Guide cmig install LZO Compression.html - and added the Parcel .. . Answer : I assume you have correctly installed your LZO libraries you should have libgplcompression.so in your lib natives Linux - and the jar file in your lib folder .. . .. . Since you have them the correct class should be LzoDeprecatedTextInputFormat.class or LzoTextInputFormat.class depending on wich API you use According to your post you are using it right Job with LzoTextInputFormat . So your problem could be in your java.library.path wich should include path to your jar file . You can set it up in your .bash-profile or in you bin hadoop file . hope that helps . Comment : I have tried directly adding the LzoTextInputFormat.class file into my project lib folder as well as actually including the LzoTextInputFormat.java source in my src folder but neither works . Comment : Sorry if I failed explaining myself but I meant include your .jar file something like hadoop-lzo- .jar in your java.library.path . Because if you open this jar with vim you will see all the classes you need in it . I think there is also a way using the -Djava.library.path path to your lzo jar in your programm command-line . Hope that better helps .", "Question : I m trying to import data into my Analytics for Apache Hadoop instance using Hadoop shell commands . The Analytics for Apache Hadoop bluemix documentation provides a link-to BigInsight documentation in the related links section . The link is : http : www.ibm.com support knowledgecenter SSPT3X 4.0.0 com.ibm.swg.im.infosphere.biginsights.welcome.doc doc welcome.html .. . .. . I navigated to the following page : http : www-01.ibm.com support knowledgecenter SSPT3X 4.0.0 com.ibm.swg.im.infosphere.biginsights.import.doc doc data rest shell.html where instructions are given for using the hadoop fs command-line . I tried the following command replacing the hostname with my instance name : .. . .. . However the command timed out . -- .. . .. . Question : Can I use the hadoop fs command as described in the BigInsights documentation with Analytics for Apache Hadoop .. . Answer : It isn t possible to use the Hadoop shell commands . The next best thing is to use the REST API webHDFS . The REST api is documented here : https : www.ng.bluemix.net docs services AnalyticsforHadoop index.html analyticsforhadoop data" ] }
[ "yes-answer-long" ]
distributed-computing
UNK_RELATION
checker-framework@java@131
checker-framework -- the checker-framework is a library that enhances java s type system in order to detect and prevent errors in @placeholder programs .
{ "confidence": [ 63.81111145019531, 59.02369689941406, 58.091644287109375, 57.71692657470703, 56.40962600708008, 55.44942855834961, 55.14097595214844, 55.02549743652344, 54.4503059387207, 54.4503059387207, 53.88759994506836, 53.473236083984375, 53.20149612426758, 53.01435089111328, 52.95737838745117, 52.018924713134766, 51.89018630981445, 51.16806411743164, 50.72340393066406, 49.89970779418945, 49.89970779418945, 49.89970779418945, 48.40678024291992, 48.40678024291992, 48.135074615478516, 48.032318115234375, 47.926979064941406, 47.57899475097656, 47.275447845458984, 47.10478591918945, 46.63773727416992, 46.23361587524414, 45.88467788696289, 44.75007629394531, 44.51852035522461, 44.39175033569336, 44.39175033569336, 44.39175033569336, 44.39175033569336, 44.2618522644043, 43.7608757019043, 43.7608757019043, 43.73046112060547, 43.17848205566406, 43.17848205566406, 42.86663055419922, 42.65113067626953, 42.60243606567383, 42.60243606567383, 42.5213508605957, 41.9411506652832, 41.5094108581543, 41.19466018676758, 40.840789794921875, 40.478633880615234, 40.47645568847656, 40.47645568847656, 40.34341049194336, 39.0609016418457, 38.98352813720703, 38.531455993652344, 38.531455993652344, 38.01980972290039, 37.618953704833984, 37.36946487426758, 37.1942138671875, 37.1942138671875, 37.1942138671875, 37.1942138671875, 37.1942138671875, 37.17809295654297, 37.17809295654297, 37.166507720947266, 37.166507720947266, 37.166507720947266, 35.960418701171875, 35.673580169677734, 35.43411636352539, 35.17178726196289, 35.17178726196289, 33.45924377441406, 33.45924377441406, 30.874332427978516, 30.740707397460938, 30.04216957092285, 30.04216957092285, 29.969009399414062, 29.434673309326172, 29.434280395507812, 29.247779846191406, 29.247779846191406, 29.247779846191406, 28.6846923828125, 28.6846923828125, 26.590213775634766, 25.359519958496094, 25.359519958496094, 25.359519958496094, 25.18836784362793, 25.069168090820312 ], "content": [ "I m trying out the Checker Framework http : types.cs.washington.edu checker-framework s Nullness checker with Java 8 .", "See types.cs.washington.edu checker-framework eclipse http : types.cs.washington.edu checker-framework eclipse", "However there is a FAQ http : types.cs.washington.edu checker-framework current checker-framework-manual.html faq-array-syntax-meaning about this in the Checker Framework manual http : types.cs.washington.edu checker-framework current checker-framework-manual.html .", "I m trying to use the Checker Framework http : types.cs.washington.edu checker-framework current checker-framework-manual.html gradle with Gradle .", "To understand the issue consider the type hierarchy of the initialization type system http : types.cs.washington.edu checker-framework current checker-framework-manual.html initialization-qualifiers .", "The Checker Framework manual http : types.cs.washington.edu checker-framework current checker-framework-manual.html contains a chapter titled Suppressing warnings http : types.cs.washington.edu checker-framework current checker-framework-manual.html suppressing-warnings which might contain all the information you need .", "This is a standard part of the Java type-annotation syntax and is not specific to the Checker Framework .", "The Checker Framework s Nullness Checker http : types.cs.washington.edu checker-framework current checker-framework-manual.html nullness-checker generates an error when it encounters an uninitialised field .", "Other tips for reporting bugs appear at types.cs.washington.edu checker-framework current http : types.cs.washington.edu checker-framework current checker-framework-manual.html reporting-bugs .", "Using the Checker Framework https : types.cs.washington.edu checker-framework current checker-framework-manual.html methods used by the constructor can take @UnderInitialization annotated parameters .", "I d like to use the Checker Framework using their Eclipse Plugin http : types.cs.washington.edu checker-framework checker-plugin update-site .", "That said dataflow is not a substitute for a type-state system see a discussion of this at Typestate checkers http : types.cs.washington.edu checker-framework current checker-framework-manual.html typestate-checker .", "In particular the type annotations shipped with the Checker Framework reference ElementType.TYPE USE http : types.cs.washington.edu checker-framework jdk-api jdk java lang annotation ElementType.html TYPE USE .", "The Checker Framework issues warnings and errors that are identical to those of javac because the Checker Framework is a plug-in to javac .", "With each release an Annotated JDK http : types.cs.washington.edu checker-framework current checker-framework-manual.html skeleton-using is bundled with the Checker Framework .", "The official docs http : types.cs.washington.edu checker-framework current checker-framework-manual.html gradle suggest setting options.forkOptions.executable CHECKERFRAMEWORK checker bin javac .", "You can use the Checker Framework but still compile and run your code in a Java 7 JVM by following the instructions in section Class-file compatibility with Java 7 http : types.cs.washington.edu checker-framework current checker-framework-manual.html java7-classfiles of the Checker Framework manual .", "After that I integrated Checker framework to module B as mentioned here https : types.cs.washington.edu checker-framework current checker-framework-manual.html maven .", "When I look at file checker-framework checker jdk nullness src java util Optional.java I see the following annotated method : .. . .. . Furthermore when I run the Checker Framework on the following code it issues no warning .", "Checker Framework doesn t know what map.put does .", "Unfortunately the Checker Framework does not currently have this functionality .", "I gave up on the checker-framework for similar reasons .", "How do I tell the Checker Framework as much", "It is used automatically when you use the Checker Framework .", "You do not need to install the checker-framework separately it comes with the eclipse-plugin .", "Not an expert just interested but there seems to be several routes available http : types.cs.washington.edu checker-framework current checker-framework-manual.html suppressing-warnings-nullness .", "But recently I integrated Checker Framework http : types.cs.washington.edu checker-framework for type annotations and then all the custom annotation processors I mentioned above stopped working .", "@Initialized http : types.cs.washington.edu checker-framework current api org checkerframework checker initialization qual Initialized.html and @UnderInitialization http : types.cs.washington.edu checker-framework current api org checkerframework checker initialization qual UnderInitialization.html are siblings in the type hierarchy .", "You can either disable all the Unhandled Token in @SuppressWarnings warnings in Eclipse or you can write @SuppressWarnings annotations related to the Checker Framework in comments http : types.cs.washington.edu checker-framework current checker-framework-manual.html annotations-in-comments .", "Manual section 21.4.3 Side effects determinism purity and flow-sensitive analysis http : types.cs.washington.edu checker-framework current checker-framework-manual.html type-refinement-purity discusses how the Checker Framework indicates purity or freedom from side effects .", "That is are you using the SubtypingChecker http : types.cs.washington.edu checker-framework current checker-framework-manual.html subtyping-checker or are have you created your own subtype of BaseTypeChecker", "It s not a current limitation of the framework because the feature you propose already exists and is called stub classes http : types.cs.washington.edu checker-framework current checker-framework-manual.html stub .", "I suggest that you propose this feature to the Checker Framework developers .", "You could always submit a bug report https : github.com typetools checker-framework issues the Checker Framework developers are friendly too .", "In checker-framework it is allowing us to annotate in the code as below .", "This issue has been fixed and should work with the latest Checker Framework release .", "This annotation has been included since of Checker Framework release 1.8.0 .", "http : types.cs.washington.edu checker-framework current checkers-manual.html suppressing-warnings-nullness", "My goal is to express this trust in a way the Checker Framework understands .", "We have a library we ve written and after introducing the Checker Framework NullnessChecker to verify its code it fails to compile as expected .", "Just not cool . .. . .. . The solution is to provide stub classes http : types.cs.washington.edu checker-framework current checker-framework-manual.html annotating-libraries and pass them as an argument to the javac process .", "Regarding annotating legacy code my initial comment already directed you to the manual s discussion of stub classes http : types.cs.washington.edu checker-framework current checker-framework-manual.html stub .", "Is there a way to tell the Checker Framework that a field is injected and therefore properly initialised and non-null without simply suppressing these errors", "The Checkers Framework http : types.cs.washington.edu checker-framework references java.lang.annotation.ElementType.TYPE USE which was added in JDK8 .", "More generally in these cases the application framework guarantees that fields are initialised and non-null when they are used but the Checker Framework can t know this .", "As Gili answered you can use stub-files http : types.cs.washington.edu checker-framework current checkers-manual.html stub but if you find a missing incorrect annotation in the JDK please report it to the Checker Framework mailing list [email protected] http : mailTo : [email protected] or report it as an issue in the issue tracker https : code.google.com p checker-framework issues list .", "Create an @PolyMyAnnotation polymorphic annotation see Polymorphic Qualifiers http : types.cs.washington.edu checker-framework current checker-framework-manual.html qualifier-polymorphism .. . 2 .", "Eclipse currently offers a more limited set of annotations than the Checker Framework .", "It s a bummer that the Checker Framework didn t work out for you .", "See RegexTreeAnnotator.visitLiteral https : code.google.com p checker-framework source browse checker src org checkerframework checker regex RegexAnnotatedTypeFactory.java 268 for an example .", "Therefore whatever mechanism you already use to make Jenkins report compiler-warnings and errors will work for the Checker Framework .", "In the future the best way to get help for the Checker Framework would be to either post in the checker-framework discussion group checker-framework-discuss https : groups.google.com forum fromgroups forum checker-framework-discuss or if you think we have a bug or an obviously missing feature please create an issue in our google-code issue tracker .", "I want to annotate a fully qualified class name with @Nullable -annotation from the Java Checker Framework e.g .", "I m using the checker-framework and type annotations to check for correct use of @Nullable and @NonNull .", "For the record I am using maven and the checkersplugin http : types.cs.washington.edu checker-framework current checkers-manual.html maven-plugin with the failOnError configuration set to false and the Checker Framework warnings are displayed in the console output in Jenkins .", "Is there any way to tell the Checker Framework that a method does not modify any object other than the object it s called on", "You want to know how to make the Checker Framework never issue the warning in the first place .", "I m playing with the Checker Framework and its annotation processor requires the path to the annotated JDK jar to be passed to it so that it can add type annotations to the JDK classes .", "Annotation Identifier TypeArguments .. . .. . Thus you need the declaration : .. . .. . Or in the augmented java-7 compiler of the checker-framework : .. . .. . NOTE : normal Java compilers ignore @Nullable .", "In my case this issue was caused by https : code.google.com p checker-framework issues detail id 255", "See RegexAnnotatedTypeFactory https : code.google.com p checker-framework source browse checker src org checkerframework checker regex RegexAnnotatedTypeFactory.java 137 .. . .. . Option B : Use A TreeAnnotator Steps : .. . .. . 1 .", "You can look at RegexTransfer https : code.google.com p checker-framework source browse checker src org checkerframework checker regex RegexTransfer.java for an example or search for methods that extend CFAbstractTransfer or implement TransferFunction .", "An issue http : code.google.com p checker-framework issues detail id 177 was filed that described the disability to turn of compiler errors using the -Awarns flag .", "When I run the checker on the following code : .. . .. . the checker gives a warning on the x.f : dereference of possible null-reference x .", "My environment : .. . .. . Maven : 3.0.4 .. . Java : 1.7.0 25 Oracle .. . Checker framework 1.7.0 via maven-plugin .. . .. . This Gist https : gist.github.com kaspervandenberg 9132925 demonstrates the problem .", "I m looking for something like @EnsuresNonNull bar in the otherwise completely unusable Checker Framework .", "Your experience is not typical : Google runs the Checker Framework on hundreds of projects every day and there are plenty of other success stories .", "How can I configure so that warnings that are issued by the Checker Framework are picked up and reported in Jenkins e.g .", "Any idea on how to get them to work even with Checker Framework is greatly appreciated", "Then checker-framework related validations are executed at compile-time as expected but the FoodItemAnnotationProcessor ceased to work .", "Do you mind taking a moment and adding any relevant details about your project setup to the following issue : checker-framework-185 http : code.google.com p checker-framework issues detail id 185 .. . .. . Specifically are you using m2eclipse", "Answering my own question : .. . .. . In section Annotating Libraries http : types.cs.washington.edu checker-framework current checkers-manual.html annotating-libraries the authors write you can either provide stub-files http : types.cs.washington.edu checker-framework current checkers-manual.html stub or rewrite the class files in question .", "Your key question is : .. . .. . Is there any way to tell the Checker Framework that a method does not modify any object other than the object it s called on", "Your suggestion of partial purity annotations would be useful : it would make the Checker Framework more expressive and would reduce the need to suppress-warnings as is currently required .", "Consider this : .. . .. . This fails because checker-framework assumes ofNullable cannot accept null values after all its parameter is not marked as @Nullable .", "When I compile my code with The Checker Framwork http : types.cs.washington.edu checker-framework it complains : .. . .. . for the first argument of : .. . .. . I know that DatabaseMetadata.getColumns http : docs.oracle.com javase 7 docs api java sql DatabaseMetaData.html getColumns 28java.lang.String 20java.lang.String 20java.lang.String 20java.lang.String 29 allows a null catalog the first argument .", "Anything you do to tell the Checker Framework that the field is properly initialized will be suppressing the error so there isn t really a distinction between the two .", "It would also help for you to determine whether the checker works from the command-line or not -- that will indicate whether the problem is with the checker itself or with the Maven integration .", "That s how I use it : .. . .. . Explanation : putting checker-framework into a separate configuration allows to obtain all jars in classpath format in a natural Gradle way using configurations.checker.asPath .. . .. . compile configurations.checker.dependencies allows to reuse checker jars in compile classpath without duplicate lines .", "If your method works for both values that are initialized and for values that are under initialization then you could annotate its parameter as @UnknownInitialization http : types.cs.washington.edu checker-framework current api org checkerframework checker initialization qual UnknownInitialization.html which is a supertype of both @Initialized and @UnderInitialization .", "Is there a good way to tell checker-framework that this method or other methods in legacy code that I cannot change accepts @Nullable types everywhere without having to change code everywhere", "Furthermore your answer does not address my more general question : Is there a good way to tell checker-framework that this method or other methods in legacy code that I cannot change .. . .", "The class uses a bunch of unnanotated third-party Google Guava and JDK library methods so I include the option -AskipUses .. . along with the -AuseSafeDefaultsForUnnanotatedSourceCode in the Maven compiler plugin arguments as follows : .. . .. . The source code of the class : .. . .. . When I build the project the Checker seems to be ignoring the skip options as I m ended up with errors like .. . .. . leading us to the line 38 : .. . .. . or 39 : .. . .. . or 38 again : .. . .. . and so on -- the log is overflowed with various checker errors though I thought I got rid of them by using the -AskipUses option .", "Using javac would require to extract dependency to some directory first or to have checker installed already .", "This seems to be a current limitation of the framework .", "Great work with this framework by the way", "EDIT : this answer was based on @mernst help in the comments and in the Checker Framework s Issue tracker https : code.google.com p checker-framework issues detail can 2 start 0 num 100 q colspec ID 20Type 20Status 20Priority 20Milestone 20Owner 20Summary groupby sort id 12 .. . .. . If you like me do not want or cannot use the annotated JDK you will run into this issue .", "There is no executable javac in the jar for dependency jdk8 : 1.9.6 The checker documentation you linked to probably expects you to download the checkerframework onto your file system and set the path to javac in your build.gradle .", "The official docs are expecting an environment variable to point to the annotated JDK : .. . .. . However it is possible http : stackoverflow.com a 33270054 618906 to manage the dependency on Checker Framework through Gradle : .. . .. . How can I best get the path to javac in Gradle from the dependency on org.checkerframework : jdk8", "Annotations for null specifications http : i.stack.imgur.com UYAxQ.png .. . .. . My project s includes the checker-1.8.10 JAR to provide the annotations .", "I ve also tried the jsr305 JAR from google instead of checker in case that was an issue but that didn t help .", "or Can I make the Nullness Checker recognize @PersistanceContext as that per-field warning suppression without writing @SuppressWarnings explicitly", "Here s the offending function s signature : .. . .. . And the call site where the error occurs : .. . .. . Can anyone tell me how to get checker to accept this", "The SO answer you linked to is using -Xbootclasspath as shown in the maven example just above the gradle section of the checker documentation you linked to .", "Is it possible for an application to persist a null value into the persistence framework", "The long answer is if you have a custom checker then there are a number of ways you can do this .", "Keep in mind however that writing a custom checker is a fair bit more complicated then using meta-annotations .", "But if you have a custom checker you can do one of the following : .. . .. . Option A : Polymorphic Constructors Steps : .. . .. . 1 .", "Option C : Customize dataflow s CFAbstractTransfer Function However if you have a custom checker you can override CFAbstractTransfer.visitMethodInvocation to detect when setValue is called and refine it accordingly .", "I m not familiar with that framework does it respect @SuppressWarnings in the context you re interested in" ] }
{ "confidence": [ 64.04280090332031, 60.572540283203125, 60.25267028808594, 59.39788818359375, 57.248748779296875, 57.0091552734375, 56.18037414550781, 56.08625030517578, 55.97504425048828, 55.78582763671875, 55.58301544189453, 55.094459533691406, 54.47145080566406, 54.2059326171875, 53.534263610839844, 53.33647918701172, 52.662017822265625, 52.43403625488281, 49.81138610839844, 49.254791259765625 ], "content": [ "Question : We have a library we ve written and after introducing the Checker Framework NullnessChecker to verify its code it fails to compile as expected . I ve fixed all the obvious errors but this one I cannot find out how to fix.. . Here s the offending function s signature : .. . .. . And the call site where the error occurs : .. . .. . Can anyone tell me how to get checker to accept this It seems to me to be correct code . EDIT .. . .. . The error : .. . Answer : The error message .. . .. . would have been clearer if it had just been .. . .. . The issue is that char is a primitive type . It doesn t make sense to speak of @Nullable char or @NonNull char . Nullness is applicable only to object non-primitive types . The same is true of initialization . If you want to specify a nullable array of char -- that is the variable replacement is either null or is an array of char -- then write it this way : .. . .. . If you write .. . .. . then that is an array of @Nullable char . This is a standard part of the Java type-annotation syntax and is not specific to the Checker Framework . However there is a FAQ http : types.cs.washington.edu checker-framework current checker-framework-manual.html faq-array-syntax-meaning about this in the Checker Framework manual http : types.cs.washington.edu checker-framework current checker-framework-manual.html . Comment : Excellent explanation thank you .", "Question : Using the Checker Framework https : types.cs.washington.edu checker-framework current checker-framework-manual.html methods used by the constructor can take @UnderInitialization annotated parameters . Calling such a method from a non-constructor and passing it an @Initialized parameter results in the following error : .. . .. . I m not sure that this is a problem since passing an @Initialized value shouldn t have ill side effects . What is the proper way to address this error .. . Answer : The type-checking warning looks right to me . To understand the issue consider the type hierarchy of the initialization type system http : types.cs.washington.edu checker-framework current checker-framework-manual.html initialization-qualifiers . @Initialized http : types.cs.washington.edu checker-framework current api org checkerframework checker initialization qual Initialized.html and @UnderInitialization http : types.cs.washington.edu checker-framework current api org checkerframework checker initialization qual UnderInitialization.html are siblings in the type hierarchy . It is no more legal to supply @Initialized when @UnderInitialization is required than it is to supply a List when a Date is required . If your method works for both values that are initialized and for values that are under initialization then you could annotate its parameter as @UnknownInitialization http : types.cs.washington.edu checker-framework current api org checkerframework checker initialization qual UnknownInitialization.html which is a supertype of both @Initialized and @UnderInitialization .", "Question : The Checkers Framework http : types.cs.washington.edu checker-framework references java.lang.annotation.ElementType.TYPE USE which was added in JDK8 . When I use it under JDK7 I get the following warning : .. . .. . unknown enum constant java.lang.annotation.ElementType.TYPE USE .. . .. . This is a reasonable warning but how do I suppress it for cases I believe are harmless .. . Answer : If you get this compile-time error : .. . .. . then you are compiling using a Java 7 JDK but your code references an enum constant that is only defined in the Java 8 JDK . The problem might be that your code uses a library that references the enum constant . In particular the type annotations shipped with the Checker Framework reference ElementType.TYPE USE http : types.cs.washington.edu checker-framework jdk-api jdk java lang annotation ElementType.html TYPE USE . You can use the Checker Framework but still compile and run your code in a Java 7 JVM by following the instructions in section Class-file compatibility with Java 7 http : types.cs.washington.edu checker-framework current checker-framework-manual.html java7-classfiles of the Checker Framework manual .", "Question : I m trying out the Checker Framework http : types.cs.washington.edu checker-framework s Nullness checker with Java 8 . When I run the checker on the following code : .. . .. . the checker gives a warning on the x.f : dereference of possible null-reference x . This makes sense of course . Checker Framework doesn t know what map.put does . The map object might already have a reference to this and then call setX null on it . Now my question is the following . Is there any way to tell the Checker Framework that a method does not modify any object other than the object it s called on Because map.put doesn t call the setX method so the value of x will not change . To get rid of the warning I could change the call method to : .. . .. . Now there are no warnings . This also makes sense : the local variable cannot be accessed from the outside . But I do not like to introduce this local variable with the sole purpose of getting rid of a warning . Alternatively I could annotate the field x by @MonotonicNonNull . But in my actual use-case I would like to keep the possibility of setting the field to null . Thanks in advance Comment : Not an expert just interested but there seems to be several routes available http : types.cs.washington.edu checker-framework current checker-framework-manual.html suppressing-warnings-nullness . I would probably go with an assert x null after the map.put but that is your choice . .. . Answer : Your question already gives several excellent ways to suppress the warning so you clearly know what you are doing . However you want a better way . You want to know how to make the Checker Framework never issue the warning in the first place . Your key question is : .. . .. . Is there any way to tell the Checker Framework that a method does not modify any object other than the object it s called on Unfortunately the Checker Framework does not currently have this functionality . Manual section 21.4.3 Side effects determinism purity and flow-sensitive analysis http : types.cs.washington.edu checker-framework current checker-framework-manual.html type-refinement-purity discusses how the Checker Framework indicates purity or freedom from side effects . The @SideEffectFree and @Pure annotations are currently all-or-nothing . Your suggestion of partial purity annotations would be useful : it would make the Checker Framework more expressive and would reduce the need to suppress-warnings as is currently required . On the other hand it would also be one more thing for users to learn there is always an expressiveness-complexity tradeoff . I suggest that you propose this feature to the Checker Framework developers .", "Question : How can I configure so that warnings that are issued by the Checker Framework are picked up and reported in Jenkins e.g . by using the Analysis Collector Plugin https : wiki.jenkins-ci.org display JENKINS Analysis+Collector+Plugin For the record I am using maven and the checkersplugin http : types.cs.washington.edu checker-framework current checkers-manual.html maven-plugin with the failOnError configuration set to false and the Checker Framework warnings are displayed in the console output in Jenkins . .. . Answer : You are not required to use a special Jenkins plugin such as Analysis Collector . The Checker Framework issues warnings and errors that are identical to those of javac because the Checker Framework is a plug-in to javac . Therefore whatever mechanism you already use to make Jenkins report compiler-warnings and errors will work for the Checker Framework . As a tip if you are using the -Awarns command-line argument to treat pluggable type-checking errors as warnings then you will also want to configure the Jenkins task as follows : Set post-build actions to scan for compiler-warnings with parser Java compiler . Comment : Kind of works however I see warning : incompatible types in assignment in the Java Warnings in Jenkins whereas the console also shows could not parse-error message : found : @ReadOnly Class T extends @ReadOnly Object required : @Mutable Class T extends @Mutable Object I also tried to set javacParams -Awarns -Xmaxwarns 10000 javacParams and removed failOnError false failOnError but that caused the compiler to output errors instead of warnings Comment : An issue http : code.google.com p checker-framework issues detail id 177 was filed that described the disability to turn of compiler errors using the -Awarns flag .", "Question : I have two constructors : normal ctor which initialises the object properly and a second default ctor for Hibernate which generates initialize fields warnings . What s the preferred way to get rid of the warnings .. . Answer : You didn t mention looking in the documentation so I m not sure whether you have done so . The Checker Framework manual http : types.cs.washington.edu checker-framework current checker-framework-manual.html contains a chapter titled Suppressing warnings http : types.cs.washington.edu checker-framework current checker-framework-manual.html suppressing-warnings which might contain all the information you need . The most common approach is to write a @SuppressingWarnings annotation http : docs.oracle.com javase 8 docs api java lang SuppressWarnings.html which is the standard way to suppress-warnings from the Java compiler . You should write it on the smallest program element possible such as a local variable-declaration rather than the whole constructor or class and you should supply the most specific key possible . The reason is to avoid accidentally suppressing more warnings than you intended . Comment : I did go though the documentation and found the Suppressing warnings section . I couldn t get it to work but have just worked out that it s not a @SuppressWarnings notnull but a @SuppressWarnings initialize to get rid of the warnings . Comment : Glad you figured it out . It can be helpful to post the actual code and error message when you ask a question that would have indicated the issue . The @SuppressWarnings key is given at the beginning of the error message . Comment : That leaves a problem that you have to disable checking for unhandled token in SupressWarnings which I normally have set to Warning in Eclipse which is a shame but not the end of the world . I was wondering if I could do anything with the initialization qualifiers which I haven t figure out yet . Thanks BTW Much appreciated Comment : You can either disable all the Unhandled Token in @SuppressWarnings warnings in Eclipse or you can write @SuppressWarnings annotations related to the Checker Framework in comments http : types.cs.washington.edu checker-framework current checker-framework-manual.html annotations-in-comments .", "Question : When I compile my code with The Checker Framwork http : types.cs.washington.edu checker-framework it complains : .. . .. . for the first argument of : .. . .. . I know that DatabaseMetadata.getColumns http : docs.oracle.com javase 7 docs api java sql DatabaseMetaData.html getColumns 28java.lang.String 20java.lang.String 20java.lang.String 20java.lang.String 29 allows a null catalog the first argument . How do I tell the Checker Framework as much .. . Answer : As Gili answered you can use stub-files http : types.cs.washington.edu checker-framework current checkers-manual.html stub but if you find a missing incorrect annotation in the JDK please report it to the Checker Framework mailing list [email protected] http : mailTo : [email protected] or report it as an issue in the issue tracker https : code.google.com p checker-framework issues list . With each release an Annotated JDK http : types.cs.washington.edu checker-framework current checker-framework-manual.html skeleton-using is bundled with the Checker Framework . It is used solely to retrieve annotations for common methods in the JDK . It is used automatically when you use the Checker Framework . This annotation has been included since of Checker Framework release 1.8.0 .", "Question : null .. . Answer : I ve started to annotate my program writing the nullness annotations . Following the guidelines I ve annotated one of my classes and marked it as @AnnotatedFor nullness . The program is being compiled under the Java 7 platform using Oracle JDK 1.7.u21 can not switch to JDK 8 due to some technical limitations . The class uses a bunch of unnanotated third-party Google Guava and JDK library methods so I include the option -AskipUses .. . along with the -AuseSafeDefaultsForUnnanotatedSourceCode in the Maven compiler plugin arguments as follows : .. . .. . The source code of the class : .. . .. . When I build the project the Checker seems to be ignoring the skip options as I m ended up with errors like .. . .. . leading us to the line 38 : .. . .. . or 39 : .. . .. . or 38 again : .. . .. . and so on -- the log is overflowed with various checker errors though I thought I got rid of them by using the -AskipUses option . Am I doing something wrong UPD 07.12.2015 : attached the full source code of the class . UPD 14.12.2015 : updated the source code so it s much easier to reproduce the case now . Comment : Can you give a complete reproducible test case Your source code snippet isn t compilable and it doesn t contain 55 lines though your error messages refer to line 55 . This makes it hard to get to the root of the problem . It would also help for you to determine whether the checker works from the command-line or not -- that will indicate whether the problem is with the checker itself or with the Maven integration . Other tips for reporting bugs appear at types.cs.washington.edu checker-framework current http : types.cs.washington.edu checker-framework current checker-framework-manual.html reporting-bugs . Then hopefully someone can help you . Comment : @mernst I have not included the full source code for the sake of brevity as I ve also described what s on the line 55 not on 58 though my bad . But nonetheless I ll follow your advice and update the question tomorrow as I ll get to the workplace . Comment : Your code doesn t compile because it has mismatched curly-braces . It s also over 350 lines long . Can you provide a minimal working example Thanks Comment : @mernst I ve shortened the source code didn t think that someone would actually try to reproduce the issue and actually tried to build it in a standalone project . The errors are the same . If I comment the line arg -AuseSafeDefaultsForUnannotatedSourceCode arg in the project s pom.xml the compilation process seems to be fine though I m not sure the same applies to the type checking but with this option turned on I get the errors above and -AskipUses doesn t really help .", "Question : Consider this : .. . .. . This fails because checker-framework assumes ofNullable cannot accept null values after all its parameter is not marked as @Nullable . Is there a good way to tell checker-framework that this method or other methods in legacy code that I cannot change accepts @Nullable types everywhere without having to change code everywhere Comment : This seems to be a current limitation of the framework . The solution in my view is to allow custom configuration to add the type annotations to external libraries in my opinion the default of assuming everything non-null is just fine including the Java SDK . For example let me add to a config file the following declaration : T Optional T java.util.Optional.ofNullable @Nullable T t which will override the actual definition . Of course it should just add Type annotations not change them or mess with return parameter types . Comment : This would remove the need to have an annotated JDK and make it possible to add annotations to any library . Comment : It s not a current limitation of the framework because the feature you propose already exists and is called stub classes http : types.cs.washington.edu checker-framework current checker-framework-manual.html stub . It can be used in conjunction with the annotated JDK . .. . Answer : I m not sure why you say its parameter is not marked as @Nullable . When I look at file checker-framework checker jdk nullness src java util Optional.java I see the following annotated method : .. . .. . Furthermore when I run the Checker Framework on the following code it issues no warning . I m not sure what is going on in your case because you didn t provide a complete test case you didn t say what command you ran and you didn t give an actual error message . You did provide a diagnosis but I m not sure it is accurate . Maybe providing more details would enable better understanding of your problem . Comment : You made the assumption I am using the annotated JDK which I am not and I mentioned that in the comments . Knowing that nothing else is relevant . I am running the NullnessChecker as a simple annotation processor in Maven but that s not relevant . Using the annotated JDK is definitely not possible it is not portable it might cause compatibility security issues it even seems completely redundant given the possibility to provide stub classes - maybe you should have the stubs for Jdk8 added by default and eliminate the annotated JDK . Comment : Furthermore your answer does not address my more general question : Is there a good way to tell checker-framework that this method or other methods in legacy code that I cannot change .. . . Comment : Oh you are not using the annotated JDK . You didn t say that in comments or elsewhere . Why not use it That would be an easy way to address your problem . Regarding annotating legacy code my initial comment already directed you to the manual s discussion of stub classes http : types.cs.washington.edu checker-framework current checker-framework-manual.html stub . I see that you have now repeated that in your answer but without giving credit to my comment . Anyway I m glad that you now understand . Comment : I explained in my answer s note why I cannot use the annotated JDK . I agree I should have made it clearer I was not using it . I will add credit to your comment in my answer sorry about that . Great work with this framework by the way I hope to be able to contribute to making it even better .", "Question : My console print some error when I open its preference dialogue in eclipse . Any advise Thanks a lot . .. . Answer : You do not need to install the checker-framework separately it comes with the eclipse-plugin . It looks like you are running too old of a JVM . Java 7 or newer is required . You can check what eclipse is using by going to Help- About Eclipse- Installation Details- Configuration and looking for the eclipse.vm property . Comment : Yes I m using Java 6 but its installation requirements say that This plugin has been tested on both Eclipse 3.7.2 and 4.2.1 using either Java 6 or 7 . See types.cs.washington.edu checker-framework eclipse http : types.cs.washington.edu checker-framework eclipse Comment : Ah it looks like the docs are out of date . A Java 7 vm is required . I ve updated the website .", "Question : null .. . Answer : I m trying to use the Checker Framework http : types.cs.washington.edu checker-framework current checker-framework-manual.html gradle with Gradle . The official docs are expecting an environment variable to point to the annotated JDK : .. . .. . However it is possible http : stackoverflow.com a 33270054 618906 to manage the dependency on Checker Framework through Gradle : .. . .. . How can I best get the path to javac in Gradle from the dependency on org.checkerframework : jdk8 Comment : There is no executable javac in the jar for dependency jdk8 : 1.9.6 The checker documentation you linked to probably expects you to download the checkerframework onto your file system and set the path to javac in your build.gradle . Comment : The SO answer you linked to is using -Xbootclasspath as shown in the maven example just above the gradle section of the checker documentation you linked to . It would seem what the other SO answer shows is the only way to do it if you want to use jdk8 dependency .", "Question : Consider this : .. . .. . This fails because checker-framework assumes ofNullable cannot accept null values after all its parameter is not marked as @Nullable . Is there a good way to tell checker-framework that this method or other methods in legacy code that I cannot change accepts @Nullable types everywhere without having to change code everywhere Comment : This seems to be a current limitation of the framework . The solution in my view is to allow custom configuration to add the type annotations to external libraries in my opinion the default of assuming everything non-null is just fine including the Java SDK . For example let me add to a config file the following declaration : T Optional T java.util.Optional.ofNullable @Nullable T t which will override the actual definition . Of course it should just add Type annotations not change them or mess with return parameter types . Comment : This would remove the need to have an annotated JDK and make it possible to add annotations to any library . Comment : It s not a current limitation of the framework because the feature you propose already exists and is called stub classes http : types.cs.washington.edu checker-framework current checker-framework-manual.html stub . It can be used in conjunction with the annotated JDK . .. . Answer : EDIT : this answer was based on @mernst help in the comments and in the Checker Framework s Issue tracker https : code.google.com p checker-framework issues detail can 2 start 0 num 100 q colspec ID 20Type 20Status 20Priority 20Milestone 20Owner 20Summary groupby sort id 12 .. . .. . If you like me do not want or cannot use the annotated JDK you will run into this issue . Note : In most Java shops I ve worked we simply cannot switch which compiler we use or provide a custom JDK that s really unthinkable . For that to be portable I would have to add the custom JDK to my source repository for starters or distribute it to every machine including CI servers where the code compiles and make sure they are in the exact same path across different OS s . Just not cool . .. . .. . The solution is to provide stub classes http : types.cs.washington.edu checker-framework current checker-framework-manual.html annotating-libraries and pass them as an argument to the javac process . This can be done quite easily with whatever tool you use to compile . For example with Maven using the standard compiler plugin http : maven.apache.org plugins maven-compiler-plugin examples pass-compiler-arguments.html : .. . .. . You also need to add these dependencies to your project : .. . .. . Here checkerframework stubs is a directory relative to the location of the pom containing the stubs . For Optional my stub looks like this strangely stubs must be named .astub so this file is called Optional.astub : .. . .. . This approach is simple requires little work does not mess with which compiler I use or the Java libraries at all makes sure these definitions are only used with the checkerframework so I can for example add this to a Maven profile and enable it only if I want to by simply passing a Maven argument will work across machines and OS s without previous setup in the true Java way of doing things .", "Question : I m playing with the Checker Framework and its annotation processor requires the path to the annotated JDK jar to be passed to it so that it can add type annotations to the JDK classes . So what I need Gradle to do is go get the path to the jar and pass it to the java compiler . Pretty simple normally in Gradle : .. . .. . Running the resolveAnnotatedJdk task works The problem is trying to get it to work inside the compileJava config block : .. . .. . This doesn t work because the compileJava block is configuration and runs before dependencies are resolved I believe . I ve tried adding the options in a runFirst block and it seems to work : .. . .. . But I think I m not doing it the appropriate way seems like a hack really . Anyone knows how I can improve on this Comment : I gave up on the checker-framework for similar reasons . I m very happy with errorprone https : github.com tbroyer gradle-errorprone-plugin though . .. . Answer : That s how I use it : .. . .. . Explanation : putting checker-framework into a separate configuration allows to obtain all jars in classpath format in a natural Gradle way using configurations.checker.asPath .. . .. . compile configurations.checker.dependencies allows to reuse checker jars in compile classpath without duplicate lines . Comment : Thanks for showing a nice alternative . Comment : The official docs http : types.cs.washington.edu checker-framework current checker-framework-manual.html gradle suggest setting options.forkOptions.executable CHECKERFRAMEWORK checker bin javac . Is setting Xbootclasspath p : the equivalent Comment : Xbootclasspath allows to just use dependency JARs . Using javac would require to extract dependency to some directory first or to have checker installed already .", "Question : The Checker Framework s Nullness Checker http : types.cs.washington.edu checker-framework current checker-framework-manual.html nullness-checker generates an error when it encounters an uninitialised field . Now it is a common pattern to have some fields injected via dependency-injection : .. . .. . Here the @javax.persistence.PersistenceContext annotation ensures that em will hold a reference to an EntityManager instance after the repository has been constructed . More generally in these cases the application framework guarantees that fields are initialised and non-null when they are used but the Checker Framework can t know this . So far I ve found that one remedy is to convert field injection to constructor-injection @Inject . This isn t an option in the above example though . Is there a way to tell the Checker Framework that a field is injected and therefore properly initialised and non-null without simply suppressing these errors Comment : Anything you do to tell the Checker Framework that the field is properly initialized will be suppressing the error so there isn t really a distinction between the two . I think your question is either Can I suppress the error per-field instead of writing @SuppressWarnings initialization.fields.uninitialized on the whole class or Can I make the Nullness Checker recognize @PersistanceContext as that per-field warning suppression without writing @SuppressWarnings explicitly Can you please clarify Comment : @mernst I see . Then I m interested in answers to both of your questions . Note that @PersistenceContext is part of the Java Persistence API so I will not be able to change its definition easily . Comment : In your case the persistence framework might always return a non-null value but is that a guarantee Is it possible for an application to persist a null value into the persistence framework Comment : @mernst I m not sure I understand the question . I trust the dependency-injection framework think Spring Guice CDI JPA .. . to do the wiring : injected fields may not be null . My goal is to express this trust in a way the Checker Framework understands . .. . Answer : You can suppress the error for a single field by writing @SuppressWarnings initialization.fields.uninitialized on the field declaration . You can suppress the error for all fields by writing @SuppressWarnings initialization.fields.uninitialized on the class . There exist injection frameworks that can inject null as a value where a @PersistenceContext annotation exists such as when the .xml file isn t present the code isn t running in a transaction etc . Writing the @SuppressWarnings initialization.fields.uninitialized annotation is your way of saying that you trust that the one you are using will always inject a non-null value for your code .", "Question : I wanted to write code which looks like below . Assume MyClass method look like below .. . .. . So when some one creats object of MyClass with the annotation it should set a default-value to some x say 20 . In checker-framework it is allowing us to annotate in the code as below . Does any one know how can we get split this into two parts at the time of compiling like below or if we can able to pass defauilt value like below is also fine . Can this be achieved using annotation processor need to use bytecode processor like ASM to get it done Updated with more meaningful way . Comment : why not create a constructor also your setValue a returns type of Test but in the body you returned this Comment : Changed it to MyClass it was typo . Comment : it doesn t make sense it is an instance method and return same instance.. . Comment : Ignore about the method return . My intention is to set a default-value to member when annotation is there at the time of creating object . I tried to run some code by using above syntax but didnt work . Comment : Please be a bit more elaborate about but didnt work . Are you aware that the type-annotation feature requires Java 8 .. . Answer : Are you writing a custom type-system via meta-annotations That is are you using the SubtypingChecker http : types.cs.washington.edu checker-framework current checker-framework-manual.html subtyping-checker or are have you created your own subtype of BaseTypeChecker The short answer is with meta-annotations you cannot specify this sort of behavior . The long answer is if you have a custom checker then there are a number of ways you can do this . Keep in mind however that writing a custom checker is a fair bit more complicated then using meta-annotations . But if you have a custom checker you can do one of the following : .. . .. . Option A : Polymorphic Constructors Steps : .. . .. . 1 . Create an @PolyMyAnnotation polymorphic annotation see Polymorphic Qualifiers http : types.cs.washington.edu checker-framework current checker-framework-manual.html qualifier-polymorphism .. . 2 . Create a PolyMorphic constructor for MyClass e.g . @PolyMyAnnotation MyClass @PolyMyAnnotation int a .. . 3 . Create a TreeAnnotator that adds @MyAnnotation to the type s of int literals . See RegexTreeAnnotator.visitLiteral https : code.google.com p checker-framework source browse checker src org checkerframework checker regex RegexAnnotatedTypeFactory.java 268 for an example . 4 . Add your TreeAnnotator to the list of TreeAnnotators used by your AnnotatedTypeFactory . See RegexAnnotatedTypeFactory https : code.google.com p checker-framework source browse checker src org checkerframework checker regex RegexAnnotatedTypeFactory.java 137 .. . .. . Option B : Use A TreeAnnotator Steps : .. . .. . 1 . Create a class that extends TreeAnnotator .. . 2 . Override visitNewClass .. . 3 . Identify if the object being constructed is an instance of MyClass see ElementUtils.getQualifiedClassName and ElementUtils.isObjectType to see how you might do this . 4 . If the class being constructed is an instance of MyClass if so see if the argument is an Integer literal . 5 . If the item is a literal parse the literal and add it s value to the type being constructed . Note if you would like this to handle non-literals e.g . int a 20 new MyClass a .. . .. . Then you can use the ValueChecker . IF your type factory extends ValueAnnotatedTypeFactory it will have support for constant propagation . The data flow API also provides some support for constant propagation . Option C : Customize dataflow s CFAbstractTransfer Function However if you have a custom checker you can override CFAbstractTransfer.visitMethodInvocation to detect when setValue is called and refine it accordingly . You can look at RegexTransfer https : code.google.com p checker-framework source browse checker src org checkerframework checker regex RegexTransfer.java for an example or search for methods that extend CFAbstractTransfer or implement TransferFunction . That said dataflow is not a substitute for a type-state system see a discussion of this at Typestate checkers http : types.cs.washington.edu checker-framework current checker-framework-manual.html typestate-checker . Comment : I am new to annotations and trying to figure out how can I implement this . I have updated the question with more meaningful way . Can it be done as mentioned by you or need to use ASM", "Question : When I compile my code with The Checker Framwork http : types.cs.washington.edu checker-framework it complains : .. . .. . for the first argument of : .. . .. . I know that DatabaseMetadata.getColumns http : docs.oracle.com javase 7 docs api java sql DatabaseMetaData.html getColumns 28java.lang.String 20java.lang.String 20java.lang.String 20java.lang.String 29 allows a null catalog the first argument . How do I tell the Checker Framework as much .. . Answer : Answering my own question : .. . .. . In section Annotating Libraries http : types.cs.washington.edu checker-framework current checkers-manual.html annotating-libraries the authors write you can either provide stub-files http : types.cs.washington.edu checker-framework current checkers-manual.html stub or rewrite the class files in question . I ended up using stub files as they seemed easier to get started with .", "Question : I d like to use the Checker Framework using their Eclipse Plugin http : types.cs.washington.edu checker-framework checker-plugin update-site . This seems to work fine if I have a single project without dependencies . However when I try to run the check on my maven projects I get hundreds of warnings saying : .. . .. . cannot find symbol .. . .. . In the console I get the following Report : .. . .. . MainActivity.java : 33 : error : package de.my.dependency does not exist import de.my.dependency .. . .. . I assume that the Eclipse Checker plugin cannot resolve the maven dependencies is there anything I can do to fix this Thanks for help : .. . Answer : Do you mind taking a moment and adding any relevant details about your project setup to the following issue : checker-framework-185 http : code.google.com p checker-framework issues detail id 185 .. . .. . Specifically are you using m2eclipse And is there anything peculiar about your setup Sorry for the delay in responding . In the future the best way to get help for the Checker Framework would be to either post in the checker-framework discussion group checker-framework-discuss https : groups.google.com forum fromgroups forum checker-framework-discuss or if you think we have a bug or an obviously missing feature please create an issue in our google-code issue tracker .", "Question : When I compile my code with The Checker Framwork http : types.cs.washington.edu checker-framework it complains : .. . .. . for the first argument of : .. . .. . I know that DatabaseMetadata.getColumns http : docs.oracle.com javase 7 docs api java sql DatabaseMetaData.html getColumns 28java.lang.String 20java.lang.String 20java.lang.String 20java.lang.String 29 allows a null catalog the first argument . How do I tell the Checker Framework as much .. . Answer : I m not familiar with that framework does it respect @SuppressWarnings in the context you re interested in http : types.cs.washington.edu checker-framework current checkers-manual.html suppressing-warnings-nullness Comment : Yes but I wanted a more fine-grained solution and also I wanted to avoid having to @SuppressWarnings multiple times for the same problem across multiple-files . I ended up finding out about stub files http : stackoverflow.com a 18809315 14731 and they seem to work .", "Question : I d like to use the Checker Framework using their Eclipse Plugin http : types.cs.washington.edu checker-framework checker-plugin update-site . This seems to work fine if I have a single project without dependencies . However when I try to run the check on my maven projects I get hundreds of warnings saying : .. . .. . cannot find symbol .. . .. . In the console I get the following Report : .. . .. . MainActivity.java : 33 : error : package de.my.dependency does not exist import de.my.dependency .. . .. . I assume that the Eclipse Checker plugin cannot resolve the maven dependencies is there anything I can do to fix this Thanks for help : .. . Answer : This issue has been fixed and should work with the latest Checker Framework release .", "Question : null .. . Answer : I m working on a multi-module maven based project in which one of the modules contains a few annotation processors for the custom annotations used by other modules . When I add a dependency of annotation processor module to any other module the annotations of that modules are processed by those annotation processors . But recently I integrated Checker Framework http : types.cs.washington.edu checker-framework for type annotations and then all the custom annotation processors I mentioned above stopped working . Any idea on how to get them to work even with Checker Framework is greatly appreciated .. . .. . To clear the scenario .. . .. . Let s say I have a maven module named module A . In this module I have a annotation class level called @FoodItem . I need to enforce a rule that any class annotated with @FoodItem annotation should implement the interface Food . So I wrote an annotation processor FoodItemAnnotationProcessor in the same module module A which processes such classes and check for the compliance with that rule . Then let s say I have another module named module B which has a maven-dependency to the module A . In this module I have a class called Pizza which is annotated with @FoodItem annotation . If a build the project which has module A and module B with the above configuration the FoodItemAnnotationProcessor is executed at compile stage and validates the class Pizza for the rule mentioned above . After that I integrated Checker framework to module B as mentioned here https : types.cs.washington.edu checker-framework current checker-framework-manual.html maven . Then checker-framework related validations are executed at compile-time as expected but the FoodItemAnnotationProcessor ceased to work . Comment : Can you give more details about your setup or preferably a minimal working example Comment : Added a description of the scenario Comment : Step 3 of the instructions you referenced include a code snippet with the comment -- Add all the checkers you want to enable here -- . Did you include FoodItemAnnotationProcessor there" ] }
[ "yes-answer-long", "yes-answer-short" ]
java
UNK_RELATION
assemblies -- assemblies are collections of compiled @placeholder types and resources grouped into a logical and physical unit in the form of a .dll file or .exe file .
{ "confidence": [ 39.614013671875, 39.026885986328125, 37.06647491455078, 36.624351501464844, 34.88526916503906, 34.514041900634766, 33.69652557373047, 33.62785339355469, 33.56282043457031, 33.55731964111328, 33.009578704833984, 32.51401138305664, 32.08396530151367, 31.73055648803711, 31.73055648803711, 31.73055648803711, 31.453060150146484, 31.45166778564453, 30.965164184570312, 30.946182250976562, 30.68021011352539, 30.669132232666016, 30.530168533325195, 30.530168533325195, 30.530168533325195, 30.450796127319336, 30.450796127319336, 30.427776336669922, 30.387895584106445, 30.337566375732422, 30.0333194732666, 29.813411712646484, 29.681167602539062, 29.662662506103516, 29.601795196533203, 29.601795196533203, 29.557039260864258, 29.557039260864258, 29.557039260864258, 29.557039260864258, 29.557039260864258, 29.557039260864258, 29.42575454711914, 29.32001495361328, 29.32001495361328, 29.276351928710938, 29.090911865234375, 28.988229751586914, 28.988229751586914, 28.708038330078125, 28.708038330078125, 28.708038330078125, 28.663619995117188, 28.584247589111328, 28.398372650146484, 28.398372650146484, 28.398372650146484, 28.398372650146484, 28.398372650146484, 28.398372650146484, 28.398372650146484, 28.398372650146484, 28.39679527282715, 28.145994186401367, 28.13443946838379, 28.122034072875977, 28.122034072875977, 28.122034072875977, 28.122034072875977, 28.122034072875977, 27.96306800842285, 27.74407196044922, 27.74407196044922, 27.74407196044922, 27.726049423217773, 27.70846939086914, 27.70846939086914, 27.70846939086914, 27.70846939086914, 27.70846939086914, 27.70846939086914, 27.70846939086914, 27.70846939086914, 27.69049072265625, 27.549373626708984, 27.549373626708984, 27.549373626708984, 27.5086612701416, 27.5086612701416, 27.445749282836914, 27.296993255615234, 27.10016632080078, 27.046138763427734, 27.00707244873047, 26.89507293701172 ], "content": [ "These classes are currently grouped into a set of assemblies .", "As an alternative to ilmerge you can embed one or more assemblies as resources into your exe or DLL .", "There are no other assemblies that have dependencies on this file .", "How about .NET DLL assemblies", "You can create two types of ASP.NET Assemblies in ASP.NET : private ASP.NET Assemblies and shared assemblies .", "The compiled assemblies are not affected by extraneous using-directives .", "Just deploy the main assembly there s no need to distribute the other assemblies because they re embedded into the main DLL or EXE .", "For types and assemblies it s just a naming .", "Suggestions are local assemblies and private assemblies .", "You can process only assemblies with filename starting with a pattern or list the assemblies on a config file .", "The assemblies that are hosted in the GAC are formally called Shared Assemblies or Global Assemblies please don t confuse with your Shared Assemblies .", "We work with multiple assemblies core assemblies and specialized assemblies .", "Other alternatives : .. . .. . Combining multiple assemblies into a single EXE for a WPF application http : www.digitallycreated.net Blog 61 combining-multiple-assemblies-into-a-single-exe-for-a-wpf-application .", "Signed assemblies can only load other signed assemblies .", "GetAssemblies returns only assemblies loaded so far and not all referenced assemblies .", "This extension method gets all referenced assemblies recursively including nested assemblies .", "I m also a little confused about why .NET assemblies are .dll files .", "when my .net exe runs it loads the correct .net assemblies at rumtime .", "This needs to work for assemblies on the file system as well as those at URL addresses .", "The higher-level assemblies reference lower-level assemblies which in turn reference even lower-level assemblies .", "The only best way to do is check the compiled assemblies itself .", "When I release a PC application I use a .NET obfuscator to merge the assemblies and the EXE into a single EXE so end users cannot see the APIs of all the classes and assemblies .", "@bentayloruk : Types with the same name are still not equal if they come from different assemblies .", "It s perfectly normal for multiple assemblies to have types that exist in the same namespace .", "If you need to ship types separately you may need separate assemblies .", "First of all there s an important difference between reference assemblies and assemblies in the GAC .", "Are all .NET assemblies DLLs but not all DLLs are .NET assemblies", "is there any difference in reflecting on normal assemblies and satellite assemblies", "using the code How to embed a satellite-assembly into the EXE file http : stackoverflow.com questions 1453755 how-to-embed-a-satellite-assembly-into-the-exe-file 1454496 1454496 provided by csharptest.net I ve created a custom assembly resolver and embedded my assemblies in my resources .", "This is a special resource key which allows referencing resources from other assemblies .", "If you use reflection and use a loop like for all assemblies for all types in those assemblies check if they have attributes etc . .", "Note : If one assembly is loaded using an 8.3 path and then from a non-8.3 path they will be seen as different assemblies even though they are the same physical DLL .", "This cache manager doesn t know about the specialized cache types in referencing assemblies .", "GetPEArchitecture works for assemblies compiled using .net-3.5 4.0 4.5 and 4.5.1", "Bigger assemblies are always better than many smaller assemblies .", "Specialized assemblies have a reference to core assemblies but not the other way around .", "This question is for .NET and .NET assemblies .", "Is this the official term for these assemblies", "These assemblies are shipped by Microsoft .", "but not all DLLs are .NET assemblies", "Does this work with signed assemblies", "You re importing namespaces not assemblies .", "Don t forget to check for .exe too since executable files can also be assemblies .", "It will merge localized resources for different assemblies that are merged together .", "The first solution would embed multiple assemblies as resources inside another one .", "To be able to do any testing with the application all of the assemblies must be used the vendor s plugin assemblies the vendor s helper assemblies third party component assemblies and our plugin assemblies .", "I could add the suggested binding redirects into the configuration file but I d prefer to have the assemblies reference the same version of at a minimum the .NET Framework Assemblies .", "Once you build the solutions all deployed assemblies are just assemblies whether your or included as references it s all the same .", "I believe this only returns the assemblies that are referenced by the calling assembly all assemblies the current assembly depends on .", "That is the typical places assemblies are probed for .", "Remove the assemblies from the GAC .", "The assemblies are loaded into a separate AppDomain .", "Don t reference any types in assemblies that shouldn t get initialized .", "See that the latest assemblies are deployed and no duplicated older assemblies are hiding in certain folders .", "Load all assemblies in that directory into memory .", "Assemblies in the GAC run with Full Trust .", "you have to sign your assemblies .", "Deploy them as private assemblies instead .", "Assembly C references assemblies A and B .", "Careful with accepting remotely sent assemblies .", "Consider there are 2 assemblies written in C .", "try using : Assembly assemblies AppDomain.CurrentDomain.GetAssemblies", "So that the application directory would only contain the executable itself and the other assemblies would be contained in various logical directories .", "Are all .NET assemblies DLLs .. . .. . Either DLLs or EXE normally - but can also be netmodule .", "Chain-referenced assemblies http : i.stack.imgur.com E2JXk.png .. . .. . The problem is that Resources is not copied to the bin folder of the application causing Plugin Ctrl on the image resources it requires finding failure .", "Is signing assemblies necessary and what would be wrong with not signing", "What disadvantages are there in signing assemblies - does it cause delays", "Is signing assemblies necessary and what would be wrong with not signing it", "What disadvantages are there in signing assemblies - does it cause delays", "All assemblies might just not show up .", "Then you can inspect assemblies obtained from GetAssemblies and then inspect namespaces of types found contained in them .", "I scratch my head at ilmerge - I don t see an advantage to placing all assemblies in a single file .", "It s sometimes referred to as Xcopy deployment as you deploy the assemblies by copying them to a file location .", "Assemblies anywhere in any file system fall under some Security Guidelines that may prevent them from functioning .", "This is the code : .. . .. . The exception I am getting is : .. . .. . Could not load file or assembly file : C : SampleProj Workspace Test App bin Debug Assemblies or one of its dependencies .", "One small function of a large program examines assemblies in a folder and replaces out-of-date assemblies with the latest versions .", ".NET assemblies that contain a mixture of managed and unmanaged code cannot be ILMerged with other assemblies .", "If an assembly implementing the custom security object references other assemblies add the referenced assemblies to the full trust assembly list .", "What happens if an application tries to load an assembly which has references to assemblies in the GAC and these assemblies are not available on the machine", "The important information is the following : .. . Beginning with the .NET Framework 4 the ResolveEventHandler event is raised for all assemblies including resource assemblies .", "The overhead associated with having multiple smaller assemblies can be attributed to the following : .. . .. . The cost of loading metadata for smaller assemblies .", "BuildManager.GetReferencedAssemblies returns a list of all assemblies referenced from Web.config and elsewhere and it loads those assemblies into the current AppDomain .", "@Levi probably because he wants to get all of the referenced assemblies and the BuildManager has a method for getting all of the referenced assemblies .", "Never really debugged assemblies .", "Unused referenced assemblies are removed by the compiler .", "ReportViewer is under References- Assemblies- Extensions .", "To create a new AppDomain and load assemblies into it :", "Of course this won t work for assemblies compiled for versions 4 as they won t have the attribute in them .", "This is sort of a duplicated question to this one http : stackoverflow.com questions 652432 compare-compiled-net-assemblies .", "I am now trying to write some code that looks in the same folder for other dll and exe s to fetch assemblies from .", "In the build-process for a .NET C tool I have been using ILMerge to merge the assemblies into a single exe .", "The reason you find it with your LINQ example is that you are using GetAssemblies which obtains the assemblies that have been loaded into the current execution context and thus has the details it needs to find all the types within the assemblies .", "When I ve used it the GAC has always been troublesome because you have to worry if the GAC has all the correct assemblies for the project because assemblies can reference other assemblies .", "The problem I m having is that when debugging an application from within Visual FoxPro it runs the everything under the main vfp9.exe application file for the IDE and it appears that handles to my managed assemblies are not released .", "If both assemblies are compatible you can define in the app.exe.config or web.config file to always use the new version by declaring bindingRedirect ." ] }
{ "confidence": [ 51.824554443359375, 46.879241943359375, 45.63273239135742, 45.62131118774414, 45.380184173583984, 45.149375915527344, 42.01716995239258, 41.33928298950195, 41.00187683105469, 40.9642448425293, 39.92988204956055, 39.86690139770508, 39.65464401245117, 39.20738983154297, 39.051841735839844, 38.676109313964844, 38.55988693237305, 38.480430603027344, 38.428192138671875, 38.41044616699219 ], "content": [ "Question : using the code How to embed a satellite-assembly into the EXE file http : stackoverflow.com questions 1453755 how-to-embed-a-satellite-assembly-into-the-exe-file 1454496 1454496 provided by csharptest.net I ve created a custom assembly resolver and embedded my assemblies in my resources . I can successfully resolve my assemblies used in but somehow AppDomain.CurrentDomain.AssemblyResolve asks for an assembly called AppName.resources specifically MyProgram.resources Version 0.15.3992.31638 Culture en-US PublicKeyToken null which i don t know how to resolve I ve tried to disable loading my custom assemblies from resources placed all my assembly dll s in program directory and just enabled AppDomain.CurrentDomain.AssemblyResolve but it was still asking for it . I m a bit confused about this will appreciate a lot if you can help me on this . Here s my code for interested ones .. . Answer : My situation was a bit more complex and the above solution did not work for me . That is changing the AssemblyInfo.cs file .. . .. . I have moved all my form and image resources to a seperate dll and the moment any of the images are used the filenotfoundexception exception is thrown . The important information is the following : .. . Beginning with the .NET Framework 4 the ResolveEventHandler event is raised for all assemblies including resource assemblies . See the following reference .. . .. . https : msdn.microsoft.com en-us library system.appdomain.assemblyresolve v vs.110 .aspx .. . .. . The solution turned out to be very simple . If a resource file is requested in the form dllname.resources.dll always return null .. . .. . Here is the event code that I have adapted from other samples found . I have commented the debugging lines - un-comment them if you have a problem using the code . Add this line in your class . It is used to prevent loading a dll more than once .. . .. . This is the event method .", "Question : If you create a class-library that uses things from other assemblies is it possible to embed those other assemblies inside the class-library as some kind of resource I.e . instead of having MyAssembly.dll SomeAssembly1.dll and SomeAssembly2.dll sitting on the file system those other two files get bundled in to MyAssembly.dll and are usable in its code . .. . .. . I m also a little confused about why .NET assemblies are .dll files . Didn t this format exist before .NET Are all .NET assemblies DLLs but not all DLLs are .NET assemblies Why do they use the same file-format and or file extension .. . Answer : You can embed an assembly or any file actually as a resource and then use the ResourceManager class to access them but if you just want to combine assemblies you re better off using a tool like ILMerge http : research.microsoft.com mbarnett ILMerge.aspx . EXE and DLL files are Windows portable executables http : en.wikipedia.org wiki Portable Executable which are generic enough to accomodate future types of code including any .NET code they can also run in DOS but only display a message saying that they re not supposed to run in DOS . They include instructions to fire up the .NET runtime if it isn t already running . It s also possible for a single assembly to span across multiple-files though this is hardly ever the case .", "Question : I consuming my service stack using EXE project startup task for azure application in that I have copied following service stack s DLL some Azure s DLLs in to EXE project . dlls http : i.stack.imgur.com KSQjg.png .. . .. . When I build this EXE project then Azure DLLs will be bundled with my EXE but service stack s DLL will not be bundled with EXE because to run my EXE on any machine I need to copy all service stack s DLL manually . I have used this service stack s dll to use .. . .. . What should I have to do to bundled all these DLLs in to my EXE .. . Answer : A great tool to include referenced assemblies as embedded resources is Costura https : github.com Fody Costura a Fody https : github.com Fody Fody add-in . The author Simon Kropp describes it as follows : .. . .. . .. . a combination of two methods : .. . .. . Jeffrey Richter s suggestion of using embedded resources as a method of merging assemblies http : blogs.msdn.com b microsoft press archive 2010 02 03 jeffrey-richter-excerpt-2-from-clr-via-c-third-edition.aspx .. . Einar Egilsson s suggestion using cecil to create module initializers http : tech.einaregilsson.com 2009 12 16 module-initializers-in-csharp .. . .. . The result is a super simple solution which merely requires to fetch Costura.Fody https : www.nuget.org packages q Costura.Fody from NuGet . Features : .. . .. . Including debug-symbols .. . Compression of embedded assemblies .. . Including excluding specific assemblies .. . Others see Readme https : github.com Fody Costura blob master README.md Comment : OMG Costura.Fody is the right answer . Installed the package from nuget rebuilt the project and now I have a standalone EXE AWESOME Comment : I can t believe how easy it is . Just install packages from nuget and your are done .", "Question : If you create a class-library that uses things from other assemblies is it possible to embed those other assemblies inside the class-library as some kind of resource I.e . instead of having MyAssembly.dll SomeAssembly1.dll and SomeAssembly2.dll sitting on the file system those other two files get bundled in to MyAssembly.dll and are usable in its code . .. . .. . I m also a little confused about why .NET assemblies are .dll files . Didn t this format exist before .NET Are all .NET assemblies DLLs but not all DLLs are .NET assemblies Why do they use the same file-format and or file extension .. . Answer : ILMerge does merge assemblies which is nice but sometimes not quite what you want . For example when the assembly in question is a strongly-named assembly and you don t have the key for it then you cannot do ILMerge without breaking that signature . Which means you have to deploy multiple assemblies . As an alternative to ilmerge you can embed one or more assemblies as resources into your exe or DLL . Then at runtime when the assemblies are being loaded you can extract the embedded assembly programmatically and load and run it . It sounds tricky but there s just a little bit of boilerplate code . To do it embed an assembly just as you would embed any other resource image translation file data etc . Then set up an AssemblyResolver that gets called at runtime . It should be set up in the static-constructor of the startup class . The code is very simple . The Name property on the ResolveEventArgs parameter is the name of the assembly to be resolved . This name refers to the resource not to the filename . If you embed the file named MyAssembly.dll and call the embedded-resource Foo then the name you want here is Foo . But that would be confusing so I suggest using the filename of the assembly for the name of the resource . If you have embedded and named your assembly properly you can just call GetManifestResourceStream with the assembly name and load the assembly that way . Very simple . This works with multiple assemblies just as nicely as with a single embedded assembly . In a real app you re gonna want better error-handling in that routine - like what if there is no stream by the given name What happens if the Read fails etc . But that s left for you to do . In the rest of the application code you use types from the assembly as normal . When you build the app you need to add a reference to the assembly in question as you would normally . If you use the command-line tools use the r option in csc.exe if you use Visual Studio you ll need to Add Reference.. . in the popup menu on the project . At runtime assembly version-checking and verification works as usual . The only difference is in distribution . When you deploy or distribute your app you need not distribute the DLL for the embedded and referenced assembly . Just deploy the main assembly there s no need to distribute the other assemblies because they re embedded into the main DLL or EXE . Comment : Wow I never thought of doing that.. . to be honest I m surprised it works . Comment : That s pretty nifty . Comment : The GetManifestResourceStream args.Name probably should be GetManifestResourceStream string.Format 0 .lib . 1 .dll typeof Foo .Namespace new AssemblyName args.Name .Name or GetManifestResourceStream string.Format 0 . 1 .dll typeof Foo .Namespace new AssemblyName args.Name .Name . I don t know the reasons why but I ve has to use either of these . Comment : @mheyman - re : I don t know the reasons why.. . . it just depends on how you name the embedded resources when you compile the thing . You can use this to diagnose : cheeso.members.winisp.net http : cheeso.members.winisp.net srcview.aspx dir Embedded 20Resources file ShowEmbeddedResources.cs A tool that displays the names of the embedded resources in an assembly Comment : How does that work if you have a solution with multiple-projects and you want to include project A into project B . You can not include a project as resource I suppose . You would have to point to either the output path of the project either Debug or Release which again makes things more complicated . Is there an easy solution for such a scenario", "Question : I need a little help in terminology . You can put an assembly in the GAC to share these assembly globally in the machine . What do you call if you put the assembly in the same directory where the executable is I have been calling it side-by-side because the EXE and the DLL is side-by-side . I ve done some reading https : secure.wikimedia.org wikipedia en wiki Side-by-side assembly and it seems that side-by-side stands for something else .. . .. . EDIT : Are those DLLs called Private assemblies .. . Answer : Side-by-side refers to two versions of the same assembly i.e . 1.0.0.0 1.1.0.0 being installed in the GAC at the same time . Whether in the GAC or in the same local directory as the main application EXE assembly this DLL assembly would be known as a dependency of the main assembly . Comment : But what do you call this configuration mode where the DLL dependency assembly is being placed on the same directory as the EXE main assembly Comment : It s sometimes referred to as Xcopy deployment as you deploy the assemblies by copying them to a file location . Comment : Yes the deployment can be called Xcopy deployment but what do you call the assembly Suggestions are local assemblies and private assemblies . Is there an official term for this", "Question : If you create a class-library that uses things from other assemblies is it possible to embed those other assemblies inside the class-library as some kind of resource I.e . instead of having MyAssembly.dll SomeAssembly1.dll and SomeAssembly2.dll sitting on the file system those other two files get bundled in to MyAssembly.dll and are usable in its code . .. . .. . I m also a little confused about why .NET assemblies are .dll files . Didn t this format exist before .NET Are all .NET assemblies DLLs but not all DLLs are .NET assemblies Why do they use the same file-format and or file extension .. . Answer : Take a look at ILMerge http : www.microsoft.com downloads details.aspx FamilyID 22914587-b4ad-4eae-87cf-b14ae6a939b0 displaylang en for merging assemblies . I m also a little confused about why .NET assemblies are .dll files . Didn t this format exist before .NET Yes . Are all .NET assemblies DLLs .. . .. . Either DLLs or EXE normally - but can also be netmodule . but not all DLLs are .NET assemblies Correct . Why do they use the same file-format and or file extension Why should it be any different - it serves the same purpose Comment : .netmodule is for Modules which are parts of an assembly e.g . built with different language compilers but aren t standalone assemblies .", "Question : If you create a class-library that uses things from other assemblies is it possible to embed those other assemblies inside the class-library as some kind of resource I.e . instead of having MyAssembly.dll SomeAssembly1.dll and SomeAssembly2.dll sitting on the file system those other two files get bundled in to MyAssembly.dll and are usable in its code . .. . .. . I m also a little confused about why .NET assemblies are .dll files . Didn t this format exist before .NET Are all .NET assemblies DLLs but not all DLLs are .NET assemblies Why do they use the same file-format and or file extension .. . Answer : With respect to Cheeso s answer of embedding the assemblies as resources and loading them dynamically using the Load byte overload using an AssemblyResolve event handler you need to modify the resolver to check the AppDomain for an existing instance of the Assembly to load and return the existing assembly instance if it s already loaded . Assemblies loaded using that overload do not have a context which can cause the framework to try and reload the assembly multiple times . Without returning an already loaded instance you can end up with multiple instances of the same assembly code and types that should be equal but won t be because the framework considers them to be from two different assemblies . At least one way that multiple AssemblyResolve events will be made for the same assembly loaded into the No context is when you have references to types it exposes from multiple assemblies loaded into your AppDomain as code executes that needs those types resolved . https : msdn.microsoft.com en-us library dd153782 28v vs.110 29.aspx .. . .. . A couple of salient points from the link : .. . .. . Other assemblies cannot bind to assemblies that are loaded without context unless you handle the AppDomain.AssemblyResolve event .. . .. . Loading multiple assemblies with the same identity without context can cause type identity problems similar to those caused by loading assemblies with the same identity into multiple contexts . See Avoid Loading an Assembly into Multiple Contexts .", "Question : Let s suppose I have a Window Forms Console Application C project with some external references and references to other class-library projects in the same solution too . When I build the Window Form project I want the referenced libraries be stored in a different location eg : bin Release Libraries and not in the same folder as the .exe . Is it possible to do Comment : Are you referencing them as a file reference or a project reference Comment : with a postbuild step but you also have to change your AppDomainSetup to set the probing path for assemblies otherwise your Library dll s will never load . Have you thought of that Comment : @mellamokb both . I have references to projects in my solution and those and the WinForm too have references to external .dll files too . Comment : The main thing here is WHY you want to do this What is the benefit of having DLLs under Libraries subfolder Comment : @Petar That s what I usually do when deploying the deliverables of my applications and I think having a .exe alone with docs license file etc . is much cleaner than having the .exe file and 5-10 .dll files in the same folder in this case : deploying just ziping the files .. . Answer : There are 2 parts of your question : .. . .. . How to configure solutions to build assemblies EXE into folders of your choice - this is configured through properties of solution in VS solution properties - build - output path . Also value of check copy local property on each reference . How to load assemblies files from non-default locations i.e . from your .. . Libraries folder - you need to make changes to your app.config file to add this non-default paths to assembly search location http : support.microsoft.com kb 837908 . Comment : Further to the 2nd part of this answer also look into the Probing .config element - it allows you to specify other sub directories to search for assemblies", "Question : If you create a class-library that uses things from other assemblies is it possible to embed those other assemblies inside the class-library as some kind of resource I.e . instead of having MyAssembly.dll SomeAssembly1.dll and SomeAssembly2.dll sitting on the file system those other two files get bundled in to MyAssembly.dll and are usable in its code . .. . .. . I m also a little confused about why .NET assemblies are .dll files . Didn t this format exist before .NET Are all .NET assemblies DLLs but not all DLLs are .NET assemblies Why do they use the same file-format and or file extension .. . Answer : Why do they use the same file-format and or file extension Why should it be any different - it serves the same purpose My 2 bit of clarification here : DLL is Dynamic Link Library . Both the old style .dll C-code and .net style .dll are by definition dynamic link libraries . So .dll is a proper description for both .", "Question : null .. . Answer : I have a large collection of custom C classes that roughly follow the MVC pattern that I reuse over and over to build GUI and command-line PC applications with different groupings of functionality . For example there are classes for importing and exporting files classes for manipulating data classes for monitoring utility classes etc . These classes are currently grouped into a set of assemblies . The higher-level assemblies reference lower-level assemblies which in turn reference even lower-level assemblies . All the classes are marked as public so when I build a PC application I can reference the appropriate assemblies and uses the classes in a modular fashion . When I release a PC application I use a .NET obfuscator to merge the assemblies and the EXE into a single EXE so end users cannot see the APIs of all the classes and assemblies . Now I would like to create a .NET assembly from my collection of classes that only exposes a specific limited API and give it to end-users . I guess this is the facade design pattern . For example I would like to take assemblies A and B and use classes from those say A.Foo A.Bar A.Baz B.Foobar B.Bazbar B.Bazfoo and create a new assembly C that has a single public class C.MyClass . Assembly C references assemblies A and B . End users can only see C.MyClass and they can t see or access A.xxx or B.xxx . Is there a clean way of doing this that doesn t require drastic changes to my current collection of classes and assemblies as they are already used in multiple other projects Or is this something that is typically handed in the merging obfuscation stage instead Thanks Comment : It s an odd predicament have you considered Add as link in Visual Studio You could have all of your files in one project and just add selected ones as links in other the thinned down projects . Unfortunately this smells like a maintenance headache regardless . Comment : Thanks . Already doing that in VS . This is more about hiding public classes rather than referencing assemblies . Unless I am misunderstanding", "Question : I want to load assemblies stored inside my project application folder on the c : drive . This is the code : .. . .. . The exception I am getting is : .. . .. . Could not load file or assembly file : C : SampleProj Workspace Test App bin Debug Assemblies or one of its dependencies . Access is denied . I tried the following but the error remains the same : .. . .. . 1 . Keep the project in other drive and access assemblies from there .. . 2 . Removed read-only permission from project folder-sub folders .. . 3 . Granted full control permissions to Users in project folder properties .. . 4 . Clicked on Unblock button for all DLL properties .. . .. . Please help . Comment : I m not clear on your question are you trying to load an assembly already referred by your project The DLLs are in Debug folder of my project under a folder named Assemblies Comment : Never mind that you are not specifying a correct value . Specify the whole path that includes .dll extension Comment : You are trying to load a directory not an assembly . Kaboom treating a directory like a file produces a low-level Windows error ERROR ACCESS DENIED . The CLR can t make a better error message out of that . .. . Answer : As I wrote in the comment you are not specifying a valid path you are specifying a folder when you need to specify a dll . If you want to load all the assemblies in that folder use this piece of code :", "Question : using the code How to embed a satellite-assembly into the EXE file http : stackoverflow.com questions 1453755 how-to-embed-a-satellite-assembly-into-the-exe-file 1454496 1454496 provided by csharptest.net I ve created a custom assembly resolver and embedded my assemblies in my resources . I can successfully resolve my assemblies used in but somehow AppDomain.CurrentDomain.AssemblyResolve asks for an assembly called AppName.resources specifically MyProgram.resources Version 0.15.3992.31638 Culture en-US PublicKeyToken null which i don t know how to resolve I ve tried to disable loading my custom assemblies from resources placed all my assembly dll s in program directory and just enabled AppDomain.CurrentDomain.AssemblyResolve but it was still asking for it . I m a bit confused about this will appreciate a lot if you can help me on this . Here s my code for interested ones .. . Answer : Answering on my own .. . .. . Adding this line to AssemblyInfo.cs solves it and resolver will not get asked for resources any-more . Though this is a work-around should be carefully considered multi-language applications . More Info : .. . .. . https : connect.microsoft.com VisualStudio feedback details 526836 wpf-appdomain-assemblyresolve-being-called-when-it-shouldnt .. . http : blogs.msdn.com b kimhamil archive 2008 11 11 what-does-the-neutralresourceslanguageattribute-do.aspx .. . http : forums.devshed.com net-development-87 c-wpf-appdomain-assemblyresolve-being-called-when-it-shouldn-t-669567.html .. . http : blogs.msdn.com b microsoft press archive 2010 02 03 jeffrey-richter-excerpt-2-from-clr-via-c-third-edition.aspx .. . .. . This approach fails for machines with non en-US cultures . A better approach is ignoring resources on assembly resolver Comment : +1 thanks a lot very helpful Comment : I read somewhere that returning null will not help in this case can you confirm Comment : The better approach worked for me . Had me sacrtching my head that for a bit . Google and straight to an SO answer . I like it .", "Question : My projects are set up like this : .. . .. . Project Definition .. . Project Implementation .. . Project Consumer .. . .. . Project Consumer references both Definition and Implementation but does not statically reference any types in Implementation . When the application starts Project Consumer calls a static method in Definition which needs to find types in Implementation .. . .. . Is there a way I can force any referenced assembly to be loaded into the App Domain without knowing the path or name and preferably without having to use a full-fledged IOC framework Comment : What kind of problem is it causing Why do you need to force the loading Comment : It s not getting loaded at all presumably because there s no static dependency Comment : How are you trying to find types in implementation Are you looking for something that implements a specific interface Comment : @Mike : Yes . I m doing AppDomain.CurrentDomain.GetAssemblies and using a linq query to recursively call GetTypes on each of them . .. . Answer : This seemed to do the trick : .. . .. . As Jon noted the ideal solution would need to recurse into the dependencies for each of the loaded assemblies but in my specific scenario I don t have to worry about it . .. . .. . Update : The Managed Extensibility Framework System.ComponentModel included in .NET 4 has much better facilities for accomplishing things like this . Comment : This doesnt work for me my referenced assemblies that isnt loaded does not show up in AppDomain.CurrentDomain.GetAssemblies . . Hmm.. . Comment : What facilities I haven t found anything via searching . Comment : Using MEF the above code can be shortened to : new DirectoryCatalog . requires referencing System.ComponentModel.Composition . Comment : This answer solved my problem and worked for me.I had a MS unit test project referencing another one of my assemblies and AppDomain.CurrentDomain.GetAssemblies was not returning that assembly when running a test . I suspect that even though my unit tests were using code from that library the assembly may not have been showing up in GetAssemblies because of the way vs.net loads up a MS unit test project class-library as compared to running a regular .exe application . Something to keep in mind if your code uses reflection and is failing your unit tests .", "Question : I m working with a third-party assembly and unfortunately I now need to load their latest and a previous version into my project so at runtime I can decide which one to load . I only ever need one not both . With this in mind I am also dependent upon the types provided by the components so I cannot load from reflection and query every time for the method events interfaces that I want to use . I have seen some mention of handling this via AppDomain s but am not sure how to proceed . Would the process be to code against one version of the component and then at run-time using the AppDomain swap in the correct DLL I want to be consumed So I would only be handling this at startup .. . Answer : If both assemblies are compatible you can define in the app.exe.config or web.config file to always use the new version by declaring bindingRedirect . example .. . .. . this config entry for dotnet 1.0 tells the asembly loader always to use version 1.0.3300.0 no matter what is compiled into the calling exe . The same is possible with newer dotnet versions", "Question : There is a package I have to deal with which installs assemblies straight into the GAC e.g . somewhere deep in windows assembly . How do I exorcise the actual assembly the DLL from the GAC into the normal file system Thanks . .. . Answer : just navigate to C : Windows find the assembly folder right-click and select add to archive .. . .. . wait a little .. . .. . vola you have an archive file containing all the assemblies in your GAC", "Question : I consuming my service stack using EXE project startup task for azure application in that I have copied following service stack s DLL some Azure s DLLs in to EXE project . dlls http : i.stack.imgur.com KSQjg.png .. . .. . When I build this EXE project then Azure DLLs will be bundled with my EXE but service stack s DLL will not be bundled with EXE because to run my EXE on any machine I need to copy all service stack s DLL manually . I have used this service stack s dll to use .. . .. . What should I have to do to bundled all these DLLs in to my EXE .. . Answer : You have several options : .. . .. . use ILMerge http : www.microsoft.com download en details.aspx displaylang en id 17630 free .. . For howto see here https : github.com Tigraine dotless blob master default.ps1 L87 and here http : research.microsoft.com en-us people mbarnett ILMerge.aspx .. . .. . OR .. . .. . use some tool like SmartAssembly http : www.red-gate.com products dotnet-development smartassembly commercial .. . it can embed and merge among other things no need to change your source code .. . .. . OR .. . .. . code that yourself in less than 10 lines http : blogs.msdn.com b microsoft press archive 2010 02 03 jeffrey-richter-excerpt-2-from-clr-via-c-third-edition.aspx free but minimal source code change .. . mark all needed dependencies as embedded-resource - this way they are included in the EXE file.. . you need to setup an AssemblyResolve http : msdn.microsoft.com en-us library system.appdomain.assemblyresolve.aspx handler which at runtime reads from Resources and returns the needed DLLs to the .NET runtime.. . Comment : Thanks for reminding me of Jeffrey Richter s solution of embedding assemblies See my answer mentioning Costura https : github.com Fody Costura for a tool that combines this with injecting the necessary code .", "Question : Let s suppose I have a Window Forms Console Application C project with some external references and references to other class-library projects in the same solution too . When I build the Window Form project I want the referenced libraries be stored in a different location eg : bin Release Libraries and not in the same folder as the .exe . Is it possible to do Comment : Are you referencing them as a file reference or a project reference Comment : with a postbuild step but you also have to change your AppDomainSetup to set the probing path for assemblies otherwise your Library dll s will never load . Have you thought of that Comment : @mellamokb both . I have references to projects in my solution and those and the WinForm too have references to external .dll files too . Comment : The main thing here is WHY you want to do this What is the benefit of having DLLs under Libraries subfolder Comment : @Petar That s what I usually do when deploying the deliverables of my applications and I think having a .exe alone with docs license file etc . is much cleaner than having the .exe file and 5-10 .dll files in the same folder in this case : deploying just ziping the files .. . Answer : You ll find best practices for organizing project references here : http : codebetter.com patricksmacchia 2009 01 11 lessons-learned-from-the-nunit-code-base .. . .. . Look under chapter The VisualStudio Project Reference + Copy Local true option is evil Comment : Quote from the referenced page : the assembly nunit.core.dll is duplicated 21 times while compiling the NUnit solution with VisualStudio It means that it has to be copied loaded parsed 21 times by the C compiler that apparently doesn t come with a cache hashCode optimization for such a case . but also And indeed the code of NUnit is pretty well layered . This is the result-of the initial decision to create plenty of assemblies . So basically having plenty of assemblies guides towards better code at the expense of compile-time . Not such a bad deal .", "Question : I ve got a diagnostics page in my ASP.NET application which does things like verify the database-connection s display the current appSettings and ConnectionStrings etc . A section of this page displays the Assembly versions of important types used throughout but I could not figure out how to effectively show the versions of ALL of the loaded assemblies . What is the most effective way to figure out all currently referenced and or loaded Assemblies in a .NET application .. . .. . Note : I m not interested in file-based methods like iterating through .dll in a particular directory . I am interested in what the application is actually using right now . .. . Answer : Getting loaded assemblies for the current AppDomain : .. . .. . Getting the assemblies referenced by another assembly : .. . .. . Note that if assembly A references assembly B and assembly A is loaded that does not imply that assembly B is also loaded . Assembly B will only be loaded if and when it is needed . For that reason GetReferencedAssemblies returns AssemblyName instances rather than Assembly instances . Comment : Well I need something like this - given a .net solution I want to find out all the referenced assemblies in all the projects . Ideas Comment : Please note that both methods only list dll s that are actually used . Obviously it makes no sense to have references in solutions that are not used but this might be confusing when someone is trying to speculatively scan through ALL assemblies . All assemblies might just not show up . Comment : @Kumar Vaibhav I ve added an answer which does just that .", "Question : today I d like to know how do you configure your projects in C WPF which references additional assemblies in a chain . By the in a chain I mean something like this : .. . .. . we have application which refers to assembly Plugin .. . Plugin assembly refers Resources where resources used by Plugin are located eg . images .. . main application does not refers to Resource in any way . The following image illustrates what I ve just said : .. . Chain-referenced assemblies http : i.stack.imgur.com E2JXk.png .. . .. . The problem is that Resources is not copied to the bin folder of the application causing Plugin Ctrl on the image resources it requires finding failure . Workaround .. . .. . There are workarounds for it which are simply to include Resources to references of the main application or use a post-build step and manually copy required files in that step . Conclusion .. . .. . Concluding I d like to ask how do you deal with that problem . Are the any other solutions besides those I mentioned in workaround section Am I missing something in the projects configuration .. . Answer : If you load the plugin dynamically from a different folder than the EXE you can also copy its dependencies to the same folder as the plugin and load those assemblies dynamically as well . You then need to handle AssemblyResolve so that the already-loaded assemblies will be resolved instead of trying to find new assemblies : .. . .. . The code above does a version and strong-naming insensitive match you can implement your own policy here if you want something stricter . Comment : Thanks for that answer but the question is not about dependencies loaded dynamically from code but the Add reference.. . option in a project s context menu in MSVS", "Question : If you create a class-library that uses things from other assemblies is it possible to embed those other assemblies inside the class-library as some kind of resource I.e . instead of having MyAssembly.dll SomeAssembly1.dll and SomeAssembly2.dll sitting on the file system those other two files get bundled in to MyAssembly.dll and are usable in its code . .. . .. . I m also a little confused about why .NET assemblies are .dll files . Didn t this format exist before .NET Are all .NET assemblies DLLs but not all DLLs are .NET assemblies Why do they use the same file-format and or file extension .. . Answer : Note ILMerge doesn t work with embedded resources like XAML so WPF apps etc will need to use Cheeso s method ." ] }
[ "yes-answer-long", "yes-answer-short" ]
.net
UNK_RELATION
libsodium@networking@105
libsodium -- sodium is a portable cross-compilable installable packageable fork of the nacl cryptograpy @placeholder library with a compatible api .
{ "confidence": [ 38.79729080200195, 33.939483642578125, 32.43510818481445, 31.651573181152344, 31.081087112426758, 30.64788055419922, 30.45883560180664, 30.37677764892578, 30.327194213867188, 29.43280792236328, 29.407699584960938, 29.37298583984375, 28.34457015991211, 28.116539001464844, 27.867034912109375, 27.78807830810547, 27.528470993041992, 27.528470993041992, 27.49350357055664, 27.46602439880371, 27.3673038482666, 27.105491638183594, 26.95932960510254, 26.790395736694336, 26.45553970336914, 26.45553970336914, 26.06838607788086, 26.06838607788086, 25.955284118652344, 25.718215942382812, 25.4376163482666, 25.4376163482666, 25.4376163482666, 25.35546112060547, 25.264686584472656, 25.062702178955078, 25.06088638305664, 25.036266326904297, 24.940637588500977, 24.917293548583984, 24.87393569946289, 24.861045837402344, 24.78766632080078, 24.78766632080078, 24.78766632080078, 24.78766632080078, 24.78766632080078, 24.721012115478516, 24.670148849487305, 24.61768341064453, 24.6043643951416, 24.535308837890625, 24.340373992919922, 24.331140518188477, 24.331140518188477, 24.331140518188477, 24.147624969482422, 24.052061080932617, 24.052061080932617, 24.052061080932617, 23.933032989501953, 23.83416175842285, 23.75457000732422, 23.75457000732422, 23.75457000732422, 23.681190490722656, 23.681190490722656, 23.588226318359375, 23.588226318359375, 23.394630432128906, 23.20606231689453, 23.20606231689453, 23.20606231689453, 23.20606231689453, 23.20606231689453, 23.00499725341797, 22.945585250854492, 22.945585250854492, 22.945585250854492, 22.945585250854492, 22.945585250854492, 22.867435455322266, 22.74352264404297, 22.74352264404297, 22.74352264404297, 22.74352264404297, 22.42842674255371, 22.42842674255371, 22.369449615478516, 22.369449615478516, 22.360286712646484, 22.35504913330078, 22.35504913330078, 22.35504913330078, 22.35504913330078, 22.18506622314453, 22.099586486816406, 22.099586486816406, 22.099586486816406, 22.099586486816406 ], "content": [ "As below : .. . .. . var sodium require libsodium-wrappers .. . .. . This was no good .", "I m having problems opening a Nacl SecretBox generated in java using the TweetNaclFast library in C using the libsodium-net library .", "I want to cross-compile the libsodium cryptography library for use on iOS .", "Alternatively pre-built libraries are available in the Swift bindings https : github.com jedisct1 swift-sodium blob master Sodium libsodium-ios.a .", ". configure --with-libsodium as per this page https : github.com zeromq libzmq issues 912 reports libsodium is not installed .. . .. . . configure --with-libsodium home eng work libsodium-master --with-libsodium-include-dir home eng work libsodium-master src libsodium include --with-libsodium-lib-dir usr lib64 reports libsodium is not installed .", "Also node implementation of sodium when using crypto secretbox and crypto secretbox open restricts the secretkey to be 32 bytes long based on the code in . node-modules sodium deps libsodium src libsodium crypto stream salsa20 ref xor salsa20 ref.c PHP s implementation doesn t seem to have this restriction .", "For this I use the libsodium encryption library .", "I ve also installed Halite from Paragonie which couldn t even be installable if the libsodium extension were not installed correctly .", "The first prebuilt library A is libsodium .", "I looked at all the code in github.com paixaop node-sodium https : github.com paixaop node-sodium and in my node-modules sodium .", "I imagine that the default primitive can change in new versions of Sodium otherwise libsodium wouldn t expose a way to choose a particular one I think .", "I can use libsodium 1.0.7 just fine in Ubuntu but there seems to be some issue when trying to cross-compile the libsodium library to an armv5 architecture armv5tejl-unknown-linux-gnueabihf .", "no the libsodium", "I found this library libsodium https : github.com jedisct1 libsodium but I think it needs to be used with NDK .", "I m trying to install libsodium following this guide https : paragonie.com book pecl-libsodium read 00-intro.md installing-libsodium .", "I am trying to utilize the libsodium library in an android-studio project .", "As for libsodium : it is a library that works with MinGW and VisualStudio in Windows .", "I compiled libsodium with scripts that can be found in the library .", "I want to create an Eclipse project of the NaCl cryptographic library .", "I am trying to use the lib-sodium cryptography library in Visual Studio 2015 .", "Is there a way to extract the curve parameters when working with elliptic curves in libsodium", "Solution .. . .. . In order to get this working installing libsodium via YUM did not give a version of libsodium viable for a zeromq build .", "The second prebuilt library B is a Rust library that depends on libsodium .", "I m trying to integrate libsodium https : github.com jedisct1 libsodium library on Android project .", "configure : WARNING : unrecognized options : --with-libsodium-lib-dir", "Using Delphi 10 Seattle libSodium 1.0.10 .", "Are you actually using secretbox easy with Node-Sodium and not secretbox", "The good news is that Node-Sodium also provides secretbox easy .", "I m trying to install the libsodium extension .", "I followed the libsodium instructions .", "I have been struggling to encrypt decrypt some data using crypto secretbox easy in libsodium https : github.com jedisct1 libsodium .", "And I have tried C : Windows Microsoft.NET assembly GAC 32 libsodium and C : Windows Microsoft.NET assembly GAC 64 libsodium .", "I m compiling a git repository that requires libsodium and compiling exits with an error that libsodium is not found .", "When compiling the Rust prebuilt library libsodium is used as a dependency .", "The test secretbox easy2.c file in the sodium source code shows how to use it : .. . .. . In order to derive a key from a password sodium provides crypto pwhash scryptsalsa208sha256 .", "libsodium https : github.com jedisct1 libsodium-php from PECL .. . 3 .", "This is simply Objective C classes and memory-management design questions and not NaCL library .", "THe data exchanged between them is encrypted crypto secretbox decrypted crypto secretbox open using libsodium easy api implementations of PHP Node respectively .", "In order to use Halite 2.x you need to have : .. . .. . Libsodium 1.0.9+ preferably 1.0.10 if you have trouble compiling .9 .. . PECL Libsodium 1.0.3+ preferably 1.0.6 compiled against libsodium 1.0.9+ .", "I recently found the library Libsodium https : github.com jedisct1 libsodium and was glad that there are also Bindings for Java http : doc.libsodium.org bindings for other languages README.html .", "It needed a real build of libsodium which in turn required a recent copy of autoconf .", "Also I checked it with phpinfo it says that libsodium support is enabled but library version is only 1.0.5 while compiled version is 1.0.6", "I added libsodium-net via NuGet .", "Is it possible to encrypt AES-128-ECB with libsodium", "libsodium intentionally doesn t support the ECB mode .", "Or does libsodium-net obviate the need for salts", "You probably need php-pecl-libsodium .", "Compatible functions have been added https : github.com bitbeans libsodium-net commit 0d718a4c4d2d1f148a081864496fff7620245956 .", "I have the library downloaded from the libsodium website but do not understand how to create the library files necessary for an android-studio project .", "I am not a crypto expert which is why I m using a library like NaCl .", "The githut repository is located at Nacl Github https : github.com jeremywohl nacl and the project installation details are available at Nacl Install http : nacl.cr.yp.to install.html .. . .. . I am completely new to this and hence have no idea .", "My nim version is : Nim Compiler Version 0.12.0 2015-12-15 Windows : i386 .. . .. . I tried to build libsodium https : github.com jedisct1 libsodium with this nim wrapper https : github.com judofyr sodium.nim I ve compiled libsodium with VS2013 - Release Win32 .. . .. . I see the libsodium.lib i ve placed the nim wrapper next to it .", "For the current version of Sodium signatures are made using the Ed25519 algorithm .", "If for some reason you wish to build it WITHOUT libsodium and you have it built and installed configure libzmq with --without-libsodium .", "EDIT : .. . .. . I am trying to work with pysodium it has a dependency on libsodium .. . .. . I have downloaded libsodium but i m new to python.. .", "here is doc paragonie.com book pecl-libsodium https : paragonie.com book pecl-libsodium", "I m using Qt Creator 3.3.1 Qt 5.4.1 MSVC 2010 32-bit .. . libsodium : https : download.libsodium.org libsodium releases libsodium-1.0.2-msvc.zip", "I used this guide https : paragonie.com book pecl-libsodium read 00-intro.md installing-libsodium and many others but still no luck .", "To install it go here https : download.libsodium.org libsodium releases and download the latest version named libsodium-x.x.x-mingw.tar.gz where x.x.x is the version number .", "For pkg-config to find libsodium you need to copy libsodium.pc from libsodium-win64 lib pkgconfig or win32 to somewhere pkg-config will look .", "Now in the libsodium documentation on secure memory http : doc.libsodium.org helpers memory management.html it says : .. . .. . The returned address will not be aligned if the allocation size is not a multiple of the required alignment .", "Make sure you restart your webserver after installing PECL libsodium .. . .. . .. . here is good references : https : paragonie.com book pecl-libsodium read 00-intro.md installing-libsodium", "Libsodium is a well regarded library AES Advanced Encryption Standard is a well secure encryption algorithm they are not the same kind of thing .", "I m using libsodium library for encryption in browser extensions chrome and safari for encrypting data retrieved from webpages .", "To summarize it appears : Libsodium library looks for JQuery AMD definitions before intializing its code .", "Here is an extract from the libsodium-php extension :", "I have a program that needs to execute a libsodium encryption .", "therefore my question is thus : how do i either set the locations for zeromq s configure to look for libsodium to spot whether with --with-libsodium --with-libsodium-include-dir and --with-libsodium-lib-dir or have them installed in a location that msys2 s shell is able to find", "From the libsodium-php Github page https : github.com jedisct1 libsodium-php you will find a direct link-to a free online book https : paragonie.com book pecl-libsodium that covers everything you need to know to get started with libsodium .", "You re completely right here are the includes : include stdio.h include stdlib.h include string.h include sodium.h The same simple source compiles and executes in the host machine Ubuntu 15 with sodium built for Ubuntu but not in the target ARMv5 system with the sodium library files built for the ARMv5 system", "The answer is in the documentation https : bitbeans.gitbooks.io libsodium-net content password hashing index.html .", "Is there a step-by-step guide to installing libsodium for my Rust setup", "It is my understanding that I need to install libsodium first then the extension .", "Have you first done yum install libsodium-devel", "php54-php-pecl-libsodium is a SCL package for parallel installation .", "This is actually an inconsistency in libsodium-net https : github.com adamcaudill libsodium-net issues 133 .", "There are many ports for many languages : C https : github.com adamcaudill libsodium-net PHP https : github.com jedisct1 libsodium-php .. . .. . .. . and there is always an example with bob and alice .", "I ve found this implementation on github https : github.com mdp gibberish-libsodium gibberish-libsodium and I m using it as a base for my development but is not working .", "In order to change that you should rename libsodium-android-arm to libsodium-android-armeabi and change TARGET ARCH by TARGET ARCH ABI inside jni Android.mk .", "The final chapter contains libsodium recipes https : paragonie.com book pecl-libsodium read 09-recipes.md but each chapter contains detailed usage information .", "Found some documentation on libsodium about using libsodium wrapper if AMD https : github.com jedisct1 libsodium.js files 1 import is present .", "The libsodium documentation refers to an authentication tag which is explained in a different chapter https : download.libsodium.org libsodium content secret-key cryptography authenticated encryption.html in the following section : .. . .. . So what libsodium calls authentication tag is equivalent to the more common terminology of signing a message .", "I m using libsodium with the python bindings in pysodium 0.6.6 .. . .. . When using crypto box and crypto box open I always get a ValueError .", "However I am unable to find in the documentation wether libsodium signs the message directly or creates a hash first .", "But next time I ran the make check the CURVE test is skipped again reporting no libsodium .", "Looking at the tests I see test security curve.cpp has ifndef HAVE LIBSODIUM and that preprocessor definition appears to be driving the no libsodium skip .", "Please make sure your Qt and libsodium library are built with the same version of compiler MSVC 2010 or 2013 .", "Then I link the libsodium header-files directory path to additional dependencies and libsodium.lib to additional library directories .", "Since your name appears on the license page of libsodium https : github.com jedisct1 libsodium blob master LICENSE I ll assume you know what you are talking about .", "Looking at for example the libsodium extension docs https : paragonie.com book pecl-libsodium I would think we would have to use the same nonce every time we encrypt a person s id .", "Sodium.SecretBox.Create uses the original NaCl crypto box API which requires extra padding before the message and the ciphertext .", "You should drop the cryptography and libsodium tags .", "In general you ll want libsodium if security is your goal .", "You re probably compiling libsodium in a static way .", "Using libsodium v1.0.3 solved my problems", "I try to find out what s the right way to use the NaCl library in Objective-C . Keygeneration seems easy : .. . .. . That was easy .", "Libsodium does not provide any direct key exchange methods .", ".. . .. . So I m having problems building making zeromq with libsodium .", "cd .. . libsodium is just a placeholder to indicate which folder im in", "I am trying to work with pysodium it has a dependency on libsodium" ] }
{ "confidence": [ 50.09904479980469, 48.786346435546875, 48.17326736450195, 48.021095275878906, 46.06627655029297, 43.87873840332031, 42.80675506591797, 42.60206604003906, 40.69769287109375, 40.52396774291992, 40.45539093017578, 38.738895416259766, 38.16542053222656, 36.750213623046875, 34.72237014770508, 34.6958122253418, 33.00432205200195, 31.872528076171875, 31.474428176879883, 31.410757064819336 ], "content": [ "Question : I want to cross-compile the libsodium cryptography library for use on iOS . Specifically I want to compile it for armv7 armv7s and arm64 so that it works for older as well as newer iPhones . I followed the instructions on the libsodium website https : download.libsodium.org doc installation index.html to cross-compile it and ran the configure script like this : .. . .. . and the same for armv7s-apple-darwin and armv8-apple-darwin which is the same as arm64 I think hope since arm64 wasn t supported . Then I did make install which succeeded without errors . However if I then inspected the created static library : .. . .. . it tells me : .. . .. . for all of these . Why is this static library targeted towards x86-64 architectures while I targeted the armv7 armv7s armv8 architectures Am I doing something wrong .. . Answer : Just use the build script available in the source repository https : github.com jedisct1 libsodium blob master dist-build ios.sh . Alternatively pre-built libraries are available in the Swift bindings https : github.com jedisct1 swift-sodium blob master Sodium libsodium-ios.a .", "Question : I m having problems opening a Nacl SecretBox generated in java using the TweetNaclFast library in C using the libsodium-net library . I also can t do it the other way around open a libsodium-net generated box using TweetNaclFast . In the following example i ll create a SecretBox using TweetNaclFast Java and try to open it with libsodium-net C .. . .. . Creating the SecretBox Java .. . .. . Creation Output .. . .. . Opening the SecretBox C .. . .. . Open Output .. . .. . Any idea about what i might be doing wrong .. . .. . EDIT .. . .. . I guess the problem is with one of the libraries libsodium-net most likely . If i create a SecretBox with the same variables i get a different box.. . .. . .. . Creating a Secret Box with TweetNaclFast .. . .. . RETURNS : yDCt kOLFUWPZpV3deVNUZaH0ZHLVmj9Nvm8QlbVKPe1a INDw .. . .. . Creating a Secret Box with libsodium-net .. . .. . RETURNS : AAAAAAAAAAAAAAAAAAAAAMgwrf5DixVFj2aVd3XlTVGWh9GRy1Zo Tb5vEJW1Sj3tWvyDQ8 .. . Answer : Sodium.SecretBox.Create uses the original NaCl crypto box API which requires extra padding before the message and the ciphertext . This API is a bit confusing and is rarely useful except in C . Even in C people using it end up writing wrappers to prepend or get rid of the padding . The box and secretbox constructions as exposed by most APIs do not require extra padding . The ciphertext is directly returned without 16 extra bytes before . The message can be directly given without prepending 16 nul bytes . TweetNaclFast does not require any padding but libsodium-net apparently does . The extra 16 bytes before the ciphertext you are observing with libsodium-net do not contain any useful information . It s just a bunch of zeros . You can safely strip them and add them later when calling Sodium.SecretBox.Open . Note that unlike Sodium.SecretBox Sodium.PublicKeyBox doesn t require padding . Comment : That s exactly what i ve found . Thanks for the explanation : Comment : This is actually an inconsistency in libsodium-net https : github.com adamcaudill libsodium-net issues 133 . Compatible functions have been added https : github.com bitbeans libsodium-net commit 0d718a4c4d2d1f148a081864496fff7620245956 . Comment : You rock @Frank Denis", "Question : null .. . Answer : I can use libsodium 1.0.7 just fine in Ubuntu but there seems to be some issue when trying to cross-compile the libsodium library to an armv5 architecture armv5tejl-unknown-linux-gnueabihf . I have used . configure --host armv5tejl-unknown-linux-gnueabihf and then make DESTDIR home myself ARM . All files are generated fine headers and static shared library files and I can compile and link a small test C-program which then generates a segmentation-fault when it s executed on my ARMv5 target toolchain and all is fine everything else I compile link not using libsodium runs perfectly fine on my ARM machine : .. . .. . I have also tried the official cross-compile for ARM instructions at https : download.libsodium.org doc installation index.html but configure fails due to a missing nosys.specs file . Is there somewhere I can download this I have goggled it and it seems that it has to be specifically generated for the libsodium package Comment : Just to be sure you should show the include s as well so to make your example self-contained . Maybe the problem is there Comment : Hi You re completely right here are the includes : include stdio.h include stdlib.h include string.h include sodium.h The same simple source compiles and executes in the host machine Ubuntu 15 with sodium built for Ubuntu but not in the target ARMv5 system with the sodium library files built for the ARMv5 system Comment : Please edit your question instead of posting the code as comments . Comment : Sorry bout that . Though I was just making a normal reply . Comment : How did you come about armv5tejl-unknown-linux-gnueabihf being the correct option for your target", "Question : null .. . Answer : I m using libsodium library for encryption in browser extensions chrome and safari for encrypting data retrieved from webpages . I m also using it in iOS wkWebView browser which works fine for most of the web apps . All I had to do was grab the sodium.js file from https : github.com jedisct1 libsodium.js tree master dist browsers combined .. . .. . Add it to the project and start using it not going into the details of how js file is injected into webview or extensions . e.g . This works fine for extensions and mostly on iOS as well . But for some of the web apps on iOS webview started running into the following problem : .. . .. . The export sodium was not defined . On further debugging into the sodium.js code found that the failure is because sodium code checks if the function define is present and if so calls into that function with its own factory parameter . Check code snippet from sodium.js : .. . .. . This is the case which fails to initialize sodium export . Looks like the function define is part of JQuery which is likely defined by the active web app in webview . A success scenario would be that define is not present and it directly calls into the factory function at the end which initializes the sodium export properly . To summarize it appears : Libsodium library looks for JQuery AMD definitions before intializing its code . And if it finds it calls into the JQuery define to initialize its code . Somehow relying on existence of JQuery does not go well . Guess the first question which pops up : .. . .. . Can we have libsodium not rely on JQuery even if it exist . didn t find anything . Found some documentation on libsodium about using libsodium wrapper if AMD https : github.com jedisct1 libsodium.js files 1 import is present . As below : .. . .. . var sodium require libsodium-wrappers .. . .. . This was no good . This caused exception : that the library or its dependency could not be loaded . Any suggestions pointers would be welcome to get this to work . Thanks .", "Question : I have a PHP REST Gateway server . The client is a node.js server . THe data exchanged between them is encrypted crypto secretbox decrypted crypto secretbox open using libsodium easy api implementations of PHP Node respectively . Encrypted data in PHP doesn t have the 16 byte Zeros at the beginning salt where as the encrypted data in node.js has the 16 byte zeros . To decrypt on node of the data encrypted in PHP I have to prepend 16 bytes of zeros salt before calling the secretBox.decrypt . To decrypt on PHP of the data encrypted in node I have to first remove the 16 bytes of zeros before calling the Sodium crypto secretbox open . The question : Is this the best possible approach or I am missing something very obvious Comment : Its unclear what your question is . You have clearly found the solution to the differences in both implementations Comment : Hi . I did but I feel that it is a hack . I am hoping that someone would tell me that this is how you do it you hack : .. . Answer : Are you actually using secretbox easy with Node-Sodium and not secretbox secretbox requires extra bytes to be prepended stripped . It is only available for backward compatibility it doesn t really make sense to use this in except in C but for some reason Node-Sodium provides it . The PHP bindings don t require these extra bytes . Like most other bindings secretbox is actually secretbox easy under the hood . The good news is that Node-Sodium also provides secretbox easy . You just need to explicitly call it secretbox easy . No more padding required . Comment : Thanks . I will try it out and let you know . Comment : Hi Frank . I looked at all the code in github.com paixaop node-sodium https : github.com paixaop node-sodium and in my node-modules sodium . I can t find an API that I can call to pass in just the secretkey encryption other than the secretbox . The rest of them all want public private key pair . My Encryption Decryption is based on the secretkey as opposed to Public Private key . Please advise . Comment : Also node implementation of sodium when using crypto secretbox and crypto secretbox open restricts the secretkey to be 32 bytes long based on the code in . node-modules sodium deps libsodium src libsodium crypto stream salsa20 ref xor salsa20 ref.c PHP s implementation doesn t seem to have this restriction .", "Question : null .. . Answer : I m planning on storing a bunch of records in a file where each record is then signed with libsodium https : libsodium.org . However I would like future versions of my program to be able to check signatures the current version has made and ideally vice-versa . For the current version of Sodium signatures are made using the Ed25519 algorithm . I imagine that the default primitive can change in new versions of Sodium otherwise libsodium wouldn t expose a way to choose a particular one I think . Should I.. . .. . .. . 1 . Always use the default primitive i.e . crypto sign .. . 2 . Use a specific primitive i.e . crypto sign ed25519 .. . 3 . Do 1 but store the value of sodium library version major in the file either in a dedicated sodium version field or a general file-format revision field and quit if the currently running version is lower .. . 4 . Do 3 but also store crypto sign primitive .. . 5 . Do 4 but also store crypto sign bytes and friends .. . .. . ...or should I do something else entirely My program will be written in C . Comment : Else entirely . Whenever you update your library ensure compatibility or update your data encryption Yeah mean decrypt with the old encrypt with the new . The option is to stick with the old version . Not that I think libsodium dev s will turn algorithm s incompatible without a any head s up though . Comment : I m not sure I follow . When you say update the data encryption do you mean re-signing the old records with the new algorithm I m afraid that won t work as I as the dev don t have access to users private keys . These users and their keys might even be long gone when if libsodium changes the algorithm in the future .", "Question : I try to find out what s the right way to use the NaCl library in Objective-C . Keygeneration seems easy : .. . .. . That was easy . But with the crypto box c m mlen n pk sk function I get mixed up with padding ZEROBYTES and how to manage object ownership . How to build a simple Wrapper for crypto box c m mlen n pk sk and friends Comment : You are requesting code without showing what you tried yourself . But as it is only one method I guess we can turn a blind eye . Comment : Sure . I think C is not the language to try mixing pointers and casts until it compiles . PErhaps I just don t have the intellectual tools for researching it myself . In a dynamic language with introspection I would have experimented with the code until it returned something . But in C with crypto code I feel this is the wrong approach ... . Comment : This is not an easy question for me to answer unfortunately I have voted up but that s about all I can do . You may want to put a bounty on it if you want it resolved . Comment : You should drop the cryptography and libsodium tags . This is simply Objective C classes and memory-management design questions and not NaCL library . Use the spare tag to bring in more Objective C folks with the iPhone tag . With that said you might see some votes to close because your design questions are too high level . .. . Answer : One option is Sodium-Objc https : github.com Tabbedout SodiumObjc . These bindings haven t been updated for a while but they remain pretty good and make it really easy to use crypto box in Objective-C . .. . .. . Another option is Swift-Sodium https : github.com jedisct1 swift-sodium that is more complete . It was written in Swift but calling Objective-C from Swift should be easy enough . But if you want to go low-level and directly call the C functions you actually don t have to worry about padding . Just use the easy interface http : doc.libsodium.org public-key cryptography authenticated encryption.html : crypto box easy and crypto box open easy . crypto box easy puts the authenticator crypto box MACBYTES bytes long immediately followed by the encrypted message . No extra padding is required . And crypto box open easy decrypts the message without requiring extra padding or having to move bytes around .", "Question : I have been struggling to encrypt decrypt some data using crypto secretbox easy in libsodium https : github.com jedisct1 libsodium . I can t seem to find any good documentation on the usage . I want to get a password from the user use that to somehow make a key then encrypt decrypt the data using that . The problem with the toy code that I have posted below is that the crypto secretbox open easy returns -1 from within verify 16.c . Does anyone have any idea where I could find source showing how to use this interface or what could be going wrong Thanks .. . Answer : The test secretbox easy2.c file in the sodium source code shows how to use it : .. . .. . In order to derive a key from a password sodium provides crypto pwhash scryptsalsa208sha256 .", "Question : I installed Libsodium-net through NuGet and am able to include Sodium in my classes but when I try to run it I get .. . .. . An exception of type System.DllNotFoundException occurred in Sodium.dll but was not handled in user code .. . .. . Additional information : Unable to load DLL libsodium.dll : The specified module could not be found . Exception from HRESULT : 0x8007007E .. . .. . I am just trying to run the sample code from the gitbooks documentation https : bitbeans.gitbooks.io libsodium-net content password hashing index.html .. . Answer : I had the same problem and solved it using J rn Wildt s answer given here http : stackoverflow.com questions 28275944 how-to-include-libsodium-net-on-asp-net . It turns out that ASP.NET doesn t make shadow copies of unmanaged DLLs such as libsodium.dll and libsodium-64.dll . .. . Sodium.dll the managed code tries to load the DLLs from either the same directory as the shadow-copy of Sodium.dll which is not going to work - or some where-in the PATH environment variable s directories . .. . My solution was to add the AppDomain Bin directory to the path before calling any Sodium code : .. . .. . .. . string path Environment.GetEnvironmentVariable PATH .. . string binDir Path.Combine AppDomain.CurrentDomain.BaseDirectory Bin .. . Environment.SetEnvironmentVariable PATH path + + binDir .. . .. . .. . As Reuben commented on the answer I added the above code in my Application Start method of my Global.asax .", "Question : I m having problems opening a Nacl SecretBox generated in java using the TweetNaclFast library in C using the libsodium-net library . I also can t do it the other way around open a libsodium-net generated box using TweetNaclFast . In the following example i ll create a SecretBox using TweetNaclFast Java and try to open it with libsodium-net C .. . .. . Creating the SecretBox Java .. . .. . Creation Output .. . .. . Opening the SecretBox C .. . .. . Open Output .. . .. . Any idea about what i might be doing wrong .. . .. . EDIT .. . .. . I guess the problem is with one of the libraries libsodium-net most likely . If i create a SecretBox with the same variables i get a different box.. . .. . .. . Creating a Secret Box with TweetNaclFast .. . .. . RETURNS : yDCt kOLFUWPZpV3deVNUZaH0ZHLVmj9Nvm8QlbVKPe1a INDw .. . .. . Creating a Secret Box with libsodium-net .. . .. . RETURNS : AAAAAAAAAAAAAAAAAAAAAMgwrf5DixVFj2aVd3XlTVGWh9GRy1Zo Tb5vEJW1Sj3tWvyDQ8 .. . Answer : I should have read the documentation RTFM .. . Apparently libsodium-net adds a 16byte authentication tag on the start of the ciphertext https : bitbeans.gitbooks.io libsodium-net content secret-key cryptography authenticated encryption.html . If i remove the first 16 bytes i get the same output as the TweetNaclFast SecretBox . now returns : yDCt kOLFUWPZpV3deVNUZaH0ZHLVmj9Nvm8QlbVKPe1a INDw .. . .. . .. . .. . To open decrypt the first example s secret box use the following code : .. . .. . It should now return Hello Stack overflow", "Question : n.b . I am not a crypto expert which is why I m using a library like NaCl . From what I have read on the subject the most secure way to store user passwords in a database is to store the hash and the salt used to generate that hash . I decided to use libsodium-net for this purpose but now I m left with the question in the subject : do I not need to generate and store salts I ask because libsodium-net includes these functions : .. . .. . There doesn t appear to be a need to use a salt when either generating or verifying the hash . In fact there are no overloaded methods of ScryptHashString and ScryptHashStringVerify that accept a salt . I feel like I m missing something obvious here . Am I Or does libsodium-net obviate the need for salts .. . Answer : The answer is in the documentation https : bitbeans.gitbooks.io libsodium-net content password hashing index.html . The string returned from PasswordHash.ScriptHashString password contains the salt and a couple other parameters so there s no need to store a salt separately . Comment : is correct . You don t need to store the salt nor the other parameters max memory max ops . Everything is already stored in the returned string . The salt itself is automatically generated by ScryptHashString .", "Question : I ve installed libsodium on Windows for PHP 7 and I m developing my project with PHPStorm . I ve also installed Halite from Paragonie which couldn t even be installable if the libsodium extension were not installed correctly . Also the IDE finds the used functions and when clicking on the variables and so on it opens up the fitting files of libsodium . But unfortunately in my setup I get the following error : .. . .. . My index.php file looks like the following : .. . .. . I m also submitting my form with Jquery which leads successfully to the execution of the following function which doesn t find the libsodium functions variables : .. . .. . I ve installed the php libsodium.dll in the extension directory and put the libsodium.dll in in the directory of the php server . Just for trying out i put it later also in system32 directory and in Syswow64 directory - both didn t change anything . I just installed the halite library from paragonie with composer but using it is unfortunately harder than I thought . I also tried to use the libsodium extension without Halite but that lead to similar errors that the needed classes constants and functions and so on were not found . I ve also tried to change my autoloader but the strange thing anyway is that the IDE finds everything without problems but executing the script in the browser just don t . Comment : 1 Did you enable the extension in php.ini and 2 did you restart your web server Comment : yes to both . I just thought a little bit about it : could it be a version problem because I ve installed version 1.0.6 of libsodium but there also exists version 1.0.10 . I didn t compiled it myself but used pre-compiled dll-files for windows . Also I checked it with phpinfo it says that libsodium support is enabled but library version is only 1.0.5 while compiled version is 1.0.6 .. . Answer : In order to use Halite 2.x you need to have : .. . .. . Libsodium 1.0.9+ preferably 1.0.10 if you have trouble compiling .9 .. . PECL Libsodium 1.0.3+ preferably 1.0.6 compiled against libsodium 1.0.9+ . The easy way to verify that this is set up is : .. . .. . If you want a little more specific information on what s failing just run this instead : .. . .. . Most likely you ll need to uninstall reinstall the PHP extension compiled against a newer version of the shared library . There s an RFC under discussion for PHP 7.1 right now https : wiki.php.net rfc libsodium that will make this painless in the future if accepted . Comment : that s a helpful answer since the verification returns false . Thank you .", "Question : I have a program that needs to execute a libsodium encryption . I found this library libsodium https : github.com jedisct1 libsodium but I think it needs to be used with NDK . And so I started to read tutorials about NDK but I still don t know where to start on using this library . If someone could give a hint or very useful stuff to give an idea on how to integrate this library I would be so happy . Thanks .. . Answer : To integrate libsodium into your Android app you need : .. . .. . The libsodium library compiled for your Android platform s .. . A JNI binding like kalium-jni https : github.com joshjdevl kalium-jni .. . .. . If you trust random people on the Internet which you should not download this tarball http : op-co.de tmp kalium-jni-2015-02-24.tar.gz and extract it into your project source . Otherwise follow the instructions below to compile it yourself . libsodium .. . .. . You need a Linux box VM with Android NDK to compile the libsodium shared-libraries and it seems like you need the current git master branch to compile it with the NDK . Once you checked it out compile the Android library code for ARM ARMv7 and x86 : .. . .. . kalium-jni .. . .. . To compile kalium you will need SWIG http : www.swig.org installed . Then you need to generate the SWIG C wrapper compile the libkaliumjni native-code for your target-platform s install it into your app libs directory and include the JAR . In the kalium-jni jni sub-directory create the SWIG wrapper and the native libkaliumjni.so for your host it will be needed for testing the JAR : .. . .. . Afterwards modify jni Android.mk and replace installs with wherever you have compiled libsodium and TARGET ARCH with TARGET ARCH ABI then run in the kalium-jni directory : .. . .. . Now the libs directory contains the native kalium libraries . Copy it into your Android project . Finally you need to compile the kalium JAR : .. . .. . It should end up in .m2 repository org abstractj kalium kalium-jni 1.0.0-SNAPSHOT kalium-jni-1.0.0-SNAPSHOT.jar . Copy that to your libs directory as well . It is accompanied by javadoc and sources JARs which you can add into Eclipse to get the references . Comment : Your armv7 sodium build isn t going to be picked the armv5 will be used for armv5 and armv7 builds . In order to change that you should rename libsodium-android-arm to libsodium-android-armeabi and change TARGET ARCH by TARGET ARCH ABI inside jni Android.mk . Also you can add easily x86 to the list of supported platforms : . dist-build android-x86.sh ln -s libsodium-android-i686 libsodium-android-x86 and ndk-build APP ABI armeabi armeabi-v7a x86 Comment : Thanks @ph0b I ve updated the instructions and added a new tarball with x86 .so and hopefully fixed arm7 build Comment : I followed the libsodium instructions . Now after running the do the job.sh script I end up with the .so files . How can I now get the .jar Because now I don t know how to use the library . Comment : It s now published as an AAR : github.com GerardSoleCa Robosodium releases https : github.com GerardSoleCa Robosodium releases", "Question : I try the following code to see if the library sodium can be located .. . .. . This always returns none .. . .. . Please how do I add external libraries dependencies and reference them correctly in my python code . EDIT : .. . .. . I am trying to work with pysodium it has a dependency on libsodium .. . .. . I have downloaded libsodium but i m new to python.. . I m actually using PTVS 2.1 to get up to speed running python in my familiar dev environment . .. . Answer : If I understood you correctly . What you want is to import a library . Put the pysodium directory under the script you want to use and then simply do .. . .. . It is as simple as that . Usually what you do is install the libraries on your system or in a virtualenv and import them to your python script . Cloning the repository will not generally help unless the libraries you want to import are in the same directory as the script you re importing from . I personally would recommend using virtualenv and pip together hand in hand . Read up on virtualenv it will come very handy . Assuming you have both virtualenv and pip all you need to do is the following .. . .. . This should create a virtualenv container activate it and install pysodium inside . Your script will only work when the virtualenv is activated . You can deactivate it using the command deactivate . Comment : I am trying to work with pysodium it has a dependency on libsodium Comment : This is a bad way to do things but it should work if you try it . Comment : i dont understand how you mean bad way Comment : It is generally a bad way to clone a library and put it inside your working directory to use it . The better way to go about doing it is as I suggested using virtualenv and pip together . Comment : oh let me clarify the library i m trying to load is not a python lib", "Question : I try to find out what s the right way to use the NaCl library in Objective-C . Keygeneration seems easy : .. . .. . That was easy . But with the crypto box c m mlen n pk sk function I get mixed up with padding ZEROBYTES and how to manage object ownership . How to build a simple Wrapper for crypto box c m mlen n pk sk and friends Comment : You are requesting code without showing what you tried yourself . But as it is only one method I guess we can turn a blind eye . Comment : Sure . I think C is not the language to try mixing pointers and casts until it compiles . PErhaps I just don t have the intellectual tools for researching it myself . In a dynamic language with introspection I would have experimented with the code until it returned something . But in C with crypto code I feel this is the wrong approach ... . Comment : This is not an easy question for me to answer unfortunately I have voted up but that s about all I can do . You may want to put a bounty on it if you want it resolved . Comment : You should drop the cryptography and libsodium tags . This is simply Objective C classes and memory-management design questions and not NaCL library . Use the spare tag to bring in more Objective C folks with the iPhone tag . With that said you might see some votes to close because your design questions are too high level . .. . Answer : I wrote crypto secretbox in this lib and I do the padding as defined in the docs : https : github.com gabriel NACL blob master NACL NASecretBox.m .. . .. . It might help if the padding setup is the same for crypto box . Comment : Links no longer works .", "Question : I have an old webservice build on ASP.NET using .asmx files . I need to use sodium.net - unfortunately it fails while loading the dependent libsodium.dll file . Any ideas about what I make wrong I have added libsodium.net through NuGet . I have renamed the 64 bit DLL to libsodium.dll and other naming-conventions too . I have tried to reference libsodium.dll directly but VS rejects it not a valid DLL . So I have added it as content instead with copy to output . After building I can see that the website Bin folder contains both sodium.dll the .NET assembly and libsodium.net . When I try to use libsodium.net I get : .. . .. . ERROR 2015-02-02 11 : 14 : 27 118 13798ms 41 CabinetService doRequest - Caught : The type initializer for Sodium.SodiumCore threw an exception . System.TypeInitializationException : The type initializer for Sodium.SodiumCore threw an exception . --- System.DllNotFoundException : Unable to load DLL libsodium.dll : The specified module could not be found . Exception from HRESULT : 0x8007007E at DynamicDllInvokeType.sodium init at Sodium.SodiumCore..cctor --- End of inner-exception stack-trace --- at Sodium.SodiumCore.LibraryName at Sodium.SecretBox.Create Byte message Byte nonce Byte key at Macaroons.SecretBoxCryptoAlgorithm.Encrypt Byte key Byte plainText in c : Projects Macaroons.Net Macaroons.Net SecretBoxCryptoAlgorithm.cs : line 58 .. . .. . So it cannot find libsodium.dll even though it is in the Bin folder . I did also try to remove the dependency on sodium.net where after I got a runtime-error saying sodium.net is missing - when I re-added it that error disappeared and I got the one above instead indicating the sodium.net loads correctly . So I open up the website shadow folder in C : Windows Microsoft.NET Framework v4.0.30319 Temporary ASP.NET Files cabinetservice and search for sodium . The only result is sodium.dll in some subfolder . There is no libsodium.dll . So apparently ASP.NET ignores the libsodium.dll file when creating the shadow-copy of the website . I have also tried adding the libsodium.dll 32-bit to C : Windows System32 and libsodium.dll 64 bit to C : Windows SysWOW64 . Same result . And I have tried C : Windows Microsoft.NET assembly GAC 32 libsodium and C : Windows Microsoft.NET assembly GAC 64 libsodium . Same result . How can I make ASP.NET aware of the dependency .. . Answer : It turns out that ASP.NET doesn t make shadow copies of unmanaged DLLs such as libsodium.dll and libsodium-64.dll . Sodium.dll the managed code tries to load the DLLs from either the same directory as the shadow-copy of Sodium.dll which is not going to work - or some where-in the PATH environment variable s directories . My solution was to add the AppDomain Bin directory to the path before calling any Sodium code : Comment : thanks for posting the answer Comment : I added that snippet to the Application Start of my Global.asax.cs and it did the trick for my Web Forms application . I added libsodium-net via NuGet . Comment : @J rn Wildt thanks for posting this when adding it to my Global app start it worked locally . That said I get the same error when I use my web-publish on the server . :", "Question : null .. . Answer : I m hoping to get the CurveCP functionality working within ZeroMQ MQ . I m using CentOS as the underlying OS . After downloading and running ZeroMQ I ve done the usual . configure make and sudo make install . Then running make check returned many test passes but stated : .. . .. . So sudo yum install libsodium and sudo ldconfig then make clean and the commands above . But next time I ran the make check the CURVE test is skipped again reporting no libsodium . Looking at the tests I see test security curve.cpp has ifndef HAVE LIBSODIUM and that preprocessor definition appears to be driving the no libsodium skip . . configure --with-libsodium as per this page https : github.com zeromq libzmq issues 912 reports libsodium is not installed .. . .. . . configure --with-libsodium home eng work libsodium-master --with-libsodium-include-dir home eng work libsodium-master src libsodium include --with-libsodium-lib-dir usr lib64 reports libsodium is not installed . Solution .. . .. . In order to get this working installing libsodium via YUM did not give a version of libsodium viable for a zeromq build . It needed a real build of libsodium which in turn required a recent copy of autoconf . Comment : configure : WARNING : unrecognized options : --with-libsodium-lib-dir Comment : Thanks it s helpful . In addition automake installation was also needed for me askubuntu.com questions 430706 installing-autotools-autoconf http : askubuntu.com questions 430706 installing-autotools-autoconf", "Question : I am trying to utilize the libsodium library in an android-studio project . However I am having trouble figuring out how to do this . I have the library downloaded from the libsodium website but do not understand how to create the library files necessary for an android-studio project . Any help would be greatly appreciated . I imagine that kalium https : github.com abstractj kalium would help me do this but am slightly confused on how to incorporate that as well . .. . Answer : I know it s quite late but if you want a starting point this answer could help you : Answer http : stackoverflow.com a 28627827 3424545 . Also now there are many helpers to use libsodium in Android like this github project : Robosodium https : github.com GerardSoleCa Robosodium .", "Question : null .. . Answer : Is there a way to extract the curve parameters when working with elliptic curves in libsodium", "Question : I need to encrypt decrypt data with PHP . I am completely new to this however I have read that Libsodium-PHP is the best tool for AES encryption . Much like the other PHP encryption libraries I have researched Libsoduim-PHP seemed to offer almost no documentation of how to use the library that I was able to find . Can anyone that has experience with PHP encryption either point me in the direction of a good learning resource or write a few lines of sample code using Libsoduim-PHP Thank you very much for the help .. . Atlas .. . Answer : Much like the other PHP encryption libraries I have researched Libsoduim-PHP seemed to offer almost no documentation of how to use the library that I was able to find . From the libsodium-php Github page https : github.com jedisct1 libsodium-php you will find a direct link-to a free online book https : paragonie.com book pecl-libsodium that covers everything you need to know to get started with libsodium . The final chapter contains libsodium recipes https : paragonie.com book pecl-libsodium read 09-recipes.md but each chapter contains detailed usage information . If you specifically need AES read this https : paragonie.com book pecl-libsodium read 08-advanced.md crypto-aead-aes256gcm . If you don t have an AES-or-bust requirement hanging over your head where failure to specifically use AES means your department gets axed and your developers face a firing squad you should consider just using crypto secretbox https : paragonie.com book pecl-libsodium read 05-publickey-crypto.md crypto-box which uses Xsalsa20 for encryption and attaches a Poly1305 authentication tag . This is authenticated encryption https : paragonie.com blog 2015 05 using-encryption-and-authentication-correctly which you want to use almost always . Also look into Halite https : github.com paragonie halite if you want easy-mode . Comment : Thank you for the help" ] }
[ "yes-answer-long", "yes-answer-short" ]
networking
UNK_RELATION
skaction@graphics@79
skaction -- questions about programming skaction objects in apple s spritekit @placeholder rendering and animation framework .
{ "confidence": [ 43.422454833984375, 42.16203308105469, 42.13616180419922, 42.13616180419922, 41.11714553833008, 40.09828186035156, 40.09828186035156, 40.09828186035156, 39.41737365722656, 39.41737365722656, 39.020633697509766, 38.87715148925781, 38.87715148925781, 38.87715148925781, 38.87715148925781, 38.87715148925781, 38.87715148925781, 38.60337448120117, 38.40528106689453, 37.4493522644043, 37.386417388916016, 37.386417388916016, 37.386417388916016, 37.386417388916016, 37.17737579345703, 36.89216232299805, 36.22821807861328, 36.115699768066406, 36.115699768066406, 36.115699768066406, 36.115699768066406, 35.1217155456543, 34.987815856933594, 34.96575927734375, 34.894569396972656, 34.894569396972656, 34.894569396972656, 34.894569396972656, 34.894569396972656, 34.894569396972656, 34.894569396972656, 34.894569396972656, 34.894569396972656, 34.894569396972656, 34.0423698425293, 34.0423698425293, 33.45638656616211, 33.28847885131836, 33.02350616455078, 33.02350616455078, 33.02350616455078, 33.02350616455078, 32.57255172729492, 32.14345169067383, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 31.80237579345703, 30.975502014160156, 30.718067169189453, 30.718067169189453, 30.472911834716797, 30.168720245361328, 30.166719436645508, 30.166719436645508, 29.8772029876709, 29.8772029876709, 29.8772029876709, 29.8772029876709, 29.8772029876709, 29.8772029876709, 29.69920539855957, 28.858341217041016, 28.858341217041016, 28.858341217041016, 28.858341217041016, 28.858341217041016, 28.858341217041016, 28.858341217041016, 28.858341217041016, 28.858341217041016, 28.858341217041016, 28.478073120117188, 28.478073120117188, 28.478073120117188 ], "content": [ "I want to achieve this using SpriteKit nodes and the SKAction scaleTo .", "They are all described in the SKAction docs https : developer.apple.com library ios documentation SpriteKit Reference SKAction Ref index.html apple ref occ cl SKAction .", "On this node you can run SKAction scaleTo : and SKAction fadeOutWithDuration : simultaneously SKAction group : to achieve desired effect .", "On this node you can run SKAction scaleTo : and SKAction fadeOutWithDuration : simultaneously SKAction group : to achieve desired effect .", "Is there a way to handle this with SKAction", "SKAction should work .", "That is how SKAction work .", "In this case the duration for this SKAction is instantaneous .", "Use SKAction runBlock : instead of a selector .", "Is there a way that I could pause this SKAction", "The lightweight object is triggered in a runAction animation by the standard no-argument SKAction performSelector : onTarget : .", "And SKAction is already encodable .", "SKAction is not the right way of doing this .", "Is there anyways to instantly perform this SKAction", "Did you mean SKAction", "Use AVAudioPlayer instead of SKAction .", "The SKAction is for playing a sound .", "I use a subclass NSOperation to obtain serial execution of SKAction as described in this question : How to subclass NSOperation in Swift to queue SKAction objects for serial execution", "Is there any way to make the square change position in the middle of running the SKAction and then continue running the SKAction .", "Example if it helps : .. . .. . But looking at various SpriteKit tutorials online many use SKAction to move nodes across the screen .", "However the SKAction doesn t appear to move the node fast enough before the next SKAction starts working .", "So you can wrap your SKAction in a concurrent NSOperation subclass that only completes when the SKAction does .", "I will only know which node to run on the SKAction after the end of the first SKAction", "Make the SKAction a sequence of the action you want along with a SKAction runBlock : and then pass this action using sprite RunAction : withKey :", "It was an SKAction sequence encapsulated inside a repeatActionForever .", "But here s my justification : If you are building your own representation of animation state in your app then you are reimplementing SKAction : SKAction already effectively represents the state of the animation .", "I just want to know if there is a way to do it with SKAction since it seems done for that in SpriteKit .", "If it s fairly straightforward regular movement then SKAction is fine .", "I m having difficulty removing 1 SKaction .", "I listen to touch and add SKAction to a sprite .", "The method is supposed to be called on the node which the SKAction is running on .", "I saw this answer http : stackoverflow.com questions 22746843 skaction-to-follow-circle-cgpathref-in-clockwise-direction on how to use SKAction to follow Circle CGPathRef in clockwise direction .", "What I am trying to understand is if I setup all my animation as retained SKAction s is there any point in also preloading the SKTextureAtlas that they originally came from my thinking is no as the images for the SKAction s are already loaded in memory", "I looked into many other stackoverflow posts and none helped me or at least gave me a clue why this happens : .. . .. . SKAction playSoundFileNamed stops background music http : stackoverflow.com questions 21835402 skaction-playsoundfilenamed-stops-background-music .. . .. . Stop SKAction that RepeatsForever - Sprite Kit http : stackoverflow.com questions 22037223 stop-skaction-that-repeatsforever-sprite-kit .. . .. . Is it possible to end an SKAction mid-action", "For me this behavior is most noticeable for SKAction sequence .", "You re right that I m stretching the possibilities of SKAction .", "I m trying to refocus the question on SKAction sequence in particular .", "Probably this is why you are suggesting not using SKAction", "I also tried hooking the SKAction to SKSpriteNode .", "@AncAinu - Are you absolutely set on only doing this with a SKAction", "It appears to me that the SKAction is only acting on the latest node .", "Are you sure that fading those sounds is compatible with SKAction", "There are SKAction bugs on the iPhone 5s 64-bit architecture .", "I looked in the wrong Documentation SKAction docs .", "SKAction is my bet but perhaps there s a better way to do this .", "if there isn t is there another way to increment the wait time in an skaction or method or something", "Here s the code of the SKAction : .. . .. . And here s how I execute the SKAction : .. . .. . I tripled checked I m certain that the error come from here .", "To @user2194039 s question you cannot add to an SKAction sequence after it has begun running .", "What I want is to swap two sprite s position with SKAction following CGPath .", "It is and the rest of the function work fine so the problem only lies with the SKAction :", "The issue is that you don t want an operation to complete until the SKAction does .", "I m looking for a SKAction which can move a node with easeOut .", "+ playSoundFileNamed : waitForCompletion : https : developer.apple.com library mac documentation SpriteKit Reference SKAction Ref index.html apple ref occ clm SKAction playSoundFileNamed : waitForCompletion : just plays a sound .", "Encodable lightweight objects can model the kinds of SKAction code blocks that we want to use but can t .", "Example 2 : Tweening .. . .. . The SKAction customActionWithDuration : actionBlock : seems a beautiful fit for tweening .", "Imperfect Solution : Never use SKAction code blocks especially after a delay .", "Again it is triggered by the no-argument SKAction performSelector : onTarget : invoking a designated execute method .", "When a node running an SKAction is encoded and decoded the action will restart from the beginning .", "It would be okay if we could subclass SKAction to do it but we can t .", "Of course because in my SKAction i am saying orientToPath true .", "I know that i ve tried to reverse the SKAction and this did not work .", "reverse SKAction it s not enough : good luck for your project", "You can t stop audio from playing when run from SKAction .", "Absolutely not I would prefer but maybe it s not possible at all with SKAction for this case .", "The mutable array is then used to animate with the textures stored and played with an SKAction .", "I can t figure out how to incorporate this code into my SKAction sequence .", "Every SKAction has a property that can be set called timingMode .", "You can colorize an SKLabelNode with an SKAction by creating a custom-action .", "I am trying to get the duration of this SKAction down to pretty much nothing .", "If you want an instant SKAction just set the duration to 0.0 instead of 0.01 .", "The SKAction playSoundFileNamed is buggy in regards to the app transitioning between background and foreground .", "If it is not possible to stop an SKAction mid-execution is there a roundabout way to do so", "I have achieved this but theres a delay in-between the loop using SKAction like this .", "Well I 100 agree that SKAction should provide more info about its state regardless .", "1 https : developer.apple.com library iOS documentation SpriteKit Reference SKAction Ref Reference Reference.html apple ref occ clm SKAction customActionWithDuration 3aactionBlock 3a .. . .. . RandomY is randomised every time action is run and position is set according to that .", "duration https : developer.apple.com library prerelease ios documentation SpriteKit Reference SKAction Ref index.html apple ref occ instp SKAction duration property specifies the time in seconds required for current action to complete .", "And once you ve got SKAction representing the state of your animation it s reasonable to persist it : If an orc is in the middle of a death animation when you background the app then it should be in the middle of a death animation when you restore it .", "By pre-setting up strong SKAction s for all my in game animations is the actual image data cached by Sprite Kit for future use .", "I have tried the following : - used a weak or strong property on a : .. . .. . to secure a pointer to the SKAction so I can access it beside using the withKey property since I initialized the SKAction in initWithSize .", "I have this SKAction sequence : .. . .. . When this part below runs I want to change the texture property of my node but I can t figure out how to add that into the SKAction sequence .", "I can say that the line self runAction : SKAction group : myActionArray that makes the NSRangeException .", "I have three SKAction variables all of them change the color of my ball on the screen .", "Instead the square does not move to x 375.0 until the SKAction is completed once the square has reached 100 100 .", "The SKAction docs don t state it explicitly so I assume the selector has to be one that doesn t take parameters .", "First I had to initialize my SoundAction SKAction within my didMoveToView function in my scene file .", "Question : Does SKAction playSoundFileNamed not work when called from a singleton or is my code missing something", "You have to use + followPath : asOffset : orientToPath : speed : https : developer.apple.com library mac documentation SpriteKit Reference SKAction Ref index.html apple ref occ clm SKAction followPath : asOffset : orientToPath : speed : method and set offset parameter to false .", "Is there a way I can get an SKLabelNode to change its text property using an SKAction", "I put the stopper bool in there in order to ensure that the SKAction doesn t get called continuously as it s in the update method .", "My first thought was to use SKAction for this but I didn t figure out if it actually can be applied this way .", "But i can t understand or SKAction works incorrect or I have some mistake on code", "When I paint these path s like : .. . .. . It shows me correct swap line but SKAction performs this followPath : incorrect .", "You can combine the 2 - move the sprites in Update and animate them with an SKAction or vice-versa .", "I did not do a SKAction sequence because I have to unhide the node halfway through .", "You need to either create a custom SKAction or override I think the texture property to determine what texture is being shown", "hi Thanks for your answer but parameter to send to SKAction and the Node will need to be decided on runtime .", "If you really want to achieve this through SKActions triggering movement you are after the timingMode property of SKAction .", "I m making a game with SpriteKit where I have a node that is repeatedly moving back and forth from the left to the right side of the screen using this SKAction sequence : .. . .. . The node is an SKTexture and I m using an atlas called WalkRight .", "I m making a game with SpriteKit where I have a node that is repeatedly moving back and forth from the left to the right side of the screen using this SKAction sequence : .. . .. . The node is an SKTexture and I m using an atlas called WalkRight .", "Behind the scenes Spritekit uses AVAudioSession which makes sense for SKAction playSoundFileNamed : .. . .. . AVAudioSession cannot be active while the application is in the background so we have to stop it when going in to background and reactivate it when entering foreground ." ] }
{ "confidence": [ 57.01514434814453, 51.71717071533203, 51.089725494384766, 50.47132110595703, 50.358760833740234, 49.832916259765625, 49.70402526855469, 49.4995231628418, 49.05241394042969, 48.21446990966797, 47.29153060913086, 47.05779266357422, 46.30791091918945, 45.65362548828125, 45.607452392578125, 44.00820541381836, 43.55559158325195, 43.10835266113281, 43.10181427001953, 43.006263732910156 ], "content": [ "Question : null .. . Answer : I use a subclass NSOperation to obtain serial execution of SKAction as described in this question : How to subclass NSOperation in Swift to queue SKAction objects for serial execution http : stackoverflow.com q 28373490 540780 .. . .. . I then modified the previous subclass in order to group animations for several nodes : http : stackoverflow.com a 30600718 540780 .. . .. . At last as I needed to run completion block after SKAction completed I slightly modified the code by using an array of struct instead an array of tuples . The main idea is to elaborate animations by adding data of ActionData type append them to an array and transmit this array to the ActionAnimation object . In some random cases some runAction doesn complete : they start but some of them randomly do not complete . Here is a typical log where 6 block started but only 5 completed : .. . .. . In this case only one runAction failed to completed in other case 2 3 or none . I really don t understand where the problem come from . UPDATE .. . .. . In some cases the app crashed with EXC BAD ACCESS on main thread . This seems to be related to SKCSprite : : update double : enter image description here http : i.stack.imgur.com thesi.png Comment : I am not sure why you are going through all this work with NSOperations just to get animation sequences . Have you looked at SKAction.sequence and SKAction.group You can have actions run in a sequence or group actions together or even include groups in your sequence . You could even put a completion at the end of your sequence using SKAction.runBlock . They are all described in the SKAction docs https : developer.apple.com library ios documentation SpriteKit Reference SKAction Ref index.html apple ref occ cl SKAction . Comment : I need to use NSOperations to sequence execution of animations and computations on different nodes . Maybe there is a far easy way to achieve this and I don t see it . But this is not the purpose of this question . Comment : To @user2194039 s question you cannot add to an SKAction sequence after it has begun running . The approach referenced in this question How to subclass.. . http : stackoverflow.com q 28373490 540780 makes that possible .", "Question : My app is a SpriteKit game with application state preservation and restoration . When application state is preserved most of the nodes in my current SKScene are encoded . When a node running an SKAction is encoded and decoded the action will restart from the beginning . This appears to be standard SpriteKit behavior . For me this behavior is most noticeable for SKAction sequence . On decoding the sequence restarts no matter how many of its component actions have already completed . For instance say the code to run the sequence looks like this : .. . .. . If application state is preserved during the 10-second wait and then restored the SKAction sequence will start again from the beginning with a second visible fade-out-and-in . It makes sense that SKAction sequence should show decoding behavior consistent with other actions . It would be useful though to make an exception so that any actions already completed are not run again . How can I prevent a sequence restarting after decoding Comment : Beyond handling this in more of a Model View Controller design pattern I don t know if you are going to be able to achieve what you want . I suspect an SKAction doesn t actually know how far along it is because the scene determines that . As I said a guess . So when saved it doesn t save a progress . If you weren t using SKActions and rather saving updating these states in a model you could have control over saving the progress but you would have to update the state of your sprites every update loop . Comment : You can t do it the way you are thinking but you could record the time each SKAction has started capture the pause time use that to determine how much time is left in your action and do a fast-forward by increasing the speed Comment : Thank you @SkylerLauren and @KnightOfDragon Based on further experiments I ve edited the question to acknowledge that all SKActions not just sequences restart on decoding that s standard apparently . So then there s two ways for the question to go : 1 Can we on decoding resume an SKAction which has partially completed or 2 Can we as a special case for sequences have sequences not re-run any actions which have already completed Your comments both could handle 1 which is a harder problem maybe too hard but I ve edited the question to be 2 . And I ve got some code to show . .. . Answer : The only way I can think of accomplishing what you are looking to achieve would be the following . 1 . When you start the action store the time in a variable . Keep in mind you will want to use the currentTime value passed in update function . 2 . When you need to encode calculate how much time has passed from when you created the action to when you encoded . From there you have two choices save how much time is left and when you go to recreate the action use that into your calculations or create new actions based on how much time is left and encode those . I don t think SKActions were really intended to be used in this manner but that may be a work around at least . I think it is more common for developers to store the state of their game for persistence instead of trying to store the actual sprites and actions . It would be the same with UIKit stuff . You wouldn t store UIViews for persistence you instead would have some other object that would contain the info to recreate based on user progress . Hopefully some of that was at least a little helpful . Best of luck . Edit .. . .. . To give more info on how in theory I would go about this and you are right it is a hassle . 1 . Subclass SKSpriteNode .. . 2 . Create a new method to run actions on that Sprite like - void startAction : withKey : duration : which would ultimately call run action with key . 3 . When startAction is called you store that into some sort of MutableArray with a Dictionary that stores that action its key duration and startTime defaulted to 0 . You might not even have to actually store that action just the key duration and start time . 4 . Add an update : method on to this SKSpriteNode subclass . Every update loop you call its update and check to see if 1 any actions don t have a start time and 2 if those actions are still running . If no start time you add current time as the start time and if not running you remove it form the array . 5 . When you go to encode save that sprite you use the info in that array to determine state of those SKAction . The big point of this is that each SKSpriteNode holds onto and tracks its own SKAction in this example . Sorry I don t have time to go through and write the code in Objective-C . Also by no means am I claiming or trying to imply this is better or worse than your answer but rather addressing how I would handle this if I was determined to save the state of SKActions as your question asks . Comment : You re right that I m stretching the possibilities of SKAction . But here s my justification : If you are building your own representation of animation state in your app then you are reimplementing SKAction : SKAction already effectively represents the state of the animation . And once you ve got SKAction representing the state of your animation it s reasonable to persist it : If an orc is in the middle of a death animation when you background the app then it should be in the middle of a death animation when you restore it . And SKAction is already encodable . Mostly : Comment : Two responses to your specific suggestions also : thank you . 1 . I m trying to refocus the question on SKAction sequence in particular . In that case we don t need the time elapsed in each SKAction we just need for sequences to not re-run actions which have already run . 2 . I can picture doing what you re saying but it would be difficult to recreate each and every running SKAction on decode and to track and encode a separate time variable for each . It would be okay if we could subclass SKAction to do it but we can t . Probably this is why you are suggesting not using SKAction Comment : Well I 100 agree that SKAction should provide more info about its state regardless . I have struggled with SKActions in the past with my own games do to some of the limitations of knowing where they are when I want to save the game or reacting when something changes in the scene . I tend to take a more hands on approach but it seems like such a waste when there are actions that are so nicely sequenced and grouped . I do the like the idea of MVC though because at any given moment you can save model data but you have to manage everything from position to animation frame . Comment : Okay yeah big upvote for what you are saying about MVC : it s not reimplementing SKAction it s separating view from model . And I admit I am mixing view and model most horribly here . That said if I don t accept your answer it s because the first part of it is so unpalatable even if the last paragraph is ultimately the best practice .", "Question : I m trying to make my spriteNode rotate over finger touch . So far I can do it but what I want is that my node have a rotation speed . So I calculate the length of the angle then set a different timing to rotate with it if the arc is long it will take time.. . . Here s my code : .. . .. . The main problem is that adding several SKAction to the node block the movement . .. . .. . I would like to know what could be the solution If possible by using SKAction since I would like to avoid doing an update on each frame to calculate the movement but if it s the only solution.. . .. . .. . NOTE AFTER ANSWER .. . .. . As I received answers I read again the SpriteKit documentation and found this clear note https : developer.apple.com library ios documentation GraphicsAnimation Conceptual SpriteKit PG AddingActionstoSprites AddingActionstoSprites.html apple ref doc uid TP40013043-CH11-SW13 : .. . .. . When You Shouldn t Use Actions .. . .. . Although actions are efficient there is a cost to creating and executing them . If you are making changes to a node s properties in every frame of animation and those changes need to be recomputed in each frame you are better off making the changes to the node directly and not using actions to do so . For more information on where you might do this in your game see Advanced Scene Processing . Comment : I am a little confused on what you are trying to accomplish . Are you looking to change the angle rotation in mid movement in case the player moves his finger around using thouchesMoved or are you looking to block any further actions until the movement has completed Comment : Neither of this . I have a turret which have a maximum rotation speed and should target the finger position but not immediately by taking time to turn . I already do that but since touchesMoved is called like 60time by seconds adding 60 actions by seconds block the movement actions don t run.. . Comment : So you are you looking for the turret to track the touch-location even as it moves around the view Comment : It just turn on itself but yeah it target the finger but at its speed .. . Answer : I have created code to turn the node0 sprite towards the touch point at a constant speed regardless of angle . You had indicated in your question that you prefer using SKAction instead of having code in your update method . Below is the sample project code for the GameScene.m file : .. . .. . Personally I think it would be better to use the update method to accomplish this task . It would give you greater control in the step by step movement of the object s zRotation rather than using a SKAction . Comment : I already did this my point isn t to do it on touchesBegan only but on touchesMoved the whole point is that the turret follows the finger as it moves . Just try to put your code in touchesMoved too you will see my problem Comment : @AncAinu - Are you absolutely set on only doing this with a SKAction Comment : Absolutely not I would prefer but maybe it s not possible at all with SKAction for this case . I just want to know if there is a way to do it with SKAction since it seems done for that in SpriteKit . If it s impossible I want to know why if someone know . If no one can tell then I will conclude it s not possible or I didn t find someone enough good into SpriteKit . The question is beyond my problem to see if this is a limit of SpriteKit :", "Question : How do i change the duration of a created sound created with SKAction.playSoundFileNamed : .. . .. . var sound SKAction.playSoundFileNamed sound.mp3 waitForCompletion : false .. . .. . I tried setting sound.duration 1.0 but with no luck so far .. . Answer : In short that is impossible with SKAction.playSoundFileNamed : method . duration https : developer.apple.com library prerelease ios documentation SpriteKit Reference SKAction Ref index.html apple ref occ instp SKAction duration property specifies the time in seconds required for current action to complete . When using SKAction.playSoundFileNamed : https : developer.apple.com library prerelease ios documentation SpriteKit Reference SKAction Ref index.html apple ref occ clm SKAction playSoundFileNamed : waitForCompletion : method you don t have control over the audio being played no pausing stoping resuming pitching etc . It s meant to play a sound nothing more . Some useful links : .. . .. . http : stackoverflow.com a 22590464 3402095 .. . .. . http : stackoverflow.com a 21023417 3402095", "Question : Allright guys I ve been developing an app in which I have a NSMutableDictionary with an SKAction object in it . The SKAction is for playing a sound . This all works well except .. . the app crashes upon entering background with the following stack-trace : .. . .. . Since it said EXC BAD ACCESS I suspected zombie-objects but enabling them in the scheme didn t help a thing in understanding this crash . This even happens in the most minimalistic project setup literally 2 lines-of-code in MyScene.m : .. . .. . How is this possible You can download this project from my github page : https : github.com SabatinoMasala SpritekitCrash Comment : possible duplicate of Sprite Kit playing sound leads to app termination http : stackoverflow.com questions 18976813 sprite-kit-playing-sound-leads-to-app-termination .. . Answer : Allright I found the issue . Behind the scenes Spritekit uses AVAudioSession which makes sense for SKAction playSoundFileNamed : .. . .. . AVAudioSession cannot be active while the application is in the background so we have to stop it when going in to background and reactivate it when entering foreground . Use this piece of code in both applicationWillResignActive and applicationDidEnterBackground to disable the AVAudioSession : .. . .. . To enable it again use this in applicationWillEnterForeground : Comment : I have the same issue without any sounds . I m pausing the SKScene view on background .", "Question : I would like to create this effect : .. . .. . http : d.pr v 4oGc .. . .. . Here in details : .. . .. . enter image description here http : i.stack.imgur.com NVk4E.png enter image description here http : i.stack.imgur.com 4qgJt.png enter image description here http : i.stack.imgur.com gMfUS.png .. . .. . in sprite-kit with SKLabelNode . So basically I would like the labels to fly in . My first thought was to use SKAction for this but I didn t figure out if it actually can be applied this way . Any tips for recreating that effect in Spritekit Comment : SKAction should work . SKAction.moveTo or SKAction.followPath may suit your needs Comment : From what I see in your link all HUD elements share a single parent node . On this node you can run SKAction scaleTo : and SKAction fadeOutWithDuration : simultaneously SKAction group : to achieve desired effect . Comment : That s right I ll make answer out of this Comment : You must insert some pictures to explain what you want to do not only a link it can be unavailable so your question become unreadable . .. . Answer : From what I see in your link all HUD elements share a single parent node . On this node you can run SKAction scaleTo : and SKAction fadeOutWithDuration : simultaneously SKAction group : to achieve desired effect . CloakedEddy Comment : What are you doing You answer your question with the comments of other user Remove your question and re-creat a question with answer . Comment : This does not provide an answer to the question . To critique or request clarification from an author leave a comment below their post . - From Review review low-quality-posts 12493946 Comment : What s the problem I find CloakedEddy s comment to be the answer to my question and therefore to make it easier for others who should read this question make the answering comment an answer . There is no point duplicating the question as a new question .", "Question : By pre-setting up strong SKAction s for all my in game animations is the actual image data cached by Sprite Kit for future use . What I am trying to understand is if I setup all my animation as retained SKAction s is there any point in also preloading the SKTextureAtlas that they originally came from my thinking is no as the images for the SKAction s are already loaded in memory I am guessing at this from the Apple Adventure Example which although the authors use lots of SKTextureAtlas es they don t do a single preloadTextureAtlases in any of the code . Comment : SK will load textures on the fly . However preloading the SKActions seems like taking it too far they re lightweight objects that can be created on the fly and I wager getting them from storage will be about if not more expensive than creating a new action for every animation . Take the easier approach until you ve proven with actual measurements that it does make a difference AND your app is impacted by it . Otherwise it s premature-optimization . Comment : but you don t want textures loading on the fly the first time that ship x enters the screen what I am trying to get is the best approach to pre setting up assets so you don t take a hit mid game . Comment : Use SKTextureAtlas preload method and keep a strong reference to the atlas object . That ll keep all textures in the atlas in memory . You can leave the above code unchanged and instead of loading the image it will look in the atlas - provided that you set up the atlas correctly ie .atlas folder with all resources as reference instead of group and not adding image files with the same name elsewhere to the project . Comment : Thats a very good explanation something that I have been curious about for a while and have not found any definitive answer you should add your comment as the answer I am sure a lot of other people will be helped by knowing this .. . Much appreciated . Comment : Just as aside note for anyone wondering reference folders in Xcode are BLUE group folders are YELLOW . .. . Answer : To keep textures of an atlas cached use SKTextureAtlas preload method and keep a strong reference to the atlas object . That is all . That ll keep all textures in the atlas in memory . You can leave the above code unchanged and instead of loading the image it will look in the atlas - provided that you set up the atlas correctly ie .atlas folder with all resources as reference instead of group and not adding image files with the same name elsewhere to the project .", "Question : I checked my old game made in SpriteKit and I want to update it in Swift 2.0 . When I tried to fix it Xcode found an errors . Error is : Cannot convert value of type NSMutableArray to expected argument type SKAction .. . .. . In code : .. . .. . Function : .. . .. . .. . .. . Can someone help me .. . Answer : You can do this instead : .. . .. . The method expects a parameter of type SKAction which NSMutableArray does not conform to .", "Question : I m creating a game in SpriteKit using Swift . I have a node on the scene and when the user touches the screen I want the node to move up with easeOut . When the user releases the screen the node should fall to the ground . I m looking for a SKAction which can move a node with easeOut . Can anyone help me making that action Thanks in advance Comment : just set Gesture events and change the gravity of a node .. . Answer : If you really want to achieve this through SKActions triggering movement you are after the timingMode property of SKAction . someAction.timingMode .EaseInEaseOut .. . .. . As zg r is writing in the comment though this can also be achieved with physics which might be better depending on your requirement .", "Question : I am quite new to SpriteKit coming from about 4 months playing around with HTML5 . Using Mark Wihlberg s https : github.com maxwihlborg HTML5 youtube game tutorials my programs always constantly updated a player or object s position . Example if it helps : .. . .. . But looking at various SpriteKit tutorials online many use SKAction to move nodes across the screen . My question is whether constantly updating a node s position in SpriteKit is unorthodox or frowned upon and I should get used to using actions and why Comment : You could either use SKActions outside the update function or increment decrement the position or rotation in update function it s up to you . .. . Answer : No it isn t frowned upon and it s good to know how to do these things manually . If it s fairly straightforward regular movement then SKAction is fine . For more complicated stuff and SKActions can actually get complicated with sprites following paths and bezier curves etc use the Update function iterate over your sprites using enumerateChildNodesWithName or similar and move them as necessary . You can combine the 2 - move the sprites in Update and animate them with an SKAction or vice-versa . Bear in mind that you don t call Update it is called automatically by the game-engine 60 times a second . It gets passed a time so you can work out exactly how long it has been since Update was last called not always 1 60s", "Question : Problem .. . .. . When the node hierarchy is encoded as is common during application state preservation or a game save nodes running SKAction actions with code blocks must be handled specially since the code blocks cannot be encoded . Example 1 : Delayed Callback after Animation .. . .. . Here an orc has been killed . It is animated to fade out and then remove itself from the node hierarchy : .. . .. . If the orc node is encoded and then decoded the animation will restore properly and complete as expected . But now the example is modified to use a code block that runs after the fade . Perhaps the code cleans up some game state once the orc is finally dead . Unfortunately the code block will not encode . During application state preservation or game save if this sequence is running a warning will be issued : .. . .. . SKAction : Run block actions can not be properly encoded Objective-C blocks do not support NSCoding . After decoding the orc will fade and be removed from parent but the cleanup method orcDidFinishDying : will not be called . What is the best way to work around this limitation Example 2 : Tweening .. . .. . The SKAction customActionWithDuration : actionBlock : seems a beautiful fit for tweening . My boilerplate code for this kind of thing is this : .. . .. . Unfortunately customActionWithDuration : actionBlock : cannot be encoded . If the game is saved during the animation it will not restore properly on game load . Again what is the best way to work around this limitation Imperfect Solutions .. . .. . Here are solutions I have considered but don t like . That said I d love to read answers that successfully champion one of these . Imperfect Solution : Use performSelector : onTarget : rather than runBlock : in the animation . This solution is imperfect because arguments cannot be passed to the invoked selector context for the call can only be expressed by the target and the name of the selector . Not great . Imperfect Solution : During encoding remove the SKAction sequence from any relevant nodes and advance the program state as-if the sequence had completed . In the first example that would mean setting the node alpha immediately to 0.0 removing the orc node from parent and calling orcDidFinishDying : . This is an unfortunate solution for at least two reasons : 1 It requires special handling code during encoding 2 Visually the node won t get a chance to finish its animation . Imperfect Solution : During encoding remove the SKAction code blocks from any relevant nodes and recreate them during decoding . This is non-trivial . Imperfect Solution : Never use SKAction code blocks especially after a delay . Never rely on the completion of an animation in order to restore good app state . If you need to schedule a future event in an encodable way build your own event queue not using code blocks . This solution is imperfect because runBlock and customActionWithDuration : actionBlock : are just so damn useful and it would be a shame and a recurring trap for newbies to consider them evil . .. . Answer : Encodable lightweight objects can model the kinds of SKAction code blocks that we want to use but can t . Code for the below ideas is here https : github.com hilogames HLSpriteKit blob master HLSpriteKit HLAction.h . Replacement for runBlock .. . .. . The first encodable lightweight object replaces runBlock . It can make an arbitrary callback with one or two arguments . The caller instantiates the lightweight object and sets its properties : target selector and arguments . The lightweight object is triggered in a runAction animation by the standard no-argument SKAction performSelector : onTarget : . For this triggering action the target is the lightweight object and the selector is a designated execute method . The lightweight object conforms to NSCoding . As a bonus the triggering SKAction retains a strong reference to the lightweight object and so both will be encoded along with the node running the actions . A version of this lightweight object could be made that retains the target weakly which might be nice and or necessary . Here is a draft of a possible interface : .. . .. . And an accompanying implementation : .. . .. . And an example of using it : .. . .. . Replacement for customActionWithDuration : actionBlock : .. . .. . A second encodable lightweight object replaces customActionWithDuration : actionBlock : . This one is not so simple however . Again it is triggered by the no-argument SKAction performSelector : onTarget : invoking a designated execute method . A customActionWithDuration : actionBlock : has a duration . But the triggering performSelector : onTarget : does not . The caller must insert a companion waitForDuration : action into her sequence if it depends on duration . The lightweight object is initialized with a target selector node and duration . When it is triggered the lightweight object tracks its own elapsed time and periodically calls the selector on the target passing it the node and the elapsed time . The lightweight object conforms to NSCoding . On decoding if already triggered it resumes calling the selector for the remainder of its configured duration . Limitations .. . .. . I have implemented a version of these proposed classes https : github.com hilogames HLSpriteKit blob master HLSpriteKit HLAction.h . Through light use I ve already found an important limitation : Nodes encoded with a running SKAction sequence restart the sequence from the beginning upon decoding http : stackoverflow.com q 36293846 1332415 .", "Question : Goal : I want to present a new scene : .. . .. . and end the current background music in order to start the new background music the new background music from level 2 . TheProblem : Upon presenting the new scene the background music of the 1 . scene level1 keeps playing and DOES not stop even when leaving the miniGame since the whole game consists of few mini games . The music played is an SKAction : .. . .. . Here does the transition to the next level happen : .. . .. . In the comments code lines you can se what I have already tried and what did not work . The : .. . .. . did absolutely nothing . The : .. . .. . line stops only the transition but the music still continues . I have tried the following : - used a weak or strong property on a : .. . .. . to secure a pointer to the SKAction so I can access it beside using the withKey property since I initialized the SKAction in initWithSize . Someone wrote that SKAction is a fire-and-forget object which I understood as without having stored a pointer to it accessing it later is not possible directly . However it didnt work help me . I looked into many other stackoverflow posts and none helped me or at least gave me a clue why this happens : .. . .. . SKAction playSoundFileNamed stops background music http : stackoverflow.com questions 21835402 skaction-playsoundfilenamed-stops-background-music .. . .. . Stop SKAction that RepeatsForever - Sprite Kit http : stackoverflow.com questions 22037223 stop-skaction-that-repeatsforever-sprite-kit .. . .. . Is it possible to end an SKAction mid-action http : stackoverflow.com questions 19041610 is-it-possible-to-end-an-skaction-mid-action .. . .. . Pausing a sprite-kit scene http : stackoverflow.com questions 21593198 pausing-a-sprite-kit-scene 21593852 21593852 .. . .. . .. . Thoughts : It seems that the action is created with the creation of the SKScene object . It is hooked to it and finished after the audio duration . While I was using repeatForever it would never stop . However there is no way to pause or stop it . I also tried hooking the SKAction to SKSpriteNode . When the SKScene is loaded animals are loaded with it . So I tried hooking the SKAction on the SKSpriteNode and use removeAllActions and alike from the SKSpriteNode but it didnt work aswell . I checked the documentation on SKAction SKView SKScene SKSpriteNode but in the end it didnt help me much . It looks like the object exists somewhere running its actions . What the error is not about : .. . .. . It is not simulator or device related error - I have tested it on both the simulator and device with the same result error . It is not a project related error - I have tested it in a separate project much smaller and the with the same result error . A temporary solution : I have been using the AVAudioPlayer class from AVFoundation framework . I created a : .. . .. . This didnt help much since I wanted to change theBackgroundSong when level2 was loaded and I had huge problems accessing the property from a nested SKScene structure . Any advice clue hint or idea would be of great help . Comment : AVAudioPlayer or a proper audio engine like ObjectAL are the way to go . I believe the playSoundFileNamed : action merely exists just to do some quick audio tests perhaps but I wouldn t use it for any real-world application . Mainly because you get absolutely no control over the audio being played back you can t pitch or pan it pause or resume it preload or release it . Comment : I agree with you . It seems that I will have to change my approach . I wasn t sure if the audio playback capabilities of iOS sprite-kit were low or if I lacked the knowledge to use it . Comment : I think they put that action in there as a convenience and for beginners learners . SK would seem missing without a barebones play audio feature . Comment : I used it to play momentary short sounds hooked onto SKSpriteNodes like animal sounds . I did the job quite well . However if the last more then few seconds it becomes a problem because if you click the animals faster then the sounds keep playing at the same time . I can not queue them or stop them . I belive apple will solve this slowly and add more functionality . For beginners its ok . .. . Answer : You can t stop audio from playing when run from SKAction . You will need another engine to run your background music . Try AVAudioPlayer - it is really easy and straightforward to use . Something like this will work : .. . .. . First import header and add new property to your scene or view controller : .. . .. . After this in viewDidLoad or in didMoveToView method of scene add following code : .. . .. . Each time you need your music to stop just call self.audioPlayer stop .. . .. . When you need new music to play put a new player into the property initialized with your new music piece . Hope this helps . Comment : You can t stop audio from playing when run from SKAction - you are right . I was not sure but now I am . It helped : .", "Question : Goal : I want to present a new scene : .. . .. . and end the current background music in order to start the new background music the new background music from level 2 . TheProblem : Upon presenting the new scene the background music of the 1 . scene level1 keeps playing and DOES not stop even when leaving the miniGame since the whole game consists of few mini games . The music played is an SKAction : .. . .. . Here does the transition to the next level happen : .. . .. . In the comments code lines you can se what I have already tried and what did not work . The : .. . .. . did absolutely nothing . The : .. . .. . line stops only the transition but the music still continues . I have tried the following : - used a weak or strong property on a : .. . .. . to secure a pointer to the SKAction so I can access it beside using the withKey property since I initialized the SKAction in initWithSize . Someone wrote that SKAction is a fire-and-forget object which I understood as without having stored a pointer to it accessing it later is not possible directly . However it didnt work help me . I looked into many other stackoverflow posts and none helped me or at least gave me a clue why this happens : .. . .. . SKAction playSoundFileNamed stops background music http : stackoverflow.com questions 21835402 skaction-playsoundfilenamed-stops-background-music .. . .. . Stop SKAction that RepeatsForever - Sprite Kit http : stackoverflow.com questions 22037223 stop-skaction-that-repeatsforever-sprite-kit .. . .. . Is it possible to end an SKAction mid-action http : stackoverflow.com questions 19041610 is-it-possible-to-end-an-skaction-mid-action .. . .. . Pausing a sprite-kit scene http : stackoverflow.com questions 21593198 pausing-a-sprite-kit-scene 21593852 21593852 .. . .. . .. . Thoughts : It seems that the action is created with the creation of the SKScene object . It is hooked to it and finished after the audio duration . While I was using repeatForever it would never stop . However there is no way to pause or stop it . I also tried hooking the SKAction to SKSpriteNode . When the SKScene is loaded animals are loaded with it . So I tried hooking the SKAction on the SKSpriteNode and use removeAllActions and alike from the SKSpriteNode but it didnt work aswell . I checked the documentation on SKAction SKView SKScene SKSpriteNode but in the end it didnt help me much . It looks like the object exists somewhere running its actions . What the error is not about : .. . .. . It is not simulator or device related error - I have tested it on both the simulator and device with the same result error . It is not a project related error - I have tested it in a separate project much smaller and the with the same result error . A temporary solution : I have been using the AVAudioPlayer class from AVFoundation framework . I created a : .. . .. . This didnt help much since I wanted to change theBackgroundSong when level2 was loaded and I had huge problems accessing the property from a nested SKScene structure . Any advice clue hint or idea would be of great help . Comment : AVAudioPlayer or a proper audio engine like ObjectAL are the way to go . I believe the playSoundFileNamed : action merely exists just to do some quick audio tests perhaps but I wouldn t use it for any real-world application . Mainly because you get absolutely no control over the audio being played back you can t pitch or pan it pause or resume it preload or release it . Comment : I agree with you . It seems that I will have to change my approach . I wasn t sure if the audio playback capabilities of iOS sprite-kit were low or if I lacked the knowledge to use it . Comment : I think they put that action in there as a convenience and for beginners learners . SK would seem missing without a barebones play audio feature . Comment : I used it to play momentary short sounds hooked onto SKSpriteNodes like animal sounds . I did the job quite well . However if the last more then few seconds it becomes a problem because if you click the animals faster then the sounds keep playing at the same time . I can not queue them or stop them . I belive apple will solve this slowly and add more functionality . For beginners its ok . .. . Answer : Now you can stop playing sound action by assigning key string for it then using removeActionForKey later .. . .. . Sorry this is Swift . But it can be ported to Obj-C . I have tested successful Comment : In Swift awesome . Please edit only in which version 1.2 or 2.0 Comment : I ve seen this solution to several similar questions in here and it doesn t work for me . I can see the action is being successfully removed from the node but the sound continues to play until it s finished .", "Question : I m making a game with SpriteKit where I have a node that is repeatedly moving back and forth from the left to the right side of the screen using this SKAction sequence : .. . .. . The node is an SKTexture and I m using an atlas called WalkRight . What I am trying to do is when the SKAction.moveByX -frame.size.width 2.8 y : 0 duration : NSTimeInterval 4 is run I want to use a .xscale to rotate my walkRight images . I can t figure out how to incorporate this code into my SKAction sequence . Below is my code for adding the atlas in case this is needed to answer the question . .. . Answer : Make use of a custom block action and in that action run a check to see whether it s going left or right and then adjust your xScale of the node accordly . xScale -1 and xScale 1 are the values that you will be using . Comment : Thanks for the response . I can t figure out how to run a check to see if its going left or right . Comment : @NickyNick321 instead of using the SKAction in your sequence use block functions like what u did for self.move . You can differentiate between left and right that way .", "Question : My app is a SpriteKit game with application state preservation and restoration . When application state is preserved most of the nodes in my current SKScene are encoded . When a node running an SKAction is encoded and decoded the action will restart from the beginning . This appears to be standard SpriteKit behavior . For me this behavior is most noticeable for SKAction sequence . On decoding the sequence restarts no matter how many of its component actions have already completed . For instance say the code to run the sequence looks like this : .. . .. . If application state is preserved during the 10-second wait and then restored the SKAction sequence will start again from the beginning with a second visible fade-out-and-in . It makes sense that SKAction sequence should show decoding behavior consistent with other actions . It would be useful though to make an exception so that any actions already completed are not run again . How can I prevent a sequence restarting after decoding Comment : Beyond handling this in more of a Model View Controller design pattern I don t know if you are going to be able to achieve what you want . I suspect an SKAction doesn t actually know how far along it is because the scene determines that . As I said a guess . So when saved it doesn t save a progress . If you weren t using SKActions and rather saving updating these states in a model you could have control over saving the progress but you would have to update the state of your sprites every update loop . Comment : You can t do it the way you are thinking but you could record the time each SKAction has started capture the pause time use that to determine how much time is left in your action and do a fast-forward by increasing the speed Comment : Thank you @SkylerLauren and @KnightOfDragon Based on further experiments I ve edited the question to acknowledge that all SKActions not just sequences restart on decoding that s standard apparently . So then there s two ways for the question to go : 1 Can we on decoding resume an SKAction which has partially completed or 2 Can we as a special case for sequences have sequences not re-run any actions which have already completed Your comments both could handle 1 which is a harder problem maybe too hard but I ve edited the question to be 2 . And I ve got some code to show . .. . Answer : The SKAction sequence can be decomposed into a number of subsequences such that once a particular subsequence has finished it will be no longer running and so won t be restarted on decode . The Code .. . .. . Make a lightweight encodable object which can manage the sequence breaking it into subsequences and remembering on encode what has already run . I ve written an implementation in a library on GitHub https : github.com hilogames HLSpriteKit blob master HLSpriteKit HLAction.h . Here s the current state of the code in a gist https : gist.github.com karlvoskuil cef3c87c2958e04fb0fd3978667c2737 . And here s an example using the same sequence as below : .. . .. . The Concept .. . .. . A first idea : Split the sequence into a few independent subsequences . As each subsequence completes it will no longer be running and so will not be encoded if the application is preserved . For instance an original sequence like this : .. . .. . could be split like this : .. . .. . No matter when the node is encoded the methods doX doY and doZ will only be run once . Depending on the animation though the duration of the waits might seem weird . For example say the application is preserved after doX and doY have run during the 1-second delay before doZ . Then upon restoration the application won t run doX or doY again but it will wait 11 seconds before running doZ . To avoid the perhaps-strange delays split the sequence into a chain of dependent subsequences each of which triggers the next one . For the example the split might look like this : .. . .. . With this implementation if the sequence is preserved after doX and doY have run then upon restoration the delay before doZ will be only 1 second . Sure it s a full second even if it was half elapsed before encoding but the result is fairly understandable : Whatever action in the sequence was in progress at the time of encoding will restart but once it completes it is done . Of course making a bunch of methods like this is nasty . Instead make a sequence-manager object which when triggered to do so breaks the sequence into subsequences and runs them in a stateful way . Comment : What if one of the actions is do over time . Like move or animate Wouldn t this mess you up of an Orc was to move 20 to the right over one second . Would the Orc move 30 overall or only 10 in this case if decoded .5 seconds in Comment : Good point and that question also applies to regular SKAction even if not in a sequence since the moveBy will restart after decode . I guess that means we should always use moveTo Comment : That would at least guarantee it would end at a particular spot even if it would look funny going faster or slower than normal when decoded . Also I am more than happy to discuss this further but it is kind of frowned upon on SO . Shoot me an email at [email protected] and I can send you an invite to the SKA slack tomorrow and you can troubleshoot debate with the group or just email back and forth with me either works . I am off to bed for the night though . Best of luck .", "Question : null .. . Answer : Im trying to play a random music file that loops in SpriteKit . I have achieved this but theres a delay in-between the loop using SKAction like this . Regardless of the simulator or device . I have also achieved this with NSURL AVAudioPlayer without the delay problem but I m lost on how to make it random . So I guess my question is how can I do this randomly with AVAuidoPlayer . Im fairly new to objc so any help is greatly appreciated . Comment : Is it possible there is any dead air at the start or end of the audio file Comment : I do note that there is a reasonable approach in this answer : stackoverflow.com questions 22826675 http : stackoverflow.com questions 22826675 spritekit-preload-sound-file-into-memory-before-playing Comment : @HasanEdain I ve made sure there is no dead air . Looks like that question answers it . Thank you Hasan", "Question : I checked my old game made in SpriteKit and I want to update it in Swift 2.0 . When I tried to fix it Xcode found an errors . Error is : Cannot convert value of type NSMutableArray to expected argument type SKAction .. . .. . In code : .. . .. . Function : .. . .. . .. . .. . Can someone help me .. . Answer : To run a sequence of actions use this code Comment : Thanks It works perfectly .", "Question : I listen to touch and add SKAction to a sprite . If existing actions are not complete yet I want the action to be added to a queue so it will execute one after another . Any experienced similar design I did using Array and Block . If there is any easier approach Comment : Just our of curiosity : Xcode shows me an ARC Retain Cycle warning for unsafe unretained typeof self weakSelf self . Is that code correct Comment : i think so . to prevent retain cycle in block i have to make it weak reference . Comment : Okay the warning disappeared after I used the code from this answer http : stackoverflow.com a 17011096 867635 . Regarding you question : I haven t found an easier approach for an animation-queue yet . Comment : ok the warning fixed . i have to put the weak self declaration outside of the block .. . Answer : Generally you can make SKActions run concurrently using the group method and have them run sequentially using the sequence method . But if you need a queuing system rather than building your own use the native operation queue to do this for you . So you can create a serial operation queue and add operations to it . The issue is that you don t want an operation to complete until the SKAction does . So you can wrap your SKAction in a concurrent NSOperation subclass that only completes when the SKAction does . Then you can add your operations to a serial NSOperationQueue and then it will won t start the next one until it finishes the prior one . So first create an ActionOperation subclassed from NSOperation that looks like : .. . .. . and .. . .. . You could then for example create a serial queue during the initialization process : .. . .. . You can then add the operations to it : .. . .. . and you can later add more actions : .. . .. . And because the queue is serial you know that move2 will not be started until move1 is done . Comment : hi Thanks for your answer but parameter to send to SKAction and the Node will need to be decided on runtime . E.g . I will only know which node to run on the SKAction after the end of the first SKAction Comment : @ElliotYap That s fine . You haven t shown us how it knows which node you want perform that action on so it s hard for me to show you the change necessary in the operation object to make that happen but you can incorporate whatever logic you re alluding to in this ActionOperation e.g . or use block delegate pattern so caller can specify how to determine this . My point was simply that you shouldn t recreate queue mechanism when one already exists . Comment : Understand I m reading on NSOperation now Thanks for leading me to the right direction : Comment : Rob http : stackoverflow.com users 1271826 rob I found a limitation on the Swift implementation http : stackoverflow.com q 28373490 540780 of this solution when SKactions transmitted during initialization contains runAction : onChildWithName : . In this case the duration for this SKAction is instantaneous .", "Question : I saw this answer http : stackoverflow.com questions 22746843 skaction-to-follow-circle-cgpathref-in-clockwise-direction on how to use SKAction to follow Circle CGPathRef in clockwise direction . What about rectangular path The default one will be in counter-clockwise fashion : .. . .. . Tried changing the end points but the result is the same . Comment : The answer says Instead of CGPathCreateWithEllipseInRect use CGPathCreateMutable and CGPathAddArc did you try using something else than CGPathCreateWithRect like CGAddLineToPoint .. . Answer : Short Answer : run the action in reverse to follow the path in the opposite direction .. . .. . Long Answer : the followPath SKAction follows the direction in which the path was built . If you want your sprite to move along a rectangle path in a clockwise or counter-clockwise direction then build the path accordingly . Alternatively you can use the reverseAction method to follow a path in the opposite direction than it was built . Here are examples of both methods . Build a rectangular-shaped path in clockwise order in scene coordinates CCW in view coordinates .. . .. . Use built-in method to construct a rectangular-shaped path in counter-clockwise order in scene coordinates and CW in view coordinates . Comment : Got it thank you for taking the effort to provide the short and long answer : D", "Question : null .. . Answer : What I want is to swap two sprite s position with SKAction following CGPath . One of them should to go above half circle path another one have to do this below . But i can t understand or SKAction works incorrect or I have some mistake on code When I paint these path s like : .. . .. . It shows me correct swap line but SKAction performs this followPath : incorrect . Can t understand ." ] }
[ "yes-answer-long", "yes-answer-short" ]
graphics
UNK_RELATION
lib-nfc@nfc@69
lib-nfc -- libnfc is the first libre platform-independent low-level @placeholder sdk and programmers api .
{ "confidence": [ 40.632904052734375, 40.520751953125, 39.792701721191406, 36.90818786621094, 36.49327087402344, 36.424903869628906, 36.424903869628906, 35.52538299560547, 35.449012756347656, 35.18791961669922, 34.40352249145508, 34.10013961791992, 33.6695671081543, 33.61600112915039, 33.506561279296875, 33.430137634277344, 32.51469421386719, 32.51469421386719, 32.51469421386719, 32.51469421386719, 32.293846130371094, 31.769975662231445, 30.782184600830078, 30.782184600830078, 30.633617401123047, 30.627405166625977, 30.604084014892578, 30.604084014892578, 30.124923706054688, 30.121559143066406, 30.121559143066406, 30.121559143066406, 29.9178409576416, 29.286062240600586, 29.286062240600586, 29.14730453491211, 28.972530364990234, 28.972530364990234, 28.895849227905273, 28.775741577148438, 28.54471206665039, 28.5096435546875, 28.464691162109375, 28.464691162109375, 28.464691162109375, 28.464691162109375, 28.157180786132812, 28.093875885009766, 28.033689498901367, 27.882863998413086, 27.692119598388672, 27.692119598388672, 27.692119598388672, 27.533912658691406, 27.533912658691406, 27.533912658691406, 27.533912658691406, 27.515178680419922, 27.441162109375, 27.387943267822266, 27.277503967285156, 27.26803207397461, 27.219268798828125, 26.877029418945312, 26.877029418945312, 26.803604125976562, 26.803604125976562, 26.803604125976562, 26.803604125976562, 26.803604125976562, 26.73505401611328, 25.994327545166016, 25.861173629760742, 25.861173629760742, 25.861173629760742, 25.861173629760742, 25.861173629760742, 25.861173629760742, 25.861173629760742, 25.861173629760742, 25.861173629760742, 25.724254608154297, 25.724254608154297, 25.724254608154297, 25.724254608154297, 25.724254608154297, 25.30748176574707, 25.30276107788086, 25.241439819335938, 24.917268753051758, 24.917268753051758, 24.896915435791016, 24.83742332458496, 24.83742332458496, 24.797161102294922, 24.758955001831055, 24.724166870117188, 24.704727172851562, 24.566131591796875, 24.566131591796875 ], "content": [ "I use an ACRU122 NFC reader writer with libnfc 1.7.1 from Github https : github.com nfc-tools libnfc blob libnfc-1.7.1 .", "libnfc .. . .. . libnfc is a library for NFC controller chips and provides a standardized way to access an NFC interface .", "libnfc is an abstraction-layer for the NFC functionality of NFC interface devices like the ACR122U .", "This libnfc http : nfc-tools.org index.php title Libnfc supports only NXP s PN532 NFC controller and therefore doesn t work with current NFC controllers integrated into Android devices NXP s PN544 PN547 Broadcom s BCM2079x .", "I have downloaded libnfc and have run the nfc-poll program in examples using the included MIFARE Classic 1K card .", "Am programming for NFC using the libnfc library in the C language .", "The Android NFC service uses libnfc-nxp nci to access that device file .", "I am very new to NFC devices reading but I have managed to implement in my own project using the code from nfc-mfultralight.c http : www.libnfc.org api nfc-mfultralight 8c source.html libnfc .", "Since the command set of NTAG216 is compatible to the MIFARE Ultralight command set including the COMPATIBILITY WRITE command you could also use the convenience-methods for MIFARE tags defined in utils mifare.h https : github.com nfc-tools libnfc blob libnfc-1.7.1 utils mifare.h : .. . .. . nfc initiator mifare cmd pnd MC WRITE page mp .. . nfc initiator mifare cmd pnd MC READ page mp .. . .. . See the nfc-mfultralight utility for complete code examples : nfc-mfultralight.c https : github.com nfc-tools libnfc blob libnfc-1.7.1 utils nfc-mfultralight.c .", "I have installed successfully libnfc and I am able to use the .exe examples that are in libnfc utils like nfc-mfclassic.exe nfc-list.exe .. . .. . .. . I would like to manipulate Mifare cards and use NDEF Format so I am trying to install libfreefare on Windows .", "Once you enumerated and activated the tag you can use the method nfc initiator transceive bytes https : github.com nfc-tools libnfc blob libnfc-1.7.1 libnfc nfc.c L764 to send raw NTAG commands such as READ WRITE to the tag .", "am working with the libnfc open-source libraries in C and am trying to declare the variables needed to initialize nfc in global mode i.e .", "You can use libnfc for this communication .", "I need low-level access to the NFC device because the standard API does not allow me to perform all the actions I need .", "So the question is now how you could bypass the standard Android API and either use the existing NFC stack libnfc-nci nxp or Android NFC service directly .", "However if you are talking about libnfc-nxp https : android.googlesource.com platform external libnfc-nxp for NXP s PN54x or libnfc-nci https : android.googlesource.com platform external libnfc-nci for Broadcom s BCM2079x and possibly other NCI-compliant chips that s a different story .", "In that case the easiest option would be to use the existing libnfc- and Android NFC service source code and extend that with your functionality .", "Whereas libnfc talks to a device with a NFC controller chips And how can I distinguish a card reader with without a controller chip", "Now I have installed successfully Libnfc on Windows 8 and it works fine I can use nfc-list .", "What is the recommended way to poll for Mifare Desfire cards using nfc-tools libnfc and libfreefare", "I have an ACR122 and I am trying to connect to it using lib-nfc .", "While it is called open and hardware-independent it is in fact an NFC stack designed specifically for Inside Secure s MicroRead NFC chipset .", "I ve set up my environment with Libnfc and the proper reader driver .", "I am communicating with the card via a PC dongle and libNfc not android .", "See also C : libnfc-build CMakeFiles CMakeOutput.log .", "So in the case of nfc initiator transceive bytes this means that libnfc will do the following : .. . .. . Send the PN532 command InDataExchange starting with d4 40 for sending data over NFC to the other NFC device .", "Is libnfc not suitable for the reader", "Is this something because of libnfc", "Also have posted my query at lib-nfc forum .", "So I ve just got my RPI2 and PN532 set up and I am able to poll nfc devices using UART port and libnfc library .", "So under normal circumstances the device file is already used by the Android NFC service and therefore inaccessible unusable by other libnfc- instances .", "I have installed LibNFC successfully and can poll the device and also get what I want from the example NFC-Emulate-Forum-Tag2 .", "PS : This is my first project with NFC devices libnfc and MIFARE Ultralight tags so any things you think I should read please do tell me .", "Here is how regex is able to uniquely identify the NFC tags : .. . .. . Is there a way to distinguish NFC Readers from other readers", "Each visitor has his own NFC enabled phone Android Windows Phone with NFC application you provided .", "From my point of view I don t know much about libnfc pcsclite and libnfc do the same .", "Libnfc need to read and write pn532 XRAM and sometimes SFR .", "I m really trying hard to install libnfc but i keep ketting the error : .. . .. .", "Like adding product id into the NFC tag.. . and product id is fixed for that reader or writer .. . .. . So at time of tapping NFC writer will write the product id which fixed for each writer into the NFC tag .. . .. . Is that possible", "A device that controls NFC reader writer is connected to .", "I found libnfc.Now my question is can I use the libnfc for accessing this module", "Using NFC Reader ACR122U .. . .. . Installed libnfc from here link1 http : chocolatechips.me how-to-raspberry-pi-rfid-reader-kiosk-acr122u .. . .. . Running an Attendance Project on Raspberry Pi 2 using python mysql on github https : github.com davidcdupuis nfcattendancelogger issues 1 .", "Is there a way to do with something other than libnfc", "Other than that the same as for libnfc-nxp -nci applies to it .", "Yes you can use libnfc for that purpose .", "I wrote Go bindings for the libnfc a while ago .", "I don t have much knowledge regarding NFC any links for beginners in C for linux are appreciated .. . .. . I have lib-nfc on my machine centos 6.5 64bit and if I do nfc-list I get : .. . .. . NFC device : ACS ACR122U PICC Interface opened .. . .. . So I assume it is connected I don t see any red light on When I try to run the . nfc-pool example I get this : .. . .. . What am I doing wrong", "So i m trying to install libnfc using this guide : .. . .. . http : www.mobilefish.com developer libnfc libnfc.html .. . .. . However when i try to configure CMake as described in the tutorial i encounter the following error : .. . .. . Configuring incomplete errors occurred", "First thing I am learner : .. . .. . Scenario is I have five art pieces and 50 visitors .. . .. . So I am thinking I will implement 5 NFC card reader and writer and 50 NFC tags .. . .. . All NFC TAGS are already filled up with user data like email email phone .. . .. . And all NFC reader and writer are setup with art pieces .", "NFC support isn t always that great .", "happened long before so i kinda forgot but most likely it s libnfc After installing libnfc it suddenly stops blinking .", "Here s the link I followed for setting up everything including the links to the libraries : mobilefish.com developer libnfc libnfc.html http : www.mobilefish.com developer libnfc libnfc.html", "I managed to compile it as 32bit library with MinGW using this tutorial http : www.mobilefish.com developer libnfc libnfc.html .. . .. . How to compile libnfc into 64bit library under Windows", "+barny how would I get the information connection of the nfc reader", "I need to implement something like NFC virtual shopping store .", "But problem is I don t want to use mobile phone as NFC reader .", "When user scans NFC tag art piece information is stored in application .", "Purpose of NFC controller chips : physical and logical interface to NFC infrastructure NFC devices NFC tags contactless smartcards contactless-smartcard readers etc", "To summarize pcsclite is for access to smartcard readers that could also be contactless-smartcard readers and libnfc is for access to NFC interfaces which are something different than smartcard readers though they may sometimes be used for the purpose of reading contactless smartcards .", "In your case you are using the acr122 usb interface driver libnfc will directly interact with the NFC CCID device exposed by the ACR122U and will directly send CCID frames containing the reader-specific commands APDU-wrapped native commands for the PN532 NFC controller inside the ACR122U .", "I would suggest that you first look into the functionality that the existing Android NFC service provides beyond what is available through the Android API .", ".. . .. . I WANTED TO MONITOR THE USER when they scan from the NFC Reader .. . .. . Explaining in details Case Scenario : let s say you had 10 NFC readers in a company how would you programmatically differentiate an NFC reader from another especially if the user scanned their tag", "Could anyone point me to a simple way to read-write data or at least give a clear explanation if there is only a low-level solution", "User will come to gallery and tap NFC TAG on the required art piece or somethings .. . .. . PROBLEM IS HERE .. . .. . can I update NFC tag data dynamically when he tapping", "In case you cannot use NFC enabled phone : .. . Store only unique ID on visitor NFC tag and have user data stored in central database server .", "So using libnfc are the following steps correct to send something to tag", "Environment : Win10 libnfc 1.6.0 .. . .. . Does the tag enter ACTIVE state at this point", "I can use libnfc examples to read manufacturer ID and it works fine .", "I successfully compiled libnfc written in C under Windows .", "But now I want to write a program on python-2.7 with libNFC .", "Though you could try to change the backend used by libnfc from arc122 usb to acr122 pcsc .", "For an example of how to accesws MIFARE Classic cards see .. . .. . the nfc-mfclassic util that s included in the libnfc package see nfc-mfclassic.c https : code.google.com p libnfc source browse utils nfc-mfclassic.c .. . the micmd tool available here : https : code.google.com p micmd .. . .. . With regard to formatting MIFARE Classic cards with NDEF data I suggest that you have a look at the application note from NXP on this topic : .. . .. . NFC Type MIFARE Classic Tag Operation http : www.nxp.com documents application note AN1304.pdf .. . MIFARE Classic as NFC Type MIFARE Classic Tag http : www.nxp.com documents application note AN1305.pdf .. . .. . For security matters isn t better to have DESFire 4k or 8k instead of Misfare 1k in order to be sure that my card is secure can not be overwritten", "I have tested many syntax with the nfc-mfclassic command x X w W.. . but it does not change anything .", "I am still struggling on how to Identify the NFC reader in this mysql table field example .", "Five NFC readers writers are also very expensive minimum 50 for once piece .", "More common scenario would be : .. . Each art piece has its own NFC tag .", "When user taps NFC tag controller adds record to database with user ID .", "I have a NFC card that implements Mifare Plus over IsoDep NFCa and NDEF .", "NFC Forum specifications must now be paid for depending on budget the other approach may be more appealing .", "The NFC Forum Type 4 Tag was needed and provides a very clear explanation of the commands to use to retrieve data .", "I got this question while I browsing this link http : nfc-tools.org index.php title Devices compatibility matrix .", "I wanna know my own NFC TAG ID on my phone .", "This depends on several factors : .. . .. . Is a secure element attached to the NFC controller in that phone", "Is the NFC controller configured to expose an attached secure element to the outside world", "Does the NFC controller expose exactly one card-emulating entity e.g .", "If you have another example of a NFC libary thats ok to", "@BrianSidebotham here is the GitHub link : github.com PeterNjeru nfc https : github.com PeterNjeru nfc", "But the code being used above is part of the code am using in my applications for reading nfc cards and that s also where I began learning about reading nfc cards that s why I asked @user1118094 to check those tutorials out .", "NFC has relatively low data-transfer rate as mentioned for example here : http : stackoverflow.com a 14717391 371804 .", "YOu would certainly need root access to achieve any of that as you will have to force the exsiting NFC service to shut down and as your replacement NFC service will need access to the NFC controller s device file .", "I m trying to use a NFC shield with a PN532 NFC chip http : www.sunfounder.com index.php c downloadscs a Manualdetails id 99 name Raspberry 20Pi attached to my Raspberry Pi to have the same effect as a NFC tag .", "I used itead nfc https : www.raspberrypi.org forums viewtopic.php f 45 t 78966 module interface with rasberry pi and using libnfc 1.7.1 and libllcp for communicate with mobile .", "Each nfc reader has its own connection - use the information about the connection to record which reader read a particular tag", "I am working on a school project and currently have a Raspberry Pi running standard Raspbian Wheezy connected to the Adafruit PN532 NFC Shield .", "It will grant better understanding how this whole NFC works .", "Input : D4 08 ADR1H ADR1L VAL1 ADRnH ADRnL VALn .. . .. . ADR1H ADR1L First address High and Low bytes VAL1 First value to be written ADRnH ADRnL nth address High and Low bytes VALn nth value to be written .", "You might want to read the following specifications by the NFC Forum http : www.nfc-forum.org they are available on their website : .. . .. . Type 2 Tag Operation Specification .. . NFC Data Exchange Format NDEF Technical Specification .. . NFC Record Type Definition RTD Technical Specification .. . NFC Text RTD Technical Specification", "I want to use the NFC reader with i-MX6 based custom board which is running on linux kernel.The module I have is AMS AS39111B .I want to access this module using C programming thats why I was searching the API", ".. . .. . If i don t reboot after installing driver it still blinks until i install libnfc i think .", "@Peter can you update your post to include link-to compiler libusb and libnfc that you used" ] }
{ "confidence": [ 63.97745132446289, 54.021278381347656, 50.93680953979492, 48.629703521728516, 48.498409271240234, 47.27464294433594, 44.59876251220703, 44.4323616027832, 42.97297286987305, 42.464698791503906, 41.84435272216797, 41.33993148803711, 41.02021789550781, 40.03998947143555, 39.7337646484375, 39.46437072753906, 39.391639709472656, 38.695960998535156, 38.695960998535156, 38.51313400268555 ], "content": [ "Question : I would like to use libnfc on a smartphone I can use both Android or Windows phones . I need low-level access to the NFC device because the standard API does not allow me to perform all the actions I need . Is that possible Is there a way to do with something other than libnfc Can some one help me .. . Answer : Windows Phone .. . .. . On a Windows Phone I don t think that it will be easy for you to bypass the Windows API and directly access the NFC controller s driver layer with your own software stack . Android .. . .. . On Android that depends on what libnfc you are talking about and on how deep you want to go into the device s Android system . This libnfc http : nfc-tools.org index.php title Libnfc supports only NXP s PN532 NFC controller and therefore doesn t work with current NFC controllers integrated into Android devices NXP s PN544 PN547 Broadcom s BCM2079x . However if you are talking about libnfc-nxp https : android.googlesource.com platform external libnfc-nxp for NXP s PN54x or libnfc-nci https : android.googlesource.com platform external libnfc-nci for Broadcom s BCM2079x and possibly other NCI-compliant chips that s a different story . You might be able to use them or adapt them to your needs . So the question is now how you could bypass the standard Android API and either use the existing NFC stack libnfc-nci nxp or Android NFC service directly . I would suggest that you first look into the functionality that the existing Android NFC service provides beyond what is available through the Android API . If that functionality is already sufficient you could try to directly interface with the NFC service and simply use that functionality . If you need more functionality it will get complicated : The NFC controller is integrated into the Android system through a kernel driver and is accessible as a Linux device file under dev . The Android NFC service uses libnfc-nxp nci to access that device file . So under normal circumstances the device file is already used by the Android NFC service and therefore inaccessible unusable by other libnfc- instances . Moreover only the NFC service or rather its Linux user has access to the device file . So there are two options : .. . .. . 1 . You can modify the whole Android system i.e . you create a customized Android system firmware . In that case the easiest option would be to use the existing libnfc- and Android NFC service source code and extend that with your functionality . You can even adapt the Android API of your custom firmware to your needs . 2 . You want to change a live system i.e . you do not want to flash a customized firmware onto the device . In that case you would need to replace the existing Android NFC service with your own NFC service that contains the extended functionality you need . YOu would certainly need root access to achieve any of that as you will have to force the exsiting NFC service to shut down and as your replacement NFC service will need access to the NFC controller s device file . Comment : Thank you I ll try but what about open-nfc.org http : open-nfc.org Comment : Open NFC doesn t seem to have much relevance in practice right now at least not with Android or Windows . While it is called open and hardware-independent it is in fact an NFC stack designed specifically for Inside Secure s MicroRead NFC chipset . So it s not really usable for any other chip hardware unless you create a proper HAL for it . Other than that the same as for libnfc-nxp -nci applies to it . Comment : And what about a BusyBox approach Would this work", "Question : Can someone explain what is the difference relationship between the two Now I m using GPShell + globalplatform + pcsclite too manipulate the NFC-enabled card . From my point of view I don t know much about libnfc pcsclite and libnfc do the same . .. . Answer : pcsclite or rather PC SC in general and not just the pcsclite implementation .. . .. . PC SC is a smartcard API for the personal computer platform initially mainly destop computers but also servers etc and even smartphones and other embedded systems . So PC SC is a standard that provides interoperability between arbitrary smartcard readers and arbitrary PC platforms from different manufacturers . pcsclite is the implementation of this interoperability layer from developer point of view basically providing a standardized API that is idependent of the smartcard and reader platform as well as the target OS . PC SC comes from times before contactless smartcards and has since been extended to contactless smartcards and contactless memory cards . libnfc .. . .. . libnfc is a library for NFC controller chips and provides a standardized way to access an NFC interface . While this also permits access to contactless smartcards and memory cards NFC tags NFC controllers have much more capabilities peer-to-peer mode communication and host card emulation . These capabilities are covered by libnfc btw there is not really a standard defining the interfaces and layers of the software stack behind libnfc as is with PC SC . This is starting to change with the NFC Forum s NCI specification at least for the lower levels . To summarize pcsclite is for access to smartcard readers that could also be contactless-smartcard readers and libnfc is for access to NFC interfaces which are something different than smartcard readers though they may sometimes be used for the purpose of reading contactless smartcards . So libnfc and pcsclite simply have a different purpose and comparing them is pretty much like comparing apples and oranges . Comment : Thanks for your reply . Comment : Thanks for your reply . Let me rephrase your comments - smartcard readers don t have a controller chip as the PC is its controller chip . Whereas libnfc talks to a device with a NFC controller chips And how can I distinguish a card reader with without a controller chip Comment : No smartcard readers also have controller chips but these controller chips are smartcard-reader specific and are usually no NFC controllers . Purpose of controller chips in smartcard-reader : physical and logical interface to contact contactless smartcards . Purpose of NFC controller chips : physical and logical interface to NFC infrastructure NFC devices NFC tags contactless smartcards contactless-smartcard readers etc Comment : Thank you for your crystal explain .", "Question : null .. . Answer : I am working on a school project and currently have a Raspberry Pi running standard Raspbian Wheezy connected to the Adafruit PN532 NFC Shield . I have downloaded libnfc and have run the nfc-poll program in examples using the included MIFARE Classic 1K card . Everything worked fine and there were no issues . Now I am wondering how I can read and write integer data to the card for my project . I have looked into the structure of the MIFARE card but it seems a little above my expertise . Could anyone point me to a simple way to read-write data or at least give a clear explanation if there is only a low-level solution", "Question : I have been trying for a long while now to write and read data from my NFC cards . The cards are NTAG216 . I can use libnfc examples to read manufacturer ID and it works fine . But I need to write to each tag some custom data e.g . the string abcdefg and read it back . I have read almost everything relevant I could find about libnfc but all of them does not talk about this specific area . I would appreciate any guidance . Code example will be appreciated . I use an ACRU122 NFC reader writer with libnfc 1.7.1 from Github https : github.com nfc-tools libnfc blob libnfc-1.7.1 . Comment : thanks for editing the question .. . Answer : Once you enumerated and activated the tag you can use the method nfc initiator transceive bytes https : github.com nfc-tools libnfc blob libnfc-1.7.1 libnfc nfc.c L764 to send raw NTAG commands such as READ WRITE to the tag . Since the command set of NTAG216 is compatible to the MIFARE Ultralight command set including the COMPATIBILITY WRITE command you could also use the convenience-methods for MIFARE tags defined in utils mifare.h https : github.com nfc-tools libnfc blob libnfc-1.7.1 utils mifare.h : .. . .. . nfc initiator mifare cmd pnd MC WRITE page mp .. . nfc initiator mifare cmd pnd MC READ page mp .. . .. . See the nfc-mfultralight utility for complete code examples : nfc-mfultralight.c https : github.com nfc-tools libnfc blob libnfc-1.7.1 utils nfc-mfultralight.c . However you might want to adapt that code to use the more efficient MIFARE Ultralight NTAG WRITE 0xA2 command instead of the COMPATIBILITY WRITE which is what MC WRITE uses . Comment : thanks Mike . I will go though whatever you wrote and come back . On thing do those command allow rewrite or once you write once everything becomes read only Comment : @StefanoMtangoo That depends on where you write to . NTAG216 has one one-time programmable page page 3 and re-writable data pages as long as you don t set thew lock-bits for those pages .", "Question : null .. . Answer : I want to use the NFC reader with i-MX6 based custom board which is running on linux kernel.The module I have is AMS AS39111B .I want to access this module using C programming thats why I was searching the API I found libnfc.Now my question is can I use the libnfc for accessing this module I got this question while I browsing this link http : nfc-tools.org index.php title Devices compatibility matrix .", "Question : null .. . Answer : I have an ACR122 and I am trying to connect to it using lib-nfc . is this the correct step I don t have much knowledge regarding NFC any links for beginners in C for linux are appreciated .. . .. . I have lib-nfc on my machine centos 6.5 64bit and if I do nfc-list I get : .. . .. . NFC device : ACS ACR122U PICC Interface opened .. . .. . So I assume it is connected I don t see any red light on When I try to run the . nfc-pool example I get this : .. . .. . What am I doing wrong Any links to tutorials or books regarding NFC USB communication are welcomed with examples in C if possible . I am really trying to learn and not have someone write anything for me . Thanks Comment : Is there a PC SC daemon running on that machine If yes you might want to try if disabling it helps . Or you might at least want to prevent it from accessing the ACR122U . Comment : I started the daemon and then I got a red light on the ACR . Comment : If the daemon was not running before than that s not the cause of your problem . Though you could try to change the backend used by libnfc from arc122 usb to acr122 pcsc .", "Question : I am very new to NFC devices reading but I have managed to implement in my own project using the code from nfc-mfultralight.c http : www.libnfc.org api nfc-mfultralight 8c source.html libnfc . What I don t understand is that when I read the data from a MIFARE Ultralight band I get lots of garbage . For example I have the number 255555574558888 in the tag I used an Android device to write this number to the tag . Now when I run : .. . .. . I get this .. . .. . This is from the examples of libnfc so shouldn t this program just read the correct data The Android app I am using just sees the value 255555574558888 . The value -67644-67546-2346 is part of what I had written before . How do I know just the correct data I need to read What should I change in the example code so that it works correctly I am using an ACR122 to read the data from the tags . PS : This is my first project with NFC devices libnfc and MIFARE Ultralight tags so any things you think I should read please do tell me . Edit 1 .. . .. . So I have found this question : Reading a NFC Mifare card with NXP Reader Library http : stackoverflow.com questions 22126314 reading-a-nfc-mifare-card-with-nxp-reader-library .. . .. . Which I think helps me out a bit . I printed out the hex value of another test string and got this .. . .. . I see the 3d followed by 0a and then d1 but what is all the values before the 3d Is this something because of libnfc .. . Answer : The data you are seing in pages 0 and 1 bytes 0 to 7 is the card s UID . Page 2 contains card-specific data bytes 8 and 9 and the lock bytes bytes 10 and 11 . Page 3 contains the Capability Container CC that indicates that this tag is formatted according to the NFC Forum Type 2 tag operation specification version 1.1 . The user data area of the tag starts at page 4 . As this tag follows the NFC Forum s tag operation specification the NDEF data on it is stored in an NDEF-TLV object tag 0x03 length 0x0A . 0xD1 indicates an NDEF message that consists of one record in short format with an NFC Forum record-type . The record type T 0x54 means it is a Text record . The Text record contains the language definition en English and the text hey 0x68 0x65 0x79 . The data area is terminated by the Terminator-TLV tag 0xFE length 0x00 . Moreover there seems to be data from a previous NDEF message that was larger than the current one . As data is written in pages 4 bytes and a tag s data area is typically not cleared when a new message is written the old data is still readable from the tag . You might want to read the following specifications by the NFC Forum http : www.nfc-forum.org they are available on their website : .. . .. . Type 2 Tag Operation Specification .. . NFC Data Exchange Format NDEF Technical Specification .. . NFC Record Type Definition RTD Technical Specification .. . NFC Text RTD Technical Specification", "Question : I have a NFC card that implements Mifare Plus over IsoDep NFCa and NDEF . I am communicating with the card via a PC dongle and libNfc not android . I have read thru the 7816-4 but am still confused as to what the first steps I should be taking when communicating with the card . Should I for example be selecting the MF or EFDir Reading from these files .. . Answer : To program reading and writing NDEF data on a Type 4 Tag requires either the NFC Forum Type 4 Tag specification or learning from existing open-source code . NFC Forum specifications must now be paid for depending on budget the other approach may be more appealing . For someone suitably familiar with the Python programming language a source of inspiration may be the Type 4 Tag reader implementation of http : nfcpy.org in file nfc tag tt4.py . Comment : For anyone else who stumbles upon this question Stephens answer is exactly correct . I was attempting to use standard commands from the ISO 7816-4 spec . The NFC Forum Type 4 Tag was needed and provides a very clear explanation of the commands to use to retrieve data . It s basically a walkthrough .", "Question : I am new to NFC and I want to learn more about this so I bought a PN532 NFC shield from Adafruit and a couple of Mifare 1K Card . Now I have installed successfully Libnfc on Windows 8 and it works fine I can use nfc-list . I have tried to install libfreefare but I have errors I have posted a topic on that .. . .. . But I really need to be able to format cards to NDEF and to read and write NDEF data on a MIFARE Classic 1K card . Does anyone know how to do so Is it possible to use the libnfc.dll to do so Does anyone have exemple or tutorial on this For security matters is it better to have DESFire 4k or 8k instead of MIFARE Classic 1k in order to be sure that my card is secure can not be overwritten .. . Answer : Yes you can use libnfc for that purpose . For an example of how to accesws MIFARE Classic cards see .. . .. . the nfc-mfclassic util that s included in the libnfc package see nfc-mfclassic.c https : code.google.com p libnfc source browse utils nfc-mfclassic.c .. . the micmd tool available here : https : code.google.com p micmd .. . .. . With regard to formatting MIFARE Classic cards with NDEF data I suggest that you have a look at the application note from NXP on this topic : .. . .. . NFC Type MIFARE Classic Tag Operation http : www.nxp.com documents application note AN1304.pdf .. . MIFARE Classic as NFC Type MIFARE Classic Tag http : www.nxp.com documents application note AN1305.pdf .. . .. . For security matters isn t better to have DESFire 4k or 8k instead of Misfare 1k in order to be sure that my card is secure can not be overwritten .. . .. . Right . MIFARE Classic security is know to be completely broken since 2008 2009 . This means that .. . .. . Anyone can easily find the access keys for your card . All an attacker needs for this is the card . Anyone can read your card regardless of what access keys you set though using it as NDEF tag implies that you want to have it world-readable anyways . Unless you permanently write protect all sectors of your card this means that you set the access conditions in a way that no block can be written with any access key an attacker can easily overwrite any data . Depending on your requirements digital signatures cryptographic checksums may be suitable to overcome this issue . It s rather easy to create perfect clones of MIFARE Classic cards . Comment : thank you so much for your answer i will have a look to your suggestions and get back to you ASAP . Comment : What about NTAG216 I want to be able to do the same", "Question : I need to implement something like NFC virtual shopping store . But problem is I don t want to use mobile phone as NFC reader . First thing I am learner : .. . .. . Scenario is I have five art pieces and 50 visitors .. . .. . So I am thinking I will implement 5 NFC card reader and writer and 50 NFC tags .. . .. . All NFC TAGS are already filled up with user data like email email phone .. . .. . And all NFC reader and writer are setup with art pieces . User will come to gallery and tap NFC TAG on the required art piece or somethings .. . .. . PROBLEM IS HERE .. . .. . can I update NFC tag data dynamically when he tapping Like adding product id into the NFC tag.. . and product id is fixed for that reader or writer .. . .. . So at time of tapping NFC writer will write the product id which fixed for each writer into the NFC tag .. . .. . Is that possible Sorry I am not good in explaining problem in short .. . : .. . .. . Please let me know it is possible or not . . and I am on right track or not .. . .. . thanks in advanced .. . Answer : The answer is : yes you can but it is not very practical . You would have to connect all five card readers writers to a controller like PC and implement writing logic there . Five NFC readers writers are also very expensive minimum 50 for once piece . More common scenario would be : .. . Each art piece has its own NFC tag . This tag is read-only so no one can change data and contains information about art piece id price .. . . Each visitor has his own NFC enabled phone Android Windows Phone with NFC application you provided . When user scans NFC tag art piece information is stored in application . In case you cannot use NFC enabled phone : .. . Store only unique ID on visitor NFC tag and have user data stored in central database server . When user taps NFC tag controller adds record to database with user ID . This way you have all the data tied to the user stored in one location and you do not have to write back to user tag . Comment : thanks a lot for the help. . but can you please tell what do you mean by controller in the second approch Comment : can you please explain what is controller Comment : A device that controls NFC reader writer is connected to . It can be PC or Raspberry PI etc.. . It communicates with reader writer over RS-232 or USB serial-port . You can use libnfc for this communication .", "Question : Am programming for NFC using the libnfc library in the C language . Am using the TDM-GCC MinGW Compiler and the CMAKE open-source build-system which I installed following this tutorial http : www.mobilefish.com developer libnfc libnfc.html for building compiling the code . I am trying to compile my program which includes imports a header file having a source file . A part of the header file card objects.h is : .. . .. . A part of the source code file card objects.c is : .. . .. . Both files are in the include dir directory at the current path relative to the main file . I have called the header file in the main program file as follows : .. . .. . when I try to compile the above program on my computer i get the following error : .. . .. . Can anyone figure out what I could have done wrong Keep in mind I have some other header-files with no source files just variable definitions which are being compiled with no problem . This is the only header file-source file import and it s not working . Anyone see a problem Comment : Sorry I jumped the gun in my last comment . However please supply your CMakeLists.txt file as clearly card objects.o doesn t get linked to main file.o Comment : @BrianSidebotham here is the GitHub link : github.com PeterNjeru nfc https : github.com PeterNjeru nfc .. . Answer : You CMakeLists.txt file is incorrect . Here is your original : .. . .. . In the FOREACH source EXAMPLES-SOURCES section you create two targets each one only has a single c file so you end up with SET TARGETS main file.c in the first iteration and SET TARGETS tests test progs.c on the second iteration . card objects.c is not referenced anywhere in the CMakeLists.txt file so it will never get built into any executable hence you get an undefined-reference to code that isn t being built.. . .. . .. . You should also add a cmake minimum required http : www.cmake.org cmake help v2.8.12 cmake.html command : cmake minimum required and project http : www.cmake.org cmake help v2.8.12 cmake.html command : project call to the CMakeLists.txt file too . Perhaps for example you need to use SET TARGETS source .c card objects.c Comment : Yap that worked Comment : @Peter can you update your post to include link-to compiler libusb and libnfc that you used I m programming using same library and can t get past compile process Comment : Here s the link I followed for setting up everything including the links to the libraries : mobilefish.com developer libnfc libnfc.html http : www.mobilefish.com developer libnfc libnfc.html Comment : Then all I had to do was edit the cmake file at the sources directory to include my new sources", "Question : null .. . Answer : I am trying to communicate nfc module pn532 with Android mobile . I used itead nfc https : www.raspberrypi.org forums viewtopic.php f 45 t 78966 module interface with rasberry pi and using libnfc 1.7.1 and libllcp for communicate with mobile . After run libllcp test program snep-client.c example .. . .. . I get this error .. . .. . error libnfc.driver.pn532 spi Unable to wait for SPI data . RX .. . .. . libllcp.mac.link Could not send 2 bytes .. . .. . Log : .. . .. . I used pn532 itead nfc module to communicate with android 4.3 samsung S3 . I used libnfc - libllcp - libndef to send data from raspberry-pi to android . Problem : .. . .. . My mobile vibrate when I tap it with nfc module but not showing any message and error occurs at pi console . Questions : .. . .. . Is 1.7.1 libnfc version is right to use with libllcp library and snep protocol to send my NDEF message to android If I send Text RTD Record to android than will phone display text on screen Please comment your view about this error-log May it help me to solve error . Thank you Comment : I solved problem I use nexus-5 android lolipop instead of samsung and it start working .", "Question : I am trying to send a direct command to the ACR122U reader . The simplest one I have is : FF 00 48 00 00 .. . .. . This command is suppose to return the Firmware version . Using the ACR122U tool I can see that it works fine . I am trying to use nfc initiator transceive bytes to send this and get the firmware version . This is how I am doing : .. . .. . This is always returning -2 . Is nfc initiator transceive bytes not the correct function What am I doing wrong Thanks PS : I have xFF x00 x00 x00 x05 on there because that s what the manual says to do API ACR122U v1.4.pdf section 6.1 direct commands .. . .. . I have turned on debuging on libnfc and I am seeing this : .. . .. . debug libnfc.driver.acr122 usb TX : 6f 0d 00 00 00 00 00 00 00 00 ff 00 00 00 08 d4 40 01 ff 00 48 00 00 debug .. . libnfc.driver.acr122 usb RX : 80 05 00 00 00 00 00 00 81 00 d5 41 27 90 00 .. . .. . I can see the ff 00 00 00 so I guess I don t have to specify that when I send a direct command but this is still returning this : .. . .. . debug libnfc.chip.pn53x Chip error : Command Not Acceptable 27 returned error : Invalid argument s -2 .. . .. . Is it the hex that libnfc is adding that is messing this up Please anyone I have also changed the initial code . I have also tried with nfc target send bytes by doing : .. . .. . nfc target send bytes pnd abtCmd 5 0 .. . .. . This gives me a segmentation-fault . .. . Answer : libnfc is an abstraction-layer for the NFC functionality of NFC interface devices like the ACR122U . So the method nfc initiator transceive bytes already handles the ACR122U device-specific protocol . In your case you are using the acr122 usb interface driver libnfc will directly interact with the NFC CCID device exposed by the ACR122U and will directly send CCID frames containing the reader-specific commands APDU-wrapped native commands for the PN532 NFC controller inside the ACR122U . So in the case of nfc initiator transceive bytes this means that libnfc will do the following : .. . .. . Send the PN532 command InDataExchange starting with d4 40 for sending data over NFC to the other NFC device . Wrap the PN532 native command into an APDU for transport over CCID starting with ff 00 00 00 08 . Wrap the whole command into a USB CCID-class frame starting with 6f 0d . And for the answer : .. . .. . Unwrap the answer CCID frame starting with 80 05 . Unwrap the response APDU d5 41 27 90 00 . Decode the native PN532 InDataExchange response d5 41 27 . For you this effectively means that you cannot use that method to send the ACR122U-specific APDU command ff 00 48 00 00 to get the firmware-version of the reader using this method . Instead you should use e.g . PC SC to directly send APDU commands to the reader if you want to use such commands . Comment : Thanks for the answer . Do you have any example code of the ps sc sending apdu commands Comment : @AntonioCS No not in C .", "Question : Using NFC Reader ACR122U .. . .. . Installed libnfc from here link1 http : chocolatechips.me how-to-raspberry-pi-rfid-reader-kiosk-acr122u .. . .. . Running an Attendance Project on Raspberry Pi 2 using python mysql on github https : github.com davidcdupuis nfcattendancelogger issues 1 . What do I want to achieve .. . .. . I WANTED TO MONITOR THE USER when they scan from the NFC Reader .. . .. . Explaining in details Case Scenario : let s say you had 10 NFC readers in a company how would you programmatically differentiate an NFC reader from another especially if the user scanned their tag database querying : solution I was thinking querying user s profile data . for example if you scan your name Id and time of scan will be added in a mysql table . I am still struggling on how to Identify the NFC reader in this mysql table field example . Here is how regex is able to uniquely identify the NFC tags : .. . .. . Is there a way to distinguish NFC Readers from other readers Thank you Comment : Each nfc reader has its own connection - use the information about the connection to record which reader read a particular tag Comment : Sorry but your description and your code are not sufficient to base a good advise on them . We have basically not information on your readers and the architecture . Comment : Sorry for confusing you the needed information is provided Comment : +barny how would I get the information connection of the nfc reader Thank you for your answer .. . Answer : The ACR122U is an older reader and doesn t have any uniquely identifiable data fields for you to discover in software . So if you re expecting to be able to move the reader from host device to host device you won t be able to verify which one it is . If you plan on having the reader parked on one host device during it s entire usage then you can seek out uniquely identifiable data on the host device to solve your problem . But that s a separate question . There are newer devices from ACS like the ACR35 and the ACR1255U-J1 that do include uniquely identifiable data fields in their firmware . These can be queried in software from a host device like a PC or a smartphone . We are authorized distributors of ACS products as well as from other manufacturers . You can check out our line of NFC readers here : .. . .. . http : flomio.com product-category readers .. . .. . We provide extensive support for these readers on our forums http : flomio.com ask-the-flomies including sample apps and development kits to help you get going quickly . Comment : thank you very much . I did not know that . now I even consider buying estimote beabvon Comment : Estimate beacons to achieve indoor navigation system", "Question : I m trying to use a NFC shield with a PN532 NFC chip http : www.sunfounder.com index.php c downloadscs a Manualdetails id 99 name Raspberry 20Pi attached to my Raspberry Pi to have the same effect as a NFC tag . Thus when it is read by a phone it will display plain text URL etc . I have installed LibNFC successfully and can poll the device and also get what I want from the example NFC-Emulate-Forum-Tag2 . How do I cahnge the data that is sent to the phone .. . Answer : The tag memory is emulated inside the NFC-Emulate-Forum-Tag2 example program that you use . The array nfcforum tag2 memory area contains the tag memory contents : .. . .. . See the Type 2 Tag Operation Specification http : www.cardsys.dk download NFC Docs NFC 20Forum 20Type 202 20Tag 20Operation 20Specification 201.1.pdf and the NFC Data Exchange Format NDEF specification http : www.cardsys.dk download NFC Docs NFC 20Data 20Exchange 20Format 20 28NDEF 29 20Technical 20Specification.pdf on how to encode the data inside the emulated tag memory area .", "Question : am working with the libnfc open-source libraries in C and am trying to declare the variables needed to initialize nfc in global mode i.e . all outside any function so that they are global but am getting the following error : .. . .. . what could be the problem EDIT : by the way they work perfectly when declared within the main method Comment : Did you mention extern before declaration. . Comment : @ANBU.SANKAR that is not the reason from the error message . probably some missing header file containing the declaration of nfc context nfc init . Also please note nfc init context is a fucntion call not a forward-declaration . Comment : Yes I did tried both with and without the extern but it still brought up the same error Comment : I think this is function declaration . Is it. . Comment : nfc init is function-call it cannot be used in a global-scope only inside some function . .. . Answer : This was solved by putting the nfc init context call inside the main function without the EXTERN keyword", "Question : I am on windows-8 64 bits . I have installed successfully libnfc and I am able to use the .exe examples that are in libnfc utils like nfc-mfclassic.exe nfc-list.exe .. . .. . .. . I would like to manipulate Mifare cards and use NDEF Format so I am trying to install libfreefare on Windows . I have followed a tutorial on libnfc.org showing how to have libfreefare on Windows and It worked fine . And I used cmake-gui to generate build file .. . .. . Coming now to the step of mingw32-make I have this error : .. . .. . Thanks for your help Comment : It seems to me : 1 . you may have not included a file in the compilation which has the definitions of the above undefined variables 2 . you may have included the file in your program but it is not mentioned in the Makefile file paths for your compiler to find . Could you first search in your file where the above variables are mentioned then check if the file they are included in is present as a include or if the file path is in one of the Makefile paths Comment : Do you have a compatible version of OpenSSL and did you properly link-to libcrypto Comment : @Peter I have found out that in mifare desfire.c there is include openssl rand.h so i thought it was a path problem then I changed it for include D : tools OpenSSL-Win64 include openssl rand.h but it didn t work . In the directory containing mifare desfire.c there is CMakeLists.txt I added include directories D : tools OpenSSL-Win64 include but didn t work is there a way to indicate additionnal include directory Comment : @MichaelRoland I ve Win64OpenSSL-1 0 1L.exe from here link http : slproweb.com products Win32OpenSSL.html link I don t think I linked it to libcryto i don t have it in the OpenSSL distribution . I ve libssl32.dll can I use this one at the place Comment : @wald See this question : Win7 OpenSSL libcrypto equivalent missing http : stackoverflow.com q 19321982 2425802 .. . Answer : I ve found a solution : .. . .. . At the root of the folder : libfreefare-0.4.0 there is CMakeLists.txt .. . .. . I replaced this line : .. . .. . set LIBS LIBS LIBNFC LIBRARIES OPENSSL LIBRARIES .. . .. . by this one .. . .. . set LIBS LIBS LIBNFC LIBRARIES D : tools OpenSSL-Win32 libeay32.dll D : tools OpenSSL-Win32 libssl32.dll .. . .. . And it worked fine Thanks @MichaelRoland for the tips on libcrypto equivalent", "Question : null .. . Answer : What is the recommended way to poll for Mifare Desfire cards using nfc-tools libnfc and libfreefare I prefer to use the libnfc nfc initiator poll target function as it uses hardware polling and is presumably more efficient but it doesn t seem to play nice with Desfire cards . My goal is to use Desfire cards to get access to a room so the process needs to be fairly fast . My setup is a PN532 based reader connected over I2C to a raspberry-pi and a custom C program using the latest development version of libnfc and libfreefare from git 1.7.1 as of current August 2015 . For Mifare classic cards I use the following in pseudocode : .. . .. . This works well and is fast card needs to be present for less than 1s .. . .. . For Desfire cards I tried the following : .. . .. . 1 . With hardware polling .. . .. . Hangs on desfire connect until I remove and replace the card so is not usable .. . .. . 2 . With repeated calls to freefare get tags .. . .. . This works but it very slow and CPU intensive .. . .. . 3 . Combined hardware polling and call to freefare get tags .. . .. . This works but is way too slow to be usable requires the card to be present for more than 3s .. . .. . Any advice is appreciated . Please note that I simplified the code above as much as possible and I m aware it doesn t work like this exactly . I m happy to provide the full code if that s helpful .", "Question : I m trying to use RFIDIOt with libnfc-1.7.0-rc7 on Windows 7 64 bit . I compiled dll from sources and it works perfect with programs like nfc-poll.exe and so on . But now I want to write a program on python-2.7 with libNFC . I want to use RFIDIOt to communicate with my PN532 uart reader but I can t run example program on windows . When I try to run : python cardselect.py -R RFIDIOt.rfidiot.READER LIBNFC .. . .. . I get an Error : .. . .. . I don t have an idea how to fix it.. . Please anybody help me This problem is only on Windows on Linux all works great but I want to use my program on Windows . How do I fix this error I m using python-2.7 libNFC-1.7.0-rc7 Windows 7 x64 and pn532 uart reader on COM1 . .. . Answer : Well.. . I solved this problem by accident . I launched this command : python cardselect.py -R RFIDIOt.rfidiot.READER LIBNFC as administrator . This idea went to me when I was reading this . http : winappdbg.sourceforge.net doc v1.5 reference winappdbg.win32.advapi32-pysrc.html .. . .. . P.S . : sorry for my English . I hope it will helpful for somebody .", "Question : null .. . Answer : I successfully compiled libnfc written in C under Windows . After compilation I get 3 files : libnfc.dll libnfc.dll.a libnfc.lib . I want to call functions of this library in my Go application . My test program .. . .. . nfc version - name of function available in library . I put libnfc.lib file in directory with go source and also copy folder nfc with header-files . If I put libnfc.dll or libnfc.dll.a instead of libnfc.lib - I get error message library not found . Then I run .. . .. . Go successfully compiled program but when I try to start it I get error : This application has failed to start because null .DLL was not found . How to properly use library with golang application Comment : I wrote Go bindings for the libnfc a while ago . Maybe you can use them . Comment : Yes I also tried to use this bindings . Install it by go get and write test program package main import github.com fuzxxl nfc import fmt func main res : nfc.Version fmt.Printf res But I couldn t managed to build it . Could you describe some steps in order to use your library Comment : well where did it fail Do you have the libnfc installed and set up so the Go compiler finds it Have you ever worked with DLLs before Comment : Now I create env variable LIBRARY PATH and point it to libnfc.lib file So Go compiler find it and successfully build app but I get same error when try to start it This application has failed to start because null .DLL was not found . Comment : When I try to register libnfc.dll by regsvr32.exe libnfc.dll I get error : DllRegisterServer entry-point was not found" ] }
[ "yes-answer-long", "yes-answer-short" ]
nfc
UNK_RELATION
bluebird@server@73
bluebird -- bluebird is a fully featured promise library for client and @placeholder javascript with focus on innovative features and performance .
{ "confidence": [ 49.3504753112793, 49.27496337890625, 49.27496337890625, 46.21201705932617, 44.17705154418945, 44.17705154418945, 42.87138748168945, 41.98509979248047, 41.30623245239258, 41.22318649291992, 40.2188835144043, 40.2188835144043, 40.2188835144043, 40.2188835144043, 40.2188835144043, 40.2188835144043, 40.06843948364258, 40.05973434448242, 39.84954833984375, 39.458778381347656, 39.371429443359375, 39.253849029541016, 39.253849029541016, 39.253849029541016, 38.67264938354492, 38.605064392089844, 38.605064392089844, 38.605064392089844, 38.524658203125, 38.46837615966797, 38.46837615966797, 37.890037536621094, 37.819496154785156, 37.70761489868164, 37.70761489868164, 37.64002990722656, 37.64002990722656, 37.64002990722656, 37.64002990722656, 37.33096694946289, 37.01370620727539, 37.01370620727539, 37.01370620727539, 36.9631233215332, 36.854461669921875, 36.56354904174805, 36.56354904174805, 36.550994873046875, 36.4834098815918, 36.33116912841797, 36.33116912841797, 36.196067810058594, 36.04867172241211, 36.04867172241211, 36.04867172241211, 36.04867172241211, 36.04867172241211, 35.66761016845703, 35.3972282409668, 34.892051696777344, 34.88725280761719, 34.88725280761719, 34.88725280761719, 34.88725280761719, 34.88725280761719, 34.876502990722656, 34.876502990722656, 34.876502990722656, 34.876502990722656, 34.876502990722656, 34.876502990722656, 34.876502990722656, 34.876502990722656, 34.432193756103516, 34.19145965576172, 34.00782012939453, 33.94451141357422, 33.922218322753906, 33.922218322753906, 33.911468505859375, 33.911468505859375, 33.911468505859375, 33.911468505859375, 33.911468505859375, 33.911468505859375, 33.911468505859375, 33.536468505859375, 33.449127197265625, 33.43620300292969, 33.43620300292969, 33.43620300292969, 33.33403396606445, 33.20198059082031, 33.10738754272461, 33.10738754272461, 33.03483963012695, 32.80037307739258, 32.76559829711914 ], "content": [ "But isn t bluebird faster compared to the native promise library", "Is it returning a bluebird promise", "@jfriend00 It returns a bluebird promise .", "However my javascript depends on BlueBird library .", "Is there a way to override this to use the promise implementation from bluebird", "@LukeP - That s what .map on a Bluebird promise does .", "I don t think mysql2 promise has anything to do with bluebird you shouldn t even need bluebird for mysql2 to work .", "Bluebird https : github.com petkaantonov bluebird .", "I m trying to wrap my head around promises using the Bluebird library for Node.js https : github.com petkaantonov bluebird .", "What commands do I need to execute to run the Bluebird Promise performance benchmark", "Bluebird 2.x and 3.x will throw on var findValue new Promise .", "I tried using both ES6 and Bluebird promise implementation .", "If a common value is returned Bluebird Bookshelf s choice for Promises turns it into a promise itself .", "I use bluebird and start to work with promise in the last 2 weeks.. .", "We can simulate a promise resolving in Bluebird using Promise.resolve on a value .", "It s not so much a limitation with the Promise native or bluebird API s .", "By now there are a number of libraries which do this for you : .. . .. . pg-promise https : www.npmjs.com package pg-promise - generic Promises A+ for PG .. . postgres-bluebird https : www.npmjs.org package postgres-bluebird .. . dbh-ph https : www.npmjs.org package dbh-pg .. . pg-bluebird https : www.npmjs.org package pg-bluebird", "I am using bluebird .", "But with bluebird on the browser client-side it s a total nightmare .", "@Bergi github.com petkaantonov bluebird blob master https : github.com petkaantonov bluebird blob master API.md promiseallarraydynamicpromise-values---promise this is .all", "I had a look at the bluebird promise FAQ https : github.com petkaantonov bluebird wiki Promise-anti-patterns in which it mentions that .then success fail is an antipattern https : github.com petkaantonov bluebird wiki Promise-anti-patterns the-thensuccess-fail-anti-pattern .", "If a function is synchronous - do NOT return a promise and do NOT utilize bluebird in it .", "The question concerns Bluebird as well as polyfilled and all native ES6 promise implementations .", "Here sample of my code : .. . .. . I m using bluebird promise .", "I m using the bluebird http : bluebirdjs.com library but I think the idea is the same for all of the promise libraries .", "How bluebird does it", "I m using bluebird .", "Bluebird has even deprecated it .", ".catch onRejected is Bluebird features left aside nothing but sugar for .then null onRejected .", "Is there a keyword yield similar to co in bluebird .", "yield of co and rest from bluebird", "Bluebird is indeed fast but performance isn t the main consideration here .", "Bluebird recommends using but promise-mysql doesn t support that https : github.com lukeb-uk node-promise-mysql issues 15", "However I was wondering how one ties a promise library like Bluebird with the typical stream-based processing of large-files .", "And those extra tools provide reasons to still use a promise library like Bluebird .", "I m using BlueBird .", "Bluebird is also the fastest .", "You re not useing Bluebird are you", "I am using Bluebird .", "Creating a promise is usually done with deferreds in Q although it now offers a promise constructor variant Bluebird encourages the promise constructor .", "I m totally new with promises and bluebird .", "I m using bluebird in this case if it matters .", "I m using Bluebird in a CLI app .", "It will still not have all the useful features that Bluebird does and I d be extremely surprised if it lives up to Bluebird s performance so there is still room for Bluebird alongside a future jQuery in some cases .", "I used Bluebird 3.1.1 if Cancellation is broken so how do i cancel promise in promise chain", "I check the source code and found that they use bluebird library .", "I m trying to figure out how to use promises correctly with the bluebird library .", "You can use a promise library that does promisification https : github.com petkaantonov bluebird blob master API.md promisification e.g .", "What s the equivalent in Bluebird", "https : github.com petkaantonov bluebird tree master benchmark", "Does 2 functions have to be present in bluebird .", "Bluebird .. . .. . Since you re using bluebird it has dedicated Promise.using https : github.com petkaantonov bluebird blob master API.md promiseusingpromisedisposer-promise-promisedisposer-promise--function-handler---promise and .disposer https : github.com petkaantonov bluebird blob master API.md disposerfunction-disposer---disposer functions built-in that let you handle taking releasing multiple resources at once you might want to consider .", "Not sure if has anything to do with Bluebird or not .", "Bluebird supports multiple concurrent Promises .", "I guess the same applies to Bluebird .", "Is it not possible to use Bluebird promisifyAll like that", "You don t need bluebird for any of this .", "Note that besides all the features Bluebird has over q one of the more important ones is that Bluebird will not run exceptionHandler but instead will automatically track unhandled rejections so you can throw freely with Bluebird promises and Bluebird will figure them out .", "http : stackoverflow.com q 20279484 1048572 for the generic solution : .. . .. . However Bluebird does offer https : github.com petkaantonov bluebird blob master API.md binddynamic-thisarg---promise an other way to call the function as a method :", "For anyone looking to use angular-bluebird .", "not exactly by default it uses system-wide promise and you can pass your preferred for example bluebird implementation as a parameter", "I have a promise chain bluebird that breaks up and I can t figure out why .", "I also get a false positive when I use native Promise not bluebird but the stack-trace isn t shown .", "I think I may be mixing up basic BlueBird concepts and trying to use them with request-promise .", "I want to guarantee a minimum delay on the resolution of a bluebird.js https : github.com petkaantonov bluebird promise .", "I m trying to develop a function with bluebird and request .", "Bluebird 3.0.6 .. . Should 7.1.1 .. . Node 4.2.3", "I heard that bluebird polyfill will fix this issues .", "Did you import bluebird before anything else", "For this reason Bluebird offers typed and predicate catches .", "Bluebird method does exactly the same of checking the length .", "How do I console.log the current bluebird config. .", "Will it be faster if I adopt bluebird all instead", "I am a beginner using the promise bluebird in node js to read all the csv files and convert to json in a bluebird function but for some reason I can t get it right .", "Update for bluebird 3 : .. . .. . The pg.connectAsync .. . .spread function connection release .. . call will not work anymore because the API of bluebird has changed : http : bluebirdjs.com docs new-in-bluebird-3.html promisification-api-changes .", "See the reference at : https : github.com petkaantonov bluebird blob master API.md promisejoinpromisethenablevalue-promises-function-handler---promise .. . .. . There are two ways to do it : .. . .. . .all https : github.com petkaantonov bluebird blob master API.md all---promise - good for a dynamic number of promises .. . .. . .join https : github.com petkaantonov bluebird blob master API.md promisejoinpromisethenablevalue-promises-function-handler---promise - good for a fixed number of promises and as for Bluebird s documentation it supplies a better performance than .all method .", "So I m a new convert to Bluebird from angular and I m trying to build unit tests for code that uses Bluebird promises .", "Use .settle https : github.com petkaantonov bluebird blob master API.md settle---promise", "IIRC .toArrayAsync works and then lets you use the promise-aware iteration methods from Bluebird", "I m using request 2.67.0 and bluebird 3.1.1 .", "There is nothing bluebird or promises can do here for you .", "Bluebird now allows adding yield handlers .", "Libraries like Q or Bluebird add a bunch more .", "Until then I use Bluebird to promisify whole libraries .", "If using Bluebird can I choose other option", "Which bluebird version do you use exactly", "I was confused by the fact that Promise and thenable types are used interchangeably in Bluebird docs http : bluebirdjs.com docs api promise.all.html and there s no mention of thenables promise-likes .", "If you re using the Bluebird Promise library then it has Promise.promisify and Promise.promisifyAll which make it pretty easy to promisify things that use the standard node.js async callback so you can just control everything with Promise logic .", "Is there a beginners guide to bluebird I can t seem to find any", "I m either missing some major concept with promises or with Bluebird .", "Also see yield in bluebird but it is with co-routines ping pong example .", "Using Bluebird Promises the easy way to do this is to create your client normally and then run the promisifyAll on the client .", "Assumed that looking at the method length : .. . .. . could be considered a bad practice as stated by @madara-uchiha the bluebird library has a method caller function that is : .. . .. . UPDATE I have added a working snippet of the Bluebird code to discuss it .", "If you prefer bluebird version of promises you can pass it as a parameter to mysql2 : .. . .. . See https : github.com sidorares node-mysql2 blob c487f542f7f4416f9759319225197c383b4937fb promise.js L5 .. . .. . By default global Promise is used but just doing var Promise require bluebird does not make it global .", ".. . .. . Instead you should use this way : .. . .. . See the relevant documentation bits : Promise.defer https : github.com petkaantonov bluebird blob master API.md promisedefer---promiseresolver and new Promise https : github.com petkaantonov bluebird blob master API.md new-promisefunctionfunction-resolve-function-reject-resolver---promise .", "Approach 4 : promisify child process.spawn with bluebird .. . .. . i opened an issue https : github.com petkaantonov bluebird issues 754 on bluebird if child process.spawn is promisifiable .. . .. . So my question at all .", "The Bluebird library encourages the use of an object that is passed along using their bind method http : bluebirdjs.com docs api bind.html to assign a context object to a promise chain .", "Bluebird allows scoped binding of this value via .bind and promise array methods .map .reduce .filter etc ." ] }
{ "confidence": [ 56.4760856628418, 56.290191650390625, 54.70978927612305, 54.227684020996094, 53.9587287902832, 53.61899948120117, 53.56631088256836, 53.36115646362305, 53.333518981933594, 52.22329330444336, 52.03949737548828, 51.92033004760742, 51.73427200317383, 51.62466812133789, 51.15506362915039, 51.14608383178711, 50.502384185791016, 50.4384765625, 50.14511489868164, 49.924102783203125 ], "content": [ "Question : How can we use promise on top of Duktape .. . .. . My Scenario : Migrating a client-side javascript code that loads well on web browsers to Duktape . I am using Dukluv binding with Duktape and libuv library binary to run the JavaScript . However my javascript depends on BlueBird library . When I try to execute I get an error : no async scheduler available .. . .. . The problem is in bluebird s schedule.js line 33 . Code is below for reference : .. . .. . There is no webkitmutationobserver nor document object as I am running my script on Dukluv without any browser . I also tried to use Q library even there I get an error setTimeout not defined . Please suggest me a solution if possible with some snippet of code . Thanks .. . Answer : Bluebird lets you explicitly set the scheduler for these scenarios exactly . You need to tell bluebird how to execute a function directly : .. . .. . Do this above all your promise code - this will resolve the above error . Comment : Btw how can this work The error is thrown while requiring async.js so the module will be corrupted : D", "Question : What commands do I need to execute to run the Bluebird Promise performance benchmark https : github.com petkaantonov bluebird tree master benchmark .. . Answer : Instead of running performance.js https : github.com petkaantonov bluebird blob master benchmark performance.js directly you ll typically use the bench bash script https : github.com petkaantonov bluebird blob master bench that can be found in the root directory . The options are rather self-documenting . So here are some example invocations :", "Question : After Node.js added native support for promises are there still reasons to use libraries like Q or BlueBird For example if you are starting a new project and let s assume in this project you don t have any dependencies that use these libraries can we say that there are really no more reasons to use such libraries Comment : native promises have very very basic features . Libraries like Q or Bluebird add a bunch more . If you need those features then use those libraries . Comment : need is so opinion based Comment : This is like asking windows already comes with notepad do I need sublime text or visual-studio : Comment : I edited the title to make it less about need and more about reasons to still use promise libraries . This question can be answered by primarily supplying facts not opinion . It should be reopened because it can be answered by supplying facts and not primarily opinion . See the answer below as a demonstration of that . Comment : @JaromandaX - Please consider reopening now that the title and question have been tweaked to be more about why one would use a promise library rather than whether one needs to use a promise library . In my opinion this question can be answered by supplying facts and not primarily opinion - see answer below as a demonstration of that . .. . Answer : The old adage goes that you should pick the right tool for the job . ES6 promises provide the basics . If all you ever want or need is the basics then that should could work just fine for you . But there are more tools in the tool bin than just the basics and there are situations where those additional tools are very useful . And I d argue that ES6 promises are even missing some of the basics like promisification that are useful in pretty much every node.js project . I m familiar with Bluebird and it provides a bunch of tools beyond what ES6 promises provide . And those extra tools provide reasons to still use a promise library like Bluebird . PromisifyAll .. . .. . In any node.js project I immediately use Bluebird everywhere because I use .promisifyAll a lot on standard node.js modules like the fs module . Node.js does not itself provide a promise interface to the built-in modules that do async IO like the fs module . So if you want to use promises with those interfaces you are left to either hand code a promise wrapper around each module function you use or get a library that can do that for you or not use promises . Bluebird s Promise.promisify and Promise.promisifyAll provide an automatic wrapping of node.js calling convention async APIs to return promises . It s extremely useful and time saving . I use it all the time . Here s an example of how that works : .. . .. . The alternative would be to manually create your own promise wrapper for each fs API you wanted to use : .. . .. . And you have to manually do this for each API function you want to use . This clearly doesn t make sense . It s boilerplate code . You might as well get a utility that does this work for you . Bluebird s Promise.promisify and Promise.promisifyAll are such a utility . Other Useful Features .. . .. . Here are some of the Bluebird features that I specifically find useful there are a couple code examples below on how these can save code or speed development : .. . .. . In addition to its useful function Promise.map also supports a concurrency option that lets you specify how many operations should be allowed to be running at the same time which is particularly useful when you have a lot of something to do but can t overwhelm some outside resource . Some of these can be both called stand-alone and used on a promise that itself resolves to an iterable which can save a lot of code . .. . .. . Polyfill .. . .. . In a browser project since you generally want to still support some browsers that don t have Promise support you end up needing a polyfill anyway . If you re also using jQuery you can sometimes just use the promise support built into jQuery though it is painfully non-standard in some ways perhaps fixed in jQuery 3.0 but if the project involves any signficant async activity I find the extended features in Bluebird very useful . .. . .. . Faster .. . .. . Also worth noting that Bluebird s promises appear to be significantly faster than the promises built into V8 . See this post http : programmers.stackexchange.com questions 278778 why-are-native-es6-promises-slower-and-more-memory-intensive-than-bluebird for more discussion on that topic . .. . .. . A Big Thing Node.js is Missing .. . .. . What would make me consider using Bluebird less in node.js development would be if node.js built-in a promisify function so you could do something like this : .. . .. . Or just offer already promisified methods as part of the built-in modules . Until then I do this with Bluebird : .. . .. . It seems a bit odd to have ES6 promise support built into node.js and have none of the built-in modules return promises . This needs to get sorted out in node.js . Until then I use Bluebird to promisify whole libraries . So it feels like promises are about 20 implemented in node.js now since none of the built-in modules let you use promises with them without manually wrapping them first . .. . .. . Examples .. . .. . Here s an example of plain Promises vs . Bluebird s promisify and Promise.map for reading a set of files in parallel and notifying when done with all the data : .. . .. . Plain Promises .. . .. . Bluebird Promise.map and Promise.promisifyAll .. . .. . .. . .. . Here s an example of plain Promises vs . Bluebird s promisify and Promise.map when reading a bunch of URLs from a remote host where you can read at most 4 at a time but want to keep as many requests in parallel as allowed : .. . .. . Plain JS Promises .. . .. . Bluebird Promises Comment : though it is painfully non-standard in some ways - They claim that they are Promises A+ compatible now : - blog.jquery.com 2016 01 14 jquery-3-0-beta-released http : blog.jquery.com 2016 01 14 jquery-3-0-beta-released Comment : @thefourtheye - Yes I know they ve been working towards Promise A+ compatibility in 3.0 . But that s still in beta . If it lives up to the promise pun intended it may obviate some of the reason to use an external promise library in browser JS if you were already using jQuery . It will still not have all the useful features that Bluebird does and I d be extremely surprised if it lives up to Bluebird s performance so there is still room for Bluebird alongside a future jQuery in some cases . In any case the OP s question appears to be mostly about node.js . Comment : Wow I ve been using Q think i ll be switching to Bluebird Comment : @jfriend00 thank you for such a detailed answer Comment : To expand on this excellent answer it might come as a surprise at least it was for me that apparently Bluebird promises are faster than native ones http : programmers.stackexchange.com questions 278778 why-are-native-es6-promises-slower-and-more-memory-intensive-than-bluebird", "Question : I have a promise chain bluebird that breaks up and I can t figure out why . This fails with TypeError : undefined is not a function on .spread https : github.com petkaantonov bluebird blob master API.md spreadfunction-fulfilledhandler--function-rejectedhandler----promise . A console.log on the last .then show it returns . Exchanging spread for then makes the code run . What am I doing wrong What would make spread be undefined .. . .. . Update : Changing the last spread to the code below makes it work . .. . Answer : I m an idiot : missed including bluebird in that file so it was using the native implementation of promises https : developer.mozilla.org en docs Web JavaScript Reference Global Objects Promise which doesn t have spread .", "Question : What aspects of a promise library does the spec not cover What kind of things vary between implementations Please illustrate with examples of actual differences eg between Bluebird and Q . .. . Answer : Almost everything . The Promises A+ spec is aimed for promise interoperability it s built so promise libraries and now native promises can talk to each other . The idea is for it to be possible to predict how a promise behaves and to define how promises are assimilated by other libraries . Quoting the specification : .. . .. . This specification details the behavior of the then method providing an interoperable base which all Promises A+ conformant promise implementations can be depended on to provide . As such the specification should be considered very stable . Although the Promises A+ organization may occasionally revise this specification with minor backward-compatible changes to address newly-discovered corner cases we will integrate large or backward-incompatible only after careful consideration discussion and testing . Finally the core Promises A+ specification does not deal with how to create fulfill or reject promises choosing instead to focus on providing an interoperable then method . Future work in companion specifications may touch on these subjects . The following are not covered : .. . .. . Creating a promise that s the promise constructor https : github.com promises-aplus constructor-spec spec . Promise aggregation although most implementations support .all . Progression that s the progression spec https : github.com promises-aplus progress-spec which will soon be replaced imo . Cancellation that s the cancellation spec https : github.com promises-aplus cancellation-spec . Unhandled rejection monitoring there is no spec but there is an inspection discussion . Stack traces . Bluebird and Q for example are both completely Promises A+ complaint but differ on a lot of these : .. . .. . The next Q v2 introduces estimation where Bluebird intends to deprecate progression eventually in favor of something like C s IProgress . Creating a promise is usually done with deferreds in Q although it now offers a promise constructor variant Bluebird encourages the promise constructor . Bluebird has more robust and stronger promisification abilities turning a whole callback API to promises in a single command . Q author Kris built Q-IO which manually promisifies the filesystem and http modules . Bluebird allows scoped binding of this value via .bind and promise array methods .map .reduce .filter etc . Q has primitives like asynchronous queues and RPC via Q-connection in mind .. . Bluebird is about 100 times faster has better stack traces and automatic unhandled rejection detection . It also consumes a lot less RAM memory per promise . Here is another reference https : github.com petkaantonov bluebird issues 63 issuecomment-34140791 Comment : This is a great answer thank you", "Question : Array and loops through but I want to be able to run all of them in parallel instead as I don t want to run one after another . I basically want to store all endpoint calls status codes body and time as array and return them as results regardless of there are errors or not in the endpoint . I m using Bluebird how can I use its features to solve this issue Comment : Can you please come up with a Short Self Contained Correct Compilable Example http : sscce.org Comment : WTH is getComponentStatuses componentsToCheck 0 supposed to do Why do you build an array at all if you only care for the first Btw your requests already are running in parallel . Comment : @Bergi thanks for this . I m using 0 because I m getting this error if not using it : Object object Promise object Promise object Promise has no method then which is InternalError Comment : @thefourtheye I had to show the entire script codebase to allow understanding of exactly what s going on behind the scenes . Comment : @Bergi what do you mean it s already running in parallel .. . Answer : Bluebird supports multiple concurrent Promises . See the reference at : https : github.com petkaantonov bluebird blob master API.md promisejoinpromisethenablevalue-promises-function-handler---promise .. . .. . There are two ways to do it : .. . .. . .all https : github.com petkaantonov bluebird blob master API.md all---promise - good for a dynamic number of promises .. . .. . .join https : github.com petkaantonov bluebird blob master API.md promisejoinpromisethenablevalue-promises-function-handler---promise - good for a fixed number of promises and as for Bluebird s documentation it supplies a better performance than .all method . From bluebird s documentation : Comment : Great . I m using Promise.all now . But when one fails with catch error everything else seems to be fail . Because this is a healthcheck I need it to return values instead . How do I do this without causing errors", "Question : I understand that promise libraries provide clarity of code-structure . But are they faster I am using async.js each to loop through asynchronous xmlHttpRequests . Will it be faster if I adopt bluebird all instead Comment : So your code is waiting on multiple async responses and somehow you think the processing speed of two different callback systems is going to really be significant Comment : I also have functions inside async each loop to parse xml responses . So you think the two different callback systems will not make any significant performance difference If so the only reason to choose bludbird over async.js is the different code abstractions between the two call back systems Comment : There are lots of reasons to choose promises over the async library . My favorite reason is much more robust and automatic error propagation particularly in complicated scenarios where you need bulletproof code . Bluebird is indeed fast but performance isn t the main consideration here . I d suggest you read this article for lots of reasons to choose promises : spion.github.io posts why-i-am-switching-to-promises.html https : spion.github.io posts why-i-am-switching-to-promises.html . .. . Answer : If you are using ES6 you don t need any external libraries anymore . You could just use built-in functionality . And if you trying to return an array of results of all of your requests you could user Promise.all which returns a promise as well . To read more about it here is MDN link https : developer.mozilla.org en-US docs Web JavaScript Reference Global Objects Promise all . Comment : But isn t bluebird faster compared to the native promise library Comment : Native promises are slower . The answer from bluebird author here gives an excellent explanation why . programmers.stackexchange.com questions 278778 http : programmers.stackexchange.com questions 278778 why-are-native-es6-promises-slower-and-more-memory-intensive-than-bluebird Comment : And here is a lot of data on what is faster and what is using less memory spion.github.io posts why-i-am-switching-to-promises.html https : spion.github.io posts why-i-am-switching-to-promises.html I hope it helps", "Question : I want to use the aws-sdk in JavaScript using promises . Instead of the default callback style : .. . .. . I instead want to use a promise http : wiki.commonjs.org wiki Promises style : Comment : So have you tried to bluebird.promisifyAll dynamodb Comment : With bluebird var dynamoDb Promise.promisifyAll new AWS.DynamoDB .. . Answer : You can use a promise library that does promisification https : github.com petkaantonov bluebird blob master API.md promisification e.g . Bluebird https : github.com petkaantonov bluebird . Here is an example of how to promisify DynamoDB . Not you can add Async to any method to get the promisified version . Comment : worked great for me i am using the new DynamoDB-doc lib . var docClient new doc.DynamoDB Promise.promisifyAll Object.getPrototypeOf docClient", "Question : I am using node v0.11.14-nightly-20140819-pre on Windows with harmony flag . I have JavaScript object with two methods defined in its prototype : .. . .. . serviceMethod of Service object returns a promise . When I use User object like below : .. . .. . this in method2 of object User ends up undefined when called by then once promise is fulfilled . I tried using both ES6 and Bluebird promise implementation . Why this ends up being undefined in this case .. . Answer : Why this ends up being undefined in this case Because you re passing a function not a method-bound-to-an-instance . This problem is not even promise-specific see How to access the correct this context inside a callback http : stackoverflow.com q 20279484 1048572 for the generic solution : .. . .. . However Bluebird does offer https : github.com petkaantonov bluebird blob master API.md binddynamic-thisarg---promise an other way to call the function as a method :", "Question : I posted something similar here : Use ldapjs with promise http : stackoverflow.com questions 30682597 use-ldapjs-with-promise . Unfortunately it is still unsolved . This time I tried bluebird and hopefully I can get some luck . The script doesn t output anything . It is waiting for something in terminal . .. . Answer : Using Bluebird Promises the easy way to do this is to create your client normally and then run the promisifyAll on the client . Now you can call client.addAsync and client.searchAsync and such .", "Question : null .. . Answer : I have a TS function in a class : .. . .. . which I call with .. . .. . .. . which works fine . But how do I be more typescript-like and force a return-value in the function of type : promise of a string I want to do something like : .. . .. . I get an error : error TS2304 : Cannot find name Promise . This works in the Angular 2 Promise library . Is there a beginners guide to bluebird I can t seem to find any I m using typescript v1.8.10 and bluebird v3.4.1 on Node v 6.2.2 only NOT the browser", "Question : I am coding using co module on sail framework . I want to catch InvalidError but error-log says undefined . How can I fix this code Co module can t catch ErrorType specification error-log is here .. . Answer : You re not useing Bluebird are you The standard catch method https : developer.mozilla.org en-US docs Web JavaScript Reference Global Objects Promise catch does not have error type filtering http : bluebirdjs.com docs api catch.html filtered-catch you ll need to do that yourself : Comment : thank you for your advise I am using Bluebird . If using Bluebird can I choose other option Comment : Well you might be using Bluebird but co does not : - You can either overwrite the global Promise variable with Bluebirds implemenation or you can cast the promise returned by co to a Bluebird one like outlined here http : stackoverflow.com a 24315410 1048572 and there http : stackoverflow.com a 30934440 1048572", "Question : I ve been only using bluebird for a few days but I want to go over all my old code and promisify it : .. . .. . My problem is that I still don t fully grasp the flow of then commands . Consider these two blocks : .. . .. . A .. . .. . B .. . .. . 1 . in scenario A task3 will get the result-of task2 In B they all get the result-of the first promise 2 . How does the second one differ from running Promise.all from bluebird 3 . How do these A B Promise.all differ when it comes to using the catch method where do I put it . Sorry it s a bunch of questions in one . Comment : How would you run Promise.all Comment : @Bergi github.com petkaantonov bluebird blob master https : github.com petkaantonov bluebird blob master API.md promiseallarraydynamicpromise-values---promise this is .all Comment : @BenjaminGruenbaum : I know well what it does I asked the OP how he would apply it . .. . Answer : You are not getting one simple principle chaining .. . .. . In first one can be written like .. . .. . In second case .. . .. . Hope this explains the difference b w the two", "Question : I have the following code : .. . .. . But when I run this I get this error : .. . .. . I ve been trying to follow the sample code on the MySQL2 github site . But I cannot see why this is not working . pool.getConnection seems to be returning a promise as far as I can tell . Anyone done code like this Comment : I don t think mysql2 promise has anything to do with bluebird you shouldn t even need bluebird for mysql2 to work . It uses it s own implementation of promises . Use then instead of disposer . Example npmjs.com package mysql2 promise-wrappers https : www.npmjs.com package mysql2 promise-wrappers Comment : not exactly by default it uses system-wide promise and you can pass your preferred for example bluebird implementation as a parameter .. . Answer : If you prefer bluebird version of promises you can pass it as a parameter to mysql2 : .. . .. . See https : github.com sidorares node-mysql2 blob c487f542f7f4416f9759319225197c383b4937fb promise.js L5 .. . .. . By default global Promise is used but just doing var Promise require bluebird does not make it global .", "Question : I m trying to figure out how to use promises correctly with the bluebird library . I ve come across some nested promises in my code and I noticed that in the bluebird docs it reads : .. . .. . if you are utilizing the full bluebird API offering you will almost never need to resort to nesting promises in the first place . There are many other blog posts about promises being misused and nesting is a regular anti-pattern . .. . .. . All of my functions return objects . Looking at the bluebird docs it seems like there are multiple helper methods : all join props . So my question is : How could I avoid the nesting if there are dependencies Perhaps this is my misunderstanding of the asynchronous nature of promises . Could something like this work Comment : Related stackoverflow.com questions 22539815 http : stackoverflow.com questions 22539815 arent-promises-just-callbacks .. . Answer : You always need nesting for control structures and usually you will need one level of nesting for the function expressions passed to then . It s not totally avoidable but can be reduced significantly http : stackoverflow.com a 22000931 1048572 . In your case you even can omit some of the function expressions and pass the functions directly . Comment : If the call to loadMake calls a function that eventually throws shouldn t it resolve to a catch in my target promise Comment : Since loadMake returns a promise it shouldn t throw anyway http : stackoverflow.com q 21887856 1048572 but even it it does the exception will get caught by the then that executes the callback unless you use jQuery make sure to cast the jqXHR to a Bluebird promise Comment : I am casting a jqXHR to a BB promise in my custom library . When the call fails and ends up in the catch I use Promise.reject . I would think this would propagate to the catch statement in my target promise . I tried throwing instead to see if it made a difference . Comment : You might want to ask a new question where you post that code including the casting the catch the Promise.reject and the target promise", "Question : I ve been only using bluebird for a few days but I want to go over all my old code and promisify it : .. . .. . My problem is that I still don t fully grasp the flow of then commands . Consider these two blocks : .. . .. . A .. . .. . B .. . .. . 1 . in scenario A task3 will get the result-of task2 In B they all get the result-of the first promise 2 . How does the second one differ from running Promise.all from bluebird 3 . How do these A B Promise.all differ when it comes to using the catch method where do I put it . Sorry it s a bunch of questions in one . Comment : How would you run Promise.all Comment : @Bergi github.com petkaantonov bluebird blob master https : github.com petkaantonov bluebird blob master API.md promiseallarraydynamicpromise-values---promise this is .all Comment : @BenjaminGruenbaum : I know well what it does I asked the OP how he would apply it . .. . Answer : in scenario A task3 will get the result-of task2 In B they all get the result-of the first promise Yes . How does the second one differ from running Promise.all from bluebird You do not fetch the results of the parallel tasks 2 and 3 into a new promise . How do these A B Promise.all differ when it comes to using the catch method where do I put it . Usually you would put it on the end of the chain except you want to catch a specific error . Comment : I guess I did mostly understand how it works . Very intuitive I wish I could go back in time and erase the few months I ve spent fighting callbacks and pyramids : Thanks for the answer . I ll award the answer to the other guy because he was a bit quicker and did those great jsfiddles but have an upvote instead - great answer", "Question : Is this safety device necessary Is it possible and safe to supply thenables to collection methods - Promise.all Promise.race etc Any pitfalls The question concerns Bluebird as well as polyfilled and all native ES6 promise implementations . Comment : You can supply any thenable or value in the iterable you pass to Promise.all . You don t have to wrap them into promises yourself . The implementation of Promise.all will test to see if they are a thenable and if so wait for their resolution if not the value will be the resolution . See demo : jsfiddle.net jfriend00 jgf0xwhm https : jsfiddle.net jfriend00 jgf0xwhm .. . Answer : This is not necessary and should be done by the promise implementation itself : .. . .. . The all function returns a new promise which is fulfilled with an array of fulfillment values for the passed promises or rejects with the reason of the first passed promise that rejects . It resolves all elements of the passed iterable to promises as it runs this algorithm . .. . .. . ES2015 Specification paragraph 25.4.4.1 Promise.all iterable http : www.ecma-international.org ecma-262 6.0 sec-promise.all .. . .. . Phrased more accessible by MDN https : developer.mozilla.org en-US docs Web JavaScript Reference Global Objects Promise all Description : .. . .. . If something passed in the iterable array is not a promise it s converted to one by Promise.resolve . Comment : Thanks . I guess the same applies to Bluebird . I was confused by the fact that Promise and thenable types are used interchangeably in Bluebird docs http : bluebirdjs.com docs api promise.all.html and there s no mention of thenables promise-likes .", "Question : I want to promisify node-postgres pg.connect method along with the inner connection.query method provided in the callback . I can .promisify the latter but I need to implement the first one manually if I m missing something here please explain . The thing is I m not sure if this code is correct or should be improved The code is working I just want to know if I m using Bluebird as meant . Comment : Just so if you are not using a promise library that offers automatic connections and transactions management you are effectively wasting that which is the best part about promises when it comes to databases . Head-on promisification like one implemented by Bluebird is a great generic tool but it does no justice whatsoever to working with databases . Comment : For possible future readers if wondering why promisifying by hand might be a bad idea : 1 the initiating function might throw exception that would go unnoticed 2 the resulting callback might be called multiple times . More info at bytearcher.com articles pitfalls-of-promisifying-by-band http : bytearcher.com articles pitfalls-of-promisifying-by-band .. . Answer : By now there are a number of libraries which do this for you : .. . .. . pg-promise https : www.npmjs.com package pg-promise - generic Promises A+ for PG .. . postgres-bluebird https : www.npmjs.org package postgres-bluebird .. . dbh-ph https : www.npmjs.org package dbh-pg .. . pg-bluebird https : www.npmjs.org package pg-bluebird Comment : You do realize the author of postgres-bluebird asked the original question Comment : @SpencerRathbun : Answers are not only for OPs--they are for future visitors as well . If the OP wishes to provide an answer providing a link-to postgres-bluebird to get the credit that would be appropriate . Comment : The first answer was to throw away one horrible approach and replace it with another horrible approach . When it comes to database usage promises can automatically manage connections and transactions lifespan when done properly of which you get none through head-on API promisification .", "Question : I m trying to wrap my head around promises using the Bluebird library for Node.js https : github.com petkaantonov bluebird . Below is a simple example that doesn t work as I would expect . I m either missing some major concept with promises or with Bluebird . Thanks in advance for your help . EDIT : Revised and now working version based on feedback from jfriend00 . .. . Answer : For promisifyAll to work the function has to be asynchronous and the last argument passed to the function has to be the completion callback and the completion callback has to have as its first argument an error argument that is falsey when there s no error and the return-value as the second argument if there is a value . Your function doesn t meet any of those criteria . .. . .. . Here s an excerpt from the Bluebird doc for .promisifyAll https : github.com petkaantonov bluebird blob master API.md promisepromisifyallobject-target--object-options---object : .. . .. . The target methods are assumed to conform to node.js callback convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument . If the node method calls its callback with multiple success values the fulfillment value will be an array of them . Please remember that .promisifyAll can t make a synchronous operation into an async operation . What is does is take an asynchronous operation that conforms to a specific calling convention and wraps that into in a promise by hooking the callback and testing the callback s arguments to detect success or failure and to propagate the return-value . .. . .. . If you re curious about how Bluebird does this you can inspect their actual code here on Github https : github.com petkaantonov bluebird blob master src promisify.js though it is not super easy to follow exactly what it does without some significant study . Here s a bit simpler version of a promisify function to just see what it does I d recommend using Bluebird for all of it s other features rather than this . Here s a working demo of this promisify function : https : jsfiddle.net jfriend00 m1265vos Comment : Thanks jfriend00 Comment : Thank you this helped me track down this weird problem until your comments I realized that using mongoskin MongoClient.connect wouldn t work since it doesn t have callbacks I swapped it back to mongodb MongoClient.connect which does before running promisifyAll on the lib . And solved it . Silly me . Comment : Somehow stumbled upon this right as you edited it and the edit was exactly what I was looking for : O . Thank you .", "Question : I have the following code : .. . .. . But when I run this I get this error : .. . .. . I ve been trying to follow the sample code on the MySQL2 github site . But I cannot see why this is not working . pool.getConnection seems to be returning a promise as far as I can tell . Anyone done code like this Comment : I don t think mysql2 promise has anything to do with bluebird you shouldn t even need bluebird for mysql2 to work . It uses it s own implementation of promises . Use then instead of disposer . Example npmjs.com package mysql2 promise-wrappers https : www.npmjs.com package mysql2 promise-wrappers Comment : not exactly by default it uses system-wide promise and you can pass your preferred for example bluebird implementation as a parameter .. . Answer : Thanks everyone . I ve now switched over to the Knex http : knexjs.org API which solves all the problems I was encountering ." ] }
[ "yes-answer-long", "yes-answer-short" ]
server
UNK_RELATION
entitydatasource@server@56
entitydatasource -- entitydatasource is an asp.net web @placeholder control available in .net framework 3.5 sp1 or later .
{ "confidence": [ 50.92531204223633, 45.767608642578125, 44.47178649902344, 44.47178649902344, 43.616031646728516, 41.218379974365234, 40.18791580200195, 40.18791580200195, 40.18791580200195, 40.18791580200195, 40.181488037109375, 40.06288528442383, 39.87531280517578, 39.87531280517578, 39.87531280517578, 39.11634063720703, 39.067317962646484, 38.55095291137695, 37.72425079345703, 37.72425079345703, 37.72425079345703, 37.72425079345703, 37.72425079345703, 37.72425079345703, 37.52033615112305, 36.861793518066406, 36.861793518066406, 36.861793518066406, 36.177268981933594, 35.74119567871094, 35.74119567871094, 35.74119567871094, 34.734840393066406, 34.535743713378906, 34.44279479980469, 34.44279479980469, 34.39813232421875, 34.39813232421875, 34.39813232421875, 34.39813232421875, 34.39813232421875, 34.39813232421875, 34.39813232421875, 34.39813232421875, 34.39813232421875, 34.07068634033203, 33.80200958251953, 32.82265090942383, 32.82265090942383, 32.38152313232422, 32.38152313232422, 32.38152313232422, 32.38152313232422, 32.38152313232422, 32.38152313232422, 32.38152313232422, 32.38152313232422, 32.38152313232422, 31.260929107666016, 31.260929107666016, 31.260929107666016, 31.117977142333984, 30.335037231445312, 29.917861938476562, 29.917861938476562, 29.917861938476562, 29.917861938476562, 29.917861938476562, 29.857725143432617, 29.63950538635254, 29.63950538635254, 29.63950538635254, 28.518909454345703, 28.518909454345703, 28.518909454345703, 28.257503509521484, 28.04581069946289, 27.17584228515625, 27.17584228515625, 27.17584228515625, 26.568344116210938, 26.568344116210938, 25.4477481842041, 25.281795501708984, 24.929523468017578, 24.929523468017578, 24.10468292236328, 24.10468292236328, 24.10468292236328, 24.10468292236328, 24.10468292236328, 24.10468292236328, 24.10468292236328, 24.10468292236328, 23.233993530273438, 23.233993530273438, 22.590173721313477, 22.552879333496094, 21.799524307250977, 20.770328521728516 ], "content": [ "I have a GridView with DataSource an EntityDataSource web control .", "Unfortunately the EntityDataSource control does not work with the latest version of Entity Framework EF6 .", "it s DataSource is EntityDataSource .", "Here is my EntityDataSource", "If I will not use the e.Context property of the EntityDataSource control then I think there is NO use of EntityDatasource at all", "What is the best way to programmatically set a selecting parameter for the EntityDataSource control", "I didn t have users in the include of the EntityDataSource .", "I use ASPxGridView and EntityDataSource as its datasource .", "this is my EntitydataSource : .. . .. . Any help would be appreciated thanks .", "I edit my question and show my EntityDataSource .", "I m using an EntityDataSource in an asp .net form and a Gridview is bound to it .", "I have an ASP.NET page with a GridView control bound to an EntityDataSource see simplified code below .", "I have a QueryExtender control with an EntityDataSource as Target db Oracle11g .", "I have the following DropDownList and EntityDataSource in an .ascx user control .", "How effectively use DbContext with the EntityDatasource http : www.nuget.org packages Microsoft.AspNet.EntityDataSource control", "I am upgrading from EF5 to EF6 and for that I am using the newly released EntityDataSource control http : blogs.msdn.com b webdev archive 2014 02 28 announcing-the-release-of-dynamic-data-provider-and-entitydatasource-control-for-entity-framework-6.aspx in my web application .", "you need to make AutoGenerateWhereClause property to true in the EntityDataSource", "I have an EntityDataSource where-in the Select property I m pulling a variety of fields .", "I am using an EntityDataSource with a FormView on VB.NET application .", "I instead have to declare UpdateParameters on my EntityDataSource .", "Now you can see it in the Select parameter of the EntityDataSource .", "I m facing this error while using EntityDataSource", "I am trying to use a EntityDataSource to populate a DropDownList .", "I could configure the EntityDataSource without any problem .", "Note : The example is based on a asp : SqlDataSource but it should work as well for an EntityDataSource if you make sure that you use WhereParameters in the EntityDataSource instead of SelectParameters in the SqlDataSource .", "This is the correct version in order to pass the dropdownlist selectedvalue in the Select attribute of EntityDataSource .", "I am using EntityDataSource to query data from database .", "How can I get the row-number using EntityDataSource", "Anyone knows how to set the query timeout using EntityDataSource .. . .. . I found a few articles that state how to do that with a SqlDataSource but not with EntityDataSource .", "I am binding a GridView to the following EntityDataSource : .. . .. . This works fine .", "You can also set the SortExpression on the column to a value that is in your EntityDataSource .", "You cannot bind the user s identity declaratively in markup directly to the EntityDataSource .", "The Microsoft EF team recommends people to stay away from the EntityDataSource control and only use it for Dynamic Data web sites Model Binding is the preferred solultion .", "This is my first time using an EntityDataSource in ASP.net and I m trying to figure out why the update function would only call a stored procedure once .", "I am using new EntityDatasource http : www.nuget.org packages Microsoft.AspNet.EntityDataSource control for binding and updating the asp : FormView .", "FYI : I m using the EntityDatasource control only for Bind and Update operations .. . .. . Any help is highly appreciated .", "I found a workaround by putting the following code in the Updating event of the EntityDataSource .", "A where clause is used in the entityDataSource : .. . .. . @Name is a parameter : .. . .. . But it doesn t work .", "Is there a way to use an entitydatasource that has an arbitrary join as the source for an editable gridview", "I have a C webform that uses a gridview bound to an EntityDataSource .", "I d like to run the GridView off an EntityDataSource to make paging and sorting easier .", "and using entityDatasource With Navigation Property Included Item .. . .. . Here is Code", "Why do consumers of the EntityDataSource and GridView have to figure out that themselves", "I m using a CASE statement in my EntityDataSource to do custom sorting .", "How can I get this type of sorting to work in my EntityDataSource", "I did it by a EntityDataSource like : .. . .. . How can I show a field of CommitteeUser object in my grid", "Please use this URL to get the IN statement working stackoverflow.com questions 25251205 http : stackoverflow.com questions 25251205 entitydatasource-where-clause-in-vb-net", "I d like to use a GridView and EntityDataSource in order to save writing CRUD .", "Can I convert my DBContext to an ObjectContext that is expected by the EntityDataSource", "So in this example the EntityDataSource uses the person table but in the user table I have a personid field .", "I have a GridView that is editable with an entitydatasource if my users want to delete the text in one of the fields they cannot .", "I have a entitydatasource connecting to my database and I want to filter the results using the Where property .", "This asp : EntityDataSource returns me a list of employe and the EntityDataSource can be filtered by a textbox on the name of the employee .", "The entitydatasource is being used by an aspx gridview and when the gridview performs an update everything works fine .", "I am using EntityDataSource with CommandText to get some table columns with row-number .", "In EntityDataSource I write CommandText so I can not set EnableInsert EnableUpdate or EnableDelete to true .", "So it has nothing to do with entityDataSource you re just asking for a working linq2entity query", "The query is the above and I want to show it the results in a GridView working with an EntityDataSource but I dont know how to do it .", "I have a GridView bound to this EntityDataSource : .. . .. . In the codebehind I set the values of the WhereParameters and the Where statement .", "I have a EntityDataSource as such : .. . .. . And I can t for the life of me get it to show me only the not deleted results .", "However generally if you re unable to access the column through your entitydatasource you ll probably have to use a different data source .", "It would register a new EntityDataSource Control in the web.config under pages : .. . .. . Next step is to replace existing asp : EntityDataSource controls to ef : EntityDataSource in your aspx pages .", "The Entity DataSource control for EF6 is available del in preview since 2014-01-30 details in this Microsoft announcement http : blogs.msdn.com b webdev archive 2014 01 30 announcing-preview-of-dynamic-data-provider-and-entitydatasource-control-for-entity-framework-6.aspx .", "make sure you do no have any filtering already applied in the creation of the EntityDataSource .", "In addition you should remove properties DefaultContainerName and ConnectionString and just set ContextTypeName on the EntityDataSource .", "I m not finding any way how I can avoid the use of ObjectContext in EntityDatasource .", "I want to know how I can set a guid parameter for my entitydatasource .", "I am assuming here that an EntityDataSource can work with what I ll call derived properties on an entity .", "Upon further research which was tedious as there isn t a lot of the actual EntityDataSource control since all us probably do most of our EF work in the code-behind there were three issues .. . .. . 1 .", "I have a gridview with a list of items and on checking a checkbox and hitting edit button it sends you to a different view where there is a detailsview that has entitydatasource as it s DS .", "Remove is not to and make sure that we can t write any function on EntityDataSource like upper lower . . etc but you can do it as Linq query", "I have a DB with 3 tables : .. . .. . This query : .. . .. . I need to show the result-of the above query in a Gridview with an EntityDataSource either code or set it in the design mode .", "Aside from a kludge like writing the Where statement into an invisible label and then copying it into the EntityDataSource is there a way to preserve the value of the Where statement during postback", "Because this is an entitydatasource a data source bound to EF entities msdn.microsoft.com en-us library http : msdn.microsoft.com en-us library system.web.ui.webcontrols.entitydatasource.aspx", "Now I cannot inf any Parameter in EntityDataSource that would allow me to dot that in Where Automatically generate a Where expression using provided parameter .", "I have a drop down list that is using entitydatasource the user select a value form drop down list and the Grid View change based on the Order Status Drowpdownlist .", "I have an ASP.NET Web Forms application which uses .NET framework v4.5 and EF v6.1.1 .", "There s no LINQ in your question can you update it to see what are you doing with the EntityDataSource that didn t work when using ISNULL", "I can extend the EF class by adding a property that relays the child count but I can t figure out how to get this custom property to be recogninzed by the EntityDataSource .", "Consider the following code : .. . .. . In T-SQL this would be a perfecty normal way of sorting but used in the EntityDataSource it throws the following exception : .. . .. . The query syntax is not valid .", "I have an EntityDataSource that works to get row data from tblOrderFile as follows : .. . .. . I would now like to modify it to also return back the number of rows in child table tblOrderFileItem with Entity Set Name tblOrderFileItems .", "Have to modified the EntityDataSource removing the EntitySetName and EntityTypeFilter attributes and add the CommandText like this : .. . .. . This link help me : http : msdn.microsoft.com en-us library aa697427 v vs.80 .aspx", "I would like filter Data using EntityDataSource filter show apply for the Current Logged-In User this value should be taken using MS Memebership Provider Membership.GetUser .", "I ve checked out the following links : .. . .. . http : msdn.microsoft.com en-us library ee404748 28v vs.100 29.ASPX .. . .. . EntityDataSource replace with wildcard on queries http : stackoverflow.com questions 4632512 entitydatasource-replace-with-wildcard-on-queries .. . .. . I m creating a page where a user will perform a search by selecting multiple options from the web page click the search button and a GridView will be populated .", "The join would be something like this : .. . .. . select from session s where s.sessionid select top 1 sessionid from sessionhistory order by lastactivitydate desc .. . .. . I could do it like in this post : EntityDataSource query inner-join http : stackoverflow.com questions 10878713 entitydatasource-query-inner-join however I m trying to preserve the EF relationships so that I can reference them in my Gridview eg .", "I want to show Name and Text in GridView using EntityDataSource it s work fine but when I do sort in GridView it not show proper sort for Name since name have capital and lower case like this when I do Sort in GridView : .. . .. . I want to be like this sort and capitalize initial letter to each word : .. . .. . My EntityDataSource like this :", "Depending on how you actually update the entity I haven t used the EntityDataSource but I m guessing it internally uses the ObjectContext.Attach method the code that creates the SQL statement will try to update only those columns that are actually changed .", "At first I thought it was some compatibility problems with ObjectContext and the new EF I m casting the DbContext to IObjectContextAdapter to pass the ObjectContext to the EntityDataSource in code but I see that the OP is using the old EF already : .", "I do know how to set the SelectedIndex on the DDL and can search and assign like this : .. . .. . .. . but haven t figured out how or where to do it with the list being populated from an EntityDataSource .", "After this change I got build errors due to invalid type cast : .. . .. . This is obvious as the Context property of the EntityDatasource EventArgs e is of type ObjectContext while SchoolEntities of type DbContext .", "If I m using e.Context IObjectContextAdapter ctx .ObjectContext then when getting the entity back var school School e.Entity in the EntityDatasource updating event I m losing the navigation properties .", "I m using this EntityDataSource in a aspx page to retrieve some data from my database : .. . .. . As you can see im selecting the combination of 2 fields ID + Name as a single field so i can use it in a dropdownlist .", "In case of the EntityDataSource the corresponding view is the EntityDataSourceView and from the exception thrown - an EntitySqlException - I would conclude that ExecuteSelect builds the query using Entity SQL http : msdn.microsoft.com en-us library bb399560.aspx .", "Did you anywhere see documented : When the data source is of type EntityDataSource the SortExpression of a TemplateField in a GridView must be a valid Entity SQL ORDER BY clause . I didn t .", "How can I get just Time in h : mm format and concat them in CommandText of EntityDataSource : 01 02 2013 3 : 15 AM and 01 02 2013 4 : 15 AM should be 15 : 15-16 : 15 I found cast for concat Is it right solution :", "I am trying to display a grid of users so I set up this EntityDatasource : .. . .. . Now in my GridView I can bind to fields like lastname firstname emailaddress and fields from the location table like address and city .", "as per the suggestions given by the IDE we can go to the Nuget Package Console and run the following command to install the new Entity Framework data source : Install-Package Microsoft.AspNet.EntityDataSource .. . .. . Also add the following package as refered in this https : blogs.msdn.microsoft.com webdev 2014 02 28 announcing-the-release-of-dynamic-data-provider-and-entitydatasource-control-for-entity-framework-6 article : Install-Package Microsoft.AspNet.DynamicData.EFProvider", "In my web application ASP.NET 4.0 I have two tables Committee and CommitteeUser committeeId UserId RoleId .", "I am using Telerik Radgrid in my Asp.Net Web application .", "However I couldnt set the data fields for the value and the text of the DropDownBox using the wizard if I click the Refersh Schema button in the Data Source Configuration Wizard I am getting the following error The schema could not be determined because of the following error from the EntityDataSource : Could not find teh CLR type for" ] }
{ "confidence": [ 57.953468322753906, 56.09763717651367, 55.25157165527344, 54.352901458740234, 51.44169616699219, 50.260284423828125, 48.84111022949219, 48.72331237792969, 48.36466979980469, 48.36308670043945, 47.88588333129883, 46.685394287109375, 46.6219367980957, 45.140892028808594, 45.0483512878418, 44.83723831176758, 44.83723831176758, 44.43351364135742, 44.1219367980957, 43.707305908203125 ], "content": [ "Question : I have an ASP.NET Web Forms application which uses .NET framework v4.5 and EF v6.1.1 . I am using new EntityDatasource http : www.nuget.org packages Microsoft.AspNet.EntityDataSource control for binding and updating the asp : FormView . Previously I was using the ObjectContext and now I changed it to use DbContext . After this change I got build errors due to invalid type cast : .. . .. . This is obvious as the Context property of the EntityDatasource EventArgs e is of type ObjectContext while SchoolEntities of type DbContext . I m also doing some CRUD operation using the e.Context property e.g : .. . .. . To fix the error I got the ObjectContext from the DbContext as follows : .. . .. . Here e is Microsoft.AspNet.EntityDataSource s event args . Also I have added the EntityDataSource ContextCreating event to solve the type casting problem : .. . .. . After doing this change I got rid of the build errors but it caused several other errors . Problems .. . .. . 1 . If I m using e.Context IObjectContextAdapter ctx .ObjectContext then when getting the entity back var school School e.Entity in the EntityDatasource updating event I m losing the navigation properties . 2 . I m not finding any way how I can avoid the use of ObjectContext in EntityDatasource . I want to stay away from ObjectContext as it is completely removed in EF 7 . What I have tried .. . .. . So to resolve all these problems I currently added a page level context object like : .. . .. . I removed e.Context IObjectContextAdapter ctx .ObjectContext from the EntityDatasource s context creating event . I also removed the existing codes which was using the e.Context property for doing the CRUD operations . I used the page level context ctx variable instead of e.Context and everything worked fine . So this confirms the culprit is e.Context IObjectContextAdapter ctx .ObjectContext .. . .. . Questions .. . .. . 1 . How effectively use DbContext with the EntityDatasource http : www.nuget.org packages Microsoft.AspNet.EntityDataSource control 2 . For my case what changes I will do in order to get back the navigation properties while retrieving the entity back from the eventargs var school School e.Entity 3 . If I will not use the e.Context property of the EntityDataSource control then I think there is NO use of EntityDatasource at all FYI : I m using the EntityDatasource control only for Bind and Update operations .. . .. . Any help is highly appreciated . .. . Answer : To ensure the navigation properties are filled you need to set those you want populated as a comma separated list in the EntityDataSource s Include property .", "Question : I use EF 4 C and MS Membership Provider . I have a GridView with DataSource an EntityDataSource web control . I would like filter Data using EntityDataSource filter show apply for the Current Logged-In User this value should be taken using MS Memebership Provider Membership.GetUser . Now I cannot inf any Parameter in EntityDataSource that would allow me to dot that in Where Automatically generate a Where expression using provided parameter . Do you have any ideas Please provide me a sample of code . Thanks for your time .. . Answer : You cannot bind the user s identity declaratively in markup directly to the EntityDataSource . But there are basically two workarounds : .. . .. . The first is the easier one but requires code-behind . You can use a generic asp : Parameter and set its value in code-behind to the user s identity : .. . .. . Markup : .. . .. . Code-behind : .. . .. . The second way is to create a custom parameter . An example how to do that is shown here http : blog.einbu.no 2010 02 custom-asp-net-datasource-parameters . Note : The example is based on a asp : SqlDataSource but it should work as well for an EntityDataSource if you make sure that you use WhereParameters in the EntityDataSource instead of SelectParameters in the SqlDataSource . Comment : Thanks Slauma I followed your advice and I implemented the custom parameter . Thanks for your time", "Question : I am upgrading from EF5 to EF6 and for that I am using the newly released EntityDataSource control http : blogs.msdn.com b webdev archive 2014 02 28 announcing-the-release-of-dynamic-data-provider-and-entitydatasource-control-for-entity-framework-6.aspx in my web application . The problem I am facing with this is that on changing the entity datasource control to : .. . .. . All the events are taking incorrect old namespace System.web.UI.WebControls instead of correct namespace Microsoft.AspNet.EntityDataSource . There are numerous places where I ve to edit this but I think it should be automatically handled by the control . Can anyone help me whats wrong with this .. . Answer : Reference the namespaces with a using directive like this :", "Question : I created an ORM using Entity Framework 5.0 . I added a reference to the ORM to my ASP.NET application . I am trying to use a EntityDataSource to populate a DropDownList . I could configure the EntityDataSource without any problem . However I couldnt set the data fields for the value and the text of the DropDownBox using the wizard if I click the Refersh Schema button in the Data Source Configuration Wizard I am getting the following error The schema could not be determined because of the following error from the EntityDataSource : Could not find teh CLR type for Comment : Post your current markup for the DDL .. . Answer : Changing the Code Generation Strategy didn t work for me . But adding the following to my web-config file did :", "Question : I created an ORM using Entity Framework 5.0 . I added a reference to the ORM to my ASP.NET application . I am trying to use a EntityDataSource to populate a DropDownList . I could configure the EntityDataSource without any problem . However I couldnt set the data fields for the value and the text of the DropDownBox using the wizard if I click the Refersh Schema button in the Data Source Configuration Wizard I am getting the following error The schema could not be determined because of the following error from the EntityDataSource : Could not find teh CLR type for Comment : Post your current markup for the DDL .. . Answer : Try this : Change the Code Generation Strategy for your model to Default . Delete .tt files . Save clean and rebuild . Comment : Yes It fixed . I fixed it long time back by using ObjectContext . Thanks for the answer though", "Question : null .. . Answer : This is my first time using an EntityDataSource in ASP.net and I m trying to figure out why the update function would only call a stored procedure once . I have mapped the stored proc using the Stored procedure Mapping pane in the .edmx data model to the Update function . The entitydatasource is being used by an aspx gridview and when the gridview performs an update everything works fine . However on subsequent updates of the SAME record the procedure never gets called .", "Question : null .. . Answer : In my web application ASP.NET 4.0 I have two tables Committee and CommitteeUser committeeId UserId RoleId . Each Committee can have multiple CommitteeUser . I have a GridView and want to show Committee with the CommitteeUser that roleId s 1 . I did it by a EntityDataSource like : .. . .. . How can I show a field of CommitteeUser object in my grid", "Question : I have a webforms project using EF codefirst to persist data . I d like to use a GridView and EntityDataSource in order to save writing CRUD . Is this possible Can I convert my DBContext to an ObjectContext that is expected by the EntityDataSource Here s what I tried : .. . .. . However I get this exception : .. . .. . Unable to cast object of type SomeNamespace.Models.ShopDBContext to type System.Data.Objects.ObjectContext . Comment : possible duplicate of How to bind EF Code First DbContext to an Asp.Net DataSource http : stackoverflow.com questions 6327937 how-to-bind-ef-code-first-dbcontext-to-an-asp-net-datasource Comment : Indeed it is a duplicate thanks note : a search for DBContext ObjectContext GridView will find this but not the question with an answer .. . Answer : Try this one -", "Question : I have a DB with 3 tables : .. . .. . This query : .. . .. . I need to show the result-of the above query in a Gridview with an EntityDataSource either code or set it in the design mode . this is my EntitydataSource : .. . .. . Any help would be appreciated thanks . Comment : msdn.microsoft.com en-us library cc488524.aspx http : msdn.microsoft.com en-us library cc488524.aspx Comment : Hi Rapha l the samples in the link only have selects and wheres with only one table my real problems is to accomplish the Join and the Distinct operations with my query . Comment : So it has nothing to do with entityDataSource you re just asking for a working linq2entity query Then say what s your real problem and what you wanna get from this query.. . Comment : The query is the above and I want to show it the results in a GridView working with an EntityDataSource but I dont know how to do it . I edit my question and show my EntityDataSource . Comment : Ok look at here then weblogs.asp.net scottgu archive 2007 09 07 http : weblogs.asp.net scottgu archive 2007 09 07 linq-to-sql-part-9-using-a-custom-linq-expression-with-the-lt-asp-linqdatasource-gt-control.aspx .. . Answer : Finally got it . Have to modified the EntityDataSource removing the EntitySetName and EntityTypeFilter attributes and add the CommandText like this : .. . .. . This link help me : http : msdn.microsoft.com en-us library aa697427 v vs.80 .aspx", "Question : I created an ORM using Entity Framework 5.0 . I added a reference to the ORM to my ASP.NET application . I am trying to use a EntityDataSource to populate a DropDownList . I could configure the EntityDataSource without any problem . However I couldnt set the data fields for the value and the text of the DropDownBox using the wizard if I click the Refersh Schema button in the Data Source Configuration Wizard I am getting the following error The schema could not be determined because of the following error from the EntityDataSource : Could not find teh CLR type for Comment : Post your current markup for the DDL .. . Answer : I just lost 2 hours because I didn t follow Insane4Sure s instructions properly . Change the Code Generation Strategy Right click in the empty space in the Model diagram .edmx file and click properties . Code Generation Strategy is the first option - set it to Legacy ObjectContext . Here s the important part - delete all the .tt files that are under the .edmx file in Solution Explorer . I though I d deleted them all but didn t . When you clean and build you ll be able to click the Refresh Schema button .", "Question : I have a C webform that uses a gridview bound to an EntityDataSource . Now when I run an extensive query I get a timeout on the underlying sql query . Anyone knows how to set the query timeout using EntityDataSource .. . .. . I found a few articles that state how to do that with a SqlDataSource but not with EntityDataSource . Thank you . .. . Answer : You could set the timeout using the connectionstring . From msdn How to : Define the Connection String http : msdn.microsoft.com en-us library bb896291.aspx .. . .. . Note the relevant part : .. . .. . Edit : .. . .. . I just read here http : stackoverflow.com questions 6232633 entity-framework-timeouts there is a known bug when you set the TimeOut in the Entity Framework ConnectionString . So you might want to set the TimeOut directly on the context as noted in the answer . Or :", "Question : I have a webforms project using EF codefirst to persist data . I d like to use a GridView and EntityDataSource in order to save writing CRUD . Is this possible Can I convert my DBContext to an ObjectContext that is expected by the EntityDataSource Here s what I tried : .. . .. . However I get this exception : .. . .. . Unable to cast object of type SomeNamespace.Models.ShopDBContext to type System.Data.Objects.ObjectContext . Comment : possible duplicate of How to bind EF Code First DbContext to an Asp.Net DataSource http : stackoverflow.com questions 6327937 how-to-bind-ef-code-first-dbcontext-to-an-asp-net-datasource Comment : Indeed it is a duplicate thanks note : a search for DBContext ObjectContext GridView will find this but not the question with an answer .. . Answer : After 2 days of struggling I found this link http : stackoverflow.com questions 13282083 contextcreating-method-in-entitydatasource-cannot-convert-entities-to-objectcont which helped me a lot.I am working withVS 2012 and I had same problem with DBContext . According to the link in VS2012 the default code generator was changed to generate POCO entities and DBContext as opposed to entities derived from EntityObject and ObjectContext which was default in VS2010 . In solution-explorer under your entity-model You need to remove tt templates and in the designer righ-click on the designer surface and then in the properties change the code generation strategy from None to Default to get EntityObject based entities and ObjectContext derived context .", "Question : I m using an EntityDataSource in an asp .net form and a Gridview is bound to it . A where clause is used in the entityDataSource : .. . .. . @Name is a parameter : .. . .. . But it doesn t work . When I change @Name with a fixed string it works properly like this : Comment : Sorry I found my answer Where it.Name like +@Name+ .. . Answer : i think no text in the textbox should force the eds to show all elements", "Question : I have an EntityDataSource that works to get row data from tblOrderFile as follows : .. . .. . I would now like to modify it to also return back the number of rows in child table tblOrderFileItem with Entity Set Name tblOrderFileItems . I found a way to get the Count to work by adding an Include directive as follows : .. . .. . but I believe this is returning the all the columns of all the rows for each Order Item . I only really want the Count and do not want to deliver the rest of the data to the web page . I also tried simply adding it.tblOrderFileItems.Count to the Select statement but get an error saying .. . .. . Count is not a member of Transient.collection MyDBModel.tblOrderFileItem Nullable True DefaultValue . To extract a property of a collection element use a subquery to iterate over the collection . .. . Answer : Comment : stackoverflow.com questions 8259091 http : stackoverflow.com questions 8259091 sorting-a-bound-asp-net-gridview-on-the-count-of-items-in-an-entity-framework-na", "Question : null .. . Answer : I am using Telerik Radgrid in my Asp.Net Web application . The grid has datasource assigned from asp : EntityDataSource . There is one extra column i have added which is not a part of asp : EntityDataSource but i calculated it on ItemDataBound event of Radgrid . Now when i am trying to sort the grid with the extra column it gives me below exception . please help . i saw many similar kind of question on Stack overflow but its not related . Thanks in advance . Exception : .. . .. . HasChangeReason is not a member of type EMTModel.CarModel in the currently loaded schemas . Near simple identifier line 6 column 4 . Comment : You can intercept the sort event using the grid s OnSortCommand property . You can also set the SortExpression on the column to a value that is in your EntityDataSource . However generally if you re unable to access the column through your entitydatasource you ll probably have to use a different data source . Perhaps SQLdatasource Objectdatasource or manually bind to a datatable . With any of those you could likely do your calculation prior to the grid binding instead of OnItemDatabound . The other quick workaround would be to just disable sorting on that column . Comment : Thank you very much for reply . I was planning to manually sort the data on sort event . I tried to intercept the sort event using OnSortCommand property but in this method the DataSource property of DataTableView is null .", "Question : I have a entitydatasource connecting to my database and I want to filter the results using the Where property . As a test I have the following : .. . .. . And I get the following error : .. . .. . I guess what I m typing in is wrong but why Comment : Possibly use or lt gt instead of is not .. . Answer : Remove is not to and make sure that we can t write any function on EntityDataSource like upper lower . . etc but you can do it as Linq query", "Question : null .. . Answer : I am using EntityDataSource with CommandText to get some table columns with row-number . However the function row-number needs to use with function OVER and I get error The query syntax is not valid . Near identifier OVER line 1 column 22 . How can I get the row-number using EntityDataSource", "Question : null .. . Answer : I have the following DropDownList and EntityDataSource in an .ascx user control . As is the DropDownList is populating correctly with about a dozen entries . I have an aspx page that contains a number of these user-controls and I need to set the selected value in each one differently and programmatically but I m not sure where to put the code since I want it to run after the DDL has been populated by the data source . I do know how to set the SelectedIndex on the DDL and can search and assign like this : .. . .. . .. . but haven t figured out how or where to do it with the list being populated from an EntityDataSource . An event in the page In the control Or glue up some javascript to run on the client after the page loads Thanks for any help . Code greatly appreciated- Comment : Try using DataBound event because it occurs after the control binds to a data source . Comment : Perfect thanks", "Question : I use ASPxGridView and EntityDataSource as its datasource . In EntityDataSource I write CommandText so I can not set EnableInsert EnableUpdate or EnableDelete to true . That s why I manipulate insert update delete data manually . Changes are made manually pass-through to database . But at the side of the GridView these errors are given : .. . .. . For inserting : Insert is disabled for this control . .. . For updating : Update is disabled for this control . .. . For deleting : Delete is disabled for this control . .. . .. . How can I solve this problem The reason of using CommandText is where parameters and joining of more than 1 tables for showing in GridView . Comment : Around that time 2012 ASPxGriView with EF was read-only only . It is nut much better since even sort by column does not work . .. . Answer : I made workaround to this problem . in gridview I have template column I m passing two arguments in CommandArgument : .. . .. . in code-behind I m splitting CommandArgument and saving values in variables and then using them in SelectedIndexChanged event : .. . .. . this works . You can use this for updating gridview row too .", "Question : null .. . Answer : I am binding an EntityDataSource http : msdn.microsoft.com en-us library cc488502 28v vs.100 29.aspx to a DataGrid in a web forms app and am using the Select http : msdn.microsoft.com en-us library system.web.ui.webcontrols.entitydatasource.select 28v vs.100 29.aspx property to join a few tables and return the result-of the query but I can t seem to find a way to UNION the result from 2 selects . Is there a way to do this or do I need to drop into the CommandText http : msdn.microsoft.com en-us library system.web.ui.webcontrols.entitydatasource.commandtext 28v vs.100 29.aspx or convert to a standard DataSource that binds to the result-of a Repository lookup that uses Linq . Here is an example before the UNION is added : Comment : why the ef tag Comment : Because this is an entitydatasource a data source bound to EF entities msdn.microsoft.com en-us library http : msdn.microsoft.com en-us library system.web.ui.webcontrols.entitydatasource.aspx" ] }
[ "yes-answer-long", "yes-answer-short" ]
server
UNK_RELATION
knockout-mapping-plugin@open-source@54
knockout-mapping-plugin -- knockout.js mapping is an @placeholder knockout.js plugin that simplifies the mapping a plain javascript object or json string to a knockout view model .
{ "confidence": [ 80.81687927246094, 78.02049255371094, 73.40384674072266, 71.27104187011719, 71.27104187011719, 71.07220458984375, 70.94037628173828, 70.71945190429688, 69.8831558227539, 67.31269073486328, 67.14181518554688, 66.56340026855469, 65.1920166015625, 64.38941192626953, 64.13215637207031, 63.276248931884766, 63.276248931884766, 63.15375900268555, 62.282039642333984, 62.1795654296875, 62.1795654296875, 62.1795654296875, 62.1795654296875, 61.728546142578125, 61.2657470703125, 59.62334442138672, 59.62334442138672, 59.62334442138672, 59.59574508666992, 59.5626106262207, 59.36573791503906, 59.1329460144043, 59.10710144042969, 58.95545196533203, 58.903629302978516, 58.78166961669922, 58.78166961669922, 58.74818420410156, 58.14069366455078, 57.4597282409668, 57.061161041259766, 56.91361999511719, 56.682533264160156, 56.624778747558594, 56.61538314819336, 56.36780548095703, 56.266700744628906, 56.19647216796875, 56.171897888183594, 56.00789260864258, 56.00789260864258, 56.00789260864258, 55.11628723144531, 54.95868682861328, 54.903507232666016, 54.82167434692383, 54.666908264160156, 54.159061431884766, 53.907630920410156, 53.907630920410156, 53.52745819091797, 53.4516716003418, 53.4516716003418, 53.4516716003418, 53.4516716003418, 53.4516716003418, 52.95148849487305, 52.545780181884766, 52.53410720825195, 52.24216079711914, 52.24216079711914, 52.241756439208984, 52.112091064453125, 52.09368896484375, 52.02150344848633, 51.92179870605469, 51.826541900634766, 51.8231086730957, 51.77482986450195, 51.77482986450195, 51.77482986450195, 51.77482986450195, 51.2997932434082, 50.63222885131836, 50.600303649902344, 50.48656463623047, 50.42809295654297, 50.228965759277344, 50.11237335205078, 49.72582244873047, 49.28642272949219, 49.21860885620117, 49.21860885620117, 49.21860885620117, 49.21860885620117, 49.007240295410156, 48.94997787475586, 48.44231414794922 ], "content": [ "I am using knockout.js with the mapping plugin .", "I m having a problem with the knockout-mapping plugin with IE8 .", "Tell me will it be possible to add a slide when using knockout-mapping-plugin", "The KnockOut docs for the Mapping plugin are IMO wrong on the syntax for calling ko.mapping.fromJS .. . .", "I m using the knockout-mapping-plugin to create an observable viewmodel hierarchy for me .", "At present I am using Knockout JavaScript library v2.2.1 and Knockout Mapping plugin v2.3.5 .", "What the mapping plugin allows you to do is create a mapping from the regular JavaScript object or JSON structure to an observable view model .", "I m new to using knockout and I m trying to use the knockout-validation plugin along with the mapping plugin .", "Knockout Mapping", "I am trying to create-view Models using KnockOut mapping plugin .. . .. . This is the object Basically below is a sentence with words in it .", "Using Mapping Options .. . .. . The Knockout Mapping plugin allows the creation of certain properties on mapped objects to be customized .", "We are using knockout and the knockout-mapping-plugin to facilitate databinding in our jQTouch web application .", "the mapping plugin lets you pass in mapping options .", "Short answer if you re going to use the mapping plugin to map your model you need to use the mapping plugin to unmap it .", "The reason we use the mapping plugin is to be able to use knockout without the need to define change viewmodels manually in javascript .", "Using the knockout-mapping-plugin http : knockoutjs.com documentation plugins-mapping.html can you map a deeply hierachical object", "reading this exchange in stackoverflow titled How to map to an Array coming from server object using Knockout Mapping plugin in templates", "I also use knockout mapping .", "I m using Knockout Mapping and Validation plugins .", "I have a complex knockout viewmodel that has been created using the mapping plugin .", "The mapping plugin updates each field separately and knockout executes the subscriptions on every change .", "One thing I ve been investigating is the Knockout Mapping plugin http : knockoutjs.com documentation plugins-mapping.html .", "Is there anyway I can tell the knockout-mapping-plugin to subscribe to all property changes call a certain function", "I am new to knockout I am having issues with mapping .", "The mapping plugin is working as you expect .", "I am having trouble understanding how to work with Knockout JS Mapping Plugin .", "How do I implement the create method of knockout-mapping-plugin for nested observable and observablearrays that are models with computed inside of them .", "I am trying to use knockout-sortable with the mapping plugin to drag a list of products to another list .", "I am trying to use knockout mapping but it isn t working as I expected .", "You can use the mapping plugin to update part of your view model .", "I only want to use the mapping plugin for parts of my model .", ".. . .. . Arrays are not meant to be passed to the mapping plugin .", "Check MultiModels plugin for Knockout JS - https : github.com sergun Knockout-MultiModels", "After reviewing Automate mapping of dependent properties in knockout http : stackoverflow.com questions 19434411 automate-mapping-of-dependent-properties-in-knockout answer and the code from @PW Kad it made sense to write a simple custom mapper .", "The mapping plugin makes this easy .", "I m having endless recursion on IE by my knockout.js mapping .", "I have following knockout.js mapping : .. . .. . When I render the page approx .", "I get the following data from the server : .. . .. . I m having some issues after I map the data using the knockout-mapping-plugin .", "So in this instance what is the point in using the mapping plugin", "So my expected JSON is .. . .. . However on doing this .. . .. . I am getting result .. . .. . Knockout mapping is not ignoring a.a1 .", ".. . .. . Edit : Taken from the KNockout.js Manual : When calling your handler Knockout will supply the current model value as the first parameter .", "The KNOCKOUT Code is .. . .. . The HTML is : .. . .. . The structure of JSON is : .. . .. . Hence the view model will be :", "Mapping Plugin Argument : copy .. . .. . If you want the mapping plugin to simply copy the plain properties and not make them observable use this argument as shown below .", "I would use the knockout-mapping-plugin http : knockoutjs.com documentation plugins-mapping.html .", "Is there are way to tell the mapping plugin or knockout in general to wait with the evaluation of dependencies until I tell it that all values have been set", "The main thing is .. . .. . where mapping plugin will be forced to use certain object creation function then deserializes your cild model .", "Turns out I have to define all view model properties inside javascript so that knockout can initialize the view model with properties before I update it with server data .. . .. . Reference : http : www.underwatergorilladome.com how-to-use-knockouts-computed-observables-with-the-mapping-plugin .. . .. . http : jsfiddle.net GLDxx 2", "When used with AMD the mapping plugin exports its functionality into a separate object .", "This is my first trail on the mapping plugin .Please do suggest me a reference to build some complex things using mapping plugin .", "well @mcktimo you are not effectively using mapping plugin .", "What is the standard way of loading mapping plugin in require.js", "Using mapping plugin I did this .. . .. . That s all .", "Note : Samples are from the knockout.js mapping plugin documentation http : knockoutjs.com documentation plugins-mapping.html comments added by me .. . .. . Mapping Plugin Argument : include .. . .. . The following snippet will omit all properties from the source object other than those passed in via the include argument .", "It has a setting called include which is documented as such : .. . .. . When converting your view model back to a JS object by default the mapping plugin will only include properties that were part of your original view model except it will also include the Knockout-generated destroy property even if it was not part of your original object .", "I m using the Knockout mapping plug-in to refresh the UI with JSON retrieved from the server every 3 seconds .", "After using Knockout for a little longer I ve noticed that the mapping plugin has some additional options that give you much more fine grained control over the mapping process .", "See stackoverflow.com questions 10906252 http : stackoverflow.com questions 10906252 knockout-mapping-with-computed-fields", "I think mapping can help too you can follow this test and see difference between using jquert map knockout map knockout-map-vs-jquery-map http : jsperf.com knockout-map-vs-jquery-map .. . .. . When you start using heavily ObservableArrays mapping become crucial", "I think this is now the single most asked question re the mapping plugin .", "One thing that is strange to me though is how the mapping plugin works .", "The main object looks like this : .. . .. . I m trying to do this with knockout mapping and templates for each section type but don t really know how to do that .", "The mvcModel created by the mapping plugin will have observable properties .", "As the mapping plugin is exactly that a plugin it is not included in the core library .", "So in summary I ll definitely be sticking with the mapping plugin .", "Nice this looks like the opposite of the mapping plugin .", "Are you also using the KO mapping plugin", "Can you use the mapping plugin to map JSON data to an observableArray inside of my existing model", "The easiest way to achieve that is that you properly define the mapping-model before passing it to the mapping plugin as parameter .", "There is some very useful information in this question How can I use ko.toJs method without computed properties in knockout mapping", "When you use the mapping plugin later these observable properties will be correctly updated and the view will react to the changes .", "There is a Array of data i m storing in a variable and later using mapping plugin and i am making those as observable s to bind it to view .", "http : stackoverflow.com questions 7499133 mapping-deeply-hierarchical-objects-to-custom-classes-using-knockout-mapping-plug .. . .. . Your reasoning for using mapping plug-in is reasonable and the one that I use .", "You can invert the mapping by creating a model object that is mapped internally .", "i have bookmarked that question to analyse how mapping works as i m just starting on mapping plugin but i guess you deleted the post .", "I was thinking more along these lines http : janhartigan.com articles an-extension-to-the-knockout-js-mapping-plugin where there s a way to declare additional properties or methods and have them extend the mapping generated objects but this article is concerned with single objects rather than extending objects in a generated array .", "http : jsfiddle.net 3CtFq .. . .. . The mapping object is usually optional but I guess if you are mapping a sub object as is your case the plugin can t tell that this sub items parent was originally mapped with no options .", "I ve now given up on mapping the object with the plugin and simply do it myself and this has GREATLY simplified my javascript code as well as .. . actually working .", "Thanks for your hint but I don t know how to extend mapped objects mapped with mapping-plugin : stackoverflow.com questions 13933401 http : stackoverflow.com questions 13933401 knockout-mapping-validation", "I checked the fiddle the mapping plugin that you linked is wrong .", "i want to apply mapping plugin to my existing viewmodel", "if you would like to use mapping plugin check out my answer .", "The trick is to ignore these fields in the mapping plugin then add them in manually as computed fields .", "By default the mapping plugin will take the observable instances from the source object and use the same instance in the target object .", "When you call ko.mapping.fromJS data mapping knockout calls create rule where creates MyViewModel object .", "But it appears you actually need to define the view model first in your code and then you can populate it after the fact using the mapping plugin and some JSON data .", "github.com Knockout-Contrib Knockout-Validation https : github.com Knockout-Contrib Knockout-Validation", "The mapping is creating viewModel.model.members I would change it to udpate the existing view model by calling the function with mapping and view model parameters and ignoring the return-value so you have viewModel.members : ko.mapping.fromJSON data viewModel", "I am trying to update observable array by mapping plugin but plugin doesn t update the observable array .", "Knockout.js rules .", "The mapping plugin goes through the properties of the input object and updates the properties of the target viewmodel accordingly .", "Knockout now supports multiple model-binding .", "So currently the mapping plugin will not allow you to do incremental updates in this way .", "Are there any specific downsides to using the mapping plugin so frequently like this", "Without this initial data the mapping plugin can t generate the viewmodel ko.mapping.fromJS .", "Am I wrong in assuming that this is a scenario which the mapping plugin should support", "Right now I m using this JSON with the KO Mapping plugin and it s working fine : .. . .. . Now my requirement is to perform partial updates .", "Use first for mapping view model and second for children .", "I m trying to using mapping plugin to map the Json data received from server to an existing viewModel instance ." ] }
{ "confidence": [ 94.44374084472656, 93.74398803710938, 91.66725158691406, 91.53665924072266, 89.97584533691406, 87.8746337890625, 87.7684326171875, 86.80085754394531, 86.42184448242188, 85.06277465820312, 84.84915161132812, 84.71627807617188, 83.99813842773438, 83.97959899902344, 83.09037780761719, 82.72506713867188, 82.39736938476562, 81.980712890625, 81.552001953125 ], "content": [ "Question : I ve been using knockout.js for months now and only just realized it invokes functions when calling ko.toJS when serializing my model . This can lead to obvious problems like infinite-loop http : stackoverflow.com questions 12288603 infinite-loop-when-converting-knockout-object-to-plain-javascript-object and at worst dangerous data corruption if a function with side effects is being called . This behavior was at one point changed in an earlier version of Knockout but it seems it was backtracked upon https : github.com knockout knockout pull 1079 as being by design because sometimes some people want functions to be copied . Well I never do I don t think I do and I d really appreciate a way to be able to call toJS that would not invoke my functions . I realize I can use toJSON instead but sometimes you really do want toJS in the case where you want to do something like this : .. . .. . Or perhaps I m passing the model to some utility method that needs objects . I guess I ultimately don t understand why the invocation of functions on my viewmodel isn t configurable and if there s an easy way to monkey patch it or create a new toJS2 function then I d really like to be able to do that . There is some very useful information in this question How can I use ko.toJs method without computed properties in knockout mapping http : stackoverflow.com questions 11673229 how-can-i-use-ko-tojs-method-without-computed-properties-in-knockout-mapping but as yet I ve found no solution if I want to retain objects rather than convert to a string . Comment : or perhaps some way to specify functions to ignore incrementQty with an underscore wouldn t get invoked .. . Answer : Looks like it was a false alarm . While toJS does indeed retain the function references it was not Knockout itself that is invoking them . I passed my data directly to jQuery s ajax function to make a POST request and it was jQuery s JSON serialization which was actually causing the invocation. . If I passed ko.toJSON obj or even JSON.stringify ko.toJS obj to jQuery then it worked fine .", "Question : I ve been using knockout.js for months now and only just realized it invokes functions when calling ko.toJS when serializing my model . This can lead to obvious problems like infinite-loop http : stackoverflow.com questions 12288603 infinite-loop-when-converting-knockout-object-to-plain-javascript-object and at worst dangerous data corruption if a function with side effects is being called . This behavior was at one point changed in an earlier version of Knockout but it seems it was backtracked upon https : github.com knockout knockout pull 1079 as being by design because sometimes some people want functions to be copied . Well I never do I don t think I do and I d really appreciate a way to be able to call toJS that would not invoke my functions . I realize I can use toJSON instead but sometimes you really do want toJS in the case where you want to do something like this : .. . .. . Or perhaps I m passing the model to some utility method that needs objects . I guess I ultimately don t understand why the invocation of functions on my viewmodel isn t configurable and if there s an easy way to monkey patch it or create a new toJS2 function then I d really like to be able to do that . There is some very useful information in this question How can I use ko.toJs method without computed properties in knockout mapping http : stackoverflow.com questions 11673229 how-can-i-use-ko-tojs-method-without-computed-properties-in-knockout-mapping but as yet I ve found no solution if I want to retain objects rather than convert to a string . Comment : or perhaps some way to specify functions to ignore incrementQty with an underscore wouldn t get invoked .. . Answer : For future reference and I ve encountered the same issue at times you can create a mapping to ignore methods : Comment : thanks . this is trickier when you have an object graph like I do - I construct objects for each element in the viewmodel so when it is serialized there s a pretty complicated tree of functions and data Comment : I must admit I was frustrated that they d fixed this then backtracked on it but it is what it is at the moment", "Question : I m constructing a MVC5 Web App and want to make a dynamic page view by using Knockout.js . However I have found that Knockout.Mapping doesn t seem to work correctly in my project . As you see Intellisense does not the suggestion for the mapping plugin I have included the reference of the plugin in the reference.js . And it fails to show the second alert written when I complete this line forcibly . Do I have to do something more to make it work correctly Intellisense is not working http : i.stack.imgur.com jLMb3.png Comment : Didn t you try to set the model in the beginning of the page with @model did you Comment : Yes I put @model.. . referring the viewmodel in the beginning of the cshtml . Comment : I have found that I made a mistake in the code and did not upload a screenshot . I have modified the post leaving the original lines . Sorry for making it confusing . .. . Answer : Take a look at the help available here https : github.com knockout knockout wiki Using-KO-with-ASP.NET-MVC . I think the example you will need to create your mapping is this : Comment : It doesn t work.. . I checked that Newtonsoft package was installed correctly . Thank you for your suggestion anyway .", "Question : I m having endless recursion on IE by my knockout.js mapping . Can someone more familiar with KO to spot what am I doing wrong I have following knockout.js mapping : .. . .. . When I render the page approx . 1 time out of 5 IE ends up with following infinite recursion stack causing SCRIPT28 : Out of stack space . IE s callstack : .. . .. . My view model constructor : .. . .. . Initializing of view model is done by calling json endpoint : .. . Answer : You should divide your mapping object to 2 objects . Use first for mapping view model and second for children . Your ajax request remain the same . Update MyViewModel function to use childrenMapping : .. . .. . The root cause of the issue is recursive calling of mapping . When you call ko.mapping.fromJS data mapping knockout calls create rule where creates MyViewModel object . In MyViewModel s constructor you call ko.mapping.fromJS due to the using of the same mapping options knockout calls the same create rule that creates MyViewModel object where ko.mapping.fromJS is called with the same options . Comment : Thanks this actually solved the problem . Could you explain what was the actual issue that caused recursion in the first place with IE Comment : You are welcome see updated post for clarification . Comment : What really confuses me is why this behavior is only happening with IE and even more confusing is that it happens only in 30-40 of cases Comment : Maybe browsers somehow prevent this .", "Question : I m still learning the proper usage of Knockout and I ve found myself quickly getting away from ever typing ko.observable when setting up my viewmodel and instead just defining an object-literal and passing it through the mapping plugin with something like .. . .. . or at the very least something along the lines of stuffing all of my data into an attribute on the viewModel like so .. . .. . To be honest the main reason I ve been doing this is to get around having to type ko.observable and ko.observableArray repetitively . I m just trying to figure out if this is a good approach and if there are any downsides to dropping the specific var x ko.observable declaration all together . Also I m doing this all on load not in response to any ajax call etc which from what I can tell is what the mapping plugin was designed for . In your work with knockout do you still declare the observables manually one by one or have you gone with the mapping.fromJS method that I use Are there any specific downsides to using the mapping plugin so frequently like this Edit : .. . .. . Specific Example .. . .. . In this article http : blog.stevensanderson.com 2010 07 12 editing-a-variable-length-list-knockout-style Steve sets up his viewModel by doing .. . .. . Normally I d just use ko.mapping.fromJS for this situation as well specifically to make sure the objects within the array are turned into observables as well . Looking at what he did my approach seems like its overkill and adds a bit of unnecessary overhead . Comment : One consideration you might make is whether mapping creates tight coupling between your view and your data model . Also whether you need extenders . These can be added using the mapping options but can then become unwieldy if you re extending most of your observables such as can happen with form validation . .. . Answer : Allen my recent learning experience with Knockout.js has been similar to yours . We work with a deep hierarchical object graph from the server and I have defined explicit instantiable view model functions which preserve the basic structure of it . I began by defining each property explicitly as an observable on the relevant view model but that quickly got out of hand . Also a major reason for switching to using the mapping plugin was that we have to do frequent Ajax posts of the graph back to the server where it is merged with the persisted version then validated on the server in such a way that numerous properties can change and collections be modified and a new instance returned as the Ajax result where it has to be re-merged with the client representation . That became seriously difficult and the mapping plugin helped big time by allowing the specification of identifiers for resolving adds deletes updates and to remap an updated graph onto the original . It also helped in the original graph creation through the use of the create option for sub view models . In each view model constructor I receive a reference to the parent view model plus the data with which to construct the child view model then create further mapping options to create grandchildren from the passed-in child data . The only slight downside I recently found as detailed in this question http : stackoverflow.com questions 11148214 tojson-view-model-overrides-not-being-reflected-after-knockout-unmapping is that when doing ko.mapping.toJSON it doesn t hook into any toJSON overrides you may have defined on the prototypes of your view models in order to exclude properties from serialization . I have been able to get around that by specifying ignore options in the unmapping as recommended by Ryan Niemeyer in that post . So in summary I ll definitely be sticking with the mapping plugin . Knockout.js rules . Comment : That sounds like some fun work you should post some more in depth stuff about it somewhere Could you imagine doing all that work without knockout Oh and yeah I had the same problem with .toJSON that was disappointing but I was able to work around it too .", "Question : I have a large complex page that relies heavily on knockout.js . Performance is starting to become an issue but examining the call stack and trying to find the bottlenecks is a real challenge . I noticed in another question Knockout.js -- understanding foreach and with http : stackoverflow.com questions 9916843 knockout-js-understanding-foreach-and-with that the accepted answer has the comment : .. . .. . ...and I suggest not using with where high performance is necessary because of the overhead.. . Assuming the statement is true this is really useful stuff to know and I have not found a source for such performance tips . Therefore my question is : .. . .. . Are there general guidelines top tips that I can apply to help the performance of my application before I get deep into classic performance tuning . Comment : I have a number of tips to share but no time . Will post tonight . Comment : @RPNiemeyer - Thanks Ryan . That would be great . Comment : I don t have any general tips but you might want to try the beta of 2.1 as the comments suggest there have been some general performance improvements . .. . Answer : I think mapping can help too you can follow this test and see difference between using jquert map knockout map knockout-map-vs-jquery-map http : jsperf.com knockout-map-vs-jquery-map .. . .. . When you start using heavily ObservableArrays mapping become crucial", "Question : im following this example http : jsfiddle.net rniemeyer badZb . I just copy and paste the exact code into a sample application and it gave me this error : ko.mapping is undefined . Anyone know whats happening My ko.observable and dependentObservable are working great is just that ko.mapping is not working . FYI : The knockout.js version is 2.0 and Jquery 1.7.1 .. . Answer : As the mapping plugin is exactly that a plugin it is not included in the core library . You need to include the mapping plugin http : knockoutjs.com documentation plugins-mapping.html separately . You can find it on GitHub https : github.com SteveSanderson knockout.mapping . Just make sure you include it after including the core Knockout library . Comment : OMG . Just kill me . Thanks alot Comment : No problem : Easy to overlook the obvious sometimes Comment : the problem i think is that there is a mapping walkthrough on knockout s primary site leading you to believe that it s baked in . Comment : Had the same problem too but it s thanks a lot . -", "Question : We are using knockout and the knockout-mapping-plugin to facilitate databinding in our jQTouch web application . The reason we use the mapping plugin is to be able to use knockout without the need to define change viewmodels manually in javascript . The mapping plugin works great when you have an initial load of data from the server client-side database . The problem we are having is that we have some screens views which have a form in which it is possible that there isn t any initial data . Without this initial data the mapping plugin can t generate the viewmodel ko.mapping.fromJS . This means that we still need to define our viewmodels by hand for large parts of our views . Am I wrong in assuming that this is a scenario which the mapping plugin should support I mean this means that the mapping plugin is only usable in scenarios in which you always have an initial load of data . .. . Answer : I think the solution to you problem comes from thinking about the view model in the wrong way . A view model isn t only something that delivers data to the view but also a place holder for submitting the data back . The way i usually end up working with knockout i never end up sending an empty view model to the view . The view model usually has all the fields i am binding on . While they might be empty strings or initialized objects with no display values the actual objects to still exits with a proper representation of each object to the fields i am binding to . You might want to look into simply sending empty objects instead of nothing to the view . EDIT : The example is un ASP.NET MVC .. . .. . So basiclaly i on the server-side i create an view model object which contains all the data that needs to be displayed as well as all the data that needs to be collected . For easier validation code i generally put the data to be collected into it s own subclass but that all a matter of the needs of your code . In anycase the any object going to the view inherts from a vmBase class which basically provides a toJSON method which generates the JSON serialization of the object . This gets called in my view by the view engine . As shown in the code below . When i am ready to send the code back up i simply remove pull a JS version of the view model . In some sanarios where only a part of the view model is changing this is if you are doing AJAX updates you can do some cool stuff like switching templates so that different binding can be applyed . In this case we are using a ID of Container as container of the original data template and replacing the template which can contain data-bind elements a new template ID of Template Comment : Are you also using the KO mapping plugin That enables you to generate the viewmodel instead of having to define it by hand . This is the part we are having problems with . Comment : Hope the edit helps . It s taken me a bit to realize that i can do this type of stuff with knockout . BUt it ends up with some pretty great results . It really gives the website a thick client fell and very smooth AJAX flow .", "Question : I m trying to attach validation to a mapped view . I m using Knockout Mapping and Validation plugins . Pseudo-models : .. . .. . Javascript : .. . .. . How can I extend persons observableArray to set validation rules and message I need to validate both persons and books sub-array properties . I ve found only examples that use explicit model setting without automatic mapping something like : .. . .. . Then I ll need to set ko.validatedObservable isValid and validation.init but I really don t know how to handle organize this . Can you please provide some help .. . Answer : I have found at least two ways to supply validations to model or view model objects that are created via the ko.mapping plugin : .. . .. . 1 . Use the mapping options to attach the validation rules when certain properties are created .. . 2 . HTML5 attributes . This is only supported for some validations i.e . required pattern . See the documentation for the Knockout-Validation plugin https : github.com ericmbarnard Knockout-Validation html5-validation-attributes for details .. . .. . The above two techniques can also be combined . See the following fiddle http : jsfiddle.net thedude458 ysfYc for an example . .. . .. . 1 . Using Mapping Options .. . .. . The Knockout Mapping plugin allows the creation of certain properties on mapped objects to be customized . Taking advantage of this functionality you can override the default behavior of the plugin and add validation for your mapped properties . Below is an example .. . .. . HTML .. . .. . .. . Javascript .. . .. . .. . .. . .. . 2 . HTML5 Attributes .. . .. . The Knockout Validation plugin supports a limited set of HTML5 validation attributes that can be used in your HTML controls . However using them requires enabling the parseInputAttributes option . Here is a simple example : .. . .. . HTML .. . .. . .. . Javascript Comment : you could also include the ability to extend inside the data-bind . Like the following data-bind value : name.extend required : true email : true Comment : jsfiddle.net Hv9gG http : jsfiddle.net Hv9gG", "Question : Is there a way to map a JSON data object to an observable array and then in turn have each item of the observable array be initialized into a specific type of view model I ve looked at all of knockout s documentation along with the knockout and mapping examples here and I can t find any answer that works for what I m after . So I have the following JSON data : .. . .. . And I have the following view models : .. . .. . Is it possible with the given data structure and using knockout s mapping plugin to have the resulting StateViewModel contain an observableArray populated with 2 CityViewModels and each CityViewModel containing an observableArray populated with 2 StreetViewModels Currently using the mapping plugin I m able to get it to map to a StateViewModel but the cities and streets collections are populated with generic objects instead of instances of my City and Street view models . They end up with the correct observable properties and values on them they re just not instances of my view models which is what I m after . .. . Answer : Check this http : jsfiddle.net pTEbA 268 Comment : I did have one follow up question though : when creating cities it looks like the create mapping actually returns a single object of type CityViewModel and is passed a city object . What would you do if you wanted to have a collection type like CitiesViewModel with its own collection methods Comment : Looks great But what does the this . type ..Model do in the constructors I can t find anything about a type property in the online Knockout or Knockout.mapping documentation . Comment : type is not actually necessary.. . just to demonstrate that constructor was called . Comment : Thanks . This example should be in the official Knockout Documentation .", "Question : I have the following model : .. . .. . I bind various UI elements to these fields which works great . However I convert the model back to a JavaScript object so I can save any changes to the server : .. . .. . goingToServer will include properties A B and C . However let s say property C is a huge chunk of data that will never change . I d like to avoid sending this back to the server . Is there a way to make toJS only include a predefined set of fields when converting a model back to a JavaScript object One thing I ve been investigating is the Knockout Mapping plugin http : knockoutjs.com documentation plugins-mapping.html . It has a setting called include which is documented as such : .. . .. . When converting your view model back to a JS object by default the mapping plugin will only include properties that were part of your original view model except it will also include the Knockout-generated destroy property even if it was not part of your original object . However you can choose to customize this array : .. . .. . However it appears this plugin doesn t work as documented as ko.mapping.toJS will still include A B and C even if I pass in an include array of A B . I m guessing this feature is intended to include additional fields that were not in the original model . Is there a way to exclude certain properties when converting a model back to a JavaScript object short of doing something hacky such as generating the object and manually removing the properties I don t want before sending to the server .. . Answer : Ok I ve figured out one solution that works though I m hoping there s a better approach . The trick is to ignore these fields in the mapping plugin then add them in manually as computed fields . Computed fields will never end up in the generated JavaScript object when toJS is called . I can now bind to these view model as normal :", "Question : I am trying to delete an item from a list . I am using knockout.js with the mapping plugin . My code looks like this : .. . .. . Serialize to Json .. . .. . Template .. . .. . K.O . JavaScript .. . .. . The HTML .. . .. . The Question .. . .. . Everything works as expected . A list of images shows up with delete buttons however when you click a button item.Filename is undefined . Thoughts .. . .. . Edit : Taken from the KNockout.js Manual : When calling your handler Knockout will supply the current model value as the first parameter . This is particularly useful if you re rendering some UI for each item in a collection and you need to know which item s UI was clicked . It appears that I am not getting back the Img object I am expecting . I don t know what I am getting back .. . Answer : I notice there is an example of how to do this here : .. . .. . http : blog.stevensanderson.com 2011 12 21 knockout-2-0-0-released .. . .. . Check out the 4 . Cleaner event-handling section where Steve shows an example of an item being deleted from a list . Javascript : .. . .. . But take into account that the above example is for KnockoutJS 2.0 which is the latest release . Comment : Yea it works like a champ when I do it like this . The problem is that when I use templates it stops working . Comment : It appears you are using jQuery templates which does not act the same as native templates with KO . WHich did you want to use Comment : @Jason you ought to use KO native templates . jquery.tmpl is a kind of dead-in-the-water tech with no future updates planned . Comment : I was wondering what to do because I read about jquery.tmpl being deprecated . Its still in the KO github so I figured the KO community was supporting it now or something . Glad to find out KO has native support and I can just delete tmpl .", "Question : I am trying to delete an item from a list . I am using knockout.js with the mapping plugin . My code looks like this : .. . .. . Serialize to Json .. . .. . Template .. . .. . K.O . JavaScript .. . .. . The HTML .. . .. . The Question .. . .. . Everything works as expected . A list of images shows up with delete buttons however when you click a button item.Filename is undefined . Thoughts .. . .. . Edit : Taken from the KNockout.js Manual : When calling your handler Knockout will supply the current model value as the first parameter . This is particularly useful if you re rendering some UI for each item in a collection and you need to know which item s UI was clicked . It appears that I am not getting back the Img object I am expecting . I don t know what I am getting back .. . Answer : When you use each syntax in jQuery Templates the data context is whatever the overall template is bound against . In your case that is the entire view model . A few options : .. . .. . 1- you can use your current code and pass the item that you are eaching on to the function like http : jsfiddle.net rniemeyer qB9tp 1 : .. . .. . Using an anomymous function in the data-bind is pretty ugly though . There are better options . 2- you can use the foreach parameter of the template binding which works with jQuery Templates and is more efficient than each like http : jsfiddle.net rniemeyer qB9tp 2 : .. . .. . Now the context of the template is the individual image object and calling root.deleteImage will pass it as the first argument . 3- Since the jQuery Templates plugin is deprecated and Knockout now supports native templates you might want to choose removing your dependency on the jQuery Templates plugin . You could still use a named template just need to replace any jQuery Templates syntax with data-bind attributes like : http : jsfiddle.net rniemeyer qB9tp 3 or even remove the template and just go with the foreach control-flow binding like : http : jsfiddle.net rniemeyer qB9tp 4 .. . .. . 4- While I prefer option 3 you could even choose to use event-delegation and attach a live handler like : http : jsfiddle.net rniemeyer qB9tp 5 .. . .. . This can be especially beneficial if you would be attaching a large number of the same handlers via the click binding like in a grid . Comment : Amazing answer . I ended up with option 3.2 after reading about the deprecation of jquery.tmpl . I didn t realized that KO had native support now though . Glad I have all these options in my back pocket now . Thanks", "Question : How do you add a row to an editable table in Knockout.js The table displays self.List which is an observableArray mapped to data.Lines with self.List ko.mapping.fromJS data.Lines .. . .. . When I click the addRow button I am thinking I need to recompute self.List . I have tried from why-can-not-i-concat-data-to-observable-array-in-knockout http : stackoverflow.com questions 21930955 why-can-not-i-concat-data-to-observable-array-in-knockout .. . .. . applyTotoals works fine if I don t add a row . but I get uncaught TypeError : this.Entries is not a function and the new row won t compute totals . So I have tried .. . .. . How do I modify a mapped observableArrray Here is the fiddle : http : jsfiddle.net mckennatim jngesuf2 .. . Answer : well @mcktimo you are not effectively using mapping plugin . you can make use of 2nd paramter Mapper in fromJS function and build you viewModel effectively . viewModel : .. . .. . working sample here http : jsfiddle.net supercool nejdqktq .. . .. . I suggest to take a deeper dive into the mapping documentation http : knockoutjs.com documentation plugins-mapping.html", "Question : Using the knockout-mapping-plugin http : knockoutjs.com documentation plugins-mapping.html can you map a deeply hierachical object If I have an object with multiple levels : .. . .. . How do I map it to my custom classes in javascript : .. . .. . Can the mapping plugin recursively map this data into an hierachy of my custom objects .. . Answer : I used the approach in this answer http : stackoverflow.com a 15911835 667598 to create a hierarchy of checkboxes where nodes with children are collapsible and when you check uncheck the parent its descendants get checked unchecked . View Model .. . .. . HTML view", "Question : I have the following model : .. . .. . I bind various UI elements to these fields which works great . However I convert the model back to a JavaScript object so I can save any changes to the server : .. . .. . goingToServer will include properties A B and C . However let s say property C is a huge chunk of data that will never change . I d like to avoid sending this back to the server . Is there a way to make toJS only include a predefined set of fields when converting a model back to a JavaScript object One thing I ve been investigating is the Knockout Mapping plugin http : knockoutjs.com documentation plugins-mapping.html . It has a setting called include which is documented as such : .. . .. . When converting your view model back to a JS object by default the mapping plugin will only include properties that were part of your original view model except it will also include the Knockout-generated destroy property even if it was not part of your original object . However you can choose to customize this array : .. . .. . However it appears this plugin doesn t work as documented as ko.mapping.toJS will still include A B and C even if I pass in an include array of A B . I m guessing this feature is intended to include additional fields that were not in the original model . Is there a way to exclude certain properties when converting a model back to a JavaScript object short of doing something hacky such as generating the object and manually removing the properties I don t want before sending to the server .. . Answer : If we have a complex object-model instance under vm.Payment observable reference as : .. . .. . .. . .. . Summary : .. . Count : 12 .. . PaymentAmount : 1500 .. . PaymentMethod : Cheque .. . PaymentDate : 2015-04-08T22 : 38 : 48.552Z .. . AgentOid : 1208795 .. . AgentName : Asere Ware .. . .. . .. . .. . .. . .. . and need to ignore only some inner properties then : .. . .. . .. . var mapping .. . ignore : Summary.PaymentMethod Summary.PaymentDate avoid lost some initialized values . .. . map updating existing observable Payment under my ViewMode vm with source data JSON object . ko.mapping.fromJS data mapping vm.Payment .. . .. . and this is the result for vm.Payment content where only PaymentMethod and PaymentDate are keept : .. . .. . .. . .. . Summary : .. . Count : 0 .. . PaymentAmount : 0 .. . PaymentMethod : Cheque .. . PaymentDate : 2015-04-08T22 : 38 : 48.552Z .. . AgentOid : undefined .. . AgentName : undefined .. . .. . .. . .. .", "Question : What is the standard way of loading mapping plugin in require.js Below is my config.js require.js config file .. . .. . In my view model .. . .. . However mapping is not bound to ko.mapping . Any pointers suggestions would be appreciated . Thanks Ravi .. . Answer : Your configuration object can specify a set of dependencies and a callback where further dependency configuration manipulation can be performed : .. . .. . And when you include your scripts in markup config should be loaded before require : .. . .. . Now Knockout.js will be available with a ko.mapping property as desired when used in a module definition . Please note that this is an abbreviated configuration example . There s some shimming needed for the mapping plugin to specify the proper exports just don t remember off the top of my head what it is . Comment : I m running into a race-condition where require . . is getting called before the callback runs . I really like how the callback sets up ko.mapping but it doesn t work for me all of the time", "Question : I m new to KnockoutJS http : knockoutjs.com and I m stuck trying to add additional properties and methods to the generated objects in the ko.observableArray as created by the mapping plugin . Here s where I m up to : .. . .. . I have a JSON array of Users .. . I ve created the ko.observableArray with the mapping plugin .. . I ve got a template that creates table row for each User so far so good : o .. . .. . .. . Here s what I m trying to do : .. . .. . Each User has a property called IsActive - I d like to data-bind a click event to a method on each User object that toggles this IsActive property . This question looked promising http : stackoverflow.com questions 6637579 knockoutjs-observablearray-and-ko-mapping-fromjs but it seems like unnecessary duplication to me to have to declare the entire View Model in JS unless that s the way I have to do it - is it possible to just extend the generated object I was thinking more along these lines http : janhartigan.com articles an-extension-to-the-knockout-js-mapping-plugin where there s a way to declare additional properties or methods and have them extend the mapping generated objects but this article is concerned with single objects rather than extending objects in a generated array . Here s the code : http : jsfiddle.net yZkSf 2 not yet working in JS fiddle - but I ll keep playing with it and update this link when I get it working . Thank you for your help .. . Answer : This is what I came up with using both your and Ryan s answers.. . seems to work . Please leave feedback as I am new to Knockout and curious myself if this is a good approach . JS : .. . .. . DOM :", "Question : I m new to using knockout and I m trying to use the knockout-validation plugin along with the mapping plugin . I m having an issue with the isValid function on the view model object . According to the documentation isValid should return a bool to determine whether any of the observables on the view model are in valid but when I call it I get an error saying that isValid is not a function . However if I call isValid on the observables themselves it works fine . The problem is I m using the mapping plugin with some dynamic data objects that I get from the server so I don t necessarily know the names of the observables I need to validate so it s not feasible to validate them individually . The example below is simplified but in the real implementation I don t know the names of the observables . Maybe I ve just missed some documentation Thanks for your time . This does work .. . .. . But this doesn t work .. . Answer : Call ko.validation.group in your VM to group all the validatable observables at the VM level . Then isValid will be true only if no child observables have errors . Some other SO answers about ko.validation.group .. . .. . How to use ko.validation.group function http : stackoverflow.com questions 13037713 how-to-use-ko-validation-group-function .. . .. . Knockout Validation ko.validation.group vs ko.validatedObservable http : stackoverflow.com questions 13057018 knockout-validation-ko-validation-group-vs-ko-validatedobservable" ] }
[ "yes-answer-long", "yes-answer-short" ]
open-source
UNK_RELATION
android-cursor@read-write@72
android-cursor -- android-cursor is an interface which provides random @placeholder access to the result set returned by a database query .
{ "confidence": [ 59.30626678466797, 43.25883102416992, 42.73957824707031, 39.497962951660156, 38.26581573486328, 38.025230407714844, 37.87535858154297, 37.8734130859375, 37.54412841796875, 36.98147964477539, 36.90605545043945, 36.4127197265625, 36.4127197265625, 36.10572814941406, 35.967628479003906, 35.56901550292969, 35.49751281738281, 35.14118576049805, 34.85978317260742, 34.585453033447266, 34.46002960205078, 34.45701217651367, 34.150211334228516, 33.91352081298828, 33.710044860839844, 33.586029052734375, 33.491233825683594, 33.11228561401367, 33.002601623535156, 32.57804489135742, 32.46590805053711, 32.401554107666016, 31.957317352294922, 31.957317352294922, 31.9074649810791, 31.814556121826172, 31.814556121826172, 31.75494384765625, 31.751035690307617, 31.746231079101562, 31.727802276611328, 31.225807189941406, 31.209440231323242, 31.066314697265625, 31.049198150634766, 30.95071792602539, 30.95071792602539, 30.95071792602539, 30.915618896484375, 30.882659912109375, 30.86764144897461, 30.57261848449707, 30.537948608398438, 30.490713119506836, 30.44266700744629, 30.38150405883789, 30.38150405883789, 30.38150405883789, 30.347753524780273, 30.119762420654297, 30.119762420654297, 30.033687591552734, 29.997634887695312, 29.994361877441406, 29.994361877441406, 29.8179931640625, 29.744667053222656, 29.698070526123047, 29.698070526123047, 29.692569732666016, 29.652090072631836, 29.636707305908203, 29.636707305908203, 29.636707305908203, 29.561634063720703, 29.561634063720703, 29.50921630859375, 29.50921630859375, 29.50921630859375, 29.50921630859375, 29.50921630859375, 29.30816650390625, 29.30816650390625, 29.30816650390625, 29.291828155517578, 29.291828155517578, 29.248960494995117, 29.230514526367188, 29.230514526367188, 29.123205184936523, 29.120250701904297, 29.07489776611328, 29.015213012695312, 29.013587951660156, 28.999408721923828, 28.97312355041504, 28.947872161865234, 28.930124282836914, 28.813756942749023 ], "content": [ "I believe a cursor is .. . .. . An Interface which represents a two dimensional table of any database The cursor interface allows access to the result returned by the SQL database query .. . .. . However what is the function of the Cursor Adapter in android", "Or call startManagingCursor after you get the Cursor from your query and Android will close the Cursor on its own .", "The data is returned to a cursor from query and the cursor gets passed to spinner s SimpleCursorAdapter .", "If you are having trouble debugging your SQL query Android provides a handy method DatabaseUtils.dumpCursorToString http : developer.android.com reference android-database DatabaseUtils.html dumpCursorToString 28android.database.Cursor 29 that formats the entire Cursor into a String .", "Easiest way to add rows in a cursor is to use a MatrixCursor https : developer.android.com reference android-database MatrixCursor.html and a MergeCursor https : developer.android.com reference android-database MergeCursor.html .", "When a query returns a cursor it is actually positioned before the first record in the cursor .", "I would suggest you that once you query sqlite master table using cursor A don t use the same cursor A as it contains result-of the that query result .", "He s creating a cursor and then immediately closing the database without closing the cursor .", "I was trying to get sample code working which passed a cursor returned from a database query directly to List Adapter - no interim adapter .", "Re-query the database for an updated cursor .. . 2 .", "When cursor is returned from a database query it is placed at index -1 that is above the first entry of the cursor so before using the cursor to get data you have move it to its first position .", "AFAIK any native Android functions that use a Cursor close it automatically for you", "A mouse cursor can appear on Android TV when mouse is connected .", "exactly i am trying to load more than 1MB of data from sqlite database to android-cursor .", "what if i am returning cursor to custom cursor adapter which create views for me is there any way to close the cursor then", "Cursor is actually an interface and you can create a custom class that implements the Cursor interface .", "If you will have to merge MatrixCursor with database Cursor use MergeCursor http : developer.android.com reference android-database MergeCursor.html .", "As of then when the SQLiteQueryBuilder queries the database to fill the Cursor object the return is empty cursor .", "This provides a runQuery function that returns a new cursor of filtered results likely accomplished with a database query .", "Cursor cursor getContentResolver .query ContactsContract.Contacts.CONTENT URI columns null null null causes a runtime-error .", "I had already been closing the Cursor and Database objects but had not been closing my SimpleListAdapter Cursor .", "A CursorAdapter is an implementation of the ListAdapter interface that wraps a Cursor .", "In the Android database API all query parameters are strings .", "Since a cursor is returned before the first record the moveToNext works .", "Yes you can create cursor using MatrixCursor http : developer.android.com reference android-database MatrixCursor.html .", "sounds like you may let the cursor be managed by the activity but somewhere you set the cursor null which cause the NPE", "When you create a cursor it should default to -1 its in the constructor to most known subclasses of Cursor interface .", "http : stackoverflow.com questions 6754973 how-to-insert-extra-elements-into-a-simplecursoradapter-or-cursor-for-a-spinner .. . .. . How to create Cursor data without getting data from the DataBase in Android application", "like Cursor cursor msadb.rawQuery sql .. .", "On the other hand tracking your cursor and database connections is prone to human error .", "If the cursor result is not going to change meanwhile e.g .", "@DiscoS2 Please note that Cursor is an interface so this solution will work when the cursor object is an instance of CursorWrapper class or a subclass of it .", "Since you ve mentioned Android 4.0+ you are probably referring to the system native cursor .", "You can also find a complete sample implementation at : http : www.pocketmagic.net 2012 07 android-overlay-cursor", "After the query the cursor will be pointing to row index -1 which is not a valid row .", "Not from the cursor no .", "Cursor to JSONArray", "DataSetObserver can also be used to observe the content changes in the Cursor http : developer.android.com intl zh-cn reference android-database Cursor.html in a similar fashion .", "But be warned though for this to work you have to be wise while implementing the Cursor interface .", "if db.rawQuery produces an empty Cursor them you will know why SQLiteQueryBuilder produces an empty Cursor see androidxref.com 5.1.0 r1 xref frameworks base core java android http : androidxref.com 5.1.0 r1 xref frameworks base core java android-database sqlite SQLiteQueryBuilder.java 372", "I create cursor .. . .. . In another thread i insert data to database and onChange fired but Cursor always return zero count .", ": .. . .. . I modified the queries for my cursors to explicitly set the column name like so : .. . .. . Group Cursor .. . .. . Child Cursor .. . .. . After I did that everything worked as it was supposed to in all versions of Android that I am testing .", "CursorAdapter receives a wrapped cursor from cursor loader .. . 2 .", "On other platforms I can output the Cursor s content via DatabaseUtils.dumpCursorToString cursorObject but on Android 5.0+ the method reports output on null objects .. . .. . Dumping cursor null .. . .. . .. . Even more : when I extract database file from 5.0+ devices and run the local SQL query I can fetch all data .", "Now my app is very stable and does not suffer from Android error : java.lang.IllegalStateException : trying to requery an already closed cursor when switching Activities even though they access the same database .", "cursor null will also solve the problem", "This closing of cursor prevents exception in logcat .", "It will return an empty Cursor if no results are found .", "If you tries to use a cursor later you ll get the nice Invalid statement since the connection which the cursor relies on is already closed .", "The simplest way is this : .. . .. . The cursor starts before the first result row so on the first iteration this moves to the first result if it exists .", "So my questions are : must the sqlite cursor on android contain all columns to execute correctly pretty sure the answer is yes", "My cursor unchanged from what I was using looks like this .. . .. . My database has multiple tables the one for the above cursor is the image below .", "cursor c is a global variable which you use in these two methods .. . .. . But the problem is you close the cursor in getInboxSms method and try to access same cursor in getModel method .", "Research .. . .. . The advice in this answer : http : stackoverflow.com a 18107638 1977132 is to set the cursor to null cursor.close cursor null presumably so a new cursor can be created but it makes no difference the second time round the loop it still gives a StaleDataException .", "While learning to iterate over a cursor I learned http : stackoverflow.com questions 10723770 whats-the-best-way-to-iterate-an-android-cursor that I needed to first move to position -1 and then use moveToNext in a loop : .. . .. . While mathematically this makes sense I don t know what it means to move to a cursor to a negative position .", "This is the proper way to close cursor :", "It will be called sizeOf cursor times .", "But cursor is running fine .", "As stated in the ManageQuery definition on developer.android.com http : developer.android.com reference android app Activity.html managedQuery android.net.Uri 20java.lang.String 5b 5d 20java.lang.String 20java.lang.String 5b 5d 20java.lang.String the activity manage the lifecycle of the cursor returned by managedQuery you shouldn t close the cursor manually .", "Calling Activity.stopManagingCursor on the adapter s cursor before changing the cursor solved the problem :", "In the documentation it says about changeCursor c : Change the underlying cursor to a new cursor .", "I m debugging application which uses heavily Cursor https : developer.android.com reference android-database Cursor.html as it queries a lot into several databases sms mms call log .", "@pskink but seem function Cursor query above not use for Uri", "To me there must be some as basically you re searching the cursor by a name to then extract the offset which is then used to access the data .", "The Exception would be StaleDataException that saying I am attempting to access cursor which is being closed .", "Put in your query for the entire data set you want get the Cursor and let CursorAdapter and ListView take care of the rest .", "You should override newView Context context Cursor cursor ViewGroup parent and bindView View view Context context Cursor cursor instead of getView in a CursorAdapter .", "I too have been having issues with the closing the cursor : .. . .. . Closing the cursor right after setting the list view s adapter causes the cursor to close before the data gets displayed .", "The best looking way I ve found to go through a cursor is the following : .. . .. . Don t forget to close the cursor afterwards .. . .. . EDIT : The given solution is great if you ever need to iterate a cursor that you are not responsible of .", "I have a ListView set up from a cursor that grabs the first 10 rows in a database LIMIT .", "As in my previous code I return a cursor bcause I call parent.getItemAtPosition like this : Cursor cursor Cursor parent.getItemAtPosition getAdapterPosition", "That exception is thrown if the cursor fails to allocate enough space to store the data it needs .", "Try : .. . .. . The cursor should always be closed regardless of whether or not its empty .", "if any part of the code prior to the close throws an exception the cursor won t be closed .", "From the Android documentation on SimpleCursorAdapter.ViewBinder : .. . .. . Binds the Cursor column defined by the specified index to the specified view .", "See stackoverflow.com questions 10723770 http : stackoverflow.com questions 10723770 what-is-the-neatest-way-to-iterate-over-the-results-in-an-android-cursor", "@arnold : Maybe you are thinking of the wrong Cursor", "Close the cursor object wherever you are creating it .", "startManagingCursor cursor .. . .. . This has fixed my problem", "Cursor : invalid statement in fillWindow being one of such errors .", "The solution is : first use the cursor and then close the Db .", "I think Cursor is read-only .", "May be you need a cursor requery .", "I have a Cursor A with a load of data in it .", "yes in cursor sims. .", "If there is an existing cursor it will be closed .", "Now as I am using CursorAdapter which accepts Cursor data how can I bind a new set of data which is not coming from the DataBase", "At the time of loading it gives following error like .. . .. . if any one knows how to load large-data more than 1MB to android-cursor", "Delete all the item from the ContentProvider notifyChange called .. . .. . This is the stacktrace after delete : .. . .. . The cursor wrapper is taken from here https : github.com clover android-filteredcursor .", "On the android developer site I ve seen that there are accesor methods to the cursor class such as cursor.getInt cursor.getString etc etc should I be using these to access the data that I am after .", "Since you are not limiting the number of rows in your query via the selection args your cursor will allocate space to keep a copy of all of column first in memory .", "I also found out that I can close the database and the sqlite open helper before closing the cursor .", "The Cursor will be delivered in onLoadFinished when the Loader has finished the query and will be bound to the adapter with swapCursor cursor .", "I programmatically check uncheck some buttons which filter the result and the cursor is restarted after each check uncheck .", "I want the number of items from my cursor which won t always be the entire database .", "Usually it might be enough to call changeCursor http : developer.android.com reference android-widget CursorAdapter.html changeCursor 28android.database.Cursor 29 with null adapter will close old one or swapCursor http : developer.android.com reference android-widget CursorAdapter.html swapCursor 28android.database.Cursor 29 with null and close returned cursor manually .", "Here is how my cursor loader looks like : .. . .. . Basically I let the cursor loader manage the album query and each time in the bindView I query the photos from the passed in album cursor .", "Cursors are immutable by design which means any changes made to the DB after the cursor is retrieved won t be in that cursor .", "Try to check cursor size before accessing cursor value ." ] }
{ "confidence": [ 63.16798400878906, 51.13761520385742, 47.09058380126953, 47.05365753173828, 46.87147521972656, 46.82236862182617, 46.102210998535156, 45.8203010559082, 45.706138610839844, 45.686729431152344, 45.55718994140625, 44.66551971435547, 44.61005783081055, 44.51244354248047, 43.836421966552734, 43.77809524536133, 43.4915885925293, 43.36341094970703, 43.116127014160156, 42.99587631225586 ], "content": [ "Question : I believe a cursor is .. . .. . An Interface which represents a two dimensional table of any database The cursor interface allows access to the result returned by the SQL database query .. . .. . However what is the function of the Cursor Adapter in android Many Thanks Josh .. . Answer : A CursorAdapter is an implementation of the ListAdapter interface that wraps a Cursor . ListAdapter is used with collection-style widgets like ListView Spinner GridView and others that inherit from AdapterView . The adapter serves as a bridge between your model data the Cursor and the visual representation as rows cells or whatever inside of the AdapterView .", "Question : Being new in Android I am having trouble dealing with the following : .. . .. . The following gives me the following error : .. . .. . I am trying to extract the data inside the cursor to an array . Can someone help me with the implementation . Comment : its better to use arraylist instead of string . Comment : Help full link For u androidhive.info 2011 11 android-sqlite-database-tutorial http : www.androidhive.info 2011 11 android-sqlite-database-tutorial .. . Answer : When cursor is returned from a database query it is placed at index -1 that is above the first entry of the cursor so before using the cursor to get data you have move it to its first position . For that add cursor.MoveToFirst after Cursor cursor getReadableDatabase .rawQuery SELECT name FROM contacts null", "Question : On Ice cream sandwich my application starts force close when I wanted to resume the application that has a gridview with a CursorAdapter that have passed in a managedQuery to a CursorAdapter . The Exception would be StaleDataException that saying I am attempting to access cursor which is being closed . I used the getContextResolver .query instead of using managedQuery . The help me stop having force closed of the applicatio when i tried to resume the application . In that case if I used this way . Do I need to close the cursor or will it be closed by Adapter . Comment : Please please please don t use managedQuery . Read here to understand why http : www.androiddesignpatterns.com 2012 07 loaders-and-loadermanager-background.html . .. . Answer : As per Activity documentation http : developer.android.com reference android app Activity.html managedQuery 28android.net.Uri 20java.lang.String 5B 5D 20java.lang.String 20java.lang.String 5B 5D 20java.lang.String 29 using managedQuery You don t need to close the cursor manually but using ContentResolver manually You will need to do so . Adapter won t close the cursor because it doesn t know instead of Activity when user left application and cursor is no longer needed . Usually it might be enough to call changeCursor http : developer.android.com reference android-widget CursorAdapter.html changeCursor 28android.database.Cursor 29 with null adapter will close old one or swapCursor http : developer.android.com reference android-widget CursorAdapter.html swapCursor 28android.database.Cursor 29 with null and close returned cursor manually . But I would suggest to take a look at CursorLoader http : developer.android.com reference android content CursorLoader.html as more handy reliable and suggested by Google way to load cursors . Consider using support library v4 http : developer.android.com tools extras support-library.html if You re targeting old Android . Comment : I look at it before but the support package only work from v3.0 and above of Android . Comment : No.. . it goes back to Android 1.6 SDK 4 Comment : Oh i mean certain libraries in the package .", "Question : I have a table named as products3 which has columns id type width length thickness quantity . . in order and other than type all other columns are int I wish to select quantity and return it by filtering data on other columns . Cursor in method findproduct returns false or NULL in the if condition even though the data is present in the table I have browsed the table using DB browser for SQLite please help Comment : add the error-log . Comment : stack-trace please Comment : @Suhail Jain try this SQLiteDatabase db this.getReadableDatabase Comment : What is your first column Is it a String : cursor.getString 0 Comment : @Chol no it is not .. . Answer : If you are having trouble debugging your SQL query Android provides a handy method DatabaseUtils.dumpCursorToString http : developer.android.com reference android-database DatabaseUtils.html dumpCursorToString 28android.database.Cursor 29 that formats the entire Cursor into a String . You can then output the dump to LogCat and see the result-of your query .", "Question : I m a little confused about how to use the cursor to access the data that I need using the CursorLoader model . I was able to use a SimpleCursorAdapter and pass the cursor to the swapCursor method of the adapter within the onLoadFinished method that you have to implement as follows . Now I need to query the database and based on the number of rows returned display an integer . How do I access this information There is some information that I would like to store the id of certain rows selected so that I can bundle it up and pass it to the next activity because the id is a foreign key in other database tables and I ll need to to query the database . On the android developer site I ve seen that there are accesor methods to the cursor class such as cursor.getInt cursor.getString etc etc should I be using these to access the data that I am after . .. . Answer : It seems like you have two questions here.. . so I ll answer them both . Correct me if I misunderstood your question.. . .. . .. . 1 . To get the number of rows in the table you perform a simple query as follows : .. . .. . Cursor cur getContentResolver .query uri projection selection selectionArgs sortOrder .. . int numColumns cur.getCount .. . cur.close .. . .. . .. . 2 . Retrieving the id of a selected item is actually very simple thanks to Android adapters . Here s an example that outlines how you might pass an id to another Activity for example when a ListView item is clicked . public class SampleActivity extends Activity implements .. . LoaderManager.LoaderCallbacks Cursor .. . .. . pass this String to the Intent in onListItemClicked .. . public static final String ID TAG id tag .. . .. . private SimpleCursorAdapter mAdapter .. . .. . @Override .. . public void onCreate Bundle savedInstanceState .. . super.onCreate savedInstanceState .. . .. . setup layout initialize the Loader and the adapter etc . .. . .. . setListAdapter mAdapter .. . .. . .. . @Override .. . public void onListItemClick ListView l View v int position long id .. . final Intent i new Intent getApplicationContext NewActivity.class .. . i.putExtra ID TAG id .. . pass the id to NewActivity . You can retrieve this information in .. . the Activity s onCreate method with something like : .. . long id getIntent .getLongExtra SampleActivity.ID TAG -1 .. . startActivity i .. . .. . .. . .. . .. . You ll have to create a URI yourself to query the foreign database . This can be done with something like : .. . .. . Uri uri Uri.withAppendedPath CONTENT URI String.valueOf id .. . .. . .. . where CONTENT URI is the appropriate CONTENT URI for your ContentProvider . Let me know if that helps Comment : Very helpful thank you the android dev site has a lot of deprecated examples I wanted to make sure I was accessing data with the current standards . Comment : @Alex : - Sir I have a class which is extends by service . Now when i access message from the mobile inbox it give one message again again without start managing cursor I am not able understand this Please tell me what should i do Comment : @DeepankerChaudhary Ask a question on StackOverflow and then copy and paste the link and I can try to answer it . : Comment : See this Any help will be Appreciated.. . stackoverflow.com questions 13290476 http : stackoverflow.com questions 13290476 how-i-will-stable-on-current-activity-will-work-on-another-activity Comment : stackoverflow.com questions 15912512 using-loaders-with-cursors http : stackoverflow.com questions 15912512 using-loaders-with-cursors", "Question : The application has a SearchView which fetches suggestions from a specific database-table . Everything worked without any errors until Android 5.0 appeared . As of then when the SQLiteQueryBuilder queries the database to fill the Cursor object the return is empty cursor . Not NULL but empty . On other platforms I can output the Cursor s content via DatabaseUtils.dumpCursorToString cursorObject but on Android 5.0+ the method reports output on null objects .. . .. . Dumping cursor null .. . .. . .. . Even more : when I extract database file from 5.0+ devices and run the local SQL query I can fetch all data . So the database is valid indeed . And the query is the simplest one .. . .. . The logic for selecting data from the database and filling the Cursor object is really simple .. . .. . I tried looking for some deprecated methods but was without any luck . I have already spent 3 days debugging each step in the process and I am out of any ideas what could be causing such behaviour . Anyone has any ideas EDIT .. . .. . The output of the method buildQuery .. . .. . selection and selectionArgs parameters are created like this .. . .. . The RAW query resulted the same thing as query via builder.query Comment : what does buildQuery return Comment : i am referring to String buildQuery method Comment : what is your selection and selectionArgs Comment : did you try to run that query using sqlite3 app on your device or did you try to run SQLiteDatabase.rawQuery String sql String selectionArgs Comment : if db.rawQuery produces an empty Cursor them you will know why SQLiteQueryBuilder produces an empty Cursor see androidxref.com 5.1.0 r1 xref frameworks base core java android http : androidxref.com 5.1.0 r1 xref frameworks base core java android-database sqlite SQLiteQueryBuilder.java 372 .. . Answer : Have you tried to query using the SQLiteDatabase query method like the following Comment : I have to use MATCH . will not work in this case Comment : This may help resolve your issue : stackoverflow.com questions 16022427 http : stackoverflow.com questions 16022427 android-sqlite-query-to-match-column-containing-text Comment : This is also another link-to someone with the same issue as you : stackoverflow.com questions 9428069 http : stackoverflow.com questions 9428069 android-sqlite-match-returns-nothing Comment : Conversation moved to stackoverflow.com q 30709715 437039 http : stackoverflow.com q 30709715 437039", "Question : I have a Spinner which is to show a list of data fetched from database . The data is returned to a cursor from query and the cursor gets passed to spinner s SimpleCursorAdapter . It is working fine as such but I want to insert another item on top of this data . For example the spinner is already showing a list of user created templates saved in DB but I want to insert New Template and Empty Template on top of the list of templates and it needs to be inserted into Cursor SimpleCursorAdapter somehow . I have considered using an arraylist and populating the arraylist from cursor but cursor is better solution for me since it contains other related rows of data too . I searched internet for other solutions and found some answers asking to use CursorWrapper for this purpose but I could not find a concrete example how to use CursorWrapper to accomplish what I want . How can I insert some rows in cursor or can someone please give a easy to follow CursorWrapper example Thanks in advance . .. . Answer : I found some information about adding element to spinner which has SimpleCursorAdapter : http : groups.google.com group android-developers browse thread thread 4123868e02fc9172", "Question : The application has a SearchView which fetches suggestions from a specific database-table . Everything worked without any errors until Android 5.0 appeared . As of then when the SQLiteQueryBuilder queries the database to fill the Cursor object the return is empty cursor . Not NULL but empty . On other platforms I can output the Cursor s content via DatabaseUtils.dumpCursorToString cursorObject but on Android 5.0+ the method reports output on null objects .. . .. . Dumping cursor null .. . .. . .. . Even more : when I extract database file from 5.0+ devices and run the local SQL query I can fetch all data . So the database is valid indeed . And the query is the simplest one .. . .. . The logic for selecting data from the database and filling the Cursor object is really simple .. . .. . I tried looking for some deprecated methods but was without any luck . I have already spent 3 days debugging each step in the process and I am out of any ideas what could be causing such behaviour . Anyone has any ideas EDIT .. . .. . The output of the method buildQuery .. . .. . selection and selectionArgs parameters are created like this .. . .. . The RAW query resulted the same thing as query via builder.query Comment : what does buildQuery return Comment : i am referring to String buildQuery method Comment : what is your selection and selectionArgs Comment : did you try to run that query using sqlite3 app on your device or did you try to run SQLiteDatabase.rawQuery String sql String selectionArgs Comment : if db.rawQuery produces an empty Cursor them you will know why SQLiteQueryBuilder produces an empty Cursor see androidxref.com 5.1.0 r1 xref frameworks base core java android http : androidxref.com 5.1.0 r1 xref frameworks base core java android-database sqlite SQLiteQueryBuilder.java 372 .. . Answer : Answered http : stackoverflow.com a 30710226 437039 by laalto .. . .. . MATCH foo queries never worked correctly in any version of sqlite . The fact that you got some results earlier was just a coincidence . Just the prefix form MATCH foo and MATCH foo are supported http : www.sqlite.org fts3.html termprefix . .. . Lollipop ships with a newer version of sqlite http : stackoverflow.com questions 2421189 version-of-sqlite-used-in-android . For detailed list of changes between sqlite versions see the changelog http : www.sqlite.org changes.html .", "Question : Is there an easy way to display a ListView in reverse order I am trying to create a conversation-based app and would like the most recent entries to be at the bottom of the ListView . I am aware of transcriptMode and stackFromBottom however my problem is the order of the data . Say I have 100 conversation items and want to display items 80-100 with 100 being the most recent conversation item . I would like to show 80-100 which implies an ORDER BY id desc LIMIT 20 in my query which forces the items to be sorted 100 to 80 the opposite of what I need . I currently have some nasty inner query code but feel like there should be a simpler solution based on reversing the cursor or simply inverting the ListView . Comment : Not sure if it would work but you could simply query for all items create an array of the last 20 in the Cursor that s returned and then create a MatrixCursor from the array and use that for the ListView . See developer.android.com reference android-database http : developer.android.com reference android-database MatrixCursor.html .. . Answer : inside the baseAdapter for the getView method instead of getting the item in the data in index position use the opposite meaning : numberOfItems minus the position . as for showing the number of items that s also inside the baseAdapter : set the value returned by getCount to be the one you wish it to be 20 in your example though 80-100 implies that it should be 21 . btw it seems you are a starter in the case of listView . may i suggest watching this video : http : www.youtube.com watch v wDBM6wVEO70 .. . .. . also check the api-demos provided by the sdk manager . they have plenty of examples there . Comment : Thanks I think this is the best way to go . I was considering subclassing Cursor to create a ReverseCursor and also considering altering ListView but the piece between them is the clear choice . I had just watch Romain s 2009 I O talk on Android performance which hinted in this direction thanks for the pointer to the ListView talk .", "Question : In my Android application I am using Sqlite DataBase to store the data from the server . I am using ContentProvider and ContentResolver to access the data from the DataBase and using CursorAdapter to bind the data to the ListView . As soon the data is inserted into the DataBase CursorAdapter will be notified to update the ListView . Also whenever I scroll the ListView I get new data from the DataBase table and ListView will be updated . But once I reaches to the end of the table row I need to fetch the data directly from the server without storing into the DataBase and update it in the ListView . Now as I am using CursorAdapter which accepts Cursor data how can I bind a new set of data which is not coming from the DataBase Is is possible to create Cursor data without getting data from the DataBase and use ChangeCursor method in the ContentProvider to update the ListView If not is there any other method to achieve the same .. . Answer : Is is possible to create Cursor data without getting data from the DataBase and use ChangeCursor method in the ContentAdapter to update the ListView Yes you can create cursor using MatrixCursor http : developer.android.com reference android-database MatrixCursor.html . If you will have to merge MatrixCursor with database Cursor use MergeCursor http : developer.android.com reference android-database MergeCursor.html . Comment : Thanks for your answer . So where exactly I have to merge the cursors . Should it be done in onLoadFinished method or query method of ContentProvider while calling cursor.setNotificationUri Comment : In onLoadFinished but you probably should download data from server before you init your loader if possible or refresh loader if you postpone downloading .", "Question : I have an array of phone numbers and I want to get the corresponding contact names from the contacts database . In the array of phone numbers I also have some numbers that are not saved before to the contact database . For example .. . .. . 3333333 - Tim .. . 5555555 - Jim .. . 1111111 - unknown .. . .. . I have the array containing the phone numbers shown above namely phoneArr . phones.getCount returns 2 in the above scenario . When the phone-number does not appear in the contact-list the cursor becomes empty and somehow when I merge them it doesn t contribute anything at all . What I want is to have a cursor as follows .. . .. . Cursor phones - Tim Jim 1111111 .. . .. . I think I can do this by adding the row manually as follows : .. . .. . How can I achieve this Here is the PEOPLE PROJECTION Comment : please have a look on my solution and vote for it if it solves the problem Comment : Please review the answer you accepted it seem to be wrong according to the currently available features of the Android SDK . Comment : Well by the time I accepted the answer it seemed reasonable . I will review it when I have some spare time . .. . Answer : Easiest way to add rows in a cursor is to use a MatrixCursor https : developer.android.com reference android-database MatrixCursor.html and a MergeCursor https : developer.android.com reference android-database MergeCursor.html . Those two classes are from the SDK and here to solve that kind of problems . Basically what you do is : .. . .. . 1 . Put the rows you want to add-in a MatrixCusror .. . 2 . Merge your cursor and your matrixCursor using a MergeCursor .. . .. . Something like : Comment : Would you put this at the top of the bindView method Comment : I think it s better to do this before passing the cursor to the adapter . Right after you made the query . Comment : add what would be the index of this new row in the mergeCursor Comment : @Nezam from the above example the new row will be the first in position Comment : @Nazam You need to create an index column named id in the MatrixCursor . The values in that index column will be set by addRow . They can be whatever you like as the MatrixCursor is not a SQL database and it doesn t matter if they overlap with the id values in the other Cursor .", "Question : Is there an easy way to display a ListView in reverse order I am trying to create a conversation-based app and would like the most recent entries to be at the bottom of the ListView . I am aware of transcriptMode and stackFromBottom however my problem is the order of the data . Say I have 100 conversation items and want to display items 80-100 with 100 being the most recent conversation item . I would like to show 80-100 which implies an ORDER BY id desc LIMIT 20 in my query which forces the items to be sorted 100 to 80 the opposite of what I need . I currently have some nasty inner query code but feel like there should be a simpler solution based on reversing the cursor or simply inverting the ListView . Comment : Not sure if it would work but you could simply query for all items create an array of the last 20 in the Cursor that s returned and then create a MatrixCursor from the array and use that for the ListView . See developer.android.com reference android-database http : developer.android.com reference android-database MatrixCursor.html .. . Answer : Query for records using BETWEEN keyword seems like the easiest solution to me . Comment : Thanks BETWEEN is helpful but doesn t quite work for me since I don t want to add a query to find where the last piece of data is .", "Question : Is there an easy way to display a ListView in reverse order I am trying to create a conversation-based app and would like the most recent entries to be at the bottom of the ListView . I am aware of transcriptMode and stackFromBottom however my problem is the order of the data . Say I have 100 conversation items and want to display items 80-100 with 100 being the most recent conversation item . I would like to show 80-100 which implies an ORDER BY id desc LIMIT 20 in my query which forces the items to be sorted 100 to 80 the opposite of what I need . I currently have some nasty inner query code but feel like there should be a simpler solution based on reversing the cursor or simply inverting the ListView . Comment : Not sure if it would work but you could simply query for all items create an array of the last 20 in the Cursor that s returned and then create a MatrixCursor from the array and use that for the ListView . See developer.android.com reference android-database http : developer.android.com reference android-database MatrixCursor.html .. . Answer : This code is worked for me when pulling data from database .", "Question : I have a ListView set up from a cursor that grabs the first 10 rows in a database LIMIT . The list is set up to infinitely scroll . It does this by comparing the number of items in the list and the number of items in the database once a scroll completes onScroll from OnScrollListener .. . .. . This works . But sometimes the list may be populated with items from a custom cursor from search filtering for example and so I would need the item count of that cursor . I can have a consistent count by using .getCount but if I have already used LIMIT then it will just return the LIMIT I had which was 10 . How can I get the number of items in a cursor ignoring the limit Comment : Your code is using the paging method you would normally use with getting data from a remote-server . When you are getting data from the local database you don t need that paging logic . The Cursor class -- specifically the SQLiteCursor class -- handles all the paging internally . With a CursorAdapter and a recycling ListView you have everything you need . Put in your query for the entire data set you want get the Cursor and let CursorAdapter and ListView take care of the rest . Comment : @krislarson So I should have my cursor pull the entire database and use cursoradapter to limit it I m not sure what you mean by paging logic where is that build in to listview can it handle automatic scroll loads out of the box Comment : By paging I mean the logic you put in your onScroll method -- scroll down until a certain point then go get more items to show . The 10 items would represent a page . Now when you run a query and generate a Cursor the entire query data does not go into memory . If you want you can look up classes like CursorWindow and read the source code to see how cursors work . Nevertheless if you query for everything you want in your ListView and put the resulting Cursor in a CursorAdapter you will be able to scroll through your entire list with no noticeable performance issues . .. . Answer : Use below method to get Row Count in table . To get the Table row count with where clause Comment : This would return the row count of the table . I am after the row count of a cursor without the limit . Comment : it will return the row count without limit . Comment : Check developer.android.com reference android-database https : developer.android.com reference android-database DatabaseUtils.html queryNumEntries for more information . Comment : You misunderstand . I do not want the number of items in my database I know how to get that count . I want the number of items from my cursor which won t always be the entire database . My cursor could be all names beginning with D . Comment : Then you can use DatabaseUtils.queryNumEntries db TABLE NAME NAME like new String D", "Question : I use the same cursor multiple times in the custom view in its different methods . Should I close the cursor after each use or can I keep it open until the view is destroyed And the same for the database can it be opened once the activity that holds this view is created and closed when the activity is destroyed I continuously receive an error close was never explicitly called on database.. . when I do as described above . .. . Answer : Should I close the cursor after each use or can I keep it open until the view is destroyed Depends . If the cursor result is not going to change meanwhile e.g . remote connection modifying the DB then it s OK . Don t forget to use CursorLoader http : developer.android.com reference android content CursorLoader.html to have Android manage your cursor automatically e.g . close the cursor if your app crashes . And the same for the database can it be opened once the activity that holds this view is created and closed when the activity is destroyed Yes you can open in onResume and close in onPause callbacks or when you know your database is not going to be queried anymore . I continuously receive an error close was never explicitly called on database.. . when I do as described above . This is normal only if your app crashes . Should not happen if you re doing it like I said above .", "Question : Then on line 3 according to the logs I every now and then I come across this exception excerpt below : .. . .. . .. . .. . .. . Any ideas why it is throwing this exception Thanks Comment : try this link http : stackoverflow.com questions 5288384 android-content-resolver-query-returning-0-rows-when-it-ought-not-too Comment : How many rows are in the database that is backing the ContentResolver That exception is thrown if the cursor fails to allocate enough space to store the data it needs . Since you are not limiting the number of rows in your query via the selection args your cursor will allocate space to keep a copy of all of column first in memory . If there are a large number of rows potentially the process could fail to allocate that memory . Comment : @iagreen there s only one row that s why I didn t do a loop for it . Comment : The only other thing I can think of is that it is getting a corrupt parcel back . Comment : Can you elaborate on the corrupt parcel . This exception is not always encountered but there are times where it is encountered I wonder if it is because of other things . .. . Answer : Try another thread .. . .. . . But by Android SDK source codes look like 4.0.2 r1 .. . .. . mWIndowPtr Int", "Question : Then on line 3 according to the logs I every now and then I come across this exception excerpt below : .. . .. . .. . .. . .. . Any ideas why it is throwing this exception Thanks Comment : try this link http : stackoverflow.com questions 5288384 android-content-resolver-query-returning-0-rows-when-it-ought-not-too Comment : How many rows are in the database that is backing the ContentResolver That exception is thrown if the cursor fails to allocate enough space to store the data it needs . Since you are not limiting the number of rows in your query via the selection args your cursor will allocate space to keep a copy of all of column first in memory . If there are a large number of rows potentially the process could fail to allocate that memory . Comment : @iagreen there s only one row that s why I didn t do a loop for it . Comment : The only other thing I can think of is that it is getting a corrupt parcel back . Comment : Can you elaborate on the corrupt parcel . This exception is not always encountered but there are times where it is encountered I wonder if it is because of other things . .. . Answer : Try out this way : .. . .. . .. . if cursor null .. . cursor.moveToFirst .. . do .. . first cursor.getString cursor.getColumnIndex first .. . while cursor.moveToNext .. . .. . .. . Comment : you need to check if the moveToFirst was true or not if there is no results this will not work .", "Question : Then on line 3 according to the logs I every now and then I come across this exception excerpt below : .. . .. . .. . .. . .. . Any ideas why it is throwing this exception Thanks Comment : try this link http : stackoverflow.com questions 5288384 android-content-resolver-query-returning-0-rows-when-it-ought-not-too Comment : How many rows are in the database that is backing the ContentResolver That exception is thrown if the cursor fails to allocate enough space to store the data it needs . Since you are not limiting the number of rows in your query via the selection args your cursor will allocate space to keep a copy of all of column first in memory . If there are a large number of rows potentially the process could fail to allocate that memory . Comment : @iagreen there s only one row that s why I didn t do a loop for it . Comment : The only other thing I can think of is that it is getting a corrupt parcel back . Comment : Can you elaborate on the corrupt parcel . This exception is not always encountered but there are times where it is encountered I wonder if it is because of other things . .. . Answer : I suspect the error may be related to you not closing your cursors properly all the time . Try : .. . .. . The cursor should always be closed regardless of whether or not its empty . Make sure the rest of your app is doing this as well . Comment : thanks justin will keep that in mind when I m coding Comment : This worked for me . Using the cordova contacts plugin started getting the exception on android 5.0.1 . Raised a ticket for them to have a look : issues.apache.org jira browse CB-9630 https : issues.apache.org jira browse CB-9630 Comment : close should always be in a finally block . if any part of the code prior to the close throws an exception the cursor won t be closed .", "Question : null .. . Answer : I am trying to input data from a List ParseObject to a cursor . ParseObject documentation can be found here https : www.parse.com docs android api com parse ParseObject.html . I found out that you can use MatrixCursor to do this referring to helpful sites : http : developer.android.com reference android-database MatrixCursor.html .. . .. . How to insert extra elements into a SimpleCursorAdapter or Cursor for a Spinner http : stackoverflow.com questions 6754973 how-to-insert-extra-elements-into-a-simplecursoradapter-or-cursor-for-a-spinner .. . .. . How to create Cursor data without getting data from the DataBase in Android application http : stackoverflow.com questions 15860619 how-to-create-cursor-data-without-getting-data-from-the-database-in-android-appl .. . .. . My problem is when I return the cursor from MyContentProvider.java and I try to do a cursor.getFloat it returns a String and I cannot do DecimalFormat on it . Question : .. . .. . How do I put more than one kind of data type into the MatrixCursor using addRow Object columnValues Method that uses Cursor data : .. . .. . MyContentProvider.java : .. . .. . What I want to do in MyContentProvider.java : Comment : and I try to do a ParseObject.getDouble it returns a String - you sure about that Comment : a sorry I meant to say cursor.getFloat returns a String will edit my question", "Question : My code is as below : .. . .. . I get contacts name success but get phone-number fail in GetPhoneNumber . The phones.getCount always equal 0 . How can I modify Comment : you should perform your queries asynchronously using a CursorLoader . .. . Answer : Android Contact API For 2.0 .. . .. . For more information see this link http : www.higherpass.com Android Tutorials Working-With-Android-Contacts Comment : Cursor cursor getContentResolver .query ContactsContract.Contacts.CONTENT URI columns null null null causes a runtime-error . If you can help. . Comment : FYI probably the best answer I ve seen to working with contacts . Comment : Cursor phones cr.query Phone.CONTENT URI null Phone . ID + + contactId null null is working for me" ] }
[ "yes-answer-long", "yes-answer-short" ]
read-write
UNK_RELATION
opencv@cross-platform@51
opencv -- opencv open-source computer-vision is a @placeholder library of programming functions for real-time computer-vision .
{ "confidence": [ 124.85319519042969, 68.0871353149414, 66.657958984375, 65.2919692993164, 64.51615142822266, 60.050933837890625, 58.926239013671875, 55.6981086730957, 54.84816360473633, 54.369266510009766, 54.369266510009766, 54.34421920776367, 54.34421920776367, 53.66572189331055, 53.246055603027344, 52.864437103271484, 52.37423324584961, 52.31155776977539, 51.787986755371094, 50.95766830444336, 50.85972213745117, 50.85972213745117, 50.23780059814453, 49.50583267211914, 48.854888916015625, 48.72585678100586, 48.66114044189453, 48.406314849853516, 48.32278823852539, 48.11003875732422, 47.96970748901367, 47.92306900024414, 47.277130126953125, 47.0743293762207, 47.0743293762207, 47.0743293762207, 46.91170883178711, 46.73551940917969, 46.45851135253906, 46.30908203125, 46.29589080810547, 46.29589080810547, 45.72043991088867, 45.72043991088867, 45.72043991088867, 45.72043991088867, 45.72043991088867, 45.72043991088867, 45.72043991088867, 45.55781936645508, 45.1634635925293, 45.094234466552734, 44.88755798339844, 44.854644775390625, 44.478416442871094, 44.195438385009766, 44.040626525878906, 43.73516845703125, 43.73516845703125, 43.7293815612793, 43.11935043334961, 42.87706756591797, 42.20357131958008, 42.1993522644043, 41.796382904052734, 41.51548385620117, 41.39564895629883, 41.27155685424805, 41.27155685424805, 41.27155685424805, 41.180564880371094, 40.6982307434082, 40.5020751953125, 40.4424934387207, 39.70181655883789, 39.492855072021484, 39.43235778808594, 39.43235778808594, 39.43235778808594, 39.11859130859375, 38.97008514404297, 38.93783187866211, 38.8165397644043, 38.8165397644043, 38.8165397644043, 38.8165397644043, 38.8165397644043, 38.8165397644043, 38.8165397644043, 38.690773010253906, 38.34272384643555, 38.34272384643555, 38.26414489746094, 38.078468322753906, 38.078468322753906, 38.078468322753906, 38.078468322753906, 38.078468322753906 ], "content": [ "OpenCV Open Source Computer Vision is a library of programming functions for real-time computer-vision and augmented-reality .", "OpenCV is a computer-vision library focused on real-time image-processing .", "OpenCV is bar-none the defacto computer-vision library .", "This subject was well covered on OpenCV 2 Computer Vision Application Programming Cookbook http : www.packtpub.com opencv-2-computer-vision-application-programming-cookbook book : .. . .. .", "Use OpenCV .. . .. . Development .. . .. . OpenCV is an open-source cross-platform library that provides building blocks for computer-vision experiments and applications .", "Here is precompiled OpenCV 2.3 for iOS : computer-vision-talks.com download http : computer-vision-talks.com download opencv-2.3-ios-precompiled.zip .", "I would use OpenCV as it is the best computer-vision library right now .", "but probably there are better libraries to fit curves because openCV is about computer-vision .", "The latest build script http : computer-vision-talks.com 2011 02 building-opencv-for-iphone-in-one-click from Computer Vision Talks http : computer-vision-talks.com works great for Xcode 4 and iOS 4.3 .", "The best method is currently computer-vision-talks.com 2011 02 http : computer-vision-talks.com 2011 02 building-opencv-for-iphone-in-one-click quot", "Try this : computer-vision-talks.com 2011 02 http : computer-vision-talks.com 2011 02 building-opencv-for-iphone-in-one-click", "look for a book called mastering opencv with practical computer-vision projects .", "So if this gets approved OpenCV can become the standard API for computer-vision .", "We maintain an open-source python library for computer-vision .", "OpenCV 2 Computer Vision Application Programming Cookbook http : rads.stackoverflow.com amzn click 1849513244 was published in June 2011 .", "I realise that OpenCV is very popular but please can we stop tagging every computer-vision question with OpenCV", "I am trying to improve the capture performance of a real-time computer-vision program that I am developing to run on an embedded Linux computer using OpenCV .", "http : docs.opencv.org trunk doc py tutorials py tutorials.html .. . .. . The opencv site is great for a beginner in opencv and I have personally been using it in my computer-vision project I too am new to computer-vision though not coding .", "If you are a novice you should first get a basic understanding of Computer Vision topics and then start to learn a cv library such as openCV .", "Also the book Mastering OpenCV with Practical Computer Vision Projects https : www.packtpub.com application-development mastering-opencv-practical-computer-vision-projects has a usefull chapter about that .", "I m working on a project of computer-vision and I need to use two cameras using opencv library .", "As you know OpenCV is very useful library that let you do amazing and powerful things in Computer vision .", "@Dima : for what its worth many of the functions in the Computer Vision Toolbox are based on OpenCV Mathworks built their own MEX wrappers :", "On the other hand Opencv is a much larger library and includes more functionalities related to image-processing and computer-vision than android.graphics .", "Under the hood MATLAB uses OpenCV for some of its computer-vision http : www.mathworks.com products computer-vision functions including detecting SURF http : en.wikipedia.org wiki SURF features .", "Found good FAQ computer-vision-software.com blog 2009 11 http : www.computer-vision-software.com blog 2009 11 faq-opencv-haartraining", "That s called computer-vision .", "To have an overall idea on Computer Vision Learning Opencv is a good starting point then you can directly study the new opencv examples and unit test .", "Also OpenCV is considered as part of a Khronos Computer Vision Group Proposal http : www.khronos.org assets uploads developers library Computer-Vision-Working-Group-Proposal-Dec11.pdf .", "computer-vision-software.com blog 2009 03 http : www.computer-vision-software.com blog 2009 03 arm-wrestling-with-opencv Doesn t look too promising .", "I have been experimenting with face-detection in OpenCV Open Source Computer Vision Library and found that one could use Haar cascades to detect faces as there are several of them provided with OpenCV .", "I m new in computer-vision .", "And see other OpenCV algorithms : http : www.comp.leeds.ac.uk vision opencv opencvref cv.html cv imgproc features", "I would personally stick with opencv as it s the number one opensource computer-vision api out there .", "I agree but it s for a computer-vision class thus I must use opencv .", "I did my PhD in computer-vision and some naming-conventions in OpenCV seem really confusing silly to me .", "I m still new to Computer Vision.. .", "Multiple view geometry in computer-vision .", "I am new to computer-vision + OpenCV so probably a better explanation than OpenCV s documentation could help .", "But the best I could do was turning it into a UIImage with a function from Computer Vision Talks http : computer-vision-talks.com 2012 06 opencv-tutorial-part-3 .", "in European Conference on Computer Vision 2010 .", "I m new to computer-vision FYI .", "In the book Mastering OpenCV with Practical Computer Vision Projects it said something about Perspective-N-Point but I cannot understand it .", "Everything I know about computer-vision is a few examples of photo editing with OpenCV .", "There s no code in it but lots of useful techniques typically used in computer-vision most of them already implemented in opencv .", "The book I m reading Mastering OpenCV with Practical Computer Vision Projects passes it as-if the marker is a 1x1 matrix and it works fine how", "I have been reading about various techniques in Computer Vision using OpenCv python .", "http : www.morethantechnical.com 2010 11 10 20-lines-ar-in-opencv-wcode fabulous blog about computer-vision .. . 4 .", "opencv is a computer-vision framework hence the c-v which can interact with device cameras .", "I m on people tracking in computer-vision .", "@Chris Maes computer-vision is about programming mathematic transformations", "Unfortunately OpenCV doesn t have any connected component labelling functionality which seems like a serious omission for a computer-vision library .", "area51.stackexchange.com proposals 11036 computer-vision http : area51.stackexchange.com proposals 11036 computer-vision", "They are often used in computer-vision applications and found in libraries such as OpenCV http : opencv.org PCL http : www.pointclouds.org about etc .", "Here is the opening from the appnote - .. . .. . This application note describes how the OpenCV library can be used to develop computer-vision applications on Zynq devices .", "Comparison 1 http : computer-vision-talks.com articles 2011-07-13-comparison-of-the-opencv-feature-detection-algorithms and comparison 2 http : computer-vision-talks.com articles 2011-01-04-comparison-of-the-opencv-feature-detection-algorithms .", "It s also a good time to commit to Computer Vision http : area51.stackexchange.com proposals 66531 computer-vision referrer jiRHFaYYF95AXOBQ42MWrg2 a new StackExchange proposal .", "i m developing a computer-vision application for Android .", "Computer Vision - ECCV 2004 2004 469 481 .", "Look at this book : Laganiere Robert - OpenCV 2 Computer Vision Application Programming Cookbook - 2011 p . 266 .. . .. . Full algorithm is already implemented in this book using opencv .", "There are great grad school programs in computer-vision .", "If there was a computer-vision forum I would certainly spend time there researching and asking .", "I have all this opencv.i386 : Collection of algorithms for computer-vision opencv-devel.i386 : Development files for using the OpenCV library opencv-python.i386 : Python bindings for apps which use OpenCV I use Fedora the error is : include c++ 4.3.2 bits stl move.h : 87 : error : within this context I using virtualenv.py .", "I m working on stereo-vision with the stereoRectifyUncalibrated method under OpenCV 3.0 .", "Start by reading this nice article Realtime Computer Vision with OpenCV http : queue.acm.org detail.cfm id 2206309 it has performance comparisons about using NEON etc .", "I cant use the Computer Vision Toolbox .", "Android API face-detection vs . OpenCV JavaCV face-detection http : stackoverflow.com questions 27683958 android-api-face-detection-vs-opencv-javacv-face-detection .. . .. . Android Computer Vision JavaCv OpenCV Fastv comparison http : stackoverflow.com questions 10673099 android-computer-vision-javacv-opencv-fastv-comparison .. . .. . My questions : 1 How does android face api face-detection and landmark extraction compare to opencv javaCV or opencv NDK accuracy Vs speed 2 Is FastCV better for this", "I want to use APM 2.6 on arduplane firmware to tracking following river and road using opencv with cubieboard.the parameter that i use from opencv is y coordinate from the river road moment on computer-vision frame .", "I am trying to implement computer-vision using opencv on the AR drone 1.0 using cylonjs however I cannot seem to install the cylon-opencv module but other modules I require work fine .", "But take a look at this blog post it s pretty old : Computer vision with iOS Part 1 : Building an OpenCV framework http : aptogo.co.uk 2011 09 opencv-framework-for-ios which will give you a good starting point .", "Zhang s method is considered good enough that virtually everyone in computer-vision research uses it and most of them either use Bouguet s toolbox or OpenCV .", "There is a function extractHOGFeatures http : www.mathworks.com help vision ref extracthogfeatures.html in the Computer Vision System Toolbox for MATLAB .", "Advances in Computer Graphics and Computer Vision volume 4 of Communications in Computer and Information Science Springer Berlin Heidelberg 2007 pp .", "OpenCV is a framework for Computer Vision and it s very limited for what you need because it requires you to write most of the cool filters yourself .", "This will completes the OpenCV 2.4.3 installation on your computer .", "I ve already implemented a somewhat complicated vision system in OpenCV and I d like to swap out some of the OpenCV routines e.g .", "Though consulting a computer-vision resource would be beneficial here .", "Its one of the few things in many that REALLY works in computer-vision", "Computer vision is about getting computers to understand the physical world in some manner .", "I will use the stereo algorithm from the link below Stereo vision with OpenCV http : stackoverflow.com questions 5893619 stereo-vision-with-opencv .. . .. . Using this approach I want to create a detailed mapping of an indoor environment .", "EDIT : .. . .. . Using sudo dpkg -l grep opencv gives : .. . .. . ii libopencv-calib3d2.3 2.3.1-11ubuntu2 amd64 computer-vision Camera Calibration library .. . ii libopencv-contrib2.3 2.3.1-11ubuntu2 amd64 computer-vision contrib library .. . ii libopencv-core-dev 2.3.1-11ubuntu2 amd64 development files for libopencv-core .. . ii libopencv-core2.3 2.3.1-11ubuntu2 amd64 computer-vision core library .. . ii libopencv-features2d2.3 2.3.1-11ubuntu2 amd64 computer-vision Feature Detection and Descriptor Extraction library .. . ii libopencv-flann-dev 2.3.1-11ubuntu2 amd64 development files for libopencv-flann .. . ii libopencv-flann2.3 2.3.1-11ubuntu2 amd64 computer-vision Clustering and Search in Multi-Dimensional spaces library .. . ii libopencv-gpu-dev 2.3.1-11ubuntu2 amd64 development files for libopencv-gpu .. . ii libopencv-gpu2.3 2.3.1-11ubuntu2 amd64 computer-vision GPU Processing library .. . ii libopencv-highgui2.3 2.3.1-11ubuntu2 amd64 computer-vision High-level GUI and Media I O library .. . ii libopencv-imgproc-dev 2.3.1-11ubuntu2 amd64 development files for libopencv-imgproc .. . ii libopencv-imgproc2.3 2.3.1-11ubuntu2 amd64 computer-vision Image Processing library .. . ii libopencv-legacy2.3 2.3.1-11ubuntu2 amd64 computer-vision legacy library .. . ii libopencv-ml-dev 2.3.1-11ubuntu2 amd64 development files for libopencv-ml .. . ii libopencv-ml2.3 2.3.1-11ubuntu2 amd64 computer-vision Machine Learning library .. . ii libopencv-objdetect2.3 2.3.1-11ubuntu2 amd64 computer-vision Object Detection library .. . ii libopencv-video-dev 2.3.1-11ubuntu2 amd64 development files for libopencv-video .. . ii libopencv-video2.3 2.3.1-11ubuntu2 amd64 computer-vision Video analysis library .. . ii opencv-doc 2.3.1-11ubuntu2 all OpenCV documentation and examples .. . ii python-opencv 2.3.1-11ubuntu2 amd64 Python bindings for the computer-vision library .. . rc ros-fuerte-opencv2 2.4.2-0precise-20120908-1624-+0000 amd64 OpenCV .. . rc ros-groovy-opencv2 2.4.4-1quantal-20130325-0857-+0000 amd64 OpenCV .. . .. . Sorry the formatting is not the best .", "I have just read this in the book OpenCV 2 Computer Vision Application Programming Cookbook by R . Laganiere : .. . .. . It is important to note that in order to open the specified video file your computer must have the corresponding codec installed otherwise cv : : VideoCapture will not be able to understand the input file .", "HZ00 Multiple view geometry in computer-vision by R.Hartley and A.Zisserman 2000 .", "I am just learning about computer-vision and C .", "However I am not sure if it a best practise in computer-vision .", "Yeah tuning params is always an annoying issue in computer-vision .", "You need to consult with a computer-vision image-processing expert .", "@karlphillip The field of computer-vision is large I committed to the SE proposal .", "I am pretty new in computer-vision so any advice is welcomed .", "However OpenCV 2.4.3 http : code.opencv.org projects opencv wiki ChangeLog was the http : developer.amd.com community blog 2013 07 09 opencv-cl-computer-vision-with-opencl-acceleration first version to support http : opencv.org opencv-2-4-3-released.html OpenCL http : en.wikipedia.org wiki OpenCL .", "I am now learning a code from the opencv codebook OpenCV 2 Computer Vision Application Programming Cookbook : Chapter 5 Segmenting images using watersheds page 131 .", "I found another stack-overflow answer that referred to the book OpenCV 2 Computer Vision Application Programming Cookbook Ch9 : Matching images using random sample consensus .", "You can get all the details of above methods in chapter 9 of Computer vision application programming cookbook .", "It may be complicated but that s just the nature of doing anything in computer-vision .", "International Journal of Computer Vision 80.3 2008 : 300-316 .", "Wikitude .. . .. . this is more for augmentedreality but in its core is still computer-vision .", "I have a computer-vision set up with two cameras .", "Sorry if this is an obvious question but I am only new to computer-vision ." ] }
{ "confidence": [ 118.8877182006836, 89.97708892822266, 68.47412872314453, 66.93511962890625, 66.58927154541016, 65.93805694580078, 65.7712631225586, 65.17884063720703, 64.93645477294922, 64.51683044433594, 63.855224609375, 63.417564392089844, 63.36912536621094, 62.358970642089844, 61.01148223876953, 60.32011413574219, 60.201446533203125, 60.035926818847656, 57.91741943359375, 57.89164733886719 ], "content": [ "Question : OpenCV Open Source Computer Vision is a library of programming functions for real-time computer-vision and augmented-reality . http : opencv.willowgarage.com wiki .. . .. . I ve only found a couple of iOS ports : .. . .. . https : github.com macmade OpenCV-iOS .. . .. . https : github.com BloodAxe opencv-ios-template-project .. . .. . And a specific iOS folder and makefile in the official repository : .. . .. . https : code.ros.org svn opencv trunk opencv ios .. . .. . Is there any OpenCV C wrapper for Monotouch Thanks in advance .. . Answer : Just created example project for using OpenCV on Xamarin.iOS see here : https : github.com trinnguyen xamarin.ios-opencv", "Question : OpenCV Open Source Computer Vision is a library of programming functions for real-time computer-vision and augmented-reality . http : opencv.willowgarage.com wiki .. . .. . I ve only found a couple of iOS ports : .. . .. . https : github.com macmade OpenCV-iOS .. . .. . https : github.com BloodAxe opencv-ios-template-project .. . .. . And a specific iOS folder and makefile in the official repository : .. . .. . https : code.ros.org svn opencv trunk opencv ios .. . .. . Is there any OpenCV C wrapper for Monotouch Thanks in advance .. . Answer : Not quite sure about Monotouch but EmguCV http : www.emgu.com wiki index.php Main Page is a wrapper for C .Net . Since Monotouch declares .Net libraries compability is should suit to your needs . Comment : The above link has a table comparing it EmguCV to other OpenCV bindings for .NET . More choice is a click away : - Comment : +1 just a note that EmguCV has a licensing fee . Comment : Unfortunately I ve checked it all but there are no MonoTouch builds . Mono is a very different platform from MonoTouch and some DLLs required by those Distributions are not awailable . In addition other wrappers such as OpenCVDotNet SharperCV or Code Project use unsafe code not compatible with MonoTouch on iPhone . The only one that doesn t use it is EmguCV written entirely in managed C but it still requires some DLLs from Mono not available in MonoTouch . No wonder none of those sites even mention MonoTouch on their pages . : Comment : Unsafe code is perfectly fine with MonoTouch . Comment : As of mid-2012 they re claiming it s compatible with MonoTouch .", "Question : I know that OpenCV was ported to Mac OS X http : opencv.willowgarage.com wiki Mac OS X OpenCV Port however I did not find any info about a port to the iPhone . I am not a Mac developer so that I do not know whether a Mac OS X port is enough for the iPhone . Does anyone know better than me Edit : Thanks for the informed answer Adam . .. . Answer : OpenCV does indeed work on the iphone . Use the configure script here to compile the library : cross-compiling for iphone http : lambdajive.wordpress.com 2008 12 20 cross-compiling-for-iphone .. . .. . You just have to cross-compile just as you do your apps . Comment : that method does not work with the recent versions of OpenCV or the recent versions of iOS SDK . The best method is currently computer-vision-talks.com 2011 02 http : computer-vision-talks.com 2011 02 building-opencv-for-iphone-in-one-click quot Comment : This link is broken Comment : Take out the 22 at the end and it does . Try this : computer-vision-talks.com 2011 02 http : computer-vision-talks.com 2011 02 building-opencv-for-iphone-in-one-click Comment : Here is precompiled OpenCV 2.3 for iOS : computer-vision-talks.com download http : computer-vision-talks.com download opencv-2.3-ios-precompiled.zip . Comment : OpenCV is now available as a framework for iOS . Just drag-and-drop into your project . It supports video capture too . See the article and get the example project here : bit.ly pTWfOh http : bit.ly pTWfOh", "Question : I am working on school project and part of it should be about current situation about computer-vision libraries for Android . I went to it with large enthusiasm because computer-vision seems like fascinating subject but I have been searching for more then a week and I did not find much . I would like to be able to provide information about libraries themselves and about comparison between them . I will share what I found so far . OpenCV .. . .. . seems like the most advanced one and the most popular . provide the biggest number of functions .. . .. . it had problem with backward compatibility .. . .. . is fast at least so I heard but I have zero information about it .. . .. . does have biggest amount of books about it at least for C++ version .. . .. . JavaCV .. . .. . is wrapper for few other libraries including opencv .. . .. . FastCv .. . .. . new with Qualcomm behind it . Wikitude .. . .. . this is more for augmentedreality but in its core is still computer-vision . As you can see I have a little information about it and doing my own tests for every library is far beyond my current computer-vision skills . Kind regards Peter . Comment : Someone else worked on a similar project before : cs.brown.edu courses csci1290 results final sbnguyen http : www.cs.brown.edu courses csci1290 results final sbnguyen Comment : @SamuelAudet you should put that as official answer so I can rep it : Comment : @SamuelAudet now looking at it It seems that information in the link are outdated . .. . Answer : I would use OpenCV as it is the best computer-vision library right now . You ll program your functions in C++ and then you compile the Android aplication using the JNI library . You have information on how to do that on the official documentation http : opencv.itseez.com doc tutorials introduction android binary package android binary package using with NDK.html . I have worked with this configuration and OpenCV performance in android is really nice . You will notice benefits if you make some functions in fixed-point arithmetic . Good luck Comment : Hi @jav Rock thank you for your answer but as I state above I really looking for some serious comparisson .", "Question : Hey so im starting to play around with OpenCV and I cant get my webcam output saved to a file . Here is what I have . This runs fine launches the webcam and creates output.avi The issue is output.avi is tiny 414 bytes and the same exact bytes each time I run the program . Im guessing the issue is with the fourcc encoding but I havent been able to find what works in my case . I am running on Mac OS X . Let me know if you need anymore information . .. . Answer : Organize your code into class and separate clear functions find several functions for saving your results in API OpenCV try other formats and run your code on several OS . You can also turn to C++ or a Java C with OpenCV .. . .. . I guess there is a chapter on your problem in a Computer Vison book http : www.amazon.com s ref nb sb noss 1 url search-alias 3Dstripbooks field-keywords Cassandra 20NoSQL ref nb sb noss 2 url search-alias 3Dstripbooks field-keywords python+computer+vision+open+cv rh n 3A283155 2Ck 3Apython+computer+vision+open+cv http : www.amazon.com s ref nb sb noss 1 url search-alias 3Dstripbooks field-keywords Cassandra 20NoSQL ref nb sb noss 2 url search-alias 3Dstripbooks field-keywords python+computer+vision+open+cv rh n 3A283155 2Ck 3Apython+computer+vision+open+cv .. . .. . That is all I could for helping you", "Question : I m implementing an algorithm in OpenCV that I ve designed in MATLAB . I m writing a unit test for the SURF feature extractor in OpenCV and I want to compare the output of MATLAB s extracted SURF features to OpenCV . This issue is using the same parameters for both MATLAB and OpenCV extractors I m getting different numbers of features . How is this possible Are there different ways to implement SURF For MATLAB http : www.mathworks.com help vision ref detectsurffeatures.html I m using : .. . .. . MetricThresh : 200 .. . NumOctaves : 3 .. . NumScaleLevels : 4 .. . SURFSize : 64 .. . .. . .. . For OpenCV I m using : .. . .. . HessianThreshold : 200 .. . nOctaves : 3 .. . nOctaveLayers : 4 .. . extended : false .. . upright : true .. . .. . .. . .. . What s going on here Is there a better way to test that openCV and MATLAB are producing the same extracted SURF features from the same image Thank you for your help Comment : fyi you might might this project useful : github.com kyamagu mexopencv https : github.com kyamagu mexopencv exposes OpenCV as MEX-functions in MATLAB .. . Answer : Under the hood MATLAB uses OpenCV for some of its computer-vision http : www.mathworks.com products computer-vision functions including detecting SURF http : en.wikipedia.org wiki SURF features . If you look inside the matlabroot bin arch folder you ll find OpenCV shared-libraries in addition to a gateway library ocv.dll . In fact the same reference paper is mentioned in the documentation of both which suggests that the algorithm parameters have the same meaning in both frameworks . MATLAB .. . .. . Herbert Bay Andreas Ess Tinne Tuytelaars Luc Van Gool SURF : Speeded Up Robust Features Computer Vision and Image Understanding CVIU Vol . 110 No . 3 pp . 346--359 2008 .. . .. . OpenCV .. . .. . Bay H . and Tuytelaars T . and Van Gool L . SURF : Speeded Up Robust Features 9th European Conference on Computer Vision 2006 .. . .. . .. . .. . First thing make sure you are using the same parameter values in both taking into account the default values . Here are the doc pages for OpenCV http : docs.pencv.org modules nonfree doc feature detection.html surf and MATLAB http : www.mathworks.com help vision ref detectsurffeatures.html for reference . So try the following codes : .. . .. . In MATLAB : .. . .. . In C++ OpenCV : .. . .. . Other than that MATLAB usually include an older version of OpenCV my MATLAB R2013a ships with v2.4.2 DLLs which could result in different results from whatever OpenCV version you are using latest as of now is v2.4.6 Comment : note that I subtracted 2 from NumScaleLevels to get nOctaveLayers check the source code of edit detectSURFFeatures.m to understand Comment : Hello thanks for your thorough answer I tried your approach with those parameters and from the same grayscale image OpenCV detected 254 points while MATLAB detected 267 points . I m using MATLAB 2012a and the OpenCV version I m using is v2.4.5 . I suppose the next logical step is to repeat this test but with MATLAB using the v2.4.5 libraries . If you have any other suggestions I would appreciate them . Thank you for your time and help . Comment : @trianta2 : like I said If you want to obtain the exact same results you must use the same OpenCV version in both cases which may not be possible . From what I can tell MATLAB R2012a ships with OpenCV DLLs v2.1.0 considered pretty old by now . Seeing that those are hard-coded you can t really change what MATLAB is linked against your only option is to download http : opencv.org downloads.html this old version and build your C++ program against it.. . Otherwise I suggest your ignore these minor differences and stick with the latest version :", "Question : I am starting a new project were I will be getting a video input and I will have to add several itens in the video..some lines and real-time information . Since the camera will be in a shaking enviroment I will probably need also to add some sort of video stabilization as well . I plan to use C in the project since it s the language I know better so I wanted to know which APIs should I look for OpenCV is just fine or are there any better choices I am pretty new in computer-vision so any advice is welcomed . .. . Answer : OpenCV is bar-none the defacto computer-vision library . It is packed full of functions to make your life easier . With respect to image-stabilization Stackoverflow has answered possible approaches to this http : stackoverflow.com questions 3431434 video-stabilization-with-opencv . Most of the time you want to extract robust local feature descriptors and use them to perform registration http : en.wikipedia.org wiki Image registration on consecutive image frames . Comment : The camera will be in an airplane so I am afraid the software can go nuts because of the airplane motion thinking it is some kind of shake...is this easy to resolve", "Question : I have just installed OpenCV 2.4.5 and Eclipse IDE for C C++ Developers on Ubuntu 12.10 and followed this opencv.org tutorial http : docs.opencv.org doc tutorials introduction linux eclipse linux eclipse.html linux-eclipse-usage . The project builds with no errors but when I reach the Running the executable section from Eclipse I get the following message after hitting Run : .. . .. . home pedro workspace di Debug di : error while loading shared-libraries : libopencv core.so.2.4 : cannot open shared object file : No such file or directory .. . .. . Does anyone have any suggestions on how to solve this issue EDIT : .. . .. . Using sudo dpkg -l grep opencv gives : .. . .. . ii libopencv-calib3d2.3 2.3.1-11ubuntu2 amd64 computer-vision Camera Calibration library .. . ii libopencv-contrib2.3 2.3.1-11ubuntu2 amd64 computer-vision contrib library .. . ii libopencv-core-dev 2.3.1-11ubuntu2 amd64 development files for libopencv-core .. . ii libopencv-core2.3 2.3.1-11ubuntu2 amd64 computer-vision core library .. . ii libopencv-features2d2.3 2.3.1-11ubuntu2 amd64 computer-vision Feature Detection and Descriptor Extraction library .. . ii libopencv-flann-dev 2.3.1-11ubuntu2 amd64 development files for libopencv-flann .. . ii libopencv-flann2.3 2.3.1-11ubuntu2 amd64 computer-vision Clustering and Search in Multi-Dimensional spaces library .. . ii libopencv-gpu-dev 2.3.1-11ubuntu2 amd64 development files for libopencv-gpu .. . ii libopencv-gpu2.3 2.3.1-11ubuntu2 amd64 computer-vision GPU Processing library .. . ii libopencv-highgui2.3 2.3.1-11ubuntu2 amd64 computer-vision High-level GUI and Media I O library .. . ii libopencv-imgproc-dev 2.3.1-11ubuntu2 amd64 development files for libopencv-imgproc .. . ii libopencv-imgproc2.3 2.3.1-11ubuntu2 amd64 computer-vision Image Processing library .. . ii libopencv-legacy2.3 2.3.1-11ubuntu2 amd64 computer-vision legacy library .. . ii libopencv-ml-dev 2.3.1-11ubuntu2 amd64 development files for libopencv-ml .. . ii libopencv-ml2.3 2.3.1-11ubuntu2 amd64 computer-vision Machine Learning library .. . ii libopencv-objdetect2.3 2.3.1-11ubuntu2 amd64 computer-vision Object Detection library .. . ii libopencv-video-dev 2.3.1-11ubuntu2 amd64 development files for libopencv-video .. . ii libopencv-video2.3 2.3.1-11ubuntu2 amd64 computer-vision Video analysis library .. . ii opencv-doc 2.3.1-11ubuntu2 all OpenCV documentation and examples .. . ii python-opencv 2.3.1-11ubuntu2 amd64 Python bindings for the computer-vision library .. . rc ros-fuerte-opencv2 2.4.2-0precise-20120908-1624-+0000 amd64 OpenCV .. . rc ros-groovy-opencv2 2.4.4-1quantal-20130325-0857-+0000 amd64 OpenCV .. . .. . Sorry the formatting is not the best . The command locate libopencv core .. . .. . usr lib libopencv core.a .. . usr lib libopencv core.so .. . usr lib libopencv core.so.2.3 .. . usr lib libopencv core.so.2 .. . .. . locate libopencv shows a extensive list that I don t know if it would be appropriate to copy it . Comment : That s interesting . What is the output when you say locate libopencv or locate libopencv core in command-prompt Is there any such file there but with other version Did you install some packages manually or all from repository Were there ldconfig issued Comment : locate libopencv core gives the following : usr lib libopencv core.a usr lib libopencv core.so usr lib libopencv core.so.2.3 usr lib libopencv core.so.2.3.1 I installed all of them from repository following tutorials and using ldconfig in one of the steps . Comment : You say it returns nothing What does locate libopencv return and now most importantly what does sudo dpkg -l grep opencv shows Comment : How experienced are you with Ubuntu Linux I assumed that if you could build it you have the required knowledge . If you could build it you must have the required -dev packages installed and I thought those should automatically pull-in the library packages themselves they depend on them . What was your installation procedure Comment : The tutorial what you linked pulls a source of OpenCV from GitHub and compiles it . If you installed opencv from Ubuntu 12.10 repo that is usually little behind than the most recent source version . .. . Answer : Ubuntu Quency Quantal 12.10 has 2.3.1 packages in it s repo : OpenCV in Ubuntu 12.10 repo http : packages.ubuntu.com search keywords opencv searchon names suite quantal section all The next version raring has 2.4 . I d uninstall Ubuntu 12.10 s various v2.3.1 opencv related packages . How did they got installed Did you install them manually or something pulled them in . Then I d try to compile+install the OpenCV source again . The install stage of the make procedure should provide libraries to you . Comment : I actually was careful to compile the 2.4.5 instead of 2.3.1 . Comment : Hmmm . In the dpkg package list it seems that most of your related packages have version 2.3.1 . Then you need to fix that . Comment : OK I edited my answer so the problem will be that 12.10 has v2.3.1 OpenCV in it s repos . I ll look into the tutorials how they can resolve that . Comment : After editing the opencv.config file from usr local lib to usr local lib and then run sudo ldconfig -v I was able to run the program without errors . I guess there was a problem when I first ran ldconfig and I didn t notice . Comment : Good to hear you solved it . My answer is kind of off though then . But I d be still a little bit concerned about the 2.3.1 version packages you have in your system from the 12.10 repo . They can cause trouble later .", "Question : I am working on school project and part of it should be about current situation about computer-vision libraries for Android . I went to it with large enthusiasm because computer-vision seems like fascinating subject but I have been searching for more then a week and I did not find much . I would like to be able to provide information about libraries themselves and about comparison between them . I will share what I found so far . OpenCV .. . .. . seems like the most advanced one and the most popular . provide the biggest number of functions .. . .. . it had problem with backward compatibility .. . .. . is fast at least so I heard but I have zero information about it .. . .. . does have biggest amount of books about it at least for C++ version .. . .. . JavaCV .. . .. . is wrapper for few other libraries including opencv .. . .. . FastCv .. . .. . new with Qualcomm behind it . Wikitude .. . .. . this is more for augmentedreality but in its core is still computer-vision . As you can see I have a little information about it and doing my own tests for every library is far beyond my current computer-vision skills . Kind regards Peter . Comment : Someone else worked on a similar project before : cs.brown.edu courses csci1290 results final sbnguyen http : www.cs.brown.edu courses csci1290 results final sbnguyen Comment : @SamuelAudet you should put that as official answer so I can rep it : Comment : @SamuelAudet now looking at it It seems that information in the link are outdated . .. . Answer : For a android based project it is easy to start with JavaCV . It contain almost all the functions that are available on OpenCV . But there are no rich documentation on JavaCV but OpenCV has . So you can find the relevant methods from OpenCV documentation and use those in JavaCV same method names . There is a complete document at here http : code.google.com p javacv . That is discuss about how to setup JavaCV on eclipse - android environment . Comment : Thank you for the answer but I was not looking for library to use but as title is saying I am looking for general comparsion .", "Question : null .. . Answer : I am trying to process faces in images on a device tablet . I have used opencv NDK a while ago . I see that there are couple of other options available to process faces . Just wondering how opencv android-vision api and FastCV would compare specifically for processing faces .. . .. . Found couple of similar posts here but they did not answer all my questions . Android API face-detection vs . OpenCV JavaCV face-detection http : stackoverflow.com questions 27683958 android-api-face-detection-vs-opencv-javacv-face-detection .. . .. . Android Computer Vision JavaCv OpenCV Fastv comparison http : stackoverflow.com questions 10673099 android-computer-vision-javacv-opencv-fastv-comparison .. . .. . My questions : 1 How does android face api face-detection and landmark extraction compare to opencv javaCV or opencv NDK accuracy Vs speed 2 Is FastCV better for this I presume it comes with license restrictions . 3 Does the android api work for all android devices I found couple of ports for open-source CV libraries other than opencv that are commonly used for pc based CV applications but these are not optimized for the devices I found them very slow when used as is . thanks Comment : What did you end up using I am using android-vision api but if detector s All classification is enabled it slows down performance . Comment : I had to take the traditional path javacv for non-technical reasons . I was more interested in the key points in the vision api as I could use them for alignment and registration . I know this depends on the phone we use for testing but how much time does it usually take for face-detection and the fiducial poiny extraction I think the relative timing info should be comparable across different phones .", "Question : I am working on school project and part of it should be about current situation about computer-vision libraries for Android . I went to it with large enthusiasm because computer-vision seems like fascinating subject but I have been searching for more then a week and I did not find much . I would like to be able to provide information about libraries themselves and about comparison between them . I will share what I found so far . OpenCV .. . .. . seems like the most advanced one and the most popular . provide the biggest number of functions .. . .. . it had problem with backward compatibility .. . .. . is fast at least so I heard but I have zero information about it .. . .. . does have biggest amount of books about it at least for C++ version .. . .. . JavaCV .. . .. . is wrapper for few other libraries including opencv .. . .. . FastCv .. . .. . new with Qualcomm behind it . Wikitude .. . .. . this is more for augmentedreality but in its core is still computer-vision . As you can see I have a little information about it and doing my own tests for every library is far beyond my current computer-vision skills . Kind regards Peter . Comment : Someone else worked on a similar project before : cs.brown.edu courses csci1290 results final sbnguyen http : www.cs.brown.edu courses csci1290 results final sbnguyen Comment : @SamuelAudet you should put that as official answer so I can rep it : Comment : @SamuelAudet now looking at it It seems that information in the link are outdated . .. . Answer : vizier answered quite nicely but I am under the impression that his analysis has a mistake . I think he is not aware that Opencv has a version for android called OpenCV4Android . It is Java wrappers for the c++ functionality meaning you can avoid using Android NDK and program everything in Java . This would make JavaCV non-official library redundant except for the fact that this one besides wrapping opencv also wraps a lot of other nice CV libraries . Edit : .. . .. . This doesn t change vizier conclusions about recommending OpenCV it actually adds more points towards choosing it .", "Question : I am working on school project and part of it should be about current situation about computer-vision libraries for Android . I went to it with large enthusiasm because computer-vision seems like fascinating subject but I have been searching for more then a week and I did not find much . I would like to be able to provide information about libraries themselves and about comparison between them . I will share what I found so far . OpenCV .. . .. . seems like the most advanced one and the most popular . provide the biggest number of functions .. . .. . it had problem with backward compatibility .. . .. . is fast at least so I heard but I have zero information about it .. . .. . does have biggest amount of books about it at least for C++ version .. . .. . JavaCV .. . .. . is wrapper for few other libraries including opencv .. . .. . FastCv .. . .. . new with Qualcomm behind it . Wikitude .. . .. . this is more for augmentedreality but in its core is still computer-vision . As you can see I have a little information about it and doing my own tests for every library is far beyond my current computer-vision skills . Kind regards Peter . Comment : Someone else worked on a similar project before : cs.brown.edu courses csci1290 results final sbnguyen http : www.cs.brown.edu courses csci1290 results final sbnguyen Comment : @SamuelAudet you should put that as official answer so I can rep it : Comment : @SamuelAudet now looking at it It seems that information in the link are outdated . .. . Answer : Basically there are two options : OpenCV and FastCV .. . .. . OpenCV is a more mature library with a lot more functionality than FastCV . For many computer-vision tasks you can find only the most basic functionality in FastCV whereas you can have almost all popular alternatives available in OpenCV . Check the available feature detectors for instance . OpenCV has Harris SURF SIFT FAST etc . FastCV on the other hand has only Harris and FAST . OpenCV contains hardware optimizations for different HW including desktop computers and mobile computing devices . The ability to use OpenCV in desktop provides you a more flexible development option as you can tweak and test the code on a fast desktop computer before you start working the mobile development . Also OpenCV is considered as part of a Khronos Computer Vision Group Proposal http : www.khronos.org assets uploads developers library Computer-Vision-Working-Group-Proposal-Dec11.pdf . So if this gets approved OpenCV can become the standard API for computer-vision . As far as I can see FastCV provides superior optimizations for Snapdragon CPUs . This might play an important role in the decision in the short term but I m sure OpenCV will close the gap very fast if any . If you choose the OpenCV path then there are two sub-paths : OpenCV with Android NDK vs . JavaCV with Android SDK . JavaCV is a wrapper around OpenCV based on JavaCpp . JavaCV mostly wraps C API although OpenCV provides an Object Oriented C++ API as well . The C++ API handles releasing of unused memory automatically for instance . However C API hence JavaCV requires you to handle releasing of unused imagery manually . Also when you face a problem in JavaCV it is difficult to tackle the problem because there are too many indirections to check . Problems are easier to locate when you use OpenCV directly . However in case of Android the added difficulty of NDK should not be forgotten . If available OpenCV functionality is necesary for the specific application and no custom pixel level processing code is needed JavaCV is the way to go . However if a considerable amount of custom image-processing code is required Java code will slow you down and you will need to switch to NDK anyway . In the latter case OpenCV is the alternative to choose . Comment : Thank you vizier that was the answer I was looking for more or less . Comment : BTW we can use JavaCPP instead of using the NDK directly . Comment : It is worth noting that SIFT and SURF are both patented and not free for commercial use . Don t know but possibly this is why FastCV omits them .", "Question : I would like to use OpenCV with the Racket programming language . I normally use Python but would like to use Racket so that I can start using it for computer-vision projects . However I do not know how to use link the OpenCV library with to Racket . Please could you assist me with this if you know how . Thank you . .. . Answer : Take a look at https : github.com oetr racket-opencv tree master tutorials and https : github.com tonyg racket-opencv-videocapture .. . .. . I have tried neither of them . The first project has ported some of the Open CV tutorials which could a starting point . https : github.com oetr racket-opencv tree master tutorials", "Question : I know that OpenCV was ported to Mac OS X http : opencv.willowgarage.com wiki Mac OS X OpenCV Port however I did not find any info about a port to the iPhone . I am not a Mac developer so that I do not know whether a Mac OS X port is enough for the iPhone . Does anyone know better than me Edit : Thanks for the informed answer Adam . .. . Answer : The latest build script http : computer-vision-talks.com 2011 02 building-opencv-for-iphone-in-one-click from Computer Vision Talks http : computer-vision-talks.com works great for Xcode 4 and iOS 4.3 . I have tried the script myself and it is just awesome Comment : this is a great script - deserves voting up as it s more current than the top one currently same answer more current script Comment : Yes this is currently the best method . Highly recommended Comment : Definitely the best method .", "Question : I m currently working on pattern-recognition using SURF in OpenCV . What do I have so far : I ve written a program in C where I can select a source-image and a template which I want to find . After that I transfer both pictures into a C++-dll where I ve implemented a program using the OpenCV-SURFdetector which returns all the keypoints and matches back to my C -program where I try to draw a rectangle around my matches . This pictures shows a source-image and a template with it s keypoints and matches . Also I ve tried to calculate a rectangle around my matches http : i.stack.imgur.com RUhbQ.jpg .. . .. . Now my question : Is there a common measure of accuracy in pattern-recognition Like for example number of matches in proportion to the number of keypoints in the template Or maybe the size-difference between my match-rectangle and the original size of the template-image What are common parameters that are used to say if a match is a real and good match Edit : To make my question clearer . I have a bunch of matchpoints that are already thresholded by minHessian and distance value . After that I draw something like a rectangle around my matchpoints as you can see in my picture . This is my MATCH . How can I tell now how good this match is I m already calculating angle size and color differences between my now found match and my template . But I think that is much too vague . .. . Answer : There are many ways to match two patterns in the same image actually it s a very open topic in computer-vision because there isn t a global best solution . For instance if you know your object can appear rotated I m not familiar with SURF but I guess the descriptors are rotation invariant like SIFT descriptors you can estimate the rotation between the pattern you have in the training set and the pattern you just matched with . A match with the minimum error will be a better match . I recommend you consult Computer Vision : Algorithms and Applications http : szeliski.org Book . There s no code in it but lots of useful techniques typically used in computer-vision most of them already implemented in opencv .", "Question : I am just learning about computer-vision and C . It seems like two prominent image-processing libraries are OpenCV http : opencv.willowgarage.com wiki and AForge http : code.google.com p aforge . What are some of the differences of the two I am making a basic image editor in C and while researching I have come across articles on both . But I don t really know why I would choose one over the other . I would like to eventually improve the app to include more advanced functions . Thanks . .. . Answer : I am using OpenCV for a project in school right now and I browsed the documentation for AForge and their feature seem to differ . AForge has lots of filters and is probably excellent for different transforms and image-manipulation . But it seems to lack quite a bit in other areas . I could not find any matrix operations which was a disappointment as it is so useful in computer-vision . Our current project 3D point cloud reconstruction from an image sequence would as far as I could see from the docs be impossible to do with AForge alone . Combine AForge with a good linear-algebra library and you might have something really useful though . As for OpenCV it has a rich feature set but is a bit tricky to program with .", "Question : I am working on school project and part of it should be about current situation about computer-vision libraries for Android . I went to it with large enthusiasm because computer-vision seems like fascinating subject but I have been searching for more then a week and I did not find much . I would like to be able to provide information about libraries themselves and about comparison between them . I will share what I found so far . OpenCV .. . .. . seems like the most advanced one and the most popular . provide the biggest number of functions .. . .. . it had problem with backward compatibility .. . .. . is fast at least so I heard but I have zero information about it .. . .. . does have biggest amount of books about it at least for C++ version .. . .. . JavaCV .. . .. . is wrapper for few other libraries including opencv .. . .. . FastCv .. . .. . new with Qualcomm behind it . Wikitude .. . .. . this is more for augmentedreality but in its core is still computer-vision . As you can see I have a little information about it and doing my own tests for every library is far beyond my current computer-vision skills . Kind regards Peter . Comment : Someone else worked on a similar project before : cs.brown.edu courses csci1290 results final sbnguyen http : www.cs.brown.edu courses csci1290 results final sbnguyen Comment : @SamuelAudet you should put that as official answer so I can rep it : Comment : @SamuelAudet now looking at it It seems that information in the link are outdated . .. . Answer : There s a new option for CV on Android the Google Mobile Vision API https : developers.google.com vision . The API is exposed through com.google.android.gms.vision and lets you detect various types of objects faces barcodes and facial features given an arbitrary image bitmap .", "Question : I am trying to implement computer-vision using opencv on the AR drone 1.0 using cylonjs however I cannot seem to install the cylon-opencv module but other modules I require work fine . I have tried to install node-opencv module too but that also failed . This is the error I get .. . Answer : first missing library seems to be : lippicv", "Question : i made application eye detecting by following this link link http : romanhosek.cz android-eye-detection-and-tracking-with-opencv and it work .. . how can i detect the eye is opened or closed is there library in android to detect closed or opened Comment : possible duplicate of Opencv - detecting whether the eye is closed or open http : stackoverflow.com questions 20563835 opencv-detecting-whether-the-eye-is-closed-or-open Comment : The new Android Face API supports detecting eyes open and smiling : developers.google.com vision https : developers.google.com vision .. . Answer : I ve no idea whether there is any library for that but using technique descirbed in article Eye-blink detection system for human computer interaction by Aleksandra Kr lak and Pawe Strumi o you can download it here http : link.springer.com article 10.1007 2Fs10209-011-0256-6 and here http : paperity.org p 8557547 eye-blink-detection-system-for-human-computer-interaction and here is some simplified version http : medialt.no pub uikt u2010 011-Krolak index.html in my opinion is a good option . Generally this technique is quite simple : .. . .. . 1 . Find eye or both eyes . Remember this part of image as a template . 2 . In next frame use some kind of corellation authors used normalized cross correlation method but you can try with other types - OpenCV has few types of correlation methods implemented http : docs.opencv.org doc tutorials imgproc histograms template matching template matching.html which-are-the-matching-methods-available-in-opencv to find region similar to your template . Place with highest correlation value most likely will be eye . 3 . If correlation value some threshold value than eye is open otherwise it is closed . Threshold value used by authors is in the article but when i was using this technique i ve used other value so most likely you will need to find value for your case on your own . Comment : i will try to work in this", "Question : I want to do project on image-processing . i want to know if i want to implement this project on FPGA which tool should I choose at 1st stage Matlab or OPEN CV and is it possible to convert code from Open CV to FPGA directly like code generator can be used from Matlab to FPGA directly Comment : Not sure but that s unlikely . Comment : It depends on which one you are more comfortable with . I would go for Matlab since it is much more stable and mature and easier to debug . .. . Answer : Xilinx has a tool called Vivado HLS http : www.xilinx.com products design-tools vivado integration esl-design index.htm . There is also an appnote XAPP1167 http : www.xilinx.com support documentation application notes xapp1167.pdf that describes targetting OpenCV on Zynq platform using the tool . I do not have experience with this but learnt about it at a recent OpenCV meet . Here is the opening from the appnote - .. . .. . This application note describes how the OpenCV library can be used to develop computer-vision applications on Zynq devices . OpenCV can be used at many different points in the design process from algorithm prototyping to in-system execution . OpenCV code can also migrate to synthesizable C++ code using video libraries that are delivered with Vivado HLS . When integrated into a Zynq design the synthesized blocks enable high resolution and frame-rate computer-vision algorithms to be implemented . Altera supports OpenCL http : www.altera.com products software opencl opencl-index.html sdk which is a broad specification to parallelize ANSI C . There is a OpenCV module http : www.khronos.org message boards showthread.php 8140-OpenCL-module-for-OpenCV available for OpenCL . Again I do not have experience with this yet . This link http : www.cmsoft.com.br index.php option com content view category layout blog id 59 Itemid 106 helps to understand use of OpenCL in the context of host and hardware accelerators such as FPGA development boards . So if you would like to go the Altera route then you would have to wrap your OpenCV functions in OpenCL using the OpenCV module noted above and then use Altera s SDK to target the fpga . The upside of going this route is that if you find that FPGAs are not so great for your application then you could target the OpenCL+OpenCV to some other platform . Comment : I forgot to mention both Altera and Xilinx have tools that let you go from Matlab to HDL . In case of Altera you could get these free with some development boards ." ] }
[ "yes-answer-short" ]
cross-platform
UNK_RELATION
groovy-2@java@71
groovy-2 -- groovy is an object-oriented programming language for the @placeholder platform .
{ "confidence": [ 34.084835052490234, 34.084835052490234, 33.34964370727539, 32.793949127197266, 32.42658996582031, 31.500484466552734, 31.398941040039062, 31.381885528564453, 31.381885528564453, 30.465484619140625, 30.465484619140625, 30.180404663085938, 28.696697235107422, 27.154800415039062, 27.154800415039062, 27.154800415039062, 26.728939056396484, 25.6357479095459, 25.303068161010742, 25.303068161010742, 24.316749572753906, 24.316749572753906, 23.229061126708984, 23.229061126708984, 23.229061126708984, 23.229061126708984, 23.229061126708984, 22.501853942871094, 22.501853942871094, 22.501853942871094, 21.93817138671875, 20.977313995361328, 19.875476837158203, 18.648719787597656, 18.57611083984375, 18.57611083984375, 18.191329956054688, 18.13926124572754, 17.30229949951172, 14.931953430175781, 14.471632957458496, 14.361248016357422, 12.914003372192383, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 12.777657508850098, 11.486769676208496, 11.486769676208496, 11.486769676208496, 11.486769676208496, 11.486769676208496, 11.486769676208496, 11.486769676208496, 11.486769676208496, 11.43130874633789 ], "content": [ "How do I do this in Groovy", "I think that doesn t work in groovy .", "This is all I ve found : docs.codehaus.org display GROOVY Creating+an+extension+module http : docs.codehaus.org display GROOVY Creating+an+extension+module", "I m using Groovy 2.1.9 with groovyConsole .", "http : java.dzone.com articles groovy-20-performance-compared", "A dynamic language will usually be a bit more slower groovy is a FAST dynamic language so you need to check your case : does maximum performance is needed", "Current Grails version 2.1 run groovy 1.8.x .. . .. . In Grails web you can see the roadmap where Groovy 2.x integration is featured .. . .. . http : grails.org Roadmap", "In the older 1.x.x versions of Groovy you can add constructors using metaClass.constructor .. . .. . Is there a way to register constructors using the new Groovy 2.0 extension modules", "I see that as of Groovy 2.0 there is the possibility to add a TypeChecked annotation to classes or methods to trigger the optional static checking http : www.infoq.com articles new-groovy-20 .", "This seems to work : .. . .. . Define an extension class as normal for Groovy 2 and just add the constructors in a static initialiser", "I m trying to make a project I m working on interoperable between Groovy 1.x and 2 .", "When using groovy your code should be covered with tests .", "While faster than normal Groovy it can compile only a subset of Groovy and behaves a bit different .", "As of December 20th 2012 http : grails.org news 1285958 the annotation should be useable with Grails 2.2 which uses Groovy 2.0", "This code should give you a good idea of how groovy works and what can be done with closures .", "The fact is a typical groovy class which is not designed to be typechecked will have something like def foo 1 .", "I ve read through the What s new in Groovy 2.0 http : www.infoq.com articles new-groovy-20 and I m a bit confused about when to use @CompileStatic .", "I worked on a web application for 2 years using groovy and mostly of our problems came from high JSF 1.2 memory usage and bad mapping on JPA .", "I am new to groovy Lists and I have list as shown below : .. . .. . I want the fileList to have the latest files .. . .. . 1 .", "Is it possible that my experience with Groovy is not representative but I have found lots of code which does not explicitly declare return types and simply uses def .", "It s because of the way groovy chooses which method to call and its potential incompatibility with java .", "http : groovy.329449.n5.nabble.com mixing-public-private-overloaded-methods-causes-compilation-error-td367147.html", "You can use Collection groupBy http : groovy.codehaus.org groovy-jdk java util Collection.html groupBy 28groovy.lang.Closure 29 to create a map with an entry for each unique file name .", "You can then use Map collect http : groovy.codehaus.org groovy-jdk java util Map.html collect 28groovy.lang.Closure 29 to iterate over the contents of this map and create the list you want .", "The map s values will be a list of instances of File so Collection max http : groovy.codehaus.org groovy-jdk java util Collection.html max 28groovy.lang.Closure 29 will let you search for the one with the highest revision number .", "If you call a method from an unchecked class then it s the declared return-type which is used and the behaviour is exactly the same as-if you use a Java method from Groovy .", "But the fact is that adding types for return values in Groovy 1 does not have performance beneftis if anything it is the opposite does not add type safety it casts at runtime and may hide bugs .", "So developers looking for performance improvements would not see much changes in Groovy 2.0 if they aren t able to run on JDK 7 .", "The indy version is fully dynamic Groovy as it is known only faster thanks to JDK 7 invokedynamic .", "To boil it down @CompileStatic removes some Groovy dynamic runtime functionality in favor of speed .", "What I tried .. . .. . So I checked this blog post http : blog.techstacks.com 2009 12 configuring-wire-logging-in-groovy-httpbuilder.html that says about adding log4j.xml to groovy.home conf .", "I have even found this advised as best practice since in any case declaring a return-type in Groovy 1 would not give a type check but only a cast at runtime resulting in code that is no more safe possibly hides a bug due to casting and it is slower .", "That s part of being a dynamic language - .", "I d suggest reading http : groovy.codehaus.org groovy-jdk java util Collection.html and http : groovy.codehaus.org Collections .. . .. . A very naive way of doing this would be to use the collect method as follows .. . .. . You could write as part of your condition in the collect closure to return false for duplicate items then you wouldn t have to call unique .. . .. . EDIT Thinking about the problem you are faced with you actually wouldn t want to use the above methods .", "Luckily the Groovy development team thought those developers could get interesting performance boost among other advantages by allowing type checked code to be compiled statically .", "This blog http : objectscape.blogspot.com 2012 08 groovy-20-performance-compared-to-java.html suggests I would but I m not sure he compiled correctly given that he did it within Eclipse .", "AFAIK this should be equivalent to returning Object .", "I just upgraded one of my Grails apps to 2.2.0 which is using Groovy 2.0 and I am now getting this compile error : .. . .. . Mixing private and public protected methods of the same name causes multimethods to be disabled and is forbidden to avoid surprising behaviour .", "It should not have the items of same type .. . 2 .", "Am I instantiating the SurveyQuestion object correctly", "But if you do for example a lot with meta programming then indy will be better .", "At the least I d expect it to print the object-reference as Java would", "If you will be a static guy and only use a small part of the language then @CompileStatic can be used .", "Not that I know of.. . .. . .. . You could add a static factory-method to the Example class ie : .. . .. . Then after adding a link-to this class in the staticExtensionClasses field of the org.codehaus.groovy.runtime.ExtensionModule file you could do : .. . .. . This is something worth asking on the mailing list to see if constructors are worth adding to the Module Extension system .", "Thanks Tim .", "I suspected as much but I was hoping for different .", "Maybe I need to look at the register your own features but I don t see any documentation for that yet : -", "Yep that was what I found .", "I was hoping to avoid the Advanced Modules bit as it is just check out these classes.. .", "Ahhh yeah I haven t dug in to the Advanced Modules bit yet.. .", "I guess it might be possible to write your own Module and registry classes -- but as I said I haven t looked into that at all : -", "Looking at article on DZone about improved performance with Groovy2 when compiling with @CompileStatic annotation I wonder to what extent can I take advantage of it", "I m guessing annotate controllers domain objects and services", "Does Grails take advantage of it by default when app gets compiled", "Link to article .", "It should have the highest revision files means if two or more files have the same type then the list must have the single file with the highest revision .", "I m not sure what you meant when you said that the list should not have items of the same type .", "You ll notice that if there are two instances of File with the same name and revision number but different types this solution picks one arbitrarily .", "Use the each method to iterate through your values .", "As I said this is a naive way to complete your task you may want to look into a good recursive method that piggy-backs off a sorting algorithm .", "Can you give me an example please", "This is a naive example using some of Justin Piper s code .", "Read through those APIs I posted as well as the List JDK .", "You will definately be able to make a more efficient method .", "I must admit that I am confused by how such a thing could work .", "The article gives simple examples such as .. . .. . In this case it is clear that some checks will fail .", "But in the general case one will use say the return-value of method A that is not type checked inside the type checked method B .", "In this case I do not see how the compiler can figure out whether method B types are consistent since it does not have enough information on the return-value of method A .", "How can one enable type checking on a subset of the code without losing type safety in general", "EDIT .. . .. . I try to make an example .", "What if I have an old class .. . .. . and try to use it from type-checked code like .. . .. . The compiler just does not know what to do and I guess it will fail to compile I do not have Groovy2 installed here at work to check .", "But if this is the case it become an issue to use any code written before Groovy2 .", "So I imagine something more sophisticated is done but I am not sure what .", "There is no such problem .", "Take the following example : .. . .. . Now imagine this : .. . .. . Note that in general you use mixed type checking in a single class if you have code which heavily relies on dynamic code that the type checker obviously cannot check .", "This is the case for example if you rely on a builder .", "If so then you just declare a method which uses the builder as not checked and the rest of your code is checked .", "As long as the unchecked method returns a compatible type type safety is guaranteed .", "Now when you try for instance to feed this result into a typechecked method which expects an int or Integer after boxing the type checker will complain .", "If you need maximum performance @CompileStatic .", "If needing type checking i think you are right that you should type your methods signatures else you can go for def .", "In your case i think the compiler is not inferring the return-type of the method .", "Maybe filling a JIRA", "I did not mean that the problem is slowness maybe I have expressed myself badly .", "Because of this the code I have usually seen does not contain type hints on return values .", "This is just an aside .", "The actual question is : how can the compiler type check stuff when many methods return values of unknown types", "It is not a rant I am really trying to figure out .", "The compiler will not complain about neither infer return values .", "When using @CompileStatic the compiler also won t infer the type of your return when your method contains a def you are better using the explicit return-type .", "A system i worked didn t had any tests so we always used typing in our methods .", "The Problem .. . .. . I m getting groovyx.net.http.HttpResponseException : Not Found and want to see the logs from HTTPBuilder .", "I did that here s my file : .. . .. . And here s my script that I m running in the console : .. . .. . EDIT : my HttpResponseException is solved I had a unnecessary in the request but still no builder logs appearing .", "Here s how I got it to log using java.util.logging instead of log4j : redtoad.ca ataylor 2013 10 logging-httpbuilder-traffic http : www.redtoad.ca ataylor 2013 10 logging-httpbuilder-traffic", "HTTPBuilder uses commons-logging so you have to bridge the output from commons-logging to log4j .", "Unfortunately log4j 1.2 doesn t support this out of the box .", "So I simplified your example and switched to SLF4J http : www.slf4j.org which is a Simple Logging Facade for Java .", "Under the hood the following config still uses log4j so you still need your log4j.xml in-place groovy.home conf .", "For a detailled explanation see Bridging legacy APIs http : www.slf4j.org legacy.html .", "I m trying to instantiate an object and set a single attribute on it which comes from a request parameter like so : .. . .. . This is my output in the console : .. . .. . Question text from the request : test this is our questionroosearch.SurveyQuestion : null .. . .. . And this is the SurveyQuestion class : .. . .. . The above seems to compile ok however I get further classcast exceptions when I do a redirect at the end of my action I believe this is due to the instantiating and setting of that SurveyQuestion as-if I comment out the above I don t get this failure behaviour ." ] }
{ "confidence": [ 38.18631362915039, 37.8154411315918, 36.63371276855469, 36.55503463745117, 35.6224479675293, 34.7860221862793, 34.13092041015625, 33.511199951171875, 31.015636444091797, 29.664531707763672, 28.892515182495117, 13.133559226989746 ], "content": [ "Question : I see that as of Groovy 2.0 there is the possibility to add a TypeChecked annotation to classes or methods to trigger the optional static checking http : www.infoq.com articles new-groovy-20 . I must admit that I am confused by how such a thing could work . The article gives simple examples such as .. . .. . In this case it is clear that some checks will fail . But in the general case one will use say the return-value of method A that is not type checked inside the type checked method B . In this case I do not see how the compiler can figure out whether method B types are consistent since it does not have enough information on the return-value of method A . How can one enable type checking on a subset of the code without losing type safety in general EDIT .. . .. . I try to make an example . What if I have an old class .. . .. . and try to use it from type-checked code like .. . .. . The compiler just does not know what to do and I guess it will fail to compile I do not have Groovy2 installed here at work to check . But if this is the case it become an issue to use any code written before Groovy2 . So I imagine something more sophisticated is done but I am not sure what . .. . Answer : There is no such problem . If you call a method from an unchecked class then it s the declared return-type which is used and the behaviour is exactly the same as-if you use a Java method from Groovy . Take the following example : .. . .. . Now imagine this : .. . .. . Note that in general you use mixed type checking in a single class if you have code which heavily relies on dynamic code that the type checker obviously cannot check . This is the case for example if you rely on a builder . If so then you just declare a method which uses the builder as not checked and the rest of your code is checked . As long as the unchecked method returns a compatible type type safety is guaranteed . Comment : The fact is a typical groovy class which is not designed to be typechecked will have something like def foo 1 . AFAIK this should be equivalent to returning Object . Now when you try for instance to feed this result into a typechecked method which expects an int or Integer after boxing the type checker will complain . Comment : Is it possible that my experience with Groovy is not representative but I have found lots of code which does not explicitly declare return types and simply uses def . I have even found this advised as best practice since in any case declaring a return-type in Groovy 1 would not give a type check but only a cast at runtime resulting in code that is no more safe possibly hides a bug due to casting and it is slower . Comment : A dynamic language will usually be a bit more slower groovy is a FAST dynamic language so you need to check your case : does maximum performance is needed I worked on a web application for 2 years using groovy and mostly of our problems came from high JSF 1.2 memory usage and bad mapping on JPA . If you need maximum performance @CompileStatic . If needing type checking i think you are right that you should type your methods signatures else you can go for def . In your case i think the compiler is not inferring the return-type of the method . Maybe filling a JIRA Comment : I did not mean that the problem is slowness maybe I have expressed myself badly . But the fact is that adding types for return values in Groovy 1 does not have performance beneftis if anything it is the opposite does not add type safety it casts at runtime and may hide bugs . Because of this the code I have usually seen does not contain type hints on return values . This is just an aside . The actual question is : how can the compiler type check stuff when many methods return values of unknown types It is not a rant I am really trying to figure out . Comment : I think that doesn t work in groovy . The compiler will not complain about neither infer return values . That s part of being a dynamic language - . When using @CompileStatic the compiler also won t infer the type of your return when your method contains a def you are better using the explicit return-type . When using groovy your code should be covered with tests . A system i worked didn t had any tests so we always used typing in our methods .", "Question : In the older 1.x.x versions of Groovy you can add constructors using metaClass.constructor .. . .. . Is there a way to register constructors using the new Groovy 2.0 extension modules This seems to work : .. . .. . Define an extension class as normal for Groovy 2 and just add the constructors in a static initialiser .. . Answer : Not that I know of.. . .. . .. . You could add a static factory-method to the Example class ie : .. . .. . Then after adding a link-to this class in the staticExtensionClasses field of the org.codehaus.groovy.runtime.ExtensionModule file you could do : .. . .. . This is something worth asking on the mailing list to see if constructors are worth adding to the Module Extension system . Comment : Thanks Tim . I suspected as much but I was hoping for different . I m trying to make a project I m working on interoperable between Groovy 1.x and 2 . Maybe I need to look at the register your own features but I don t see any documentation for that yet : - Comment : This is all I ve found : docs.codehaus.org display GROOVY Creating+an+extension+module http : docs.codehaus.org display GROOVY Creating+an+extension+module Comment : Yep that was what I found . I was hoping to avoid the Advanced Modules bit as it is just check out these classes.. . Comment : Ahhh yeah I haven t dug in to the Advanced Modules bit yet.. . I guess it might be possible to write your own Module and registry classes -- but as I said I haven t looked into that at all : -", "Question : Looking at article on DZone about improved performance with Groovy2 when compiling with @CompileStatic annotation I wonder to what extent can I take advantage of it I m guessing annotate controllers domain objects and services Does Grails take advantage of it by default when app gets compiled Link to article . http : java.dzone.com articles groovy-20-performance-compared .. . Answer : Current Grails version 2.1 run groovy 1.8.x .. . .. . In Grails web you can see the roadmap where Groovy 2.x integration is featured .. . .. . http : grails.org Roadmap", "Question : I am new to groovy Lists and I have list as shown below : .. . .. . I want the fileList to have the latest files .. . .. . 1 . It should not have the items of same type .. . 2 . It should have the highest revision files means if two or more files have the same type then the list must have the single file with the highest revision . How do I do this in Groovy .. . Answer : You can use Collection groupBy http : groovy.codehaus.org groovy-jdk java util Collection.html groupBy 28groovy.lang.Closure 29 to create a map with an entry for each unique file name . You can then use Map collect http : groovy.codehaus.org groovy-jdk java util Map.html collect 28groovy.lang.Closure 29 to iterate over the contents of this map and create the list you want . The map s values will be a list of instances of File so Collection max http : groovy.codehaus.org groovy-jdk java util Collection.html max 28groovy.lang.Closure 29 will let you search for the one with the highest revision number . I m not sure what you meant when you said that the list should not have items of the same type . You ll notice that if there are two instances of File with the same name and revision number but different types this solution picks one arbitrarily .", "Question : I am new to groovy Lists and I have list as shown below : .. . .. . I want the fileList to have the latest files .. . .. . 1 . It should not have the items of same type .. . 2 . It should have the highest revision files means if two or more files have the same type then the list must have the single file with the highest revision . How do I do this in Groovy .. . Answer : This is a naive example using some of Justin Piper s code . Read through those APIs I posted as well as the List JDK . You will definately be able to make a more efficient method . This code should give you a good idea of how groovy works and what can be done with closures .", "Question : I ve read through the What s new in Groovy 2.0 http : www.infoq.com articles new-groovy-20 and I m a bit confused about when to use @CompileStatic . The article mentions that the @CompileStatic annotation was added for developers who weren t able to take advantage of the invoke dynamic part of Java7 . So developers looking for performance improvements would not see much changes in Groovy 2.0 if they aren t able to run on JDK 7 . Luckily the Groovy development team thought those developers could get interesting performance boost among other advantages by allowing type checked code to be compiled statically . My question is if I m using JDK 7 and I follow the instructions to add the --indy flag do I need to add @CompileStatic to see some performance increases This blog http : objectscape.blogspot.com 2012 08 groovy-20-performance-compared-to-java.html suggests I would but I m not sure he compiled correctly given that he did it within Eclipse . Update : Here are the stats when running different permutations of the Fibonacci code . Note : this question seems a little confusing now that I understand that the features are independent . Since the basis of the question is around the confusion from the notes that made me think the two features were related I think it makes sense not to change the question wording and allow the accepted answer that explain the differences . .. . Answer : The indy version is fully dynamic Groovy as it is known only faster thanks to JDK 7 invokedynamic . @CompileStatic means static compilation . While faster than normal Groovy it can compile only a subset of Groovy and behaves a bit different . Especially all the dynamic features are not available anymore . So if you want to use dynamic features then indy is the only option . If you will be a static guy and only use a small part of the language then @CompileStatic can be used . Fibonacci is btw not a test in which invokedynamic can shine . The indy port is not always better . But if you do for example a lot with meta programming then indy will be better . You have to decide according to your usage in the end Comment : Good answer . The part that I missed from the wording in the release is that they are independent features . So even if using Java 7 with -indy CompileStatic can give a perf boost as long as the code can actually be type checked by the compiler . We did do a quick test of the different permutations with indy and CompileStatic with Fibonacci and found the following :", "Question : I am new to groovy Lists and I have list as shown below : .. . .. . I want the fileList to have the latest files .. . .. . 1 . It should not have the items of same type .. . 2 . It should have the highest revision files means if two or more files have the same type then the list must have the single file with the highest revision . How do I do this in Groovy .. . Answer : I d suggest reading http : groovy.codehaus.org groovy-jdk java util Collection.html and http : groovy.codehaus.org Collections .. . .. . A very naive way of doing this would be to use the collect method as follows .. . .. . You could write as part of your condition in the collect closure to return false for duplicate items then you wouldn t have to call unique .. . .. . EDIT Thinking about the problem you are faced with you actually wouldn t want to use the above methods . Use the each method to iterate through your values . As I said this is a naive way to complete your task you may want to look into a good recursive method that piggy-backs off a sorting algorithm . Comment : Can you give me an example please", "Question : Looking at article on DZone about improved performance with Groovy2 when compiling with @CompileStatic annotation I wonder to what extent can I take advantage of it I m guessing annotate controllers domain objects and services Does Grails take advantage of it by default when app gets compiled Link to article . http : java.dzone.com articles groovy-20-performance-compared .. . Answer : As of December 20th 2012 http : grails.org news 1285958 the annotation should be useable with Grails 2.2 which uses Groovy 2.0", "Question : I just upgraded one of my Grails apps to 2.2.0 which is using Groovy 2.0 and I am now getting this compile error : .. . .. . Mixing private and public protected methods of the same name causes multimethods to be disabled and is forbidden to avoid surprising behaviour . Renaming the private methods will solve the problem . Based on the following code : .. . .. . It s an easy fix but I d really like to understand the why better . Can someone explain this to me .. . Answer : It s because of the way groovy chooses which method to call and its potential incompatibility with java . Have you seen this thread on the mailing list http : groovy.329449.n5.nabble.com mixing-public-private-overloaded-methods-causes-compilation-error-td367147.html Comment : I had not seen that . Thanks .", "Question : I ve read through the What s new in Groovy 2.0 http : www.infoq.com articles new-groovy-20 and I m a bit confused about when to use @CompileStatic . The article mentions that the @CompileStatic annotation was added for developers who weren t able to take advantage of the invoke dynamic part of Java7 . So developers looking for performance improvements would not see much changes in Groovy 2.0 if they aren t able to run on JDK 7 . Luckily the Groovy development team thought those developers could get interesting performance boost among other advantages by allowing type checked code to be compiled statically . My question is if I m using JDK 7 and I follow the instructions to add the --indy flag do I need to add @CompileStatic to see some performance increases This blog http : objectscape.blogspot.com 2012 08 groovy-20-performance-compared-to-java.html suggests I would but I m not sure he compiled correctly given that he did it within Eclipse . Update : Here are the stats when running different permutations of the Fibonacci code . Note : this question seems a little confusing now that I understand that the features are independent . Since the basis of the question is around the confusion from the notes that made me think the two features were related I think it makes sense not to change the question wording and allow the accepted answer that explain the differences . .. . Answer : To boil it down @CompileStatic removes some Groovy dynamic runtime functionality in favor of speed . So theoretically : .. . .. . JDK7 should be faster than JDK6 because of invokedynamic .. . @CompileStatic should be faster than Standard because some overhead and features are removed . All that with the caveat that it will largely depend on what you are doing as various features are optimized to different degrees .", "Question : The Problem .. . .. . I m getting groovyx.net.http.HttpResponseException : Not Found and want to see the logs from HTTPBuilder . I m using Groovy 2.1.9 with groovyConsole . What I tried .. . .. . So I checked this blog post http : blog.techstacks.com 2009 12 configuring-wire-logging-in-groovy-httpbuilder.html that says about adding log4j.xml to groovy.home conf . I did that here s my file : .. . .. . And here s my script that I m running in the console : .. . .. . EDIT : my HttpResponseException is solved I had a unnecessary in the request but still no builder logs appearing . Comment : Here s how I got it to log using java.util.logging instead of log4j : redtoad.ca ataylor 2013 10 logging-httpbuilder-traffic http : www.redtoad.ca ataylor 2013 10 logging-httpbuilder-traffic .. . Answer : HTTPBuilder uses commons-logging so you have to bridge the output from commons-logging to log4j . Unfortunately log4j 1.2 doesn t support this out of the box . So I simplified your example and switched to SLF4J http : www.slf4j.org which is a Simple Logging Facade for Java . Under the hood the following config still uses log4j so you still need your log4j.xml in-place groovy.home conf . For a detailled explanation see Bridging legacy APIs http : www.slf4j.org legacy.html .", "Question : I m trying to instantiate an object and set a single attribute on it which comes from a request parameter like so : .. . .. . This is my output in the console : .. . .. . Question text from the request : test this is our questionroosearch.SurveyQuestion : null .. . .. . And this is the SurveyQuestion class : .. . .. . The above seems to compile ok however I get further classcast exceptions when I do a redirect at the end of my action I believe this is due to the instantiating and setting of that SurveyQuestion as-if I comment out the above I don t get this failure behaviour . Am I instantiating the SurveyQuestion object correctly Why does it display as null when I print it to the console Is that normal behaviour At the least I d expect it to print the object-reference as Java would Thanks Comment : You ll also have a problem saving that question without a Survey parent being set . .. . Answer : The default toString method on a domain instance will return a string which looks like class.name : id . As your newly created domain instance doesn t have id set is shows null . Try overriding toString in your SurveyQuestion domain :" ] }
[ "yes-answer-long", "yes-answer-short" ]
java
UNK_RELATION
django-datatable@server-side@255
django-datatable -- django-datatables-view is a base view for handling server-side processing for the awesome datatables.django-datatables-view simplifies handling of sorting filtering and creating json output as defined at : http : datatables.net usage @placeholder .
{ "confidence": [ 73.33224487304688, 71.62458038330078, 68.1326675415039, 66.83548736572266, 63.46063995361328, 62.82249450683594, 61.32625961303711, 59.87623596191406, 58.540565490722656, 56.989990234375, 56.26850128173828, 54.41934585571289, 49.796607971191406, 47.77008819580078, 38.00884246826172, 34.76023864746094, 34.76023864746094, 31.872106552124023, 30.73095703125, 30.612003326416016, 28.45567512512207, 28.253253936767578, 26.064754486083984, 25.852270126342773, 23.652088165283203, 22.097381591796875, 21.985288619995117, 21.642765045166016, 21.560638427734375, 21.384061813354492, 20.10256576538086, 19.391504287719727, 18.614377975463867, 17.703575134277344, 17.703575134277344, 16.61767578125, 16.511306762695312, 16.36517333984375, 15.521634101867676, 14.896049499511719, 14.663751602172852, 14.489026069641113, 14.489026069641113, 14.489026069641113, 14.489026069641113, 14.489026069641113, 14.489026069641113, 14.489026069641113, 14.489026069641113, 14.489026069641113, 14.489026069641113, 14.489026069641113, 14.27927017211914, 13.908613204956055, 13.08993148803711, 12.839945793151855, 12.839945793151855, 12.839945793151855, 12.839945793151855, 12.839945793151855, 12.839945793151855, 12.839945793151855, 12.839945793151855, 12.839945793151855, 12.839945793151855, 12.839945793151855, 12.353906631469727, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 11.542764663696289, 10.530162811279297, 9.988058090209961, 9.988058090209961, 9.988058090209961, 9.988058090209961, 9.988058090209961, 9.988058090209961, 9.988058090209961, 9.988058090209961, 9.988058090209961, 9.988058090209961, 9.988058090209961, 9.988058090209961, 9.988058090209961 ], "content": [ "I m using datatables datatables.net and also using server-side processing django .", "django-datatables-view https : bitbucket.org pigletto django-datatables-view .. . .. . you can use render column method for this .", "I m using the django-datatables-view that is used in conjunction with the jQuery plugin DataTables .", "I m using the jquery-datatables plugin with django-datatables-view .", "i m trying to use datatables from django-datatables-view on a django project with generic views .", "I use django-datatables-view to render a huge dataset .", "I am using Django 1.6 and django-datatables-view 1.8", "I have it imported from the django-datatables-view plugin", "Here s a sample setup of django-datatables-view : bitbucket.org pigletto django-datatables-view-example https : bitbucket.org pigletto django-datatables-view-example I should also note that everything works when I specify an individual model .", "You can use the get initial queryset https : bitbucket.org pigletto django-datatables-view method that returns the queryset used to populate the datatable .", "I am using the django-databtables-view https : pypi.python.org pypi django-datatables-view app but I get this following error in my console .", "I ve got django-datatables-view looking like this : .. . .. . How to wrap flat house.adress with a or any other html-tag", "I am using this library https : pypi.python.org pypi django-datatables for datatables in django-rest .", "Also if you re up to it check out my django snippet https : djangosnippets.org snippets 3019 on how to implement a datatables view in pure django .", "What version of django what version of django-datatable", "The datatable should be displayed via a separate view from the views.py so : .. . .. . .", "What should the view and the test.html contain to be able to display a simple datatable", "view name is the name you defined for your view in the url from urlpatterns .", "Here we have the basic code for getting djago-datatables-view to display .. . .. . This code works fine however how do I get it to not display the whole model but only filtered content from the model", "Among their datatables is one for recipes and one for ingredients .", "It seems to me django-datatable is not authenticating the user token and therefore request.user returns anonymous user .", "Within that template is a url tag that calls the DataTable class ...the url tag outputs a url string into the template I don t see how that calls a view class", "Within that template is a url tag that calls the DataTable class to create JSON data .", "You just need to assign the filter-var to the data parameter that s passed in the datatables request : .. . .. . And to filter the data just call draw on the select change event", "Ok so with url view name param1 param2 .. . you are passing arguments param1 param2 .. . to your view .", "The same way you do it about 5 lines above your comment in your view", "I m trying to display data with jQuery DataTable in JSON format but something is wrong here and it won t display anything .", "For normal use I create a class-based view based on BaseDatatableView and define there the columns variable : .. . .. . Now I would like to create a variable number of columns that is based on a parameter .", "When I try to load page with the datatable I ve encountered with AttributeError : NoneType object has no attribute count", "so I don t know if you d use the usual basic Django CVB methods e.g .", "For the simplicity i put the datatable definition into a separate file datatables.py : .. . .. . .", "You should add this to your handlers definition .. . .. . And this to your loggers .. . .. . You could also set some other handler that actually logs something check out the answer here http : stackoverflow.com questions 14530526 django-no-handlers-could-be-found-for-logger-cities rq 1", "So my question is how can I get the DataTable class in views.py to call my variable", "I have a seperate textfield in which I use it to custom filter data in the DataTable after the table has been rendered already .", "The following works just fine : .. . .. . I want to custom filter columns .. . .. . So on the page load initial load of the datatable it filters for Robert just fine .", "Question : I have a Data table displaying on django but now I like to group-by when ever I will hide the coloumn .. . .. . column1 column2 column3 .. . .. . AAA CAD 25 .. . .. . AAA USD 12 .. . .. . BBB CAD 13 .. . .. . BBB USD 16 .. . .. . CCC CAD 11 .. . .. . CCC USD 18 .. . .. . The above table will be displayed on web page using Django now when ever I hide coloumn2 It should group-by and display like below table .. . .. . column1 column3 AAA 37 .. . .. . BBB 29 .. . .. . CCC 39 .. . .. . when ever I unhide it again it should display same as first table again .", "Therefore you have to use this url : .. . .. . url r data product type DataTable.as view name DataTable .. . .. . Then to catch this product type in your DataTable you have to implement the dispatch method inside it : .. . .. . EDIT : Another way is to let the url as you have and use GET If you want to pass it as a GET parameter then the best place to catch it is inside the get context method : .. . .. . In order to catch it as a GET parameter you have to construct the URL properly appending the GET parameters .", "It simply displays processing but nothing happens .", "It s GET method is directly responsible for request processing so You should look for Your answers there .", "but still the mainpage is not displaying the JSON content in table .", "IMHO the standard relationships foreign key and many-to-many as you said seem to be the best because you can manage each item recipe ingredient category with suitable fields and django supports reference for their linkage very well so making queries considering their relations becomes quite easy .", "I try to filter flat price .", "It should be less or equal than a number that user writes in an input field .. . .. . That s my DataTablesView : .. . .. . I can t understand how filter queryset works .", "filter queryset should return queryset .", "In your code filter queryset self qs does not return any data .", "so OrderListJson.get use NoneType as a queryset", "Thanks", "Is it possible to write a custom filter in BaseDatatableView for another input field in a html template", "For example a href url id .", "Right now I only show the data from the column in a td tag .", "My html-template looks like this :", "check this .", "The filter queryset method is used to search the database I want to be able to filter what the JSON is generating before it even gets to the search ability .", "Had some problems but I finally got it working like this : codeshare.io fHbCo http : codeshare.io fHbCo", "The JSON object that is returned if i visit the URL - url search list json --used in AjaxSource of Js code below seems to be correct .", "I have the following table : .. . .. . How do you filter for the latest distinct record", "In this example I would expect to get record 1 and 3", "My code : .. . .. . only grabs record 1 .", "latest return an object row that is well latest based on specified field provided as argument .", "If you need several records rows then you need to get a QuerySet .", "Try : .. . .. . this should give you rows 1 and 3 as you expect .", "I can access the parameter in the CBV functions but it seems I cannot overwrite the columns variable .", "For example I tried to overwrite the columns variable in get context data function but columns retains its original value later in render column function .", "Somebody has a solution", "BaseDatatableView implements DatatableMixin which has a method get columns with a default implementation of .. . .. . You can override it and pass your custom columns here using your parameter", "Thank you so much Marco it works like a charm now", "enter image description here http : i.stack.imgur.com MXyw3.png .. . .. . I hope you understand my question .", "what am I missing here", "I included the logging in my settings.py", "Here is my urls.py .. . .. . When the user goes to localhost table a page is generated from a template .", "Like so : .. . .. . edit : .. . .. . views.py : .. . .. . template code :", "Print some snippets from your views and your templates", "your question doesn t make sense .", "Just posted more code should make sense now .", "Just trying to make it adaptable .", "Who is BaseDatatableView", "you are trying to extend it", "Something like this : .. . .. . Keep in mind that url view name only constructs a string does not make a redirect", "Thank you", "But now I want to programmatically change the data to filter for friend name Sara .. . .. . I alreeady tried the following the filteredData has a correct filtered object but the table itself does not redraw with the new filter .", "I also tried this but no luck .", "How Can I achieve this", "Thank you for your help .", "You ve almost got it .", "How can i use it if i d like to use generic function based views", "All tutorial talks about class based views .", "enter image description here http : i.stack.imgur.com XtsQE.png My views.py .. . .. . The js-code is below : .. . .. . The HTML is :", "can anyone tell me there is any possible way to do it .", "Thanks in advance .", "Can you post your models and template code here to make query", "models.py : DDAFULL models.Model : LCR CUSTOMER TYPE models.CharField max length 50 db column LCR CUSTOMER TYPE primary-key False CUR models.CharField max length 5 SIC CODE models.DecimalField max digits 6 decimal places 0 LCR NONOP INS models.DecimalField max digits 19 decimal places 2 LCR OP INS models.DecimalField max digits 19 decimal places 2 LCR NONOP UNINS models.DecimalField max digits 19 decimal places 2 LCR OP UNINS models.DecimalField max digits 19 decimal places 2", "views.py cursor1.execute SELECT INTO table1 FROM select dummy as LCR CUSTOMER TYPE CUR AS CURRENCY CONVERT VARCHAR 20 CONVERT MONEY sum LCR NONOP INS as LCR NONOP INS CONVERT VARCHAR 20 CONVERT MONEY sum LCR OP INS as LCR OP INS CONVERT VARCHAR 20 CONVERT MONEY sum LCR NONOP UNINS as LCR NONOP UNINS CONVERT VARCHAR 20 CONVERT MONEY sum LCR OP UNINS as LCR OP UNINS from select case-when LCR CUSTOMER TYPE Corporate then Non-Credit Financial Entities else LCR CUSTOMER TYPE end as dummy from table0 a group-by CUR dummy tab1", "The table is displaying fine...but it should grouped by other columns on web page when ever I hide a column.. . @hardik Patel", "I ve tried setting it to model MyModel.objects.filter name example but this returns an error .", "of course it returns an error you d be assigning a queryset to a model .", "You need to define the proper queryset I think which is what you are doing already in the filter queryset method .", "I don t know the classes you are using Pandas", "get queryset", "Add this in your Class OrderListJson", "Everything is working fine expect request.user session in views ." ] }
{ "confidence": [ 82.46127319335938, 76.17210388183594, 74.16932678222656, 72.79391479492188, 71.56204223632812, 69.52290344238281, 62.22168731689453, 59.629112243652344, 57.54787063598633, 55.51537322998047, 51.2566032409668, 28.320072174072266, 22.931095123291016, 21.28830337524414, 18.327898025512695, 16.854846954345703, 12.547637939453125 ], "content": [ "Question : Here is my urls.py .. . .. . When the user goes to localhost table a page is generated from a template . Within that template is a url tag that calls the DataTable class to create JSON data . So my question is how can I get the DataTable class in views.py to call my variable Like so : .. . .. . edit : .. . .. . views.py : .. . .. . template code : Comment : Print some snippets from your views and your templates Comment : your question doesn t make sense . Within that template is a url tag that calls the DataTable class ...the url tag outputs a url string into the template I don t see how that calls a view class Comment : I m using the jquery-datatables plugin with django-datatables-view . Just posted more code should make sense now . Here s a sample setup of django-datatables-view : bitbucket.org pigletto django-datatables-view-example https : bitbucket.org pigletto django-datatables-view-example I should also note that everything works when I specify an individual model . Just trying to make it adaptable . Comment : Who is BaseDatatableView you are trying to extend it Comment : I have it imported from the django-datatables-view plugin .. . Answer : Ok so with url view name param1 param2 .. . you are passing arguments param1 param2 .. . to your view . view name is the name you defined for your view in the url from urlpatterns . Therefore you have to use this url : .. . .. . url r data product type DataTable.as view name DataTable .. . .. . Then to catch this product type in your DataTable you have to implement the dispatch method inside it : .. . .. . EDIT : Another way is to let the url as you have and use GET If you want to pass it as a GET parameter then the best place to catch it is inside the get context method : .. . .. . In order to catch it as a GET parameter you have to construct the URL properly appending the GET parameters . Something like this : .. . .. . Keep in mind that url view name only constructs a string does not make a redirect Comment : Thank you Had some problems but I finally got it working like this : codeshare.io fHbCo http : codeshare.io fHbCo", "Question : null .. . Answer : i m trying to use datatables from django-datatables-view on a django project with generic views . How can i use it if i d like to use generic function based views For the simplicity i put the datatable definition into a separate file datatables.py : .. . .. . . The datatable should be displayed via a separate view from the views.py so : .. . .. . . What should the view and the test.html contain to be able to display a simple datatable All tutorial talks about class based views .", "Question : I m using datatables datatables.net and also using server-side processing django . I have a seperate textfield in which I use it to custom filter data in the DataTable after the table has been rendered already . The following works just fine : .. . .. . I want to custom filter columns .. . .. . So on the page load initial load of the datatable it filters for Robert just fine . But now I want to programmatically change the data to filter for friend name Sara .. . .. . I alreeady tried the following the filteredData has a correct filtered object but the table itself does not redraw with the new filter . I also tried this but no luck . How Can I achieve this Thank you for your help . .. . Answer : You ve almost got it . You just need to assign the filter-var to the data parameter that s passed in the datatables request : .. . .. . And to filter the data just call draw on the select change event", "Question : null .. . Answer : My Ajax request to update the tables is not working . Attached is the screenshot . It simply displays processing but nothing happens . The JSON object that is returned if i visit the URL - url search list json --used in AjaxSource of Js code below seems to be correct . but still the mainpage is not displaying the JSON content in table . Here it is : .. . .. . enter image description here http : i.stack.imgur.com XtsQE.png My views.py .. . .. . The js-code is below : .. . .. . The HTML is : Comment : Are you seeing any errors What version of django what version of django-datatable Comment : Also if you re up to it check out my django snippet https : djangosnippets.org snippets 3019 on how to implement a datatables view in pure django . I always recommend not using libraries that do everything for you and instead do things yourself . Comment : I am using Django 1.6 and django-datatables-view 1.8 Comment : I cannot figure out why the html is not getting updated although AJAX response seems to be fine. . Comment : If you open the ajax in a new tab - do you see the data If not then no the ajax response is not fine", "Question : I ve got django-datatables-view looking like this : .. . .. . How to wrap flat house.adress with a or any other html-tag For example a href url id . Right now I only show the data from the column in a td tag . My html-template looks like this : .. . Answer : check this . django-datatables-view https : bitbucket.org pigletto django-datatables-view .. . .. . you can use render column method for this .", "Question : Here we have the basic code for getting djago-datatables-view to display .. . .. . This code works fine however how do I get it to not display the whole model but only filtered content from the model I ve tried setting it to model MyModel.objects.filter name example but this returns an error . Comment : of course it returns an error you d be assigning a queryset to a model . You need to define the proper queryset I think which is what you are doing already in the filter queryset method . I don t know the classes you are using Pandas so I don t know if you d use the usual basic Django CVB methods e.g . get queryset Comment : The filter queryset method is used to search the database I want to be able to filter what the JSON is generating before it even gets to the search ability . .. . Answer : You can use the get initial queryset https : bitbucket.org pigletto django-datatables-view method that returns the queryset used to populate the datatable .", "Question : I use django-datatables-view to render a huge dataset . I try to filter flat price . It should be less or equal than a number that user writes in an input field .. . .. . That s my DataTablesView : .. . .. . I can t understand how filter queryset works . When I try to load page with the datatable I ve encountered with AttributeError : NoneType object has no attribute count .. . Answer : filter queryset should return queryset . In your code filter queryset self qs does not return any data . so OrderListJson.get use NoneType as a queryset Comment : Thanks Is it possible to write a custom filter in BaseDatatableView for another input field in a html template", "Question : I am using the django-databtables-view https : pypi.python.org pypi django-datatables-view app but I get this following error in my console . what am I missing here I included the logging in my settings.py .. . Answer : You should add this to your handlers definition .. . .. . And this to your loggers .. . .. . You could also set some other handler that actually logs something check out the answer here http : stackoverflow.com questions 14530526 django-no-handlers-could-be-found-for-logger-cities rq 1", "Question : I m using the django-datatables-view that is used in conjunction with the jQuery plugin DataTables . For normal use I create a class-based view based on BaseDatatableView and define there the columns variable : .. . .. . Now I would like to create a variable number of columns that is based on a parameter . I can access the parameter in the CBV functions but it seems I cannot overwrite the columns variable . For example I tried to overwrite the columns variable in get context data function but columns retains its original value later in render column function . Somebody has a solution .. . Answer : BaseDatatableView implements DatatableMixin which has a method get columns with a default implementation of .. . .. . You can override it and pass your custom columns here using your parameter Comment : Thank you so much Marco it works like a charm now", "Question : I am using this library https : pypi.python.org pypi django-datatables for datatables in django-rest . Everything is working fine expect request.user session in views . It seems to me django-datatable is not authenticating the user token and therefore request.user returns anonymous user . And the same is accessible even without sending user token in headers . Here is my code : .. . Answer : Have You tried to subclass BaseDatatableView and overwrite its .get like : .. . .. . My guess is that get initial queryset can be invoked before actual request dispatch so the user is anonymous there . When You look into the code of django datatables mixins.py there is a mixin called JsonResponseMixin . It s GET method is directly responsible for request processing so You should look for Your answers there . The easiest way - subclass it and overwrite the method . Comment : No I haven t overwrite get but surely will look at this Comment : Not working still AnonymousUser . Comment : Are You sending the token with the request Comment : yes as we send in rest framework Comment : Have You tried to check if Authentication header is present in the request You can check it like Authentication in self.request", "Question : Here we have the basic code for getting djago-datatables-view to display .. . .. . This code works fine however how do I get it to not display the whole model but only filtered content from the model I ve tried setting it to model MyModel.objects.filter name example but this returns an error . Comment : of course it returns an error you d be assigning a queryset to a model . You need to define the proper queryset I think which is what you are doing already in the filter queryset method . I don t know the classes you are using Pandas so I don t know if you d use the usual basic Django CVB methods e.g . get queryset Comment : The filter queryset method is used to search the database I want to be able to filter what the JSON is generating before it even gets to the search ability . .. . Answer : Add this in your Class OrderListJson", "Question : How is it possible to create a relationship like this : .. . .. . Imagine a restaurant . Among their datatables is one for recipes and one for ingredients . And there is another one which contains categories of food such as dinner lunch breakfast dessert soup . Let s name it cat food . The cook wants to sort recipes and ingredients by using cat food . For example there is a ManyToOne relationship from recipes to cat food among all the other columns . So one recipe has one category and one category has several recipes . But the cook also wants to sort the ingredients that way . Here we would have a ManyToMany relationship while we can use one ingredient in a dessert recipe just like in a dinner or soup recipe as well . One solution could be to create a cat food table for recipe and ingredients for its own . But how is it possible to create the cat food table which stores either recipes or ingredients depends on what is given .. . .. . My thought is to use an intermediate model and set both foreignKeys with the field options blank True and null True . But I am not satisfied with that . Is it possible that it can cause some database problems on the long term Is there a more elegant way to handle such a situation .. . Answer : IMHO the standard relationships foreign key and many-to-many as you said seem to be the best because you can manage each item recipe ingredient category with suitable fields and django supports reference for their linkage very well so making queries considering their relations becomes quite easy . In addition if you want a customized M2M table with extra fields you can build yourself using through https : docs.djangoproject.com es 1.9 topics db models extra-fields-on-many-to-many-relationships attibute . Comment : So you would say it is a good way to do it like this . Create one cat food with recipes and ingredients while both of them have the field options blank True and null True . So it can be either a recipe item or an ingredients . Yes I am thinking about to use an immediate table via through . I guess this is helpful in this case", "Question : null .. . Answer : I m trying to display data with jQuery DataTable in JSON format but something is wrong here and it won t display anything . This is my templates index.html file . What am I doing wrong here Should the script be placed somewhere else Thank you in advance Comment : Enable debugging tools in your browser and see if the url is being fetched properly or not", "Question : null .. . Answer : Question : I have a Data table displaying on django but now I like to group-by when ever I will hide the coloumn .. . .. . column1 column2 column3 .. . .. . AAA CAD 25 .. . .. . AAA USD 12 .. . .. . BBB CAD 13 .. . .. . BBB USD 16 .. . .. . CCC CAD 11 .. . .. . CCC USD 18 .. . .. . The above table will be displayed on web page using Django now when ever I hide coloumn2 It should group-by and display like below table .. . .. . column1 column3 AAA 37 .. . .. . BBB 29 .. . .. . CCC 39 .. . .. . when ever I unhide it again it should display same as first table again . can anyone tell me there is any possible way to do it . Thanks in advance . Comment : Can you post your models and template code here to make query Comment : models.py : DDAFULL models.Model : LCR CUSTOMER TYPE models.CharField max length 50 db column LCR CUSTOMER TYPE primary-key False CUR models.CharField max length 5 SIC CODE models.DecimalField max digits 6 decimal places 0 LCR NONOP INS models.DecimalField max digits 19 decimal places 2 LCR OP INS models.DecimalField max digits 19 decimal places 2 LCR NONOP UNINS models.DecimalField max digits 19 decimal places 2 LCR OP UNINS models.DecimalField max digits 19 decimal places 2 Comment : views.py cursor1.execute SELECT INTO table1 FROM select dummy as LCR CUSTOMER TYPE CUR AS CURRENCY CONVERT VARCHAR 20 CONVERT MONEY sum LCR NONOP INS as LCR NONOP INS CONVERT VARCHAR 20 CONVERT MONEY sum LCR OP INS as LCR OP INS CONVERT VARCHAR 20 CONVERT MONEY sum LCR NONOP UNINS as LCR NONOP UNINS CONVERT VARCHAR 20 CONVERT MONEY sum LCR OP UNINS as LCR OP UNINS from select case-when LCR CUSTOMER TYPE Corporate then Non-Credit Financial Entities else LCR CUSTOMER TYPE end as dummy from table0 a group-by CUR dummy tab1 Comment : The table is displaying fine...but it should grouped by other columns on web page when ever I hide a column.. . @hardik Patel", "Question : I have something like this in views.py . How do I make a query or get the referrer of the newly created referrer To further understand what I mean please check image below . enter image description here http : i.stack.imgur.com MXyw3.png .. . .. . I hope you understand my question . Comment : The same way you do it about 5 lines above your comment in your view .. . Answer : I guess there is some mistake in the code . if form.is valid : .. . .. . If you intend to find the referrer of the referral user of the currently created user you could do something like this . if form.is valid : .. . .. . EDIT : .. . .. . By minimal edits to your code : .. . .. . if form.is valid : Comment : Thanks It worked . Didn t know I could do something like DirectReferral.objects.get name ref user .referrer . Do you have a documentation for this kind of query Comment : This code is just a usual query . There is a possibility of another exception if name is not unique for DirectReferral . You will have to catch DirectReferral.MultipleObjectsReturned exception too .", "Question : How is it possible to create a relationship like this : .. . .. . Imagine a restaurant . Among their datatables is one for recipes and one for ingredients . And there is another one which contains categories of food such as dinner lunch breakfast dessert soup . Let s name it cat food . The cook wants to sort recipes and ingredients by using cat food . For example there is a ManyToOne relationship from recipes to cat food among all the other columns . So one recipe has one category and one category has several recipes . But the cook also wants to sort the ingredients that way . Here we would have a ManyToMany relationship while we can use one ingredient in a dessert recipe just like in a dinner or soup recipe as well . One solution could be to create a cat food table for recipe and ingredients for its own . But how is it possible to create the cat food table which stores either recipes or ingredients depends on what is given .. . .. . My thought is to use an intermediate model and set both foreignKeys with the field options blank True and null True . But I am not satisfied with that . Is it possible that it can cause some database problems on the long term Is there a more elegant way to handle such a situation .. . Answer : I m not sure if this is what you re looking for but perhaps you could create boolean values for each category for your two different tables For example if your chef had the item strawberries and your different categories were dinner lunch breakfast dessert and soup . Then you can check off the categories this food could go into . For example : breakfast True dessert True soup False . and on for the rest of the categories . If you re doing both then you can make it so that in your template you have both recipes and ingredients and have buttons or a dropdown to filter the results . Comment : I like the idea but.. . I want to make it as less redundant as possible . What I mean is if there is a new item for cat food then I just want to place it there to have it as new option in recipes or ingredients . Ok here my example is a bit on the edge because it is hard to create a new food category.. . Let s say the new one is astronout-dinner.. . Now when I add a new recipe or ingredient I want to have a dropdown men with all the possible cat food items . And I want to use as less columns as possible . Comment : That makes sense maybe you can create a third content-type I think you can import a content-type that you create separately . A manyToMany relationship might also work I ve used those before and they re fairly useful . Try this link-to see if it ll work- docs.djangoproject.com en 1.9 topics db examples many-to-many https : docs.djangoproject.com en 1.9 topics db examples many-to-many Comment : My problem is that two tables communicate with the same one which is cat food . By this I have a column for recipes and for ingredients in cat food . When one is given the other one is empty . I could handle this via blank True and null True I guess . But I am not quite sure about troubleshooting later on . Comment : You could also automatically give ingredients in a recipe the same categories as the recipes they re in Comment : Unfortunately not because all the ingredients should be given by default . I need to fill them in before people can choose them . Ok my cooking example is a really bad one I see.. . So it is like this . I am the cook who serves the database with all the ingredients and people making recipes . The cat food is for query s in a later stage and while the database is growing I am adding categories cat food to the ingredients when they have been used in a new category like I said it is actually a bad example with cooking and food", "Question : I have the following table : .. . .. . How do you filter for the latest distinct record In this example I would expect to get record 1 and 3 My code : .. . .. . only grabs record 1 . .. . Answer : latest return an object row that is well latest based on specified field provided as argument . If you need several records rows then you need to get a QuerySet . Try : .. . .. . this should give you rows 1 and 3 as you expect ." ] }
[ "yes-answer-long", "yes-answer-short" ]
server-side
UNK_RELATION
gitk@version-control@53
gitk -- a graphical browser for the git distributed @placeholder system whichallows you to quickly manage branches and search review commit logs and diffs .
{ "confidence": [ 37.371604919433594, 37.16804122924805, 37.154205322265625, 37.005287170410156, 36.55193328857422, 35.28765869140625, 34.82719802856445, 33.87997055053711, 33.8660774230957, 33.236568450927734, 33.201812744140625, 33.201812744140625, 33.067317962646484, 33.066768646240234, 32.8453483581543, 32.73492431640625, 32.41712188720703, 32.29927062988281, 32.208255767822266, 32.208255767822266, 32.20608139038086, 31.36664581298828, 31.31817626953125, 31.296613693237305, 31.296613693237305, 31.296613693237305, 31.149547576904297, 30.939682006835938, 30.811777114868164, 30.720924377441406, 30.670841217041016, 30.63661766052246, 30.597375869750977, 30.518775939941406, 30.361906051635742, 30.275806427001953, 30.143268585205078, 30.074499130249023, 30.030731201171875, 29.90923500061035, 29.888427734375, 29.697860717773438, 29.541515350341797, 29.439579010009766, 29.380897521972656, 29.300334930419922, 29.22393798828125, 29.211822509765625, 29.157936096191406, 29.101806640625, 29.101806640625, 29.101806640625, 29.101806640625, 29.101804733276367, 28.97684097290039, 28.810348510742188, 28.78439712524414, 28.78439712524414, 28.77267074584961, 28.741439819335938, 28.692092895507812, 28.67705535888672, 28.63724136352539, 28.571517944335938, 28.354820251464844, 28.354820251464844, 28.225143432617188, 28.16788101196289, 28.074604034423828, 28.00127410888672, 27.82351303100586, 27.745258331298828, 27.745258331298828, 27.745258331298828, 27.745258331298828, 27.745258331298828, 27.704851150512695, 27.64757537841797, 27.558094024658203, 27.55548095703125, 27.503055572509766, 27.503055572509766, 27.503055572509766, 27.503055572509766, 27.503055572509766, 27.503055572509766, 27.43994140625, 27.43994140625, 27.35940170288086, 27.338054656982422, 27.307212829589844, 27.275249481201172, 27.23485565185547, 27.23485565185547, 27.158838272094727, 27.12805938720703, 27.075206756591797, 27.071247100830078, 27.061046600341797, 27.02867889404297 ], "content": [ "On Linux it can be at .config git gitk or .gitk .", "gitk --all tells gitk to show all branches .", "gitk .. . 3 . review last commit .. . 4 .", "I m learning about git and is using gitk to visualize my history and branches .", "I saw there is an -i option https : github.com git git-commit accccde483c3cfd55ef55037e8802ca0baaee5a1 for git but it appears cannot pass any extra option in the search-box in gitk .", "Getting the very latest version of gitk https : github.com git git blob master gitk-git gitk and copying it over my existing gitk .", "Currently for merges without conflicts gitk shows no diffs .", "However when I tried to launch gitk to visualize a repo obtained using git-clone gitk only shows one of the branches .", "I m sorry maybe I m obtuse but I don t understand how to just git-commit -a or even git-add in gitk .", "For this I launch gitk search for the term Merge in commit messages verify that the merge commits have the right ancestry and populates .git-info-grafts acordingly .", "You call gitk inside your Git repository right", "You also need to process the file .config git gitk or remove it .", "questions 3192837 can-gitk-show-the-diff-of-merges-by-default 1 answer .. . .. . In gitk the git GUI tool is there a way to see diff of merge commit .", "gitk .. . .. . You can also make it as alias .. . .. . alias gitk gitk", "git-gui and gitk are the two that are actually part of the git suite and they re designed to complement each other - gitk for looking at history and diffs git-gui for making commits merging fetching pushing.. .", "I found that on my Windows 7 system at C : Users myusername .config git gitk .", "In Windows it is sometimes faster to check changes in files with graphical Git Commit Tool or Git History tool .", "Save the file restart gitk and it should now word-wrap commit messages .", "gitk is showing me the diff of the merge commit .", "I mis-click mark this commit in gitk .", "The branches show up in gitk but the graph does not show the branches merge back in .", "Close gitk then modify .config git gitk and change .. . .. . to some other colour .", "Also gitk is included with Homebrew git .", "The file was not in the home-directory directly but in .config git gitk", "This is on Ubuntu 14.04 git version 1.9.1 same for gitk .", "Is it a gitk issue or is the history of the git-repo incomplete", "You can view the tree of all branches in gitk it s just not default .", "gitk .. . 3 . review uncommitted changes .. . .. . Quite a bit faster : haven t timed it but it seems instant as opposed to a few second lag .. . .. . 1 . git-commit .. . 2 .", "You could make a git-alias that launched gitk with the --all parameter .", "From their official website it seems gitk comes with git but the version of my git git version 1.7.12.4 Apple Git-37 does not come with gitk .", "I read here http : stackoverflow.com questions 24208933 how-to-change-ui-colors-for-gitk that I can change the colors for gitk by modifying the file .config git gitk .", "If you must see it in gitk invoke it with no arguments find commit touching path file.txt and the commit contains that file will be bold .", "For gitk I don t know but with git-log : .. . .. . --full-diff Without this flag git-log -p .. . shows commits that touch the specified paths and diffs about the same specified paths .", "If you just want to have one git command expose all other git commands then you can create a git-alias or a script called git-gitk that just execs gitk for you when you type git gitk .", "I find giggle s tree hard to understand merges are horizontal for example while in qgit and gitk they are oblique.. . and qgit seems to not show some commits the commit creating the branch in svn is shown as a git-commit in both git-log --pretty oneline --graph and gitk but not in qgit nor giggle .", "gitk runs git rev-list which shares the code with git-log to select commits so yes this should work in gitk as well .", "Now gitk will show the yellow commit right next to the master marker and git-push will be working again .", "See also the docs of gitk http : git-scm.com docs gitk for a deeper explanation .", "When you view your last commit with gitk gitk actually runs git-diff to produce what you see so if you don t find that slow then git-diff simply isn t slow .", "So why doesn t gitk in this case show the HEAD and the 14360ed8 commit", "Presumably you mean something like git-gui gitk should launch the gitk program in the current repository on the current branch .", "git-gui and gitk are two different programs .", "In addition all branches that point to a commit in the history of the two branches are also shown .", "Is there a way to manipulate the history such that the gitk graph shows the branches merging back into the master", "I m not sure about gitk but if you are just going back in time to test old commits the easiest way is to just git-checkout commit hash and then git-checkout current branch name to go back .", "gitk http : i.stack.imgur.com w3KtN.png .. . .. . This is the weird thing : the only commit containing the word OSX shown in gitk which I ve selected manually : .. . .. . has the hash 801877c48390324dc7d600936306cd7c00486dcc unlike what git-log shows for current head 14360ed8fd3428aa0a2e052f6363e5daa0bf0d75 .. . The 14360ed8 is the merge pull request by one committer the 801877c the pull request by another committer for the same patch commit Fixed OSX libs and example .. . The 14360ed8 is not listed in any commit of gitk .. . There is no yellow dot to indicate HEAD nor a master branch label anywhere in gitk and certainly not next to 801877c .", "When using gitk a commit can be selected in the log pane and a right-click context menu offers Mark this commit .", "Then I have to type in command-line git-reset --hard origin master .. . .. . Is there a way for gitk to always show the full commit history till origin master", "This is the way gitk behaves by default because once you have a lot of branches the branch names can actually be quite distracting .", "This problem only happens with gitk for example git-gui works normally .", "I can use gitk and upgrade git version to the latest version .", "Typing git hist in my prompt runs gitk --all .", "I am using the command-line version of Git and gitk .", "gitk will write a line as the following to .gitk :", "Tags seem a natural way to do that but I expect to have a review for every commit and I don t want to clutter gitk with tons of tags .", "wrapcomment is described of .gitk here - http : marc.info l git m 114770603010712 w 2 http : marc.info l git m 114770603010712 w 2 .", "Gitk works fine now .", "On Windows it s at USERPROFILE .gitk .", "I m doing this : .. . .. . So far so good - but if I run gitk --all . in this directory then the commit of current HEAD is not indicated in the gitk display", "You can try the following : .. . .. . You can tell gitk what to display using anything that git rev-list understands http : www.kernel.org pub software scm git docs git-rev-list.html so if you just want a few branches you can do : .. . .. . .. . or more exotic things like :", "git and gitk so that if you install git for use with Windows command-prompt you get both commands .", "Either add usr local git bin to your PATH or use an alias alias gitk usr local git bin gitk", "I m using Git Gui and Gitk on Windows .", "With git show f2e4113 you see the file before the commit and git show d4b9bfc shows the file after the commit .", "Yes I call gitk inside the repository git-log shows the correct history moreover using the up and down arrow keys in the gitk interface makes me navigate the correct history .", "But even if I go through gitk in my config directory and gitk in C : Program Files Git mingw64 bin and replace every instance of green with 00ff00 I still get dark green as the branch color .", "Very useful for copy-paste into a terminal to perform an action on a given commit you used gitk to find .", "You can specify which branches you want by specifying them as arguments to the gitk command .", "Firstly gitk colors the branches differently I mean the lines between commits and secondly it seems that the commits are sometimes place in a different columns see pictures btw git-log --graph draws branches like tig .", "Find your gitk configuration file .", "git-gui doesn t provide that but you can of course just enter gitk on the command-line and launch gitk itself and it will show the current branch history .", "I want to compare 2 branches using gitk without the clutter of other branch histories .", "I tried gitk on a locally initialized repo and it is able to show both branches that I made properly .", "The only thing I find useful about the gitk interface is the nice colorful branches overview. .", "gitk provides a very easy way to manipulate branches with visual feedback which is particularly useful for new users .", "I kinda like the cli more but sometimes I invoke gitk just to see the branches and merges .", "At that point gitk showed you the master .", "I m looking in the commit history using gitk and git-log and I m trying to see how a specific commit arrived in a certain branch .", "@ubershmekel gitk doesn t do either of those things if you want a gui for them the built-in one is git-gui .", "This post http : stackoverflow.com questions 5084528 what-is-the-format-of-regular-expressions-in-gitk mentioned regexp in gitk is based on pickaxe grep system .", ".. . .. . gitk takes the same options as git-rev-list for selecting commits to display .", "gitk is a visual git tool and Cloud9 doesn t have a gui only a terminal .", "git --version returns .. . .. . From Googling it seems this version should include gitk .", ".. . .. . gitk unlike most git commands is a shell script that invokes Tcl .", "Correct the 1.7.12.4 Apple Git-37 does not come with gitk .", "Now gitk should be on your path along with an updated version of git .", "Reopen gitk .. . .. .", "Is it possible in gitk", "Re : specifying a file in the command-line for gitk is a unusual thing - if you mean my inclusion of the current dir dot as in gitk --all . I simply saw it somewhere on this site when I looked up why I cannot see all branches in gitk and I had remembered it verbatim .", "Adding the --oneline and or --decorate flags might make this output easier to search through if all you re looking for is the commit-message : .. . .. . If your commit is not in the ancestry of any of your branches and therefore not shown with log --all then you have to search the git reflog .", "When I use gitk without any further arguments it doesn t show any commit tree see image http : i.imgur.com uwHjPp4.png 1 .", "This is a very large project and there are hundreds of commits between the commit in question and the current state of the branch so I cannot clearly decipher through the limited DAG in gitk and the commit gets masked in other branches and merges and commit messages .", "OS : Ubuntu 9.04 Desktop gitk : 1 : 1.6.0.4-1ubuntu2 .. . .. . Thank you .", "Run Gitk in backgroup mode and don t close it while you paste .", ".. . .. . This obviously is a problem however : .. . .. . Opening Git Commit Tool by right clicking Git Commit Tool in context menu works fine .", "After that open the gitk from spotlight search goto the top left corner .", "Message diff pane .. . .. . Here we have the commit-message along with git-diff s output - this is something like using git-log -p with a little extra : .. . .. . Branches is equivalent to git-branch -a --contains commit .. . .. . Precedes Follows is equivalent to git describe --contains commit git-describe http : www.kernel.org pub software scm git docs git-describe.html", "I have created a test git project to figure out how should I get the differ logs between two branches .", "Gitk by default only shows you the branch you are on .", "I found this useful line on http : quirkygba.blogspot.com 2008 11 recovering-history-with-git-reflog.html : .. . .. . gitk --all git reflog cut -c1-7 .. . .. . This will display all the hidden changes in gitk where you can comfortably view point click and create new branches ." ] }
{ "confidence": [ 50.90583038330078, 50.892452239990234, 50.37396240234375, 49.198184967041016, 48.872432708740234, 48.49345779418945, 48.24938201904297, 48.01869583129883, 47.29084396362305, 47.15557861328125, 46.87008285522461, 46.0922966003418, 45.95026397705078, 45.2911376953125, 45.27165222167969, 45.066375732421875, 44.97599792480469, 44.65824508666992, 44.654029846191406, 44.373870849609375 ], "content": [ "Question : I m porting an svn repo to git using svn2git from https : www.negativetwenty.net redmine projects show svn2git and since svn does not track merges I need to edit .git-info-grafts manually . For this I launch gitk search for the term Merge in commit messages verify that the merge commits have the right ancestry and populates .git-info-grafts acordingly . The issue I m having is that gitk seems to be confused with the master branch . It often shows master being forked from a branch and being merged into a branch afterword when actually it is the opposite . Why is it unable to understand that master should be as linear as possible and it s the branch that should be forked from it not the opposite Is it a gitk issue or is the history of the git-repo incomplete It seems git-log --pretty oneline --graph is able to show the correct behaviour so I m thinking it might be a gitk issue . I also tried giggle and qgit but both have their problem . I find giggle s tree hard to understand merges are horizontal for example while in qgit and gitk they are oblique.. . and qgit seems to not show some commits the commit creating the branch in svn is shown as a git-commit in both git-log --pretty oneline --graph and gitk but not in qgit nor giggle . Note that I use gitk --all in my tests . So my question is : -How can I force gitk to show master as linear as possible Ideally left justified with branches being forked from it not the opposite . git-log --pretty oneline --graph seems to be doing it the right way but what about gitk Thanks Edit : Screenshot links are dead . Previously said : .. . .. . I have uploaded screenshots of the different tools : git-log gitk giggle qgit .. . .. . See how git-log shows the branch being merged into trunk while gitk shows trunk being merged in branch . Giggle and qgit shows the right merge but they often drop some commits creating branches so it s really hard to manualy edit the .git-info-grafts file . Comment : Is your graft expressed as merge commit master parent branch parent That should specify which parent comes first . Comment : Yes it is . I made sure the second commit id is the id of the branch merging normally master to and the third last id being the one from the branch . git-log does show it correctly though.. . Comment : These images seem to have disappeared . Any chance you still have them and could upload to imgur or insert directly into your question .. . Answer : If you have a github account you could try the Network https : github.com blog 39-say-hello-to-the-network-graph-visualizer view on there too .", "Question : I m porting an svn repo to git using svn2git from https : www.negativetwenty.net redmine projects show svn2git and since svn does not track merges I need to edit .git-info-grafts manually . For this I launch gitk search for the term Merge in commit messages verify that the merge commits have the right ancestry and populates .git-info-grafts acordingly . The issue I m having is that gitk seems to be confused with the master branch . It often shows master being forked from a branch and being merged into a branch afterword when actually it is the opposite . Why is it unable to understand that master should be as linear as possible and it s the branch that should be forked from it not the opposite Is it a gitk issue or is the history of the git-repo incomplete It seems git-log --pretty oneline --graph is able to show the correct behaviour so I m thinking it might be a gitk issue . I also tried giggle and qgit but both have their problem . I find giggle s tree hard to understand merges are horizontal for example while in qgit and gitk they are oblique.. . and qgit seems to not show some commits the commit creating the branch in svn is shown as a git-commit in both git-log --pretty oneline --graph and gitk but not in qgit nor giggle . Note that I use gitk --all in my tests . So my question is : -How can I force gitk to show master as linear as possible Ideally left justified with branches being forked from it not the opposite . git-log --pretty oneline --graph seems to be doing it the right way but what about gitk Thanks Edit : Screenshot links are dead . Previously said : .. . .. . I have uploaded screenshots of the different tools : git-log gitk giggle qgit .. . .. . See how git-log shows the branch being merged into trunk while gitk shows trunk being merged in branch . Giggle and qgit shows the right merge but they often drop some commits creating branches so it s really hard to manualy edit the .git-info-grafts file . Comment : Is your graft expressed as merge commit master parent branch parent That should specify which parent comes first . Comment : Yes it is . I made sure the second commit id is the id of the branch merging normally master to and the third last id being the one from the branch . git-log does show it correctly though.. . Comment : These images seem to have disappeared . Any chance you still have them and could upload to imgur or insert directly into your question .. . Answer : After playing with different GUI the behaviour really seems to be tool dependent . Saddly not many of them are configurable.. . I prefer having a tree view of what actually happened compared to an optimized view where everything fits.. . I have settled for gitg http : trac.novowork.com gitg . Seems relatively active and it does exactly what I expect from the history view . Master is the left most lane branches are forked from it and merged into it from the right . I feel it is consistent with my workflow . Also I can show inactive lanes so master is always shown and on the left-most side enable disable in preference window . A nice thing also is the Show history in topological order . When checked gitg will try to place commits on a branch together . When unchecked they will appear in chronological order . It can also do basic commits and staging . Only drawback I can find is the search : it seems I cannot enter an sha1sum and find the right commit . Maybe just a bug . About the original question can gitk be configured the way I want it I m still not sure it s possible . Probably a design decision.. .", "Question : What does index f2e4113..d4b9bfc 100644 mean in the output from git-diff Till now I have assumed that these SHA1 ID s are from version..to version but I can t find them in gitk . index f2e4113..d4b9bfc 100644 doesn t look like a part of diff unified format . http : en.wikipedia.org wiki Diff Unified format .. . .. . 100644 looks like a file mode but doesn t correspond to the mode of the README file 660 . f2e4113..d4b9bfc are SHA1 ID shorties . git rev-parse gives the long SHA1 . Here are all three shorties from the example above : .. . .. . But why doesn t ae1fdc1 correspond to first or second part of the diff And why can t I find d4b9bfc or d4b9bfc using gitk .. . Answer : edit : @wiswit has pointed to this http : www.git-tower.com learn git ebook command-line advanced-topics diffs good explanation . f2e4113 and d4b9bfc are file-indexes . With git show f2e4113 you see the file before the commit and git show d4b9bfc shows the file after the commit . The combined diff format is in the git-diff manual pages described . Comment : Now after understanding that it is a file index I see this index in gitk aswell . It is also possible to search for it by using the lower search field . Not the SHA1 ID field . Thanks . Comment : no problem : - When this is the answere please mark it as answer with a green sign . Thx Comment : The diff in the original question is not a combined diff just a regular git-style diff . The reason the mode is 100644 rather than 660 or 100660 is that git stores only one bit of file rwx modes specifically the x bit . The mode of a working copy is based on the stored bit plus the user s umask setting . The diff string is always just 100644 or 100755 for a regular file . Comment : Hi also see here an generally easy-following introduction : git-tower.com learn git ebook command-line advanced-topics http : www.git-tower.com learn git ebook command-line advanced-topics diffs", "Question : null .. . Answer : This post http : stackoverflow.com questions 5084528 what-is-the-format-of-regular-expressions-in-gitk mentioned regexp in gitk is based on pickaxe grep system . How could do search as case insensitive based on this I saw there is an -i option https : github.com git git-commit accccde483c3cfd55ef55037e8802ca0baaee5a1 for git but it appears cannot pass any extra option in the search-box in gitk .", "Question : I like to check my commits before I push them upstream so I always run a gitk I like a little visual before committing . I ve noticed though that it s much quicker to commit the code-first and then run gitk . Slower : .. . .. . 1 . with uncommitted changes .. . 2 . gitk .. . 3 . review uncommitted changes .. . .. . Quite a bit faster : haven t timed it but it seems instant as opposed to a few second lag .. . .. . 1 . git-commit .. . 2 . gitk .. . 3 . review last commit .. . 4 . Revert or amend as necessary . My understanding was the git basically runs a diff when it creates commits . So why does it take so much longer to diff the uncommitted code than to commit and review the last commit Comment : If you suspect the diff how long does git-diff take Comment : I ll try to time it when my repo is dirty : . I d say git-diff takes about 3 or 4 seconds Comment : What filesystem disk are you using How many files in the repository Comment : How many files in the repository -- Just for reference even diffing the Linux kernel source tree doesn t even take half a second for me . Comment : The repo is large but not that large . It has about 10 000 files and is just over 400mb . I have it checked out onto a virtualized copy of Windows 7 running on a Macbook pro . .. . Answer : My understanding was the git basically runs a diff when it creates commits . That at least is not true . When committing Git simply archives the current index precisely as it is . There are no diffs in a commit rather they are produced dynamically each time you actually view a commit . Therefore you also have the wrong idea in a way . When you view your last commit with gitk gitk actually runs git-diff to produce what you see so if you don t find that slow then git-diff simply isn t slow . : .. . .. . If producing a diff of the current working tree is slow then I suspect that s more of a problem with your filesystem than anything else . I ve never found it slow whatsoever and I even use NFS . So I must admit I don t quite understand how your filesystem could be much slower than that . Alternatively it might just bit gitk that is slow . I ve never used it much for reviewing the current state of the repository usually preferring git-status git-diff and or git-gui instead . I do use gitk but almost only to view the history and or historical commits . A couple of tips : .. . .. . Leave gitk running in the background rather than restarting it every time . Check if running git-diff itself is as slow as starting gitk . Just to be sure run a git-gc to optimize the repository . EDIT : Now that you ve mentioned that you run use Windows 7 it should be mentioned the Linus has quoted when commenting on the design of Git that he has made much use of his knowledge of the Linux kernel filesystem implementation for the speed of Git . The reason then for your slowness in comparing the working tree to the index may very well be that Windows 7 either has slower filesystem calls than Linux and or simply doesn t like the way Git uses the filesystem . This thread on the Git mailing list http : git.661346.n2.nabble.com git-status-takes-30-seconds-on-Windows-7-Why-td7580816.html seems to be the same problem you re having only worse . It has this quote among others : .. . .. . I think the simple reality is that Git was written with the assumption that stat is cheap and that isn t really the case on Windows where the filesystem cache doesn t seem to do that well with this . This answer on SO http : stackoverflow.com a 19430962 134252 mentions a patch for msysgit which dramatically improves performance on Windows .", "Question : Currently for merges without conflicts gitk shows no diffs . Is it possible to have the diffs resulting from a merge which are indeed there e.g . git-diff HEAD 1 after the merge shows these diffs shown by defautl e.g . using a command-line switch Or why does gitk by default not show them .. . Answer : By default gitk does the same thing as the --cc option to git-diff and compresses the merge to only show diff chunks that don t come directly from one or other parent . This is usually more helpful as conflicts are the interesting part of merges the other parts of the diff will already appear in the diffs for the commits that made up the branch which was merged in . The easiest way to view the full diff between a parent of a merge and the merge commit is to select the parent normal click and from the context menu on the merge commit right alternate click menu select Diff selected - this . Comment : +1 true but unfortunately I have to repeat this every time I look at a merge . I d prefer to somehow make this the default option", "Question : I have a Git repository with about a two years of history in it . I have single file in it for which I wish to find all the commits and for each commit : all the other files that were committed in it . Let s assume this file is named file.txt . I can run gitk with this file as argument : .. . .. . and I do get each commit . However browsing that tree in gitk only shows changes done to file.txt . I d like to see what other files were changed in that commit . I can copy-paste each commit SHA1 and display it but there are over hundred of commits related to this file . I notice that comments section in bottom-right part of screen is empty only shows text Comments . Maybe a list of files could be shown there Comment : For EOL else where see unix.stackexchange.com questions 10277 http : unix.stackexchange.com questions 10277 ignore-whitespaces-changes-in-all-git-commands .. . Answer : Another solution from the mailing list dated far back in 2008 http : marc.info l git m 122335116419147 : .. . .. . Try turning off the option Limit diffs to listed paths in the preferences menu or adding set limitdiffs 0 to your .gitk . Comment : this is the only solution working for me. . the .gitk is not working but changing in preferences works fine", "Question : in git I used gitk to see the hash of a commit that was made weeks ago and I used git-checkout with that hash to get my source files to that previous state . Now I want to go to a commit that is a few days later however gitk only shows commits up until the current one not later ones . Using git-log also shows only up until the current one . How can I list later commits Comment : Just checkout to the head then go back . .. . Answer : Is the commit you want to checkout in the ancestry of any of your branches In other words do any of your current branches include the changes made in the commit you re searching for If so git-log --all will show this commit in the log . Adding the --oneline and or --decorate flags might make this output easier to search through if all you re looking for is the commit-message : .. . .. . If your commit is not in the ancestry of any of your branches and therefore not shown with log --all then you have to search the git reflog . The reflog is essentially a history of all of the commits that your HEAD has pointed to . The HEAD points to a commit when you have those files currently checked out in your working directory . The format of the reflog is .. . .. . Where command is the command issued to point HEAD to this particular location and message is the message associated with this command . For commit s the message is the commit-message that you entered . Because of this very well structured format we can use grep to make the output easier to read through . For example if you know that you ve recently checked out the commit in question you can run : .. . .. . Or to only look through commits you can run : .. . .. . You can also use grep in many other ways depending on what you re searching for :", "Question : I want to compare 2 branches using gitk without the clutter of other branch histories . I can achieve this via the gui : View New view Branches tags : v0.8.x v0.9.x .. . I tried the following but it still shows all branches : gitk --branches v0.8.x v0.9.x .. . What is the correct syntax .. . Answer : gitk v0.8.x v0.9.x does it for me . However a closer look on the displayed branches shows me that there are actually not the given branches displayed . In addition all branches that point to a commit in the history of the two branches are also shown . So the command displays all branches that are specified including those branches that are direct ancestors of the ones specified . .. . .. . Edit : .. . .. . The --branches switch would be used if you want to see all branches that are for example named fix : .. . .. . would show you all branches that are matching the given shell glob . See also the docs of gitk http : git-scm.com docs gitk for a deeper explanation . Comment : Ah that s the desired result thank you . Do you know what the --branches option is for Comment : @robC : see updated answer .", "Question : I am introducing git to a team of developers and i find gitk to be an amazing tool . It s also quite hard to understand since understanding gitk requires an understanding of both git history and the viewer tool itself . Does anyone have any good references to something like a beginner s guide to git history with gitk Comment : gitolite.com gitk.html - the missing gitk documentation http : gitolite.com gitk.html .. . Answer : I ve never seen anything specifically for gitk . Here s a stab at it from a how does it work point of view . Knowing the commands that are behind everything or at least generally equivalent helps learn to use command-line tools more easily and also shows you where to look in documentation to understand gitk better File menu .. . .. . This has changed somewhat over the last few major versions - I m describing the current state . update and reload : This is probably the most confusing thing . Reload refreshes everything as-if you started the program over with the same configuration . This means if a branch has been removed rebased if some commits are now dangling you don t see them anymore . Update on the other hand refreshes all the information but still shows all commits that were previously shown . This is an excellent thing to use if you re rebasing and want to make sure you didn t mess up - you can see both the original and rebased versions . references : pretty obvious . References include tags and branches which may be remote . You can reread them and list to click a particular one to show it in the history . Views .. . .. . As the man page http : www.kernel.org pub software scm git docs gitk.html says gitk takes git-rev-list http : www.kernel.org pub software scm git docs git-rev-list.html options to help specify what history should be shown . These can also be set interactively in the view menu . The man page is an excellent place to find more information about the ways you can control views it s mostly in the commit limiting section . If you ve looked at git-log before you ll have seen a lot of this . Help .. . .. . There s a list of keybindings here Sweet . Context menu .. . .. . This presents several common git porcelain commands generally in a common default mode of operation . Listing them will at least help you find the right documentation to understand what they do if you don t already git-diff http : www.kernel.org pub software scm git docs git-diff.html Diff this - selected .. . git-format-patch http : www.kernel.org pub software scm git docs git-format-patch.html make patch .. . git-tag http : www.kernel.org pub software scm git docs git-tag.html create tag .. . git-diff-tree http : www.kernel.org pub software scm git docs git-diff-tree.html write commit to file rarely used .. . git-branch http : www.kernel.org pub software scm git docs git-branch.html .. . git-cherry-pick http : www.kernel.org pub software scm git docs git-cherry-pick.html .. . git-reset http : www.kernel.org pub software scm git docs git-reset.html reset branch to here This prompts you for soft mixed or hard with a brief reminder of what each does . Longer description on the man page but of course you have to understand the concept of the index to really get it . The mark a commit and related commands should be self-explanatory at this point . In the context menu for a branch we have git-checkout http : www.kernel.org pub software scm git docs git-checkout.html and the -d delete mode of git-branch . Middle section .. . .. . SHA1 ID : the hash of the current commit . Very useful for copy-paste into a terminal to perform an action on a given commit you used gitk to find . You can also paste hashes into here . Forward back buttons row number.. . obvious Find The options here are again pretty self-explanatory but for everyone s education they re analogous to git-log http : www.kernel.org pub software scm git docs git-log.html parameters : containing is --grep touching paths is the arguments and adding removing string is -S pickaxe . Message diff pane .. . .. . Here we have the commit-message along with git-diff s output - this is something like using git-log -p with a little extra : .. . .. . Branches is equivalent to git-branch -a --contains commit .. . .. . Precedes Follows is equivalent to git describe --contains commit git-describe http : www.kernel.org pub software scm git docs git-describe.html Comment : Fair enough for gitk menu commands +1 for that . You re doing well on the gitk part but I was really hoping for some explanation of the combination of gitk and history . Comment : I would like to make this a better answer I guess I m not too clear on what you mean by explanation of git history . Is it the concept of branching-and-merging that needs explaining The fact that commits depend directly on the previous commit through their hash It seems that once you literally see the history on the screen there s not a whole lot to explain . Comment : I m sorry maybe I m obtuse but I don t understand how to just git-commit -a or even git-add in gitk . Is there something I m missing Comment : @ubershmekel gitk doesn t do either of those things if you want a gui for them the built-in one is git-gui . This question is just about gitk though and gitk is essentially a history browsing tool with a bit of branch manipulation .", "Question : I am using the command-line version of Git and gitk . I want to see the full version tree not just the part that is reachable from the currently checked out version . Is it possible .. . Answer : if you happen to not have a graphical interface available you can also print out the commit graph on the command-line : .. . .. . if this command complains with an invalid option --oneline use : Comment : That is truly beautiful . GUIs are for wimps - Comment : who needs gitk when we have gitl alias gitl git-log --oneline --graph --decorate --all Comment : alias gl git-log --oneline --graph --decorate --all . Why type more than needed", "Question : I m porting an svn repo to git using svn2git from https : www.negativetwenty.net redmine projects show svn2git and since svn does not track merges I need to edit .git-info-grafts manually . For this I launch gitk search for the term Merge in commit messages verify that the merge commits have the right ancestry and populates .git-info-grafts acordingly . The issue I m having is that gitk seems to be confused with the master branch . It often shows master being forked from a branch and being merged into a branch afterword when actually it is the opposite . Why is it unable to understand that master should be as linear as possible and it s the branch that should be forked from it not the opposite Is it a gitk issue or is the history of the git-repo incomplete It seems git-log --pretty oneline --graph is able to show the correct behaviour so I m thinking it might be a gitk issue . I also tried giggle and qgit but both have their problem . I find giggle s tree hard to understand merges are horizontal for example while in qgit and gitk they are oblique.. . and qgit seems to not show some commits the commit creating the branch in svn is shown as a git-commit in both git-log --pretty oneline --graph and gitk but not in qgit nor giggle . Note that I use gitk --all in my tests . So my question is : -How can I force gitk to show master as linear as possible Ideally left justified with branches being forked from it not the opposite . git-log --pretty oneline --graph seems to be doing it the right way but what about gitk Thanks Edit : Screenshot links are dead . Previously said : .. . .. . I have uploaded screenshots of the different tools : git-log gitk giggle qgit .. . .. . See how git-log shows the branch being merged into trunk while gitk shows trunk being merged in branch . Giggle and qgit shows the right merge but they often drop some commits creating branches so it s really hard to manualy edit the .git-info-grafts file . Comment : Is your graft expressed as merge commit master parent branch parent That should specify which parent comes first . Comment : Yes it is . I made sure the second commit id is the id of the branch merging normally master to and the third last id being the one from the branch . git-log does show it correctly though.. . Comment : These images seem to have disappeared . Any chance you still have them and could upload to imgur or insert directly into your question .. . Answer : See how git-log shows the branch being merged into trunk while gitk shows trunk being merged in branch . That is because gitk freely reorders parents as do many other tools . The leftmost parent is not always the 1st parent . Often tools put the parents whereever there is space . It ultimately provides for a more packed view . Compare : .. . .. . http : i53.tinypic.com 29lfyti.png - git-log makes master wind around the nucrypt2 branch so that the X th X 2 parent is always right of the merge .. . http : i52.tinypic.com sc7r5v.png - git-forest default .. . http : i51.tinypic.com 28iatjd.png - same with merge shortcut seeking disabled .. . .. . I find git-log s graphing not very ergonomic - it takes more blank lines . Comment : After playing with different GUI the behaviour really seems to be tool dependent . Comment : Actually I use git-log --pretty oneline --graph in an alias so it s more ergonomic . I still prefer to see a branch being merged in master when I actually merged a branch in master instead of master being merged into a branch . Merging into both direction is valid so why confuse things in the display I ll take a look at git-forest . Thanx Comment : One could argue that reading the commit-message merged X into Y should provide the necessary info - Furthermore since git does not keep track which branch by name is an ancestor of another 2 bretheren commits sharing the same parent have the same rank so the concept of branch relationships is more diffuse . Some ideas about the case.. . Comment : an improvement to the line coloring might help basically keep the same color as the first parent although there are some edge cases to deal with Comment : These images seem to have disappeared . Any chance you still have them and could upload to imgur or insert directly into your answer", "Question : I used svn2git to migrate a svn project with branches . The branches show up in gitk but the graph does not show the branches merge back in . Check in comments indicate where the merges happened . Is there a way to manipulate the history such that the gitk graph shows the branches merging back into the master Comment : have a look at git filter-branch --parent-filter .. . Answer : Ran into this as well while working on converting some projects to git . I found this blog post http : agavi.tumblr.com post 16865375185 fixing-svn-merge-history-in-git-repositories that helped me work out how to use a grafts file and then git filter-branch to rewrite the git history and make the changes permanent . It is a bit of manual work to find all the commit hashes and tie them together right but does achieve the desired results .", "Question : I have searched twice now and explored heavily and I concede . I can t find a working answer to a simple dang problem : .. . .. . Problem .. . .. . gitk comments on my Mac are not word wrapped and overflow off the screen .. . .. . Example Illustration .. . .. . The bottom left window has the commit-message overflow out the window On add nscoding : this.. . .. . .. . enter image description here http : i.stack.imgur.com i1pLO.png .. . .. . Question .. . .. . How do you enable word-wrap in the commit description comment window on a Mac Potential Solution .. . .. . wrapcomment is described of .gitk here - http : marc.info l git m 114770603010712 w 2 http : marc.info l git m 114770603010712 w 2 . But I could not find where this is .. . Answer : wrapcomment is described of .gitk here - http : marc.info l git m 114770603010712 w 2 http : marc.info l git m 114770603010712 w 2 . But I could not find where this is Find your gitk configuration file . On Linux it can be at .config git gitk or .gitk . On Windows it s at USERPROFILE .gitk . I m not sure where it would be on OS X but probably along those lines . This is a regular text file . There change the line that starts with set wrapcomment to be set wrapcomment word . Save the file restart gitk and it should now word-wrap commit messages .", "Question : In tig I find it often hard to find out which commit belongs-to which branch . In gitk this is much more easier . I think this is because of two things . Firstly gitk colors the branches differently I mean the lines between commits and secondly it seems that the commits are sometimes place in a different columns see pictures btw git-log --graph draws branches like tig . Is there a way to color the blue stars or the pink lines drawn for each branch Gitk http : i.stack.imgur.com KmRlg.png .. . .. . Tig http : i.stack.imgur.com EizQW.png .. . Answer : Yes tig shows the branch lines with different colors since version 2.0 . Due to limitations in how lines can be drawn using text a commit graph rendered in tig is often less compact than gitk . Compared to tig gitk also uses other ways to reduce the horizontal width of the commit graph such as simply hiding branch lines in parts of the graph when they have no commits . The color of the commit nodes can be configured in tigrc by setting the graph-commit color . Example : .. . .. . example of colored commit graph http : i.stack.imgur.com 3IMmT.png Comment : Yes looks great I actually meant that the commit node color would be different foreach branch as far as possible . tig2.0 for the win Do you know why the columns are different compared to gitk Comment : Tig uses a different drawing algorithm and I think that gitk uses --topo-order by default where tig uses the same order as git-log .", "Question : I m learning about git and is using gitk to visualize my history and branches . I tried gitk on a locally initialized repo and it is able to show both branches that I made properly . However when I tried to launch gitk to visualize a repo obtained using git-clone gitk only shows one of the branches . .. . .. . This is what happen : .. . .. . After I did a git-clone I can see 1 branch locally : .. . .. . So I did git-checkout -b master origin master to create my local tracking branch now : .. . .. . Now I thought I m having 2 local branches so I happily launch gitk however I can only see one branch : .. . .. . gitk not showing local branch http : i.stack.imgur.com h9Ige.png .. . .. . I know of a way to view the hidden master branch by doing gitk --all : .. . .. . gitk only show other local branch when use with --all http : i.stack.imgur.com u8Hhv.png .. . .. . But now I m really curious why is gitk not showing the local master branch that I m having here does anyone have any idea Thanks .. . Answer : Gitk by default only shows you the branch you are on . It seems that when you launched gitk your current branch was experiment . Therefore gitk only showed you commits that lie on the experiment branch . This is the way gitk behaves by default because once you have a lot of branches the branch names can actually be quite distracting . gitk --all tells gitk to show all branches . At that point gitk showed you the master . You can create all kinds of views in gitk and you can launch it to use a pre-defined view . Checkout the Edit View menu entry . Comment : I guess gitk is launched with different view parameters in the 2 different places I m launching it . Thanks for pointing out that I can change the pre-defined view in Edit View menu I can tune to what I wanted to see easily now . Comment : Is there a way of making the default behaviour of gitk Comment : Its been a long time since I used gitk . You could make a git-alias that launched gitk with the --all parameter . Comment : I have hist gitk --all in the alias part of my .gitconfig . Typing git hist in my prompt runs gitk --all .", "Question : null .. . Answer : In Windows it is sometimes faster to check changes in files with graphical Git Commit Tool or Git History tool . These tools can be opened by right clicking on specific files that are in a git repository displaying these shortcuts in context menu can be enabled when installing git from windows . The problem I am experiencing is that opening Git History from context menu results in an error message Cannot find a git repository here . .. . .. . This obviously is a problem however : .. . .. . Opening Git Commit Tool by right clicking Git Commit Tool in context menu works fine . Running gitk file.txt from MinGW works fine . The installation pretty much uses the default settings so I am not sure what could be the problem .", "Question : This is on Ubuntu 14.04 git version 1.9.1 same for gitk . I m doing this : .. . .. . So far so good - but if I run gitk --all . in this directory then the commit of current HEAD is not indicated in the gitk display This is what I get : .. . .. . gitk http : i.stack.imgur.com w3KtN.png .. . .. . This is the weird thing : the only commit containing the word OSX shown in gitk which I ve selected manually : .. . .. . has the hash 801877c48390324dc7d600936306cd7c00486dcc unlike what git-log shows for current head 14360ed8fd3428aa0a2e052f6363e5daa0bf0d75 .. . The 14360ed8 is the merge pull request by one committer the 801877c the pull request by another committer for the same patch commit Fixed OSX libs and example .. . The 14360ed8 is not listed in any commit of gitk .. . There is no yellow dot to indicate HEAD nor a master branch label anywhere in gitk and certainly not next to 801877c . So why doesn t gitk in this case show the HEAD and the 14360ed8 commit I have tried doing : .. . .. . .. . but it seems to make no difference in terms of display in gitk .. . How can I get the proper display of HEAD and the master branch in this case .. . .. . EDIT : So I installed gitg Version 0.2.7 and it seems to make more sense visualisation-wise : .. . .. . gitg http : i.stack.imgur.com dowu5.png .. . .. . So is this a bug in gitk or does gitk need some special setup say command-line switches to show this state of the repository .. . Answer : 1 . gitk --all without path specification gives the expected result exactly as gitg .. . 2 . It seems that gitk some path completely ignores --all switch and displays the first commit which modifies a given file and doesn t collect any references . So again I wouldn t call it a bug just a hmm way it s implemented . Also I should mention that specifying a file in the command-line for gitk is a unusual thing for me . Comment : Many thanks @user3159253 - indeed without the dot for current directory gitk --all shows the yellow dots for HEAD etc . Re : specifying a file in the command-line for gitk is a unusual thing - if you mean my inclusion of the current dir dot as in gitk --all . I simply saw it somewhere on this site when I looked up why I cannot see all branches in gitk and I had remembered it verbatim . Cheers", "Question : null .. . Answer : When I use gitk without any further arguments it doesn t show any commit tree see image http : i.imgur.com uwHjPp4.png 1 . Is there a way to show the commit tree I am using Debian jessie git and tk are the only listed dependencies git version is 2.1.4 . Comment : Could you add a screenshot please Also what version of git are you using Comment : You call gitk inside your Git repository right Does git-log show you what you expect Comment : Yes I call gitk inside the repository git-log shows the correct history moreover using the up and down arrow keys in the gitk interface makes me navigate the correct history . This was tested on multiple repositories .", "Question : I am introducing git to a team of developers and i find gitk to be an amazing tool . It s also quite hard to understand since understanding gitk requires an understanding of both git history and the viewer tool itself . Does anyone have any good references to something like a beginner s guide to git history with gitk Comment : gitolite.com gitk.html - the missing gitk documentation http : gitolite.com gitk.html .. . Answer : The only thing I find useful about the gitk interface is the nice colorful branches overview. . If you want a gui for git check TortoiseGit on windows or GitX on Mac or QGit on linux . Comment : I think this is a bit of a hasty judgment . Sure the actions builder is cool but a lot of that built-in stuff in the gitk context menu is missing . gitk provides a very easy way to manipulate branches with visual feedback which is particularly useful for new users . Comment : I kinda like the cli more but sometimes I invoke gitk just to see the branches and merges . I wouldn t recommend the gitk interface for new users. . Probably scare them off Comment : Strangely enough I think that both of you are right . Comment : Thanks for the recommendation of GitX ." ] }
[ "yes-answer-long", "yes-answer-short" ]
version-control
UNK_RELATION
osqa@django@110
osqa -- osqa open-source question and answer is an open-source question-answer system written in python with @placeholder .
{ "confidence": [ 61.677589416503906, 54.73953628540039, 49.21717071533203, 47.65779495239258, 46.54395294189453, 45.894859313964844, 45.75146484375, 45.511314392089844, 45.40335464477539, 45.24226760864258, 45.0064582824707, 44.757572174072266, 44.757572174072266, 44.00262451171875, 43.5272216796875, 43.5272216796875, 43.397705078125, 42.90202331542969, 42.90202331542969, 42.75186538696289, 42.29256057739258, 42.29256057739258, 42.26716995239258, 41.634765625, 41.634765625, 41.35211944580078, 41.35211944580078, 41.35211944580078, 41.08958053588867, 40.97462463378906, 40.58506774902344, 40.58506774902344, 40.58506774902344, 40.58506774902344, 40.58506774902344, 40.32012176513672, 40.32012176513672, 40.32012176513672, 40.32012176513672, 40.219356536865234, 40.10392761230469, 40.03455352783203, 40.03455352783203, 40.03455352783203, 39.57731628417969, 39.57731628417969, 39.483001708984375, 39.41213607788086, 39.267127990722656, 39.267127990722656, 39.267127990722656, 39.267127990722656, 39.267127990722656, 39.267127990722656, 39.267127990722656, 38.444557189941406, 38.134368896484375, 38.094661712646484, 38.094661712646484, 37.77550506591797, 37.77550506591797, 37.76752471923828, 37.76752471923828, 36.77672576904297, 36.77672576904297, 36.77672576904297, 36.77672576904297, 36.322349548339844, 36.11210250854492, 36.11210250854492, 36.11210250854492, 36.11210250854492, 36.11210250854492, 36.07108688354492, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.06003189086914, 36.000179290771484, 35.28510284423828, 35.1650276184082, 34.92727279663086 ], "content": [ "Hi OSQA is the free open-source Q A system which runs on django", "I am planning to start a question answer website using osqa question answer script .", "Step 1 : install related python modules .. . .. . Step 2 : Create a database for OSQA .. . .. . Step 3 : Configure OSQA .. . .. . i .", "OSQA seems dead .", "I m developing a web based program in which I want to use osqa as a question and answer module .", "I m using OSQA Bitnami edition .", "What is osqa", "Can anyone help me to publish OSQA application https : github.com OSQA osqa to windows azure", "I am the admin of a OSQA system which is cool and great by the way .", "I use Python and Django like OSQA .", "I want to install OSQA on a local Windows system .", "seems osqa-heroku.herokuapp.com http : osqa-heroku.herokuapp.com also not working. .", "For instance on windows it is installed by default on C : Bitnami osqa apps osqa htdocs .", "http : meta.osqa.net question 121 installing-osqa-on-windows-2008-server-with-iis7", "I want to install osqa on Apache server .", "The documentation referred by the OSQA is the one of answerhub but there are differences in interface .", "https : github.com 8c1 OSQA", "I am trying to mod OSQA https : github.com OSQA osqa to not use questions anywhere in URLs and change it to some other string say thisinstead .", "OSQA is available for easy install to desktop VM or Cloud via Bitnami stack : bitnami.com stack osqa https : bitnami.com stack osqa", "I am a beginner in Python Django and OSQA .. . .. . 1 .", "the easiest way I found is to deploy to the EC2 Cloud using Turnkey Linux OSQA Virtual Appliance http : www.turnkeylinux.org osqa .", "show the relevant code from home mm osqa osqa-server forum markdownext mdx settingsparser.py in init line 13", "1 For the main admin page of OSQA : http : localhost : 8080 osqa admin .. . .. .", "As such there will be no shared data between the OSQA instances .", "It s located in osqa log django.osqa.log .", "I would like to integrate Python-social-auth to OSQA .", "The installation of osqa django and python went smoothly but rosetta just doesnt want .", "Two python-based platforms that I m aware of are OSQA and AskBot .", "I didn t do this step but you probably need to if building a new db sudo python manage.py syncdb --all .. . .. . sudo python manage.py migrate forum --fake .. . .. . sudo useradd osqa .. . .. . sudo chown -R osqa : www-data var www osqa .. . .. . sudo chmod -R g+w var www osqa forum upfiles .. . .. . sudo chmod -R g+w var www osqa log .. . .. . sudo service apache2 restart", "Go here https : wiki.webfaction.com wiki InstallScripts OSQA .", "I have taken a look at the Bitnami OSQA stack http : bitnami.org stack osqa and this may be the simplest solution .", "For more info on customization look at section D in https : github.com OSQA osqa blob master INSTALL", "My OSQA installation is in C : inetpub wwwroot osqa osqa.community.site the dir name has periods in it .", "Download http : svn.osqa.net svnroot osqa trunk to a folder OSQA ROOT eg c : osqa .. . .. . 2 .", "Today we have also released the full BitNami OSQA Stack http : bitnami.org stack osqa .", "Please tell me simple but detailed steps to install osqa on Apache server .", "Step 4 : Configure apache .. . .. . Create a configure file for OSQA say osqa.conf .", "Keep in mind that version django for OSQA need to be very old 1.3 .", "So how can I delete tags from osqa", "I try to localize OSQA django + python for russian language .", "Looking at OSQA source code most recently updated questions string is defined for translation in sort tabs.html http : svn.osqa.net svnroot osqa trunk forum skins default templates question list sort tabs.html template and it is included in django.po http : svn.osqa.net svnroot osqa trunk locale en LC MESSAGES django.po line 5466 .", "I have never seen osqa source but i think if they use reverse it could be as trivial as changing the urls.py entry", "I took a very quick glance at the OSQA source code and all of their urls are translated .", "If that is not the case please use following command in OSQA source directory to find files which includes missing translation string :", "I have installed OSQA following the instructions here : https : github.com openshift-quickstart OSQA-openshift-quickstart The installation worked and I can access and modify my OSQA settings via the admin web interface with no problems .", "Just a quick update to let you know we released a OSQA BitNami stack bitnami.org stack osqa http : bitnami.org stack osqa so no need to install manually :", "How to install osqa on linux based web-hosting is there any easiest way to install osqa on a linux based shared-hosting account", "It gives me back a 404 with this URL 127.0.0.1 : 8080 osqa osqa account facebook done code http : 127.0.0.1 : 8080 osqa osqa account facebook done code I delete one occurence of osqa and works well .", "I think this could benefit the community of osqa users", "I installed OSQA Bitnami on my VPS .", "Now I am hacking at the osqa code base .", "Then I came back to osqa it asks for a username and password .", "Sorry I have no clue about OSQA", "Does OSQA provide any OAuth OpenId mechanism", "I host a OSQA website on AWS EC2 .", "When users are asked to introduce their email and password Facebook will redirect to my website but the address is wrong : .. . .. . mywebsite.com osqa osqa account facebook done.. . .. . .. . As you can see osqa appears twice when it should be there only once .", "I have a markdown problem with OSQA and flatpages in admin .", "Here https : github.com OSQA osqa blob master HOW TO DEBUG it says that under Apache this problem might be related to Alias settings .", "I installed OSQA it works fine .. . .. . with bitnami distribution on my computer windows XP http : bitnami.com stack osqa .. . .. . 2 .", "Please check this very simple guide : Installing OSQA on Windows with IIS in production http : www.helicontech.com articles installing-osqa-on-windows-in-production", "Looks like OSQA is more promising rather than askbot but the last version of OSQA is beta3 1.0 published at 2011 when the latest askbot is 2013 .", "Add the OSQA app that you just created to your site .", "OSQA does not provide a hottest questions rss feed by default .", "OSQA http : www.osqa.net seems to be the best option available .", "I have a problem in OSQA http : osqa.net .", "I host osqa to AWS EC2 Ubuntu .", "There is an incompatibility issue in OSQA with the new versions of markdown .", "I ve downloaded the source code from the OSQA site and read the installation instructions it requires django 1.1.1 but I can t make it work .", "How can I run php service along with OSQA Bitnami it s python stack", "i have run the server through python osqa manage.py runserver but still localhost does not show anything pls help", "Hi Mark for step 7 i meant running python osqa manage.py syncdb under bitnami django stack project .", "The latest version released today also includes the dependencies required for OSQA markdown2 html2lib and also South python-openid and ElementTree .", "I have django 1.2.4 Python 2.6.6 and latest osqa july2012 installed on bluehost .", "Other reqource include wiki.osqa.net display docs Installing+OSQA+on+WebFaction http : wiki.osqa.net display docs Installing+OSQA+on+WebFaction which can help set wsgi files .", "I m trying to setup a Django site OSQA and can t get it working .", "I ve downloaded the latest dev code of OSQA and re-installed it .", "A couple users complained that they couldn t get to their authentication settings page on OSQA .", "it s in osqa forum views auth.py it s in your traceback .", "I installed OSQA using the bitnami installer and everything worked fine .", "Note that this is applicable only for OSQA using the bitnami environment with postgresql database .", "I deployed a Q A site using OSQA http : osqa.net .", "google osqa redirects me to google to confirm my email-address .", "I am using virtual-machine with Ubuntu and Bitnami OSQA stack .", "I have installed OSQA with the Bitnami Mac Installer my dev stack .", "osqa log can get you more information abouth the bug .", "I have a problem when I deploy OSQA to heroku .", "I downgrade the version of Markdown to 2.4.1 and OSQA works fine", "Yes but I don t know the way to integrate with the user account in OSQA", "app-root runtime repo wsgi osqa Thank you", "I ve been trying to reach to OSQA pages to modify them .", "I have just tried integrating OSQA with the latest version of Bitnami .", "I would like to translate the osqa app works fine using rosetta .", "Another thing is that askbot is an application not necessarily a dedicated site but can be unlike osqa .", "OSQA does have a wider user base and an active support community .", "If you want something simple you could use bitnami stack http : bitnami.com stack osqa", "You could try fix it or as a dirty workaround hardcode your redirect uri there As you re APP URL contains only one osqa there is probably a osqa to much in request.path .", "First you need to get Django going .. . .. . then check the other requirements .. . .. . http : meta.osqa.net questions 11025 server-requirements-to-run-osqa .. . .. . I ll tell you to ask this question at that forum but it looks pretty much dead already", "OSQA looks really good and seems to be exactly what I am looking for ." ] }
{ "confidence": [ 71.82339477539062, 70.8449935913086, 70.8449935913086, 66.54409790039062, 65.9301528930664, 65.8173828125, 60.26295471191406, 59.96616744995117, 59.781707763671875, 59.377525329589844, 58.473045349121094, 57.87359619140625, 57.755126953125, 57.09354782104492, 56.12974548339844, 55.287330627441406, 54.89173126220703, 54.31229019165039, 54.255653381347656, 53.75571823120117 ], "content": [ "Question : I want to install OSQA on a local Windows system . I ve downloaded bitnami-djangostack-1.1.1-2-windows-installer.exe which has django python mysql and apache built-in . I ve run a django example given on the django website and it s working fine . But I m confused how to install OSAQ . I ve downloaded the source code from the OSQA site and read the installation instructions it requires django 1.1.1 but I can t make it work . Comment : What is osqa What about the installation instructions is not working for you Comment : Hi OSQA is the free open-source Q A system which runs on django .. . Answer : Please check this very simple guide : Installing OSQA on Windows with IIS in production http : www.helicontech.com articles installing-osqa-on-windows-in-production Comment : Worked nicely . TY", "Question : I want to install OSQA on a local Windows system . I ve downloaded bitnami-djangostack-1.1.1-2-windows-installer.exe which has django python mysql and apache built-in . I ve run a django example given on the django website and it s working fine . But I m confused how to install OSAQ . I ve downloaded the source code from the OSQA site and read the installation instructions it requires django 1.1.1 but I can t make it work . Comment : What is osqa What about the installation instructions is not working for you Comment : Hi OSQA is the free open-source Q A system which runs on django .. . Answer : You can download a Windows installer here : .. . .. . http : bitnami.org stack osqa .. . .. . Just tried it and it works great the installer prompts for the information it needs and at the end it will launch the site and it all just works 10 10", "Question : I want to install OSQA on a local Windows system . I ve downloaded bitnami-djangostack-1.1.1-2-windows-installer.exe which has django python mysql and apache built-in . I ve run a django example given on the django website and it s working fine . But I m confused how to install OSAQ . I ve downloaded the source code from the OSQA site and read the installation instructions it requires django 1.1.1 but I can t make it work . Comment : What is osqa What about the installation instructions is not working for you Comment : Hi OSQA is the free open-source Q A system which runs on django .. . Answer : http : meta.osqa.net question 121 installing-osqa-on-windows-2008-server-with-iis7 Comment : See also : wiki.osqa.net display docs http : wiki.osqa.net display docs Setting+up+a+development+environment+on+Windows", "Question : I want to install OSQA on a local Windows system . I ve downloaded bitnami-djangostack-1.1.1-2-windows-installer.exe which has django python mysql and apache built-in . I ve run a django example given on the django website and it s working fine . But I m confused how to install OSAQ . I ve downloaded the source code from the OSQA site and read the installation instructions it requires django 1.1.1 but I can t make it work . Comment : What is osqa What about the installation instructions is not working for you Comment : Hi OSQA is the free open-source Q A system which runs on django .. . Answer : As Sigma0 mentioned mod-python is deprecated . Since version 1.2.3-0 the BitNami DjangoStack http : bitnami.org stack djangostack includes mod wgsi . The latest version released today also includes the dependencies required for OSQA markdown2 html2lib and also South python-openid and ElementTree . Today we have also released the full BitNami OSQA Stack http : bitnami.org stack osqa . It is configured with PostgreSQL for getting all the benefits of the full-text-search that PostgreSQL provides . The stack includes Python 2.6 Apache with mod wgsi PosgreSQL 9.04 Django 1.3 and OSQA Fantasy Island 0.9 . beta 3 latest release . After working on integrating OSQA in the BitNami Library http : bitnami.org stacks I have a few comments on the steps provided in previous answers when installing on OSQA on top of BitNami Django Stack . For security reasons it is recommended that each application use his own database and database user for accessing the database . That user should only have access to the application database . Click in the Use DjangoStack shortcut in the Windows Start Menu to open a windows console . On Windows Vista and above you will need to click it with the right mouse button and click in Run as Administrator . DJANGOSTACK mysql bin mysql -u root -pbitnami -e create database osqa .. . .. . DJANGOSTACK mysql bin mysql -u root -pbitnami -e grant all privileges on osqa . to osqa user @ localhost identify by osqa user password .. . .. . NOTE : it is also a good practice to change the default password for the root user : .. . .. . If you are using BitNami DjangoStack 1.3-1 or above you don t need to install any python dependency . If you are using an older version you can execute the following from the command-prompt : .. . .. . DJANGOSTACK python Scripts easy install.exe install South Markdown html5lib python-openid ElementTree . Once you have created that database and user and download the code you need to modify the setting local.py . Notice that you will also need to set the right value in the APP URL setting in that file . The default on Windows when using the BitNami DjangoStack would be APP URL http : 127.0.0.1 .. . .. . We recommend to keep the application apache configuration in a separate file . If OSQA ROOT is the folder where the OSQA file exist I recomend to create OSQA ROOT conf and OSQA ROOT scripts folders . Copy osqa.wgsi.dist in OSQA ROOT scripts osqa.wgsi and substitute the path to dir above and path to dir above osqa with the right value . Create OSQA ROOT conf osqa.conf file this will be the apache configuration file . The file should be similar to the below : .. . .. . .. . .. . WSGIScriptAlias OSQA ROOT scripts osqa.wsgi .. . .. . .. . .. . In DJANGOSTACK apache2 conf httpd.conf add the following line at the end : .. . .. . Now you can run DJANGOSTACK python python.exe manage.py syncdb --no-input in the console and once you restart the services everything should be ready .", "Question : I want to install OSQA on a local Windows system . I ve downloaded bitnami-djangostack-1.1.1-2-windows-installer.exe which has django python mysql and apache built-in . I ve run a django example given on the django website and it s working fine . But I m confused how to install OSAQ . I ve downloaded the source code from the OSQA site and read the installation instructions it requires django 1.1.1 but I can t make it work . Comment : What is osqa What about the installation instructions is not working for you Comment : Hi OSQA is the free open-source Q A system which runs on django .. . Answer : I have just tried integrating OSQA with the latest version of Bitnami . Because mod python.so is no longer included I couldn t get step 4 as outlined by YOU above to work . Instead follow the Basic Configuration instructions from the Django documentation here https : docs.djangoproject.com en 1.2 howto deployment modwsgi to set up OSQA on Apache with mod-wsgi instead . As stated here http : blog.dscpl.com.au 2010 06 modpython-project-is-now-officially.html the mod-python project is dead so it would be worth switching to mod-wsgi anyway . For the remainder of the setup following the steps outlined by YOU should work fine . Comment : Just a quick update to let you know we released a OSQA BitNami stack bitnami.org stack osqa http : bitnami.org stack osqa so no need to install manually :", "Question : I want to install OSQA on a local Windows system . I ve downloaded bitnami-djangostack-1.1.1-2-windows-installer.exe which has django python mysql and apache built-in . I ve run a django example given on the django website and it s working fine . But I m confused how to install OSAQ . I ve downloaded the source code from the OSQA site and read the installation instructions it requires django 1.1.1 but I can t make it work . Comment : What is osqa What about the installation instructions is not working for you Comment : Hi OSQA is the free open-source Q A system which runs on django .. . Answer : 1 . Download http : svn.osqa.net svnroot osqa trunk to a folder OSQA ROOT eg c : osqa .. . .. . 2 . Rename OSQA ROOT settings local.py.dist to OSQA ROOT settings local.py .. . .. . 3 . set following in OSQA ROOT settings local.py .. . .. . DATABASE NAME osqa Or path to database file if using sqlite3 . DATABASE USER root Not used with sqlite3 . DATABASE PASSWORD PASSWD Not used with sqlite3 . put bitnami here .. . DATABASE ENGINE mysql mysql etc .. . .. . .. . Default MySQL credentials in bitnami are : -u root -p bitnami .. . .. . .. . 4 . add following DJANGOSTACK apps django conf django.conf means root folder like http : localhost .. . .. . location .. . SetHandler python-program .. . PythonHandler django.core.handlers.modpython .. . PythonPath OSQA ROOT + sys.path .. . SetEnv DJANGO SETTINGS MODULE osqa.settings .. . PythonDebug On .. . location .. . .. . .. . 5 . instasll markdown2 and html5lib with easy install.exe which is inside DJANGOSTACK python Scripts .. . .. . easy install markdown2 .. . easy install html5lib .. . .. . .. . 6 . create new db called osqa with mysqladmin.exe which is in DJANGOSTACK mysql bin .. . .. . mysqladmin create osqa .. . .. . .. . 7 . syncdb .. . .. . DJANGOSTACK python python.exe manage.py syncdb .. . .. . .. . manage.py is in apps django django conf project template as of 5 8 11 .. . You must update settings.py with mysql root and bitnami pw and osqa as db name .. . .. . .. . 8 . enjoy alt text http : img87.imageshack.us img87 723 osqabitnamidjangostack.png .. . .. . Note : .. . .. . OSQA ROOT osqa trunk directory .. . DJANGOSTACK BitNami DjangoStack install directory Comment : Hi mark thanks for replying but for step no 5 6 i have to execute the command through command-prompt for step 7 i have to execute through osqa root i have run the server through python osqa manage.py runserver but still localhost does not show anything pls help Comment : Pankaj Khurana Yeah 5 6 need to run through command-prompt . step 7 does not need to be inside osqa root folder but need to run manage.py syncdb under that . Comment : Hi Mark for step 7 i meant running python osqa manage.py syncdb under bitnami django stack project . When i started the server python osqa manage.py runserver and typed localhost : 8000 http : localhost : 8000 in the browser its working now . Thanks for your help . Why is the url localhost : 8000 http : localhost : 8000 instead of just localhost http : localhost Can you please help me figure out Comment : @Pankaj Khurana you could just run python osqa manage.py runserver 80 for just http : localhost instead of default port 8000 . Btw manage.py runserver is running on built-in web server you don t need apache and mod-python and its settings in step 4 for that case . Comment : Hi mark thanks for the reply.Now i want to install osqa on a site hosted on host gator . Can you please tell me these steps will remain same or change as hosting company told us that python and django are pre configured but you have to put them in cgi-bin folder . Thanks", "Question : null .. . Answer : I m using OSQA Bitnami edition . The documentation referred by the OSQA is the one of answerhub but there are differences in interface . Particularly in the part related with who to manage tags . I have added some test tags and I would like to delete them but I can find any documentation source about how to make this . So how can I delete tags from osqa Thanks Comment : Well after seeing the current situation of OSQA regarding development and seeing all efforts directed towards AnswerHub I have decided to switch to Question2Answer . Worked in Spanish in minutes .", "Question : I am going to choose a platform to develop a Q A site . Two python-based platforms that I m aware of are OSQA and AskBot . I know that both are based on django which I m quite familiar with and OSQA has a wider user-base . But that s pretty much that I know so far . So I would love to hear unbiased comparisons and reasons on why should I choose one instead of another or whether there are still better options . Thanks .. . Answer : OSQA does have a wider user base and an active support community . In lots of ways there s not a lot of choice between them - either way you can run them off-the-shelf or you can tweak them as they re both open-source . And to tweak either of them you ll need to get your head around Django . If you don t know Django already it may not be worth learning some people including me think that it s a yesterday s framework - which means it will be around for years to come but if you re starting afresh there are other places you might want to start from rather than Django . OSQA does have a track record of lots of sites some of which are quite busy . OK not busy by Stack Overflow standards but busy enough - LockerGnome.net has 17 000 questions 42 000 answers and 6 000 users . There are about 10 OSQA sites that have over 10 000 questions and 1 000 users - about ten times bigger than the biggest Askbot site . Then there are several dozen OSQA sites smaller than that q : 10 000 u : 1 000 threshold . There are other options - you could try starting a site via Area51.StackExchange.com and there s Q A software available in PHP too . As far as I know there isn t a node.js Q A but maybe there should be . Or if you want to pay and have a huge site in mind there s QATO which rents out as SAAS . Comment : I d be interested to know what Python framework you think someone should start with . Personally I d say none of the contenders are well established enough to be a wise choice in preference over Django if you re looking for something to use over the next few years . Comment : I second StephenPaulger s comment . There are some other very promising Python web frameworks Pyramid and Flask for example but Django is a totally legitimate choice . In the end the tools really don t matter it s how you wield them . Comment : OSQA is available for easy install to desktop VM or Cloud via Bitnami stack : bitnami.com stack osqa https : bitnami.com stack osqa", "Question : I am planning to start a question answer website using osqa question answer script . I want to install osqa on Apache server . Please tell me simple but detailed steps to install osqa on Apache server . .. . Answer : Hi I have done this on a new machine using the guide at http : wiki.osqa.net display docs Ubuntu+with+Apache+and+MySQL but amending it for new Apache 2.4.7 and also downgrading appropriate versions of django and Markdown .. . .. . Ubuntu 14.04 Apache 2.4.7 .. . .. . Clean machine in AWS : .. . .. . sudo apt-get update .. . .. . sudo apt-get install apache2 libapache2-mod-wsgi .. . .. . sudo apt-get install subversion .. . .. . APACHE 2.4 behaves Differently - best to insatll in var www .. . .. . sudo svn co http : svn.osqa.net svnroot osqa trunk var www osqa .. . .. . sudo vi var www osqa osqa.wsgi .. . .. . sudo rm etc apache2 sites-enabled 000-default.conf .. . .. . sudo vi etc apache2 sites-available osqa.conf .. . .. . sudo ln -s etc apache2 sites-available osqa.conf etc apache2 sites-enabled osqa.conf .. . .. . sudo apt-get install mysql-client .. . sudo apt-get install python-setuptools .. . sudo apt-get install python-pip .. . .. . sudo easy install South django-debug-toolbar markdown html5lib python-openid .. . .. . sudo pip install Django 1.3 .. . .. . sudo pip install Markdown 2.4.1 .. . .. . sudo cp var www osqa settings local.py.dist var www osqa settings local.py .. . .. . sudo vi var www osqa settings local.py .. . .. . DO your database stuff - I already had one on RDS but you can make your own . I didn t do this step but you probably need to if building a new db sudo python manage.py syncdb --all .. . .. . sudo python manage.py migrate forum --fake .. . .. . sudo useradd osqa .. . .. . sudo chown -R osqa : www-data var www osqa .. . .. . sudo chmod -R g+w var www osqa forum upfiles .. . .. . sudo chmod -R g+w var www osqa log .. . .. . sudo service apache2 restart Comment : How do you configure Email settings", "Question : requirements.txt file : .. . .. . django-1.1 mysql-python python-openid psycopg2 html5lib markdown git+git : github.com dcramer django-sphinx.git South .. . .. . first virtualenv webapps --distribute source webapps bin activate export PATH usr pgsql-9.1 bin : PATH this is to avoid the pg config not found error http : community.webfaction.com questions 736 installing-psycopg2 then pip-2.7 install -r requirements.txt .. . .. . And remember don t do pip install which install into 2.4 need to invoke pip-2.7 install Comment : self answered above . Other reqource include wiki.osqa.net display docs Installing+OSQA+on+WebFaction http : wiki.osqa.net display docs Installing+OSQA+on+WebFaction which can help set wsgi files . Comment : This was helpful too meta.osqa.net questions 10897 http : meta.osqa.net questions 10897 has-anyone-installed-osqa-on-heroku Comment : docs.webfaction.com software custom.html http : docs.webfaction.com software custom.html .. . Answer : 1 . Go here https : wiki.webfaction.com wiki InstallScripts OSQA . 2 . Click Install . 3 . Add the OSQA app that you just created to your site . 4 . Done Comment : That script does not work for me . Do you know of any other methods Comment : If the script is failing then figure out the reason for the failure and correct it . Let WebFaction s support team know if you need assistance .", "Question : I am trying to mod OSQA https : github.com OSQA osqa to not use questions anywhere in URLs and change it to some other string say thisinstead . Some examples .. . .. . When the user clicks on the questions tab instead of linking to mydomain.com questions it should link-to mydomain.com somethingelse . Likewise instead of mydomain.com questions 3 Q3Title it should link-to mydomain.com somethingelse 3 Q3Title . And so forth . What would be the most elegant approach to accomplishing this Comment : have you checked the urls.py I have never seen osqa source but i think if they use reverse it could be as trivial as changing the urls.py entry .. . Answer : I took a very quick glance at the OSQA source code and all of their urls are translated . So you can just modify https : github.com OSQA osqa blob master locale en LC MESSAGES django.po line 398 run django-admin compilemessages and done . For more info on customization look at section D in https : github.com OSQA osqa blob master INSTALL", "Question : I am planning to start a question answer website using osqa question answer script . I want to install osqa on Apache server . Please tell me simple but detailed steps to install osqa on Apache server . .. . Answer : Step 1 : install related python modules .. . .. . Step 2 : Create a database for OSQA .. . .. . Step 3 : Configure OSQA .. . .. . i . Create osqa.wsgi .. . .. . Use cp osqa.wsgi.dist osqa.wsgi to make a copy and modify sys.path.append . The final content of osqa.wsgi will be .. . .. . ii . Create settings local.py .. . .. . Use cp settings local.py.dist settings local.py to make a copy and make some change . The following code shows what codes should be changed . Step 4 : Configure apache .. . .. . Create a configure file for OSQA say osqa.conf . Here is the content : .. . .. . Make the configure take effect : .. . .. . Step 5 : Modify hosts .. . .. . Append the following to etc hosts .. . .. . References : .. . .. . http : sparkandshine.net install-osqa-on-aws-ec2-ubuntu-apache-mysql .. . .. . PS : why does not the highligter syntax work", "Question : requirements.txt file : .. . .. . django-1.1 mysql-python python-openid psycopg2 html5lib markdown git+git : github.com dcramer django-sphinx.git South .. . .. . first virtualenv webapps --distribute source webapps bin activate export PATH usr pgsql-9.1 bin : PATH this is to avoid the pg config not found error http : community.webfaction.com questions 736 installing-psycopg2 then pip-2.7 install -r requirements.txt .. . .. . And remember don t do pip install which install into 2.4 need to invoke pip-2.7 install Comment : self answered above . Other reqource include wiki.osqa.net display docs Installing+OSQA+on+WebFaction http : wiki.osqa.net display docs Installing+OSQA+on+WebFaction which can help set wsgi files . Comment : This was helpful too meta.osqa.net questions 10897 http : meta.osqa.net questions 10897 has-anyone-installed-osqa-on-heroku Comment : docs.webfaction.com software custom.html http : docs.webfaction.com software custom.html .. . Answer : Just to share I installed OSQA on Webfaction following SeanF s instructions above and it was a breeze . I could even customize the script a little bit . Now the work is on customizing the site not spending countless setting up the deployment . Thanks Webfaction and SeanF .", "Question : Can anyone help me to publish OSQA application https : github.com OSQA osqa to windows azure I want to publish my osqa applicatoin to azure but I can not find any proper solution . Some solution I found but they are not useful to me . some of the site which I have find are as follows .. . .. . http : azure.microsoft.com en-us documentation articles web-sites-python-create-deploy-django-app .. . .. . Installing OSQA on windows local system http : stackoverflow.com questions 2743712 installing-osqa-on-windows-local-system .. . .. . please help me to find some proper solution that can work for me . Thanks .. . Answer : This is an old question - but in case anyone comes across it Bitnami put together an image that is available in the VM Depot in Azure . https : bitnami.com stack osqa cloud azure .. . .. . Really easy to deploy if you are already using Azure . The Azure portal will walk you through copying the image to your subscription then you just have to register it and deploy a VM from that image .", "Question : I have a problem when I deploy OSQA to heroku . Firstly I clone OSQA source code from https : github.com dzone osqa .. . .. . And I do some steps like the tutorial in https : github.com joshfinnie OSQA-Heroku .. . .. . Finally when I access to my website I get the error message such as .. . .. . ImproperlyConfigured at The included urlconf urls doesn t have any patterns in it And the stack-trace is as follow .. . .. . app forum views readers.py in index paginator context.base path reverse questions I don t know what wrong I config . So I hope anyone can help me resolve my problem . The link of heroku is http : where-we-go.herokuapp.com .. . .. . Thank you so much . Comment : seems osqa-heroku.herokuapp.com http : osqa-heroku.herokuapp.com also not working. . Anyway what about the foreman start result Comment : I can deploy in local successfully . But I don t know why there is a bug when I deploy to heroku . One more thing I run OSQA in windows for local setup so I don t use foreman . Btw the link of heroku is where-we-go.herokuapp.com http : where-we-go.herokuapp.com .. . Answer : I found the root cause . I downgrade the version of Markdown to 2.4.1 and OSQA works fine", "Question : I am planning to start a question answer website using osqa question answer script . I want to install osqa on Apache server . Please tell me simple but detailed steps to install osqa on Apache server . .. . Answer : First you need to get Django going .. . .. . then check the other requirements .. . .. . http : meta.osqa.net questions 11025 server-requirements-to-run-osqa .. . .. . I ll tell you to ask this question at that forum but it looks pretty much dead already Comment : Keep in mind that version django for OSQA need to be very old 1.3 .", "Question : I am planning to start a question answer website using osqa question answer script . I want to install osqa on Apache server . Please tell me simple but detailed steps to install osqa on Apache server . .. . Answer : If you want something simple you could use bitnami stack http : bitnami.com stack osqa", "Question : Trying to create a translation for OSQA .. . .. . Fist I copied the FR locale to RU updated the settings . Fine Most things are working but now everything in the django.po file has been translated but still a few lines show up in English and I I cannot find them. . .. . .. . For example the string .. . .. . Most recently updated questions .. . .. . in the upper sidebar content right underneath the number of questions . The string is just not present in the django.po .. . .. . PS : I installed OSQA on webfaction using the wiki script . Any help will be appreciated . Update .. . .. . The template sort tabs contains .. . .. . but I think the string is coming from the count.html template .. . .. . that might narrow it down to questions.paginator.sort description Comment : I guess you ve checked that the templates have the i18n template tag loaded and the string is on trans Most recently updated questions tag.. . Comment : Have you checked the fuzzy lines in django.po .. . Answer : Looking at OSQA source code most recently updated questions string is defined for translation in sort tabs.html http : svn.osqa.net svnroot osqa trunk forum skins default templates question list sort tabs.html template and it is included in django.po http : svn.osqa.net svnroot osqa trunk locale en LC MESSAGES django.po line 5466 . Please note that Most recently updated questions string from your example is different string then is found in found in OSQA repository uppercased Most I can only guess that you are using some other templates that ones provided . If that is not the case please use following command in OSQA source directory to find files which includes missing translation string : Comment : Thanks so far . I will check the 5466 line . But can you have a look at mamburo.ru http : www.mamburo.ru or www.hozburo.ru that I am translating you will see the uppercased Most under the number of questions in the sidebar . I have done an out of the box install on webfaction . Is that not the default template I am using Comment : This should definitely be sort tabs.html template . It could be 1 . sort tabs.html has been changed - please post result-of svn diff from forum skins default templates question list directory or 2 . run find command from the answer above and post the result . You have run python manage.py compilemessages after changing po catalog Comment : svn info would return revision . Comment : after svn or svn diff I get . is not a working copy Comment : Yes I have run compilemessages . As you see on hozburo.ru most strings are translated . My django.po stops at line 4465 so it must be an onder version I am running", "Question : I want to upload some existing users from another site to my current OSQA site . I have an Excel file with the users I want to upload their usernames and their emails . I ve found this http : meta.osqa.net questions 10600 how-do-i-bulk-upload-users-and-questionsanswers-data-into-osqa and this http : meta.osqa.net questions 4080 how-can-i-import-data-from-another-question-and-answer-script .. . .. . But both do not work for me . I use Python and Django like OSQA . Comment : Why are they dont work Could you provide ANY details Comment : When I try to execute on of the scripts to add users an error with the database occurs : Traceback most recent call last : File Applications osqa apps osqa forum modules mysqlfulltext init .py line 8 in module import MySQLdb ImportError : No module named MySQLdb Traceback most recent call last : File Applications osqa apps osqa . . osqa forum modules mysqlfulltext init .py line 8 in module import MySQLdb ImportError : No module named MySQLdb If my site is running properly is because it already has mysqldb so I do not understand why it is saying that . Comment : Are you executing the script from virtualenv If so try to import MySQLdb from python shell and let me know what does it says . Comment : Not really . I have installed OSQA with the Bitnami Mac Installer my dev stack . I have already tried to do sth like pip install MySQLdb and all of those tips and it always occurs the following error : .. . EnvironmentError : mysql config not found Complete output from command python setup.py egg info : sh : mysql config : command not found .. . EnvironmentError : mysql config not found .. . Answer : Solved I have managed to solve both problems : .. . .. . MySQL does not find mysql-config : the path was not correct . The correct one after re-installed mysql : usr local mysql bin mysql-config .. . .. . psycopg2-extensions not found : re-install psycopg2 with homebrew and it worked", "Question : I installed OSQA using the bitnami installer and everything worked fine . Now I am hacking at the osqa code base . If I need to restore the database to its initial state do i need to reinstall OSQA or is there any command to truncate the database and load intial data . I tried using use osqa.bat and did a python.py manage migrate forum but it didnt work . It uses a postgresql database Comment : Just curious what was wrong with the original title .. . Answer : Finally this worked for me . Note that this is applicable only for OSQA using the bitnami environment with postgresql database . if you want to restore your database state to the original version first connect to postgres database using admin credentials use any client I used Dbeaver .. . .. . Now drop the bitnami-osqa database and create it again if you already have connections to bitnami osqa close them .. . .. . Now open use osqa.bat in your bitnami root folder and execute the following" ] }
[ "yes-answer-long", "yes-answer-short" ]
django
UNK_RELATION
maximage2@slideshow@51
maximage2 -- maximage2 is a fullscreen background @placeholder plugin that uses jquery-cycle plugin for it s slideshow functionality .
{ "confidence": [ 24.308563232421875, 15.900856018066406, 15.900856018066406, 15.900856018066406, 15.900856018066406, 15.900856018066406, 15.900856018066406, 15.900856018066406, 15.900856018066406 ], "content": [ "I m using MAXIMAGE 2 http : www.aaronvanderzwan.com maximage to make simple image slideshow .", "I try to use horizontal scroll effects i.e .", "fx : scrollHorz .", "The JSFiddle is here http : jsfiddle.net shivanraptor jofb4o4s .", "The problem is the animation transition does not happen .", "It goes directly to 2nd slide without animation .", "Is this a bug of MAXIMAGE 2", "HTML : .. . .. . JS :", "To make scrollHorz work without fillElement config I have to add cssTransitions : false in the Maximage 2 as follow : .. . .. . Not sure if it is a bug of MaxImage 2 ." ] }
{ "confidence": [ 25.144412994384766 ], "content": [ "Question : I m using MAXIMAGE 2 http : www.aaronvanderzwan.com maximage to make simple image slideshow . I try to use horizontal scroll effects i.e . fx : scrollHorz . The JSFiddle is here http : jsfiddle.net shivanraptor jofb4o4s . The problem is the animation transition does not happen . It goes directly to 2nd slide without animation . Is this a bug of MAXIMAGE 2 HTML : .. . .. . JS : .. . Answer : To make scrollHorz work without fillElement config I have to add cssTransitions : false in the Maximage 2 as follow : .. . .. . Not sure if it is a bug of MaxImage 2 ." ] }
[ "yes-answer-long", "yes-answer-short" ]
slideshow
UNK_RELATION
css@markup@159
css -- css cascading style sheets is a style sheet language used for describing the look and formatting of html hyper text markup language and xml extensible @placeholder language documents including but not limited to colors layout and fonts .
{ "confidence": [ 88.36090087890625, 66.06555938720703, 58.490928649902344, 58.13163757324219, 51.574745178222656, 51.02051544189453, 47.4621696472168, 45.50147247314453, 45.22019577026367, 45.059574127197266, 44.89044952392578, 44.75818634033203, 44.75818634033203, 44.749935150146484, 44.24558639526367, 43.67970275878906, 42.53422164916992, 42.470027923583984, 42.263893127441406, 42.19389343261719, 42.19037628173828, 41.73502731323242, 41.691864013671875, 41.58417510986328, 41.52064514160156, 41.452392578125, 41.217811584472656, 41.08311462402344, 40.822914123535156, 40.68453598022461, 40.63370132446289, 40.570560455322266, 40.562564849853516, 40.340641021728516, 40.12012481689453, 40.100887298583984, 39.846832275390625, 39.81143569946289, 39.65761947631836, 39.65761947631836, 39.55809783935547, 39.18658447265625, 39.14404296875, 38.87828063964844, 38.85648727416992, 38.85648727416992, 38.655879974365234, 38.65447235107422, 38.62607955932617, 38.44108581542969, 38.3973274230957, 38.314796447753906, 38.2447395324707, 38.17530059814453, 38.15582275390625, 37.98930358886719, 37.904170989990234, 37.808990478515625, 37.724544525146484, 37.492366790771484, 37.48373031616211, 37.468570709228516, 37.40214920043945, 37.339759826660156, 37.339759826660156, 37.29600143432617, 37.25566864013672, 37.23153305053711, 37.075340270996094, 37.046180725097656, 36.89674758911133, 36.85203170776367, 36.79225540161133, 36.73860168457031, 36.7232666015625, 36.704017639160156, 36.68479919433594, 36.66093444824219, 36.658573150634766, 36.658573150634766, 36.658573150634766, 36.57411575317383, 36.53062438964844, 36.487144470214844, 36.487144470214844, 36.487144470214844, 36.485164642333984, 36.421836853027344, 36.376949310302734, 36.24956512451172, 36.24835968017578, 36.131080627441406, 36.049224853515625, 36.044403076171875, 35.963191986083984, 35.932979583740234, 35.932979583740234, 35.83395767211914, 35.83395767211914 ], "content": [ "Cascading Style Sheets CSS is a style sheet language used for describing the presentation semantics the look and formatting of a document written in a markup language .", "CSS 2.1 is a style sheet language that allows authors and users to attach style e.g . fonts and spacing to structured documents e.g . HTML documents and XML applications .", "This is the meaning of cascading in Cascading Style Sheets or CSS .", "CSS stands for Cascading Style Sheet .", "That s by design of CSS Cascading Style Sheet .", "CSS is a language used for styling markup nothing else .", "Cascading Style Sheets .", "CASCADING style sheets .", "The page you link-to says that it inputs Cascading Style Sheets Level 2 source text or in other words a .CSS file .", "When I teach CSS I always tell the students that cascading style sheets means something like fighting style sheets .", "JSON is a transport format and not a layout language markup language .", "My CSS style sheet is saved as .css .", "This is the body css that s on the night css style sheet .", "This is where the Cascading in Cascading Style Sheets comes in to play .", "Only Cascading Style Sheet .", "I have a textfile .css Cascading Style Sheets file which is a plain text .", "If element has an associated CSS style sheet remove the CSS style sheet in question .", "Look at this style of coding CSS.. .", "Here s an excerpt of our CSS style sheet .", "I understand that CSS style sheets are cached in browser .", "CSS DOES account for the language .", "If there is no over riding then the final CSS is just a collation of all the properties across all the CSSs - hence Cascading Style Sheets .", "Ref : css-tricks.com snippets css style-placeholder-text http : css-tricks.com snippets css style-placeholder-text", "have a look at print style sheets and page-break css", "Typically in CSS I would create a CSS style sheet and place it in the directory of my website then just reference that style sheet into each of the pages or html files .", "CSS should be used to style the same markup differently in different contexts .", "CSS style sheets are a consideration for future updates .", "Since that default type is text css the style sheet would nonetheless be applied .", "Create a CSS style sheet for the page .. . .. . 3 .", "CSS is a styling language after all .", "How can I customize a scroll bar via CSS Cascading Style Sheets for one div and not the whole page", "Html Css is a limited markup language so there is only so much it can do before you have to rely on another tool .", "Edit : code is not limited to HTML and CSS . Wrong if you want to style some in a web html and CSS is essential .", "Your code is correct as long as MyLocalFile points to a CSS style sheet .css .", "Essentially it is a language that compiles to plain CSS .", "CSS is used to put colors and form on your markup HTML .", "Uses style tags versus CSS styling sheet .", "The only other CSS I ve applied to UL s are in a nav div but that CSS doesn t touch the list-style-type it uses the reset that YUI provided and YUI and the site style sheet are the only two CSS sheets that are called .", "I have a document in a .css Cascading Style Sheets like format but it has its own keywords .", "Since the C in CSS means cascading surely the non-IE style sheets should be before the IE conditional statement", "But it requires that the language of the text be declared in HTML markup using e.g .", "Because CSS is cascading doing this will override anything inside of your external style sheet .. . .. . my style sheet.css .. . .. . my page.php .. . .. . Javascript example", "CSS is a structured language by its nature .", "I am not sure about it but most probably you are looking for this .. . .. . http : www.w3.org International questions qa-css-lang .. . .. . The best way to style content by language in HTML is to use the : lang selector in your CSS style sheet .", "Developers have to learn your custom CSS language .", "The main argument is that CSS is not really a programming language .", "I created a css style to style the css of the blog items a special css style was needed to style the leading item css class : leading-0 .", "You can describe your css selection like cascading style sheet dows :", "If not hide it with your own css style .class-name display : none style .. . add css markup to your page", "You are apparently using some language to be translated into CSS .", "CDATA .. . block : .. . .. . style type text css .. .", "Are the css used as an attribute or in style element", "CSS is used to style elements and not change the structure .", "Parse a CSS Style sheet and use the setStyle functions in flex to apply the styles .", "@DalexL HTML isn t a language it s markup .", "You cannot that s why they are called Cascading Style Sheets .", "What about choosing CSS from the language menu", "Here is the css and html code .. . .. . Here is the css style .. . .. . Here is the result .", "From the spec.. . .. . .. . A user-agent s default style sheet should present the elements of the document language in ways that satisfy general presentation expectations for the document language .", "You should probably subscribe to the www-style mailing list http : lists.w3.org Archives Public www-style of W3C .. . .. . This mailing list is for technical discussion on Cascading Style Sheets CSS and its specifications .", "The second style is whatever CSS 2.1 considers as a style .", "If I have the following in my html : .. . .. . And this in my css style sheet : .. . .. . Is there any way with javascript jquery to remove all of the inline styles and leave only the styles specified by the css style sheet", "For optimum typographic control particular named fonts should be used in style sheets .", "CSS is not a scripting-language it can t calculate stuff .", "CSS will handle this fine if it knows that the language is Greek .", "Use style type text css instead .", "You can t do that with CSS because CSS is a declarative language .", "Different language text on hover here is the .. . .. . jsfiddle example http : jsfiddle.net nagendra rao YSgKL 2 .. . .. . html : .. . .. . css :", "Create a CSS style sheet with the following properties : .. . .. . .. . As you can see each time the style element is updated a new CSS style sheet is created only if .3 and .4 are not blocking the process .", "The HTML Markup .. . .. . The CSS", "Dude seriously stop it setup some CSS style sheets and do it properly", "possible duplicate of Is there a style type besides text css", "example : .. . .. . .. . html .. . head .. . style type text css .. . p .. . color : blue .. . .. . style .. . head .. . body .. . p This text is blue p .. . body .. . html", "But really it s mostly useful in terms of specifying the default style rule for the col tag itself or an equivalent tag in a different XML-based markup language .", "Also worth reading : CSS : alternative style sheets https : www.w3.org Style Examples 007 alternatives.en.html : .. . .. . A document doesn t need to have a single style sheet .", "CSS is a general purpose styling language that it can be used with other document-types not only with HTML such as SVG .", "CDATA tags around the CSS inside style type text css in the head .", "So you re no longer really dealing with HTML here you re dealing with XML because SVG is an XML-based markup language .", "You can modify the css and take it as external style sheet. .", "You could also try listing the css in the style sheet as important", "Point to note is that css style sheet is loading in header properly in firefox5 .", "Generate your CSS dynamically either on the fly or as you re authoring your style sheets I use a Visual Studio macros to implement constants for fonts numbers and colors - and to calculate light dark tints of colors .", "From the specification http : www.w3.org TR CSS21 emphasis mine : .. . .. . This specification defines Cascading Style Sheets level 2 revision 1 CSS 2.1 .", "The HTML scheme is following : .. . .. . .item CSS style : .. . .. . And the result :", "masonry js .. . .. . css style .. . .. . html code", "CSS styles HTML it does not style .NET .", "CSS class have compiled a list of CSS2.1 User Agent Style Sheet Defaults http : css-class.com test css defaults UA-style-sheet-defaults.htm .", ".. . .. . Relevant part of the specs https : html.spec.whatwg.org multipage semantics.html the-style-element : update-a-style-block : .. . .. . The update a style block algorithm for CSS text css is as follows : .. . .. . 1 .", "Css for styling and HTML for markup .", "For example if you look at the code-behind the CSS Compressor page itself you will find the main style sheet in the head that looks like this : .. . .. . The gobbledeegook in the URL is actually an encrypted string containing all the style sheets to combine on the server .", "I m writing some css style sheets for my website and having a mass use of vw and vh css units .", "Style attribute is used for creating inline CSS .", "but I always want to seperate styling from css because for me html is for describing the markup css for styling and js for functionality .", "style type text css a : link text-decoration : underline a : visited text-decoration : none style -- this should be posted in the head section of the html page .", "I think it is not mandatory I have successfully used style and also style type text css . .", "The HTML Markup .. . .. . The CSS Styles", "Show HTML CSS markup", "CSS edited at the bottom of style .", "but css style not working" ] }
{ "confidence": [ 97.60713195800781, 89.1183853149414, 62.19904708862305, 60.858028411865234, 55.399810791015625, 54.492374420166016, 52.77901077270508, 52.462310791015625, 52.410621643066406, 52.40047836303711, 52.313575744628906, 52.25517654418945, 51.745384216308594, 51.560264587402344, 51.38246154785156, 51.32065200805664, 50.89151382446289, 50.6841926574707, 50.63700866699219, 50.429832458496094 ], "content": [ "Question : Im using php to display data from mysql . Here are my css statements : .. . .. . They are used for displaying table tableheader tabledate . Im new to php css so im just wondering how to use the above css style in php displaying codes : Comment : I don t fully understand your question . You don t use them differently in PHP than in normal HTML : either include an external stylesheet or embed the stylesheet in your head element .. . Answer : Cascading Style Sheets CSS is a style sheet language used for describing the presentation semantics the look and formatting of a document written in a markup language . more info : http : en.wikipedia.org wiki Cascading Style Sheets CSS is not a programming language and does not have the tools that come with a server-side language like PHP . However we can use Server-side languages to generate style sheets .", "Question : Can t seem to find much information about this . Smashing Magazine http : coding.smashingmagazine.com 2011 03 30 how-to-use-css3-pseudo-classes seems to essentially say html and : root are the same thing but surely there must be a difference .. . Answer : From the W3C wiki http : www.w3.org wiki CSS Selectors pseudo-classes 3aroot : .. . .. . The : root pseudo-class represents an element that is the root of the document . In HTML this is always the HTML element . CSS is a general purpose styling language that it can be used with other document-types not only with HTML such as SVG . From the specification http : www.w3.org TR CSS21 emphasis mine : .. . .. . This specification defines Cascading Style Sheets level 2 revision 1 CSS 2.1 . CSS 2.1 is a style sheet language that allows authors and users to attach style e.g . fonts and spacing to structured documents e.g . HTML documents and XML applications . Comment : Thanks wasn t aware that you could style SVGs with CSS like that . Accepted answer for citing source . : Comment : Not only SVG but anything that s based on XML . Including XHTML .", "Question : I m trying to use Google Web Fonts and on the official site it recommends http : www.google.com fonts QuickUsePlace 3aquickUse Family 3aUbuntu using a link tag including the type attribute as following : .. . .. . In the official HTML5 boilerplate site they ommit the type attribute .. . .. . According to this rather old answer http : stackoverflow.com a 7031817 798677 in HTML5 the type attribute is optional on the style tag and mandatory on the link tag . However the version without the type attribule validates fine on the W3C validator http : validator.w3.org . So is the type attribute mandatory or not Comment : possible duplicate of Is there a style type besides text css http : stackoverflow.com questions 7031703 is-there-a-style-type-besides-text-css Comment : The approved answer in the old question is wrong . The way to deal with this is to have this fixed rather than spawning new copies of the same question and leaving the old incorrect answers around . Comment : possible duplicate of style type text css .. . what else is there http : stackoverflow.com questions 6077905 style-type-text-css-what-else-is-there .. . Answer : I found the answer on the official W3C HTML5 draft http : www.w3.org TR 2012 WD-html51-20121217 document-metadata.html document-metadata : .. . .. . The type attribute gives the MIME type of the linked resource . It is purely advisory . The value must be a valid MIME type . .. . For external resource links the type attribute is used as a hint to user agents so that they can avoid fetching resources they do not support . If the attribute is present then the user-agent must assume that the resource is of the given type even if that is not a valid MIME type e.g . the empty string . If the attribute is omitted but the external resource link type has a default type defined then the user-agent must assume that the resource is of that type . .. . .. . .. . User agents must not consider the type attribute authoritative upon fetching the resource user agents must not use the type attribute to determine its actual type . Only the actual type .. . . .. . The stylesheet link type defines rules for processing the resource s Content-Type metadata . .. . .. . .. . If a document contains style sheet links labeled as follows : .. . .. . .. . link rel stylesheet href A type text plain .. . link rel stylesheet href B type text css .. . link rel stylesheet href C .. . .. . .. . ...then a compliant UA that supported only CSS style sheets would fetch the B and C files and skip the A file since text plain is not the MIME type for CSS style sheets . .. . For files B and C it would then check the actual types returned by the server . For those that are sent as text css it would apply the styles but for those labeled as text plain or any other type it would not . .. . If one of the two files was returned without a Content-Type metadata or with a syntactically incorrect type like Content-Type : null then the default type for stylesheet links would kick in . Since that default type is text css the style sheet would nonetheless be applied . For the style attribute the same document states : .. . .. . The type attribute gives the styling language . If the attribute is present its value must be a valid MIME type that designates a styling language . The charset parameter must not be specified . The default-value for the type attribute which is used if the attribute is absent is text css . RFC2318", "Question : What s the exact meaning of the term Cascading in CSS I am getting different views so I ask here . An example would help . Comment : Might be worth making this a Community Wiki - edit the post and tick the CW check box Comment : w3.org should have been the first thing that came up when you Googled this . You did Google this first right.. . Comment : If you re anything like me the Cascading refers to the cascading amounts of time you will spend adjusting your div width in two pixel increments to get things to look just right rather than focusing on your fundamental business logic . I ll probably get a few negatives for that answer but it s just so true .. . Answer : When I teach CSS I always tell the students that cascading style sheets means something like fighting style sheets . One rule tells your H3 tag to be red another rule tells it to be green -- the rules are contradicting each other who will win Style sheet deathmatch OK maybe that s a slight exaggeration but it s far more amenable to non-code non-programming people who are just starting out than any notion of a cascade or inheritance . I do of course make sure to tell them that it s not a problem for the style sheets to be fighting each other that s the way the language was designed . Comment : Not sure why this was down-voted . Looks like a simple explanation for new learners . Comment : Probably because it doesn t explain which will win and why . Comment : You appear to be confused about the question . It s not what s specificity inheritance or about which rules get applied etc . it s what does cascading MEAN . Comment : I know this is an old post but still : I think the example of style sheets and or CSS rules fighting is a bad one . Far more instructive to new learners in my own teaching experience is to explain the hierarchy of a rule overriding a previous one . Say an employee paints a H3 tag red 1st rule then hands it to his QA manager who overrules him and decides to paint it green 2nd rule . No death match just corporate hierarchy . CSS rules don t fight it out they run cascade through a strictly defined hierarchical system of subsequent decisions overruling previous ones .", "Question : When sending an HTML email can you link-to an external style sheet or does the CSS need to be included in the email Also if you can link-to an external style sheet which way is more efficient is smarter to use : linking to the style sheet or including it in the HTML .. . Answer : Forget efficient . Forget smart . Forget maintainable . This is HTML mail we re talking about . HTML mail and Webmail clients are extremely limited partly for security reasons but mainly because they re just rubbish . External style sheets almost certainly won t work . HTML-embedded style sheets probably won t work . Inline style .. . attribute on every damn element.. . has a much better chance of working but still don t be surprised when many users can t see styles at all or some styles don t work or some basic HTML doesn t work and the content ends up looking like a 1997 browser threw up all over it . HTML mail is an exercise in unpleasantness . I hate to receive it . I hate even more to author it . The sanest route for everyone is to forget HTML mail and just send a plain text message including a link-to a full web page where you can have as much CSS JavaScript and Flash loveliness as you like . Comment : +1 for that first line alone . Comment : Pretty much the only place I use tables anymore is in HTML mail . Sometimes it is really the only way to get the email to display . Comment : +1 : I wholeheartedly agree with every single word . Comment : +1 : Thank you . Wish I could up-vote more . Comment : All good except for the Flash loveliness -1", "Question : I don t have much experience on UI development . I have a class defined in CSS something like this- .. . .. . I want my content value to be internationalized to be displayed as my content in English and something else in another language . Is that possible achieve it through CSS code .. . Answer : I am not sure about it but most probably you are looking for this .. . .. . http : www.w3.org International questions qa-css-lang .. . .. . The best way to style content by language in HTML is to use the : lang selector in your CSS style sheet . For example : Comment : Thank you . That was a very helpful suggestion . I never knew about it . But implementing it is a bit tricky in my scenario as it is a bit hard to get the language information during runtime .", "Question : The issue I came across has to do with the capitalization of Greek characters by the text-transform : uppercase property . In Greek vowels can have acute accents both small and caps for instance one in Greek is . In the beginning of a sentence would be . But when a word or a phrase is written in all caps then Greek grammar says that it should have no accented letters . As it is now CSS s text-transform : uppercase capitalizes Greek letters preserving accents which is grammatically wrong so becomes while it should be . How do I make text-transform : uppercase work properly for Greek Comment : It is incorrect to close this question as a duplicate . True as stated it is a duplicate . However what the OP really wanted to do is get the accents right on the transformed Greek text . But he wrongly imagined that this was a bug in the CSS specification or CSS implementation and so asked the wrong question . Actually the question should have been : How do I make text-transform work properly with Greek to which there is a perfectly clear answer--using the lang attribute . If this question cannot be will not be re-opened then I hope the OP re-posts it . Comment : You are right I ve just changed the question exactly as suggested . Thanks a lot Comment : @BoltClock Can you re-open this or should it posted as a new question Comment : @torazaburo : Done . .. . Answer : What you are describing isn t really a bug in CSS . CSS is designed to stylize the elements of a page . This is an agnostic definition independent of culture . What you are describing would require the CSS to handle localization of a page based upon the culture specific stylized CSS would then be loaded . en fr au.. . . There are a number of links online that discuss Globalization and localization as well as CSS . Check the Mozilla site which discusses this same topic https : developer.mozilla.org en-US docs Mozilla Localization Localization content best practices Look to the section on Create localizable UI Comment : So you say that it s not actually W3C s responsibility to include this to CSS specifications but rather web browser engine designers responsibility to implement the generic definition of this property correctly for any given language and therefore I must report this to each separately . Right Comment : Yes the developer should account for the localization in the design of the application it that is the requirement . CSS is a language used for styling markup nothing else . It contains no logic to account for localization . You would need to introduce some sort of code to account for this server-side client-side etc . Comment : It makes sense . Thank you very much for your answer Comment : This is just wrong . No one is asking CSS to handle localization of a page . They re just asking it to behave properly and do what it says . In this particular case the solution is very simple : add the lang el attribute to some parent element . Otherwise no-one has any idea that this is Greek and should be treated as such . The mere use of Greek characters does not imply that the language is Greek and that therefore Greek-specific text transforms should be applied . @BoltClock It is also incorrect to have closed this issue . Comment : @rlcrews . Completely wrong . CSS DOES account for the language . Uppercase and lowercase have language-specific meanings which CSS DOES implement--if it knows what the language is from the lang attribute . Please try p style text-transform : uppercase p and p lang el style text-transform : uppercase p yourself and see the difference .", "Question : As we know Cascading Style Sheets should be linked to in HTML files as opposed to be directly in them . Should meta-tags be moved to external CSS sheets too Id Est : .. . .. . HTML : .. . .. . From here : del meta name description content Text del .. . .. . CSS : Comment : meta-tags are not styles and can t be put in a stylesheet . Comment : @rick why not post answer Comment : @unor what was your edit Comment : @DaniSpringer.com : Do you wonder about anything in specific I removed the code markup from HTML and CSS because these terms are not code . I rephrased the title to make clear what you ask your version could for example mean that you ask about how to specify external stylesheets in meta-tags . I removed the Question : label because the question mark already makes clear where what your question is . Comment : @DaniSpringer.com : If it refers to HTML s meta element which I think it does then yes . In the context of HTML and CSS every reserved term e.g . element names attribute names properties etc . would be code . For example : I have an a element . vs . I have an a element . .. . Answer : Meta tags are not styles and therefore cannot be put in stylesheets .", "Question : I m working on a web page in Google Chrome . It displays correctly with the following styles . It is important to note that I didn t define these styles . On Chrome dev tools it says user-agent stylesheet in-place of the CSS file name . Now if I submit a form and some validation error occurs I get the following stylesheet : .. . .. . The font-size from these new styles is disturbing my design . Is there any way to force my stylesheets and if possible completely overwrite Chrome s default stylesheet Comment : chrome : how to turn off user-agent stylesheet settings http : stackoverflow.com questions 18006356 Comment : Note also that on Chrome 51 you get only those two table entries when you don t have a doctype declaration . Otherwise you only get the second one . Comment : Thanks John Your answer helped me a lot . After an hour of trying to figure out why my styles are getting messed up I just added doctype and it all worked . Thanks again .. . Answer : Regarding the concept user-agent style sheet consult section Cascade http : www.w3.org TR CSS21 cascade.html cascade in the CSS 2.1 spec . User agent style sheets are overridden by anything that you set in your own style sheet . They are just the rock bottom : in the absence of any style sheets provided by the page or by the user the browser still has to render the content somehow and the user-agent style sheet just describes this . So if you think you have a problem with a user-agent style sheet then you really have a problem with your markup or your style sheet or both about which you wrote nothing . Comment : @givanse no you see user-agent style sheet effects when you don t override them and your sample markup is no exception . It will be parsed as one li element containing two ul elements with just text content they are styled by user-agent style sheet but this styling can be overridden . Whether the markup is invalid depends on context and on HTML version but this does not affect styling . Comment : @givanse that problem is not relevant to the question what is a user style sheet . If you think the problem is important post it as a new question with sufficient details . But the bullet in your jsfiddle is simple a bullet for the li element and your style sheet does not override it . Comment : It just clicked thanks", "Question : I m editing a simple CSS file in VS2010 and the editor seems to have a rather limited understanding of CSS for example : .. . .. . generates a warning : Validation CSS 1.0 : position is not a known CSS property name .. . .. . I m guessing that there is an option some where to change the CSS validation to CSS 2.1 or some thing close but can t for the life of me find it . .. . Answer : You have a dropdown in the top menu where you can switch the css validation . It s called Cascading stylesheet version for validation . If you can t see it right-click on the menu and check Style sheet so it will show . screenshot http : i.imgur.com u5SKKGC.png Comment : super thanks...helps if I actually look at the UI : - Comment : i can get the Style Sheet menu but CSS 3.0 is not one of my options . : Quality MS programs at their best .", "Question : Dropdown list needs to display items with varying text colors . Color is decided by server-side . Uses style tags versus CSS styling sheet . See example : .. . .. . From what I have read in other SO posts about formatting list item text my general procedure seems close . But my ListItem is always black . What am I missing .. . .. . Abbreviated HTML : Comment : I didn t think individual option elements in a select even could be styled . That s always been an issue in web development since different hosts render select elements their own way . Generally the solution has been to use JavaScript plugins to create custom elements which mimic the behavior of a select and synchronize with a hidden select . Comment : See stackoverflow.com questions 2609344 http : stackoverflow.com questions 2609344 how-to-format-individual-dropdownlist-items-color-etc-during-ondatabinding-e Comment : @MehdiDehghani Extra css file is unnecessary . I am modifying other ASP control attributes using the style tags successfully . .. . Answer : Instead of adding style add css class use this class in your css file to handle the color .. . .. . In your css : .. . .. . Update .. . .. . So you need to use : instead of Comment : This does not solve the issue . I specifically am using the style tag approach for other controls . A css class is not the answer here . Comment : If you use css for styling your life will be easy in future imagine maybe tomorrow your customer ask for another color editing css is much easier than editing C Comment : I appreciate your perspective . However I have a much larger application using style tags that I am modifying . CSS style sheets are a consideration for future updates . Comment : So please tell me an example of generated option tag use the browser s console Comment : @CharleyW . check the update", "Question : I ve got a stylesheet that will not for whatever reason apply list-style-type to a UL element . I m using YUI s Grid CSS with their reset-fonts-grid.css file which I know strips that out as part of the CSS reset . After calling YUI I call the stylesheet for the website and in there have a block for UL : .. . .. . I ve also tried setting it via list-style but get the same result . I know that the above CSS block is getting read as-if I add things like padding or margins those do get applied . The style-type isn t showing up in either Firefox or IE . The only other CSS I ve applied to UL s are in a nav div but that CSS doesn t touch the list-style-type it uses the reset that YUI provided and YUI and the site style sheet are the only two CSS sheets that are called . I ve also got FCKEditor on the admin side of the site and that editor does show the bullet styles so I know it has to be something with the CSS that isn t being filtered by FCKEditor . Comment : This shouldn t make a difference but have you tried applying important to the style Comment : I think you need to show the content of your nav and the ul element . .. . Answer : All I can think of is that something is over-riding this afterwards . You are including the reset styles first right", "Question : I was wondering how I can call multiple external css files at once instead of calling each individually . I want to do that to avoid the request number and minimize it to one per multiple external css files . I tired the following but didn t work I thought it is a lot easier than that any idea what I m missing here Comment : I m pretty sure you need to do them one at a time . Comment : What is the idea behind one request Shouldn t you instead consider consolidating the style-sheet if that is all you want Comment : @Learner From a development standpoint breaking up the style sheets based on what component they control is easier . However for performance reasons a single style sheet is better as the number of requests that can be made at once is limited more style sheets less other stuff that can be downloading at the same time . Comment : The thing is that some styles I use in different pages so I want to include some css to an html page and different ones to other pages.. . .. . Answer : You can use the @import statement inside your master css to make it include multiple-files at once . All you would have to do is link-to your one master file in your HTML . However this will not limit your requests . As long as they are separate files you will have to do separate requests . For real performance improvement you would have to merge the files into one bigger file . There are some good tools out there . I prefer LESS http : lesscss.org which is a precompiler that does lots more but can also merge multiple-files into one minified master css Comment : The @import statement in CSS does not avoid making multiple HTTP requests which the OP specifically wants to avoid . In fact using @import is arguably worse than including them individually via link rel .. . . Comment : @cimmanon quote myself : However this will not limit your requests . As long as they are separate files you will have to do separate requests .", "Question : Is it possible to use CSS via a style section or even an external CSS file from a VBScript using CDO.Message to send email Here is what I ve tried : .. . .. . Which doesn t work . However doing it inline does : .. . .. . All messages will be delivered to Outlook . Comment : This probably has more to do with the mail client s ability to interpret style elements . CDO is just a delivery mechanism . Comment : I m voting to close this question as off-topic because it was a simple typo not related to the actual technologies referenced in the question . .. . Answer : It doesn t matter whether CDO or the Outlook object-model is responsible for delivering emails . The viewer plays the key role there . As you may probably know Outlook uses Word for rendering HTML markup . The following articles describe supported and unsupported HTML elements attributes and cascading style sheets properties : .. . .. . Word 2007 HTML and CSS Rendering Capabilities in Outlook 2007 Part 1 of 2 https : msdn.microsoft.com en-us library aa338201 v office.12 .aspx .. . Word 2007 HTML and CSS Rendering Capabilities in Outlook 2007 Part 2 of 2 https : msdn.microsoft.com en-us library aa338200 v office.12 .aspx", "Question : After working on several large web-applications and seeing gigantic style sheets with no clear structure I d really love to know if people have found ways to keep their css clean for large and complicated web apps . How do you move from a legacy mess of css to cleaned up nicely cascading DRY stylesheets The app I m currently working on has 12000 lines of css . It s grown to this size organically as early on there were no standards or review of the css the only rule was to make the app match the design . Some of the problems we constantly have : .. . .. . Conflicting styles : one developer adds a .header font-weight : bold but .header was already used in other modules and shouldn t be bold in those . Cascading problems : Foo widget has a .header but it also contains a list of Bar widgets with .header classes . If we define .foo .header .. . and .bar .header .. . anything not explicitly overwritten in foo will show up in bar . If we define .foo .header and .bar .header but later need to modify foo to wrap header in a div our styles break . Inheritance problems we constantly redefine widget fonts to 11px normal because some top container uses a 12px 18 px line height . Fighting against widget libraries using libraries such as dojo dijit or jquery-ui that add tons of styles to be functional means that our code is littered with places where we have to override the library styles to get things looking just right . There are 2000 lines of css just for tweaking the builtin dijit styles .. . .. . .. . .. . We re at a point where we re thinking of implementing the following rules : .. . .. . Namespace all new widget classes - if you have a widget foo all sub-classnames will be .foo so we get : .foo .foo header .foo content .foo footer . This makes our css essentially FLAT but we see no other way to organize our code going forward without running into the legacy styles or the cascading problems I mentioned above . Police generic styles - have a small handful of generic classes that are only to be applied in very specific situations . e.g . .editable - apply to portions of a sentence that should invoke an editor - should only contain text nodes . Leverage css compiler mixins To avoid repeatedly defining the same styles in different widgets define and use mixins . Although we worry the mixins will get out of control too . How else can we move from css mess that constantly introduces regressions to something maintainable going forward . .. . Answer : We re using a style guide in the form of a simple HTML page with examples of every CSS rule in the stylesheet . It s very easy to tell if you add a new incompatible rule since the examples are aligned on top of eachother . An example I like : http : getbootstrap.com components added 2015 .. . .. . The other pro you get from this method is reusability : you know what you got and you know that you want the style guide to be as small as possible - therefore : reuse . When you make changes to styles already in use : check the style guide . If it doesn t change it s probably good you might need to browse around a bit if you ve just changed something including box model-issues or width height padding margin in general . How do you move from a legacy mess of css to cleaned up nicely cascading DRY stylesheets Use the style guide as a unit test . Once you got the essential parts in it : reduce refactor and combine you most probably will find some collissions between .campaign 1 span and your regular rules inheritance can be your friend . Conflicting styles : one developer adds a .header font-weight : bold but .header was already used in other modules and shouldn t be bold in those . In reply to Adriano Varoli Piazza s comment and the quote above : I don t recall this as a problem fully belonging to the CSS but more to the HTML markup . No matter what you do it will be some heavy lifting . Decide which rule you d want to keep and take actions towards cleaning out the lesser-used-ones for example : via inheritance : news a .header .. . or renaming the HTML-class a .stand out header .. . . About the following idea .. . .. . Namespace all new widget classes - if you have a widget foo all sub-classnames will be .foo so we get : .foo .foo header .foo content .foo footer . This makes our css essentially FLAT but we see no other way to organize our code going forward without running into the legacy styles or the cascading problems I mentioned above . Use a containing element instead which will be much more easy to maintain : Comment : what about the case he mentions of rules conflicting in one page and another Comment : The style guide idea is fantastic . Comment : Use the style guide as a unit test . This is probably the single best piece of CSS related advice I ve ever read . Comment : @WillTomlins : thanks a lot emphasized . Comment : I think I understand his idea of a viewable style guide but in the intervening years has anybody uncovered an example or article expanding on the idea", "Question : I was wondering how I can call multiple external css files at once instead of calling each individually . I want to do that to avoid the request number and minimize it to one per multiple external css files . I tired the following but didn t work I thought it is a lot easier than that any idea what I m missing here Comment : I m pretty sure you need to do them one at a time . Comment : What is the idea behind one request Shouldn t you instead consider consolidating the style-sheet if that is all you want Comment : @Learner From a development standpoint breaking up the style sheets based on what component they control is easier . However for performance reasons a single style sheet is better as the number of requests that can be made at once is limited more style sheets less other stuff that can be downloading at the same time . Comment : The thing is that some styles I use in different pages so I want to include some css to an html page and different ones to other pages.. . .. . Answer : In order to do what you re doing you are going to need some kind of server-side script that combines . Alternatively just combine them all manually or use something like grunt http : gruntjs.com to combine them all .", "Question : Please can some one give an example describing cascading as meant in CSS and when are they useful I have seen answers describing cascading http : stackoverflow.com questions 1043001 what-is-the-meaning-of-cascading-in-css rq 1 and also difference between cascading and inheritance http : stackoverflow.com questions 2406884 in-css-what-is-the-difference-between-cascading-and-inheritance but I haven t see any answer describing CSS Cascading by example . Comment : RTFM : w3.org TR CSS2 cascade.html cascade http : www.w3.org TR CSS2 cascade.html cascade Comment : There is an example in the first question you link-to . Try scrolling down . Comment : Have you done your homework The wikipedia entry on CSS explains what cascading is : en.wikipedia.org wiki Cascading Style Sheets http : en.wikipedia.org wiki Cascading Style Sheets Comment : @BoltClock Yes there is some example but that answer didn t get any votes . So I am bit suspicious about it . .. . Answer : The cascade : See the slides on http : www.maxdesign.com.au articles css-cascade http : www.maxdesign.com.au articles css-cascade 5D 28http : www.maxdesign.com.au articles css-cascade for a good explanation .. . .. . On inheritance vs cascade : .. . .. . Inheritance is a mechanism that s separate from the cascade : inheritance applies to the DOM Document Object Model tree while the cascade deals with the style sheet rules . However CSS properties set on an element via the cascade can be inherited by that element s child elements . - http : reference.sitepoint.com css inheritance Comment : link is quite good .", "Question : If I have a style defined .. . .. . can I reference it from a second style Or is there a way via javascript jQuery --- Edit .. . .. . To clarify the problem I am trying to apply whatever style is defined for a x and c to .x and .c without altering the CSS as the CSS is going to have updates that are out of my control . I used width but really the style would be something more complex with font border and other style elements being specified . Specifying multiple class names does work when the style is being applied to a class so I ll mark existing responses as answers but I need to take the style being applied to an id and also apply it to a class style .. . if that makes any sense . .. . Answer : Some options : .. . .. . 1 . Generate your CSS dynamically either on the fly or as you re authoring your style sheets I use a Visual Studio macros to implement constants for fonts numbers and colors - and to calculate light dark tints of colors . This topic has been much discussed elsewhere on this site . 2 . If you have a number of styles that are 140px wide and you want to have the flexibility of changing that dimension for all of those styles you could do this : .. . .. . div.FixedWidth width : 140px .. . div.Style1 whatever .. . div.Style2 whatever .. . .. . .. . and", "Question : I have an existing CSS file that I want to use with pages that also contain Japanese but the generated italics don t look good with Kanji and I definitely need different fonts from the ones used for English . Is there any way in CSS to specify a font or style for a specific set of glyphs in this case CJK .. . Answer : Not by glyphs but by lang attribute so .. . .. . The : lang selector identifies elements which have the specified lang attribute anywhere in their ancestor chain . Comment : So if I have a string of text like the character means .. . then I always have to put a span around the Comment : No it will pick up the first font that has that glyoh . So put English fonts first then CJK . Howeve . If you to to define things like italics in a language specific way then yes you d have to put it in a span .", "Question : null .. . Answer : Except for this http : sourceforge.net p cssparser discussion 283564 thread 6e3d60ac I haven t found any guides on how to use the CSS parser http : cssparser.sourceforge.net so I m kind of lost especially because I m not very familiar with CSS . I need to obtain images hidden in a css of a webpage and the getMedia method looks promising . What should I give the parser as a source Giving it the html of the page with the embedded css doesn t seem to work . Any help will be appreciated Comment : The page you link-to says that it inputs Cascading Style Sheets Level 2 source text or in other words a .CSS file . So try it with a .CSS file first and if that works we ll worry about getting the styles from a HTML page.. . Comment : It works with a .css file . Can we start worrying about getting a css from a html" ] }
[ "yes-answer-long", "yes-answer-short" ]
markup
UNK_RELATION
symfony3@web@44
symfony3 -- symfony3 is an open-source php @placeholder development framework for php 5.5.9 + focusing on easy and fast development cycles and including state-of-the-art design-patterns and programming philosophies .
{ "confidence": [ 45.19202423095703, 44.595191955566406, 44.40932846069336, 43.17306137084961, 43.00639343261719, 42.81926727294922, 42.741920471191406, 41.31978988647461, 41.31978988647461, 41.09886169433594, 41.09886169433594, 40.376338958740234, 40.252960205078125, 39.272850036621094, 38.83082962036133, 38.83082962036133, 37.88737869262695, 37.88737869262695, 37.88737869262695, 37.88737869262695, 37.88737869262695, 37.88737869262695, 37.88737869262695, 36.88152313232422, 36.88152313232422, 35.45939254760742, 35.45939254760742, 35.45939254760742, 35.45939254760742, 35.45939254760742, 35.45939254760742, 35.45939254760742, 35.45939254760742, 34.51594543457031, 34.51594543457031, 34.51594543457031, 34.51594543457031, 34.241600036621094, 33.99899673461914, 33.99899673461914, 33.385196685791016, 33.385196685791016, 33.385196685791016, 32.34021759033203, 32.34021759033203, 32.05877685546875, 30.918087005615234, 30.918087005615234, 30.918087005615234, 29.974639892578125, 29.974639892578125, 29.974639892578125, 29.974639892578125, 29.974639892578125, 29.974639892578125, 29.974639892578125, 29.974639892578125, 29.560842514038086, 29.560842514038086, 28.843891143798828, 28.843891143798828, 28.843891143798828, 28.843891143798828, 28.843891143798828, 28.49228286743164, 27.26327133178711, 27.100387573242188, 26.913097381591797, 26.897157669067383, 26.064516067504883, 26.064516067504883, 25.025711059570312, 25.025711059570312, 24.082260131835938, 24.082260131835938, 24.012359619140625, 23.993770599365234, 23.618221282958984, 23.5009765625, 23.5009765625, 23.27810287475586, 23.27810287475586, 23.06806182861328, 22.951513290405273, 22.951513290405273, 22.951513290405273, 22.951513290405273, 22.951513290405273, 22.836057662963867, 22.836057662963867, 22.67477035522461, 22.370506286621094, 22.370506286621094, 22.37033462524414, 21.892608642578125, 21.785606384277344, 21.785606384277344, 21.6490478515625, 21.544023513793945 ], "content": [ "I m incorporating PHP-FFMpeg https : github.com PHP-FFMpeg PHP-FFMpeg to my symfony3 project which is working perfectly .", "I m using Symfony3 .", "I am just starting the adventure with Symfony3 and with php and I encountered a problem .", "I am using Symfony3", "Introduction .. . .. . I m using https : github.com PHP-FFMpeg PHP-FFMpeg for my symfony3 project .", "I am using the NelmioApiDocBundle https : github.com nelmio NelmioApiDocBundle together with the PHP framework Symfony3 for a REST API .", "I m working on a project using Symfony3 .", "I d like to create a form with Symfony3 .", "I am using symfony3 as a newbie .", "Currently I m using Symfony3 .", "I found the solution for Symfony3", "Anyone know how import it to Symfony3", "I think for your setup it s different for Symfony3 .", "Your web directory in apache config should be : .. . .. . Presuming that gestion is you Symfony3 is it Symfony3", "I am having troubles with deploying a Symfony3 application .", "@gp sflover s link is the correct one to use with Symfony3 .", "The biggest site I have running there is based on Symfony3 .", "I am using symfony3 with armetiz LeezyPheanstalkBundle .", "They may refer to Symfony2 which is different than Symfony3 .", "I ve obviously adjusted the commands to make it compatible with Symfony3 .", "Using HWIOAuthBundle to allow social login with FOSUserBundle on Symfony3 .", "Are you sure it s not compatible with Symfony3 yet", "So don t work with symfony3 and will not go in this way .", "I m trying to create a private application and I m using Symfony3 and FOSUserBundle .", "I need help as i m struggling with an issue on my app based on symfony3 .", "Is symfony3 s ACL parent-child relation meant to do such things", "I m starting a project with Symfony3 and I have encountered this problem .", "The release dev-master 3.2.x-dev seems already compliant with symfony3 .", "I successfully installed this bundle on a symfony3 installation with the command : .. . .. . Hope this help", "I m using Elasticsearch for my symfony3 web application with the FOSElasticaBundle .", "I encountered a problem on roles promotion in Symfony3 as the title suggests .", "I am writing Symfony3 app using Doctrine ORM .", "@Freelancer the answer you gave was for Symfony2 be the op is using Symfony3 .", "Im using Symfony3 in my Project along with Doctrine ORM .", "I m trying to deploy my symfony3 project to production server Using deployer.ord .", "I am learning symfony3 based on symfony book instructions with nginx configured for .", "There was a closed pull request 2 days ago to do Symfony3 fixes .", "I am looking to implement the framework amphp thread with Symfony3 which I ve read about in this article https : www.mullie.eu parallel-processing-multi-tasking-php .", "In my case the Symfony3 error : .. . .. . The file does not exist .. . .. . was connected with PHP not being able write the file down to temporarily folder due to open basedir restrictions .", "Therefore in any case you see this error in Symfony3 make sure that correct permissions are set to folders and that PHP may write data into it .", "MY PROBLEM .. . .. . I am tying to make stof StofDoctrineExtensionsBundle work with symfony3 .", "It is possible to connect Symfony3 with ODBC driver on a Linux System with PHP7", "Any new ideas or proper way to move Symfony3 application to production server", "Just as a note there is different Symfony3 setup here http : symfony.com doc current cookbook controller upload file.html which might be helpful .", "I m using Symfony3 with FOSBundle and I ve followed these instructions http : symfony.com doc current cookbook security impersonating user.html .", "We have autoscaling set up for our symfony3 application .", "Everything worked fine except that I had to adapt on the Symfony3 commands the guide is written with Symfony2 commands I guess .", "I m new with Symfony and I m using Lexik JWT bundle with symfony3 for API authentication and a login form-for web authentication .", "By the way I am using Symfony3 and every component added in the type.php file is rendered excellent with Materialize except a ChoiceType .", "I try to validate a symfony3 form I use two constraints for each entity field NotBlank and Float .", "I m using Symfony3 for my project and I m facing ReferenceError : optionOneChange is not defined error .", "One thing though : the method has apparently been renamed to event- getRequestType in Symfony3 .", "Or anyone have some bundle with file uploader based on jQuery File Upload working with Symfony3", "I have a server running on apache2 with some virtual-hosts and I want to deploy a Symfony3 application on it .", "I ve only recently started using Symfony Symfony3 and I m in the process of converting my old website to use Symfony .", "I have a problem to get my entity named Waiter from session object in Symfony3 .", "Note You ll have other problems related to the Symfony3 architecture such as the cache and logs directory .", "I am attempting to use The VichImageBundle with Symfony3 there is no documentation as of yet for the FormType : : class call that is new to S3 in conjunction with the Vich Image Bundle .", "I ve setup a Symfony3 project which supports multiple-file-upload with the FileTypefield http : symfony.com doc current reference forms types file.html .", "I ve installed SonataMediaBundle with Symfony3 and I ve linked a media to an entity blogposts with a ManyToMany Relation .", "I am trying to use the JMSSerializerBundle http : jmsyst.com bundles JMSSerializerBundle for Symfony3 which just came out .", "Is it possible to place your Entity models in a different place than Bundle Documents in Symfony3", "My problem .. . .. . I am performing a join using doctrine2 query-builder and symfony3 .", "Summary .. . .. . My problem is connected with the fact that the entity field marked with @Gedmo UploadableFilePath annotation is ignored by Symfony3 .", "We are running a Syfmonfy 3.1.2 site on a server which has PHP 5.5.9 installed .", "The development branch is 2.0 .", "It doesn t work fast even I enter only one PHP file .", "The app is running on the pinky stack my composer.json requires PHP 5.5.9 .. . .. . When I try to push I get .. . .. . The phpinfo of the pinky stack http : pinky-phpinfo.cloudcontrolled.com shows that PHP 5.6.12 is running .", "In the development-environment I always use Symfony s built-in server and just use the command php bin console server : run .", "I understand the benefit or repository pattern but I just can t understand in Symfony3 Doctrine there are Doctrine ORM EntityManager and Doctrine ORM EntityRepository .. . .. . 1 .", "I tagged the question with both symfony3 and symfony2 because I m using Symfony 3.0 but I m pretty sure it s identical in Symfony 2.8 .", "I started to explore symfony3 and after install I run the provided functional test via .. . .. . on the terminal but I get the error : .. . .. . Hitting the page via browsers works .", "You can take a look at this answer to a VichUploader question http : stackoverflow.com questions 38769009 data-fixtures-with-vichuploader-bundle-in-symfony3 38773542 38773542 I made yesterday .", "here is the Symfony3 Web server configuration information Link : http : symfony.com doc current cookbook configuration web server configuration.html .. . .. . You need to modify your DocumentRoot directive just as @RiggsFolly has indicated .", "I don t want make some spam but in the same way I created a bundle that allow to configure capistrano interactively with pre-defined tasks and good configurations for now it s not symfony3 ready but it could be a good thing to adapt it", "If I run PHP Code Sniffer through the Grunt in the old project it works properly and fast .", "Added a note about development-environment .", "apcu is apc for php 7.0", "In the development enviroment everything is ok . .. . .. . composer update was made several times .", "So existing apps which switch to the development branch probably won t work .", ".. . .. . https : github.com PHP-FFMpeg PHP-FFMpeg issues 201", "its php just use php to execute a command-line string", "For use this bundle with symfony3 you must use the form type : VichFileType as described in the doc here https : github.com dustin10 VichUploaderBundle blob master Resources doc form vich file type.md as example : .. . .. . So try this in your formType class : .. . .. . Hope this help", "Based on this question How to install symfony2 app in a subdirectory in nginx http : stackoverflow.com questions 12266297 how-to-install-symfony2-app-in-a-subdirectory-in-nginx .. . .. . I ve created symfony3 application that works in subdirectory called bcms4 .", "I want to start a project with Symfony3 and SonataAdmin I was trying a lot of versions of symfony and sonataAdminBundle But I always get errors when updating composer .. . .. . What s the correct composer.json to start my project .. . .. . thanks", "I m using Scheb s two factor bundle https : packagist.org packages scheb two-factor-bundle in a Symfony3 project and I d like to handle the exclude pattern parameter differently than it does but I don t know how .", ".. . .. . As requested http : stackoverflow.com questions 37687398 how-can-i-set-the-new-directory-structure-when-updating-symfony2-8-to-symfony3-0 37687700 comment62863050 37687700 here s my composer.json file :", "You should check the composer.json files the extra section as example : .. . .. . More info in this article https : knpuniversity.com screencast symfony3-upgrade new-dir-structure Hope this help", "nothing in the php log or dev.log either", "php 7.0 hasn t apc extenstion", "It doesn t depend on Symfony or PHP .", "I m using the symfony php framework so I want web app.php to be rendered as an index page .", "To track those transactions don t I need to use the same language as my web framework meaning PHP because of symfony", "Try to use php bin console doctrine : generate : entities AppBundle or php bin console doctrine : generate : entity AppBundle Entity Actions", "DocumentRoot is not supposed to contain a PHP script .", "And you ve run : php bin console debug : router", "but i can t install apc for php 7.0 .", "Do I really need VirtualHost for local development", "How to transform this in php" ] }
{ "confidence": [ 48.35496520996094, 46.753456115722656, 43.09521484375, 43.0777587890625, 42.15625, 41.74861526489258, 40.918243408203125, 40.16606521606445, 39.711090087890625, 39.477294921875, 39.35694885253906, 39.215667724609375, 39.14238357543945, 38.06451416015625, 37.767906188964844, 37.27757263183594, 37.27757263183594, 36.62518310546875, 36.62518310546875, 36.618324279785156 ], "content": [ "Question : MY PROBLEM .. . .. . I am tying to make stof StofDoctrineExtensionsBundle work with symfony3 . Therefore instead of using form- bind as listed in example in stof documentation I tried form- handleRequest . Unluckily after submitting the form I get the following error : .. . .. . The file does not exist .. . .. . I would be thankful for you advise what am I doing wrong . Maybe somebody would be so kind and provide me with example of working upload scripts .. . .. . MY CODE .. . .. . .. . .. . My Controller code looks like this : .. . .. . form is build using the following function : .. . .. . and my entity class : .. . .. . I am using default configuration as listed here https : symfony.com doc master bundles StofDoctrineExtensionsBundle index.html . .. . Answer : In my case the Symfony3 error : .. . .. . The file does not exist .. . .. . was connected with PHP not being able write the file down to temporarily folder due to open basedir restrictions . Therefore in any case you see this error in Symfony3 make sure that correct permissions are set to folders and that PHP may write data into it .", "Question : I have a server running on apache2 with some virtual-hosts and I want to deploy a Symfony3 application on it . However I cannot deploy it correctly to the production environment it works perfectly on development-environment . Whenever I do execute .. . .. . I get the error : PHP Fatal error : Class Sensio Bundle GeneratorBundle SensioGeneratorBundle not found in my path app AppKernel.php on line 25 Script Sensio Bundle DistributionBundle Composer ScriptHandler : : clearCache handling the post-install-cmd event terminated with an exception .. . .. . After getting this error I went to read the documentation again and it said that I need to export this the Symfony environment to production . So I did that : .. . .. . After that I executed the composer install command again but same results . Some people on Stackoverflow and other sources said that I need to clear my cache by executing .. . .. . So I did that but same results . Anyone any idea Other sulutions tried : Actually it works great whenever I execute the command this way : .. . .. . However whenever everything was installed correctly I went to try to visit the URL and I got a 500 . So I went to the Apache2 logs to check if something was wrong and I saw the same RuntimeException again . EDIT .. . .. . So I ve also followed the instructions of this link http : symfony.com doc current book installation.html checking-symfony-application-configuration-and-setup but unfortunately same results . I also checked if I ve got everything installed correctly such as ACL and I did . I also did an getfacl my path var cache and it showed the correct information based on this link https : www.digitalocean.com community tutorials how-to-deploy-a-symfony-application-to-production-on-ubuntu-14-04 . EDIT 2 .. . .. . I ve also already run php bin symfony requirements and it showed me that My system is ready to run Symfony Projects even after php bin console cache : clear --env prod --no-debug .. . Answer : I m not certain what the problem could be but since this is a new deploy make sure you have setup the correct install requirements . For apache normally the user is apache and group is apache . In a production environment an easy way to set the correct owner : group is the following command : .. . .. . Also this link : http : symfony.com doc current book installation.html checking-symfony-application-configuration-and-setup .. . .. . Describes how to setup the ACL permissions on Linux and MacOS and the var directory needs special permissions . Make sure you check those things and see if that helps . Edit 2 . I saw your comment . One of those links is for Symfony2 and it s old . I don t suggest using references that are old . They may refer to Symfony2 which is different than Symfony3 . Take a look at this link : http : symfony.com doc current cookbook deployment tools.html .. . .. . Have you run the php bin symfony requirements command yet This is important that this passes . It ll point out problems . Also the command to clear and warm-up the cache is : .. . .. . That s different from what you show above . Comment : Hey I ve also followed these instructions for var cache and var logs . But nothing : See my edited question for more info . Comment : I edited my post . Take a look - I hope it helps otherwise I m not sure . Comment : Thank you I ve obviously adjusted the commands to make it compatible with Symfony3 . And yes I already run both . But unfortunately :", "Question : null .. . Answer : It is possible to connect Symfony3 with ODBC driver on a Linux System with PHP7 How should the config look like I found already this answer Symfony connect to database : ODBC connection on PHP7 http : stackoverflow.com questions 35796495 symfony-connect-to-database-odbc-connection-on-php7 but i think its only for windows os . The Linux drivers are still unstable https : github.com Azure msphpsql tree PHP-7.0-Linux binaries . Thanks in advance", "Question : I m looking to integrate the FOSElasticaBundle into my symfony 3 project . Currently this bundle doesn t support symfony 3 . I was ondering what I could do to still implement it .. . Answer : Seems is not yet tagged a valid release for using it via packagist . See this issue on github https : github.com FriendsOfSymfony FOSElasticaBundle issues 1057 . The release dev-master 3.2.x-dev seems already compliant with symfony3 . I successfully installed this bundle on a symfony3 installation with the command : .. . .. . Hope this help", "Question : null .. . Answer : I am using the NelmioApiDocBundle https : github.com nelmio NelmioApiDocBundle together with the PHP framework Symfony3 for a REST API . I want to display the description of my parameters in the api doc page . Is this possible without adding the parameters manually I want to import it from the input output class . This is how my documentation looks : .. . .. . Screenshot http : i.stack.imgur.com CIA1g.png Not enough reputation for embedding : .. . .. . Here ist my @ApiDoc of the controller action api user login which generates the documentation : .. . .. . AppBundle Libraries Core User LoginRequest class : .. . .. . I would like to use the desciptions of this class eg . for username : The username . for password : The password . and for rememberPassword : Defines whether or not to save the refresh token as cooke . . Thanks for the help . Greetings Orlando", "Question : null .. . Answer : I ve setup a Symfony3 project which supports multiple-file-upload with the FileTypefield http : symfony.com doc current reference forms types file.html . After upload the file is persisted with Doctrine . My next goal is to enable chunked file-upload as the files which need to be uploaded are going to be quite big 1gb . How can I do this in a clean and neat Symfony- way I ve looked at several options of which 1-up-lab OneupLoaderBundle https : github.com 1up-lab OneupUploaderBundle would be my first choice however this bundle doesn t support the FileType field . I ve also looked at resumable.js https : github.com 23 resumable.js and flow.js https : github.com flowjs flow.js and it s PHP counterparts resumable.php https : github.com dilab resumable.php and flow-php-server https : github.com flowjs flow-php-server but I m unsure how to implement these in my current project and keeping my current form and logic intact .", "Question : In a fresh installation of Symfony 3 the debug toolbar not showing when I have the apache 2.4.7 configuration file : .. . .. . If I change the configuration file to : .. . .. . And access : http : dev.enterprise.cl app dev.php all going ok . .. . .. . What is wrong .. . Answer : Your web directory in apache config should be : .. . .. . Presuming that gestion is you Symfony3 is it Symfony3 folder.. . .. . .. . A quick verify the way it is now is try : http : dev.enterprise.cl web app dev.php .. . .. . By the way are you using a web browser on the same host If not you ll need to edit the app dev.php file like so : .. . .. . Where that REMOTE ADDR contains the IP of your host by default it s just localhost 127.0.0.1 .", "Question : Hi guys im new to symfony and i ve done a lot search about how to upload image using doctrine entity anyone can make a short simple guide about it Comment : Read How to upload Files http : symfony.com doc current controller upload file.html from the docs . Comment : did it already but the photo is not uploaded .. . Answer : You can take a look at this answer to a VichUploader question http : stackoverflow.com questions 38769009 data-fixtures-with-vichuploader-bundle-in-symfony3 38773542 38773542 I made yesterday . Maybe that is helpful to you . Let me know and maybe I ll make a blog post on it with more details . @gp sflover s link is the correct one to use with Symfony3 .", "Question : Based on this question How to install symfony2 app in a subdirectory in nginx http : stackoverflow.com questions 12266297 how-to-install-symfony2-app-in-a-subdirectory-in-nginx .. . .. . I ve created symfony3 application that works in subdirectory called bcms4 . I ve manged to make php work with PHP-FPM but I have probelms with assets . When I want to GET asset it directs the request to app dev and shows 404 because obviosly the path does not exist . My question is how to make assets not to be proccesed by app dev but downloaded as supposed So when I enter .. . .. . test.localhost s asdfad - it runs symfony test.localhost asdf - it runs other app living in main dir test.localhost s assets css test.css - it will show file in directory var www test.localhost bcms4 web assets css test.css .. . .. . My nginx config : .. . Answer : After hours of trying I ve managed to figure it out with little hack . This is what I ve added to my config file .. . .. . It ll rewrite files that has prefix s and extension to directory where they are actually . Maybe it will help someone . I ll leave question open for a while maybe someone has better solution cause it s seems hacky for me .", "Question : I m trying to deploy my symfony3 project to production server Using deployer.ord . I ve been through all around deployer.org and not sure what is going wrong . Below is my deploy.php file .. . .. . The error that i am getting is : PHP Notice : Connection terminated by the server .. . .. . I have already tried this resource but still no luck http : www.issart.com blog deployment-of-symfony2-application-using-deployer .. . .. . I wonder if i am using the right credentials i am using ftp ones for deployment . I was also not able to find much of info online on deployer.org and a step-by-step on how to deploy and debug so any help would be highly appreciated . .. . Answer : I am using capifony http : capifony.org for deploying my symfony apps . It supports deploying to multiserver and multistage and many more . You can give it a try", "Question : null .. . Answer : this is my User Class .. . .. . . I m starting a project with Symfony3 and I have encountered this problem . Run .. . .. . And the error is : .. . .. . I find answers as here https : stackoverflow.com questions 18333456 fos-user-bundle-duplicate-defination-of-database 18334830 18334830 or here http : stackoverflow.com questions 20683191 doctrine-orm-mapping-mappingexception-duplicate-definition-of-column-username . So these fields are defined in Model User from the bundle I delete it.. . but get this other error : .. . .. . What did I do wrong Before extending Model User was no problem . Comment : Have you checked the indexes on the database It might be that the forced update failed at some point and left you with this problematic state", "Question : Welcome I m a little newbie in symfony but I wanna create website with upload file . I found good bundle https : github.com SymfonyContrib FileFieldBundle but when I try add it by composer then it s not possible becouse lastest correct Symfony version is 2.3 . Anyone know how import it to Symfony3 Or anyone have some bundle with file uploader based on jQuery File Upload working with Symfony3 Thanks for help .. . Answer : You can t use that bundle unless the maintainer of the bundle migrates it to Symfony 3 . In his composer.json https : github.com SymfonyContrib FileFieldBundle blob master composer.json the required symfony version is stated as 2.3 which is equivalent to 2.3 3.0.0 composer version syntax https : getcomposer.org doc articles versions.md tilde . You are of course free to fork the bundle on github and make the required changes yourself to make it compatible with Symfony 3 and issue a pull request .", "Question : I m using Symfony3.1 and I have just installed VichUploaderBundle . I have followed the documentation but I get this error means that Field image name can not be empty null .. . .. . SQLSTATE 23000 : Integrity constraint violation : 1048 Le champ image name ne peut tre vide null .. . .. . Config .. . .. . the entity .. . .. . FormType : .. . .. . twig .. . .. . Action Comment : Where is the code that is producing this error . You show the Entity above but we probably need to see the Controller code or form code where you do the upload . Can you edit your post and post that code please Comment : @AlvinBunk I have edited my post .. . Answer : Just as a note there is different Symfony3 setup here http : symfony.com doc current cookbook controller upload file.html which might be helpful . I think for your setup it s different for Symfony3 . Try this : .. . .. . Also you need this change too : Comment : The error is that the upload mapping name in the config and the mapping name in the entity are different but they must be the same . In the config file is product image and in the entity is actualite image . Now I give them the same name and it works good now .", "Question : null .. . Answer : I m using Symfony3 with FOSBundle and I ve followed these instructions http : symfony.com doc current cookbook security impersonating user.html . However I m also using FR3DLdapBundle https : github.com Maks3w FR3DLdapBundle and wondering if they can work together Maybe an additional config is required If you nee more details I can update the post .", "Question : I m trying to run this cmd which is supposed to dump assetic files for prod environment : .. . .. . This cmd returns the following error : .. . .. . Symfony Component DependencyInjection Exception ServiceNotFoundException You have requested a non-existent service assetic.asset manager . When i try to access the prod page through my browser i ve got the following error : .. . .. . An exception has been thrown during the rendering of a template Unable to generate a URL for the named route assetic 2f6a151 0 as such route does not exist . in YOCoreBundle : : layout.html.twig at line 14 .. . .. . Everything is working fine in the dev environment static files are minified and stored in the right folder when i run this cmd : .. . .. . Regarding my configuration : .. . .. . In composer.json : .. . .. . In app-config config.yml i have the following code : .. . .. . AsseticBundle is declared in the AppKernel.php : .. . .. . I don t really know where the problem might be . If anyone has an idea about that it would be really appreciated . Thanks in advance . Comment : did you try to clear the cache with the cache : clear command on the prod env Comment : Thanks for that I just did it . I don t have the error coming from the cmd prompt anymore . But the error when visiting the prod page through the browsse is still there . .. . Answer : @Freelancer the answer you gave was for Symfony2 be the op is using Symfony3 . The commands you need to clear the production cache are : .. . .. . and to clear the dev development cache are : .. . .. . There is no need for the --no-debug . Also a lot of time in the dev environment you won t need to clear cache for certain changes i.e . twig changes but definitely clear the cache for prod when you make significant changes . Edit 2 . You might need to run this command as well : .. . .. . Try it Comment : Thanks . I used both commands one after another : php bin console cache : clear --env prod php bin console assetic : dump --env prod But this problem still persists when visiting the prod : An exception has been thrown during the rendering of a template Unable to generate a URL for the named route assetic 2f6a151 0 as such route does not exist . in YOCoreBundle : : layout.html.twig at line 14 Comment : Check my second edit - maybe that s the problem . Comment : Thanks . I ran it emptied the cache ran it again.. . the problem persists : i m still unable to generate a URL for the named route assetic 2f6a151 0 Comment : And you ve run : php bin console debug : router to look for that route Comment : it s here : ----------------------------------- ---------- -------- ------ ----------------------------------- Name Method Scheme Host Path ----------------------------------- ---------- -------- ------ ----------------------------------- assetic 2f6a151 0 ANY ANY ANY css 2f6a151 main 1.css", "Question : I am looking to implement the framework amphp thread with Symfony3 which I ve read about in this article https : www.mullie.eu parallel-processing-multi-tasking-php . I d looked at the setting process on the git page : https : github.com amphp thread . I ve followed the checklist : .. . .. . PHP5.5+ OK Php 5.5.12 .. . pecl pthread OK I did install it as explained on Windows8 .. . .. . Now 3rd task on the checklist I have the installation of the framework itself amphp thread left to do . I am a bit confuse because it is not an official Symfony bundle . So I don t think I can put it under my symfony project vendor and refer to it in the file my symfony project app AppKernel.php . So how do one do in this case : .. . .. . Do one put the directory of the library under the root directory my symfony project And afterwards how can one refer to it in the Symphony class file should I write : use amphp thread between the namespace declaration of my Symfony file and the class code itself .. . Answer : You can simply install the library with composer as example launching this command from the root of your project : .. . .. . And use it in your code directly : the composer process generate the correct autoloader for you . No necessary add to the list of the Symfony2 bundle is not a bundle . Hope this help Comment : Thanks it worked out also I had composer in my environment-variables so just had to run : composer require amphp thread . Comment : Hi @nyluje if this or any answer has solved your question please consider accepting it http : meta.stackexchange.com q 5234 179419 by clicking the check-mark . This indicates to the wider community that you ve found a solution and gives some reputation to both the answerer and yourself . There is no obligation to do this .", "Question : I am looking to implement the framework amphp thread with Symfony3 which I ve read about in this article https : www.mullie.eu parallel-processing-multi-tasking-php . I d looked at the setting process on the git page : https : github.com amphp thread . I ve followed the checklist : .. . .. . PHP5.5+ OK Php 5.5.12 .. . pecl pthread OK I did install it as explained on Windows8 .. . .. . Now 3rd task on the checklist I have the installation of the framework itself amphp thread left to do . I am a bit confuse because it is not an official Symfony bundle . So I don t think I can put it under my symfony project vendor and refer to it in the file my symfony project app AppKernel.php . So how do one do in this case : .. . .. . Do one put the directory of the library under the root directory my symfony project And afterwards how can one refer to it in the Symphony class file should I write : use amphp thread between the namespace declaration of my Symfony file and the class code itself .. . Answer : You will need to install the bundle this can be done easily by adding the following to your composer.json file : .. . .. . Then run composer install on your server . Comment : Thanks I did use the composer require as the other answer provided suggested but it did result in what you described in the composer.json file which is beneath the root folder of my project . Comment : I m glad it helped .", "Question : null .. . Answer : I am using Materialize in a project but I don t want it on this particular select element : .. . .. . I think the only way to solve it is to make my own style and apply it to the element but as Materialize is new maybe there is an easier solution . By the way I am using Symfony3 and every component added in the type.php file is rendered excellent with Materialize except a ChoiceType . So that s why I want to exclude the Materialize style of the select element . This is the code :", "Question : null .. . Answer : I m using Elasticsearch for my symfony3 web application with the FOSElasticaBundle . I m working on a belgian project so I should set the language analyzer to dutch . This if my imported config file : .. . .. . I this sufficient for setting the dutch analyzer or should I be referencing it it every mapping like so edit : added snowball", "Question : Imagine a simple entity like this .. . .. . and form type like this .. . .. . and the Role entity the the RoleType form .. . .. . Using the typical form- isValid the choice constraint assertions is not working properly.. . is not actually validating the Role name value . .. . Answer : I found the solution for Symfony3" ] }
[ "yes-answer-long", "yes-answer-short" ]
web
UNK_RELATION
javacompiler@java@73
javacompiler -- javax.tools.javacompiler is an interface used to invoke @placeholder programming language compilers from programs .
{ "confidence": [ 29.830244064331055, 24.63152313232422, 23.5750732421875, 23.5750732421875, 23.28403091430664, 23.13153076171875, 22.61384391784668, 22.434139251708984, 22.410396575927734, 22.172752380371094, 22.130474090576172, 21.878623962402344, 21.66423797607422, 21.497018814086914, 21.48673439025879, 21.37032699584961, 20.734424591064453, 20.66277503967285, 20.381425857543945, 19.8571720123291, 19.736318588256836, 19.426721572875977, 19.426721572875977, 19.404329299926758, 19.38180160522461, 19.155790328979492, 19.037975311279297, 18.86702537536621, 18.851654052734375, 18.67333984375, 18.67333984375, 18.67333984375, 18.07398223876953, 17.685352325439453, 17.658538818359375, 17.658538818359375, 17.658538818359375, 17.658538818359375, 17.62567138671875, 17.62567138671875, 17.48685073852539, 17.459341049194336, 17.1518497467041, 17.037458419799805, 17.037458419799805, 16.472082138061523, 16.33094024658203, 16.176937103271484, 16.077890396118164, 15.915870666503906, 15.880849838256836, 15.880849838256836, 15.779576301574707, 15.779576301574707, 15.779576301574707, 15.372462272644043, 15.372462272644043, 15.372462272644043, 15.372462272644043, 15.372462272644043, 15.341009140014648, 15.267878532409668, 15.267878532409668, 14.954708099365234, 14.954708099365234, 14.790188789367676, 14.634490013122559, 14.634490013122559, 14.320167541503906, 14.244914054870605, 14.08312702178955, 14.08312702178955, 14.08312702178955, 14.08312702178955, 13.882183074951172, 13.829306602478027, 13.68028450012207, 13.571429252624512, 13.571429252624512, 13.571429252624512, 13.571429252624512, 13.50905704498291, 13.337575912475586, 13.337575912475586, 13.258258819580078, 13.258258819580078, 13.160892486572266, 12.973560333251953, 12.957694053649902, 12.907496452331543, 12.907496452331543, 12.895608901977539, 12.836376190185547, 12.836376190185547, 12.836376190185547, 12.836376190185547, 12.836376190185547, 12.836376190185547, 12.836376190185547 ], "content": [ "I have used javax.tools.JavaCompiler to compile the Classes in the Strings .", "My in tension is to create a plugin at at the run time using java code.First a created executable-jar using the java.util.jar.JarOutputStream and used javax.tools.JavaCompiler for compiling the classes .", "So I m working on building a program that uses the built-in JavaCompiler API to compile a directory of .java files .", "I writed a code that generates two class which I write them to buffer and compile them with JavaCompiler .", "@ElliottFrisch - I have a special language for people wich aren t comfortable with programming .", "I ve been using javax.tools.JavaCompiler but it doesn t seem to work with when they use multiple packages .", "Like bellow I created the java Class by copying from another file then I use JavaCompiler to compile the newly created Java .", "An open-source lexical analizer is flex https : en.wikipedia.org wiki Flex lexical analyser A useful syntactic analizer is yacc https : en.wikipedia.org wiki Yacc .. . .. . Both works with C and C++ that are the most used languages to create compilers java and others too but there are also similar alternatives for other programming-languages to create a compiler in another language not for another language .", "Here s my code : .. . .. . EDIT : Wildcards ie .java do not work in JavaCompiler.. . .. . .. . ANSWER : From the comments I tried instead of files i .getPath to pass the compiler a String containing all paths for all files .", "Also compilers that don t generate an intermediate byte code but a machine code like compilers for C or C++ .", "http : stackoverflow.com questions 1563909 how-to-set-classpath-when-i-use-javax-tools-javacompiler-compile-the-source and the examples from here : http : www.programcreek.com java-api-examples index.php api javax.tools.JavaCompiler .. . .. . but I can t seem to find the solution. . .. . .. . Alternatively it would be nice if this could be done without unpacking and saving the jar file but directly with a bite stream from the database where I ve saved the file .", "I ve tried to solve via getTask method of JavaCompiler Api by sending optionList with path but without success .", "Please see the update to my original question specifically about using JavaCompiler", "I am trying to compile a simple java class using JavaCompiler class but I see following errors : Exception in thread main java.lang.NullPointerException at com.coderbd.compile.JDK6FirstCompile.main JDK6FirstCompile.java : 12 .. . .. . I am using JDK 1.8.31 Please help me to solve the issue .", "questions 4200142 why-do-i-get-a-classnotfoundexception-when-using-class-forname 2 answers .. . .. . I have used JavaCompiler to compile a class that I generate on the fly .", "Or will certain compilers throw the exception", ".. . .. . Note : This process is not related only to java but it is common to all compilers .", "Basically language in which a compiler is written is not related to the language the compiler compiles .", "Instead of calling JavaCompiler run which actually is Tool run you might have to create a dedicated compilation task with JavaCompiler getTask https : docs.oracle.com javase 8 docs api javax tools JavaCompiler.html getTask-java.io.Writer-javax.tools.JavaFileManager-javax.tools.DiagnosticListener-java.lang.Iterable-java.lang.Iterable-java.lang.Iterable- : It allows you to add the information that is required for the compilation - particularly the compilation units .", "I ve looked at Java programmatically compile jar http : stackoverflow.com questions 10076868 java-programmatically-compile-jar How to set classpath when I use javax.tools.JavaCompiler compile the source", "For example since an interface is an abstract type how is the type checking done and how is an interface represented by the compiler to do these checks .", "It has access to both the interface and your class .", "A single class file defines either a class or interface .", "My application generates java code during runtime and compiles it using the JavaCompiler API .", "The compiler checks the class declaration against the language spec .", "ICompany.class : .. . .. . ECompany.class : .. . .. . From the class files you can see that the interface in the example does not have much added to it in terms of methods or flags hence the smaller size .", "All correct Java compilers and JVMs will run it the same way .", "Hi Thanks I used Ibcs src com coderbd compile Foo.java and compile Foo.java respectively but same error .", "I removed package spec from code outputed it to file cat JDK6FirstCompile.java compiled from terminal and successfully executed .", "For example the actual method could return a subtype of the return-type of the method in the interface .", "I tested class enum interface these 3 ways to encapsulate constant String .", "The interface just needs to have a field name type and value .", "Incremental Java compilation will improve over coming Gradle versions to be generally faster and to invoke a full recompile in response to fewer types of changes .", "So there is something like a little script language .", "How does the java compiler know that I haven t implemented all of the methods of an interface", "How does the java compiler know that I haven t implemented all of the methods of an interface", "In Java an interface is an abstract type which is a set of operations with well-defined and mutally consistent semantics .", "An interface is an abstract type which is really just a set of operations and constants that a class must conform to .", "Translate - Produce intermediate representation trees IR trees a notation that is not tied to any particular source language or targetmachine architecture .", "The Java compiler has a type checker which makes sure that the program obeys the type-compatibility rules of the language .", "I m pretty new to programming so I apologize for my ugly code .", "I m using java swing for the gui and have so far been able to compile a .java file from within the interface into a .class-file .", "Once it s compiled you will need to load the Class object and then invoke the main String method .", "If I declare that my object implements an interface but fail to implement those methods when I compile my code I get a compiler error .", "After compile they generated 330 bytes 181 bytes and 818 bytes bytecode which means interface ICompany will cost less memory when loaded into jvm .", "Maven config : .. . .. . SUGGESTION .. . .. . Another random thought I had would be to run a JavaCompiler process for the DB project in WEB but how would I inject my Processor", "VIM is a text-editor for writing your code Command Prompt is used for the computer s administrative functions and executing batch files .", "I have a prorgam thats generating source code and want to compile this source code during the java-runtime execution like : .. . .. . I use the JavaCompiler from ToolProvider : .. . .. . Now the important line is where i add the -d classdirectory in the optionlist .", "Empty loops are rare in real programs or even in serious benchmarks so optimization for them may not be very consistent or well tested .", "There is also Eclipse ecj but I ve never used it", "Register Allocation - Choose a register to hold each of the variables and temporary values used by the program variables not live at the same time can share the same register .", "Having said that the size of a .class-file is not necessarily an accurate predictor of the memory used when a class has been loaded and JIT compiled .", "I have been working on Java from more than 8 years .", "5 . flow : Performs dataflow analysis on the trees from the previous step .", "Tokens are taken as input from lexical-analysis and are combined to form expressions and instructions .", "Coder Is here : .. . .. . Any help will be appreciated .", "Use full path to Foo.java or place it where classes are outputed .", "Most likely built main class can t access Foo.java using relative-path", "That Ibcs src .. . is it in your root folder", "If it is relative-path then Ibcs src .. .", "I m trying to write a java program with an interface that allows the user to create .java file and compile and run it essentially a very simplistic IDE .", "From the comments I tried instead of files i .getPath to pass the compiler a String containing all paths for all files .", "Still I am not satisfied and eager to learn something more about this from you .", "If you would like to get a more detailed response from the community please accept this answer with the check mark and ask a new question .", "Basically this steps extract tokens from java code keywords operators separators comments variable names.. . .. . .. . Syntax analysis parser The second step is the syntax analysis .", "I find that when I run the javac command on the generated code in the command-line or alternatively if I use an application that does just the compilation via the JavaCompiler API I can compile many of these files 500 even if they are very large in under two minutes .", "Just try to do it like : .. . .. . or .. . .. . Or just move it out out of compileJava closure to the script body as it usually used like :", "@JJD you can ignore it seems that Idea doesn t know that they are used in some additional plugin .", "build.gradle from main folder .. . .. . build.gradle from app", "I m using ecj for Genetic Programming and I have it built so it takes the best fit individual program after a run and creates a java class with a function from the lisp code that is created .", "To critique or request clarification from an author leave a comment below their post .", "Removing start however prevents the bat file from launching .", "And I was able to execute the jar from command-line properly .", "The task is in compilation dynamic class created from string and subsequent creating instantiation .", "There are examples using JavaCompiler.CompilationTask for compiling single java files.But i need to to generate class file from multiple couples .java codes generated from JAXB gen .", "The deeper explanation is in JLS Sec 8.1.5 https : docs.oracle.com javase specs jls se8 html jls-8.html jls-8.1.5 : Unless the class being declared is abstract all the abstract member methods of each direct superinterface must be implemented 8.4.8.1 either by a declaration in this class or by an existing method declaration inherited from the direct superclass or a direct superinterface because a class that is not abstract is not permitted to have abstract methods 8.1.1.1 .", "Same in the sense the jar entries...Plugin.xml and Manifest files are same.But there are some differences in the .class files.But the source file I used for both is same.Is it something related to compilation issue . .", "@VinceEmigh - as you can see from the generated code its not in any specific package .", "Is there any way to programatically generate class files from .java files present in a folder .", "But I m also not sure about the solution of copying the tools.jar from a java jdk into my project .", "EDIT : .. . .. . From what I ve seen javac thinks I m in the wrong directory and can t find the main class when compiling .", "It s working now I will put in two comments the command that I used to compile and run the file .", "Why it doesn t work from the runnable jar file", "Unfortunately I cannot post too much from it .", "I don t see anything like that in the JRE and if I Google for it I see this class in various places including one from Apache .", "There are multiple .java files...compilation fails if the parent class is first compiled instead of child class....They .java files are from jaxb generated.. .", "From what I can see from your code the issue is that once exported the file paths of the exported program and the generated Crillin.java .", "I cannot place my finger on exactly why but when I switched from using the default system compiler via a call to ToolProvider.getSystemJavaCompiler but instead used Eclipse s JDT compiler things sped up significantly .", "You would have to dynamically load the class and get the methods from there .", "I d either need a return-value from the bat file so I the rest of the program waits until it s done or a way to launch the java compiler out of the program and direct the error messages into a txt file .", "I ve been researching how to run a .class-file from within java code but have found a wide range of answers which I haven t been able to get working .", "show that file and the command series which you used so far", "I got it parse through a directory to compile the files and even compiles them just not in the order I need .", "I get back the classic cannot find symbol since certain classes are reliant on one another .", "So a group of files that compiled fine with javac fail with my program .", "I need a way to either compile them in a certain order my last option is actually parsing through the file for references but I d rather not or compiling at the same time .", "Works Great", "Thanks", "did you try with javac .java" ] }
{ "confidence": [ 40.24833679199219, 30.471271514892578, 27.495868682861328, 26.28616714477539, 26.22890853881836, 25.893142700195312, 25.789743423461914, 25.184749603271484, 23.892927169799805, 23.802093505859375, 23.019577026367188, 22.094684600830078, 20.739810943603516, 20.293710708618164, 20.04311752319336, 20.0113525390625, 20.0113525390625, 19.696372985839844, 18.292688369750977, 18.205825805664062 ], "content": [ "Question : null .. . Answer : I m trying to write a program in which people can upload their src code for a Othello IA and play against each other . So I get the a jar file with .java src code which I want to compile and upload to my database . I ve been using javax.tools.JavaCompiler but it doesn t seem to work with when they use multiple packages . Here is an example of my code : .. . .. . If my toTest.jar file contains packages instead of all .java files directly this doesn t compile . I ve looked at Java programmatically compile jar http : stackoverflow.com questions 10076868 java-programmatically-compile-jar How to set classpath when I use javax.tools.JavaCompiler compile the source http : stackoverflow.com questions 1563909 how-to-set-classpath-when-i-use-javax-tools-javacompiler-compile-the-source and the examples from here : http : www.programcreek.com java-api-examples index.php api javax.tools.JavaCompiler .. . .. . but I can t seem to find the solution. . .. . .. . Alternatively it would be nice if this could be done without unpacking and saving the jar file but directly with a bite stream from the database where I ve saved the file . I m pretty new to programming so I apologize for my ugly code . I d be grateful for any help or indication EDIT : .. . .. . From what I ve seen javac thinks I m in the wrong directory and can t find the main class when compiling . Thus I need to set my classpath variable to the file I m currently working on . However in all the ways I ve tried to do that he can t even find the .java file anymore . Comment : Do you want to handle ANY Java code someone might upload with ANY external dependencies Consider that managing dependencies like this requires something of the complexity level of the entire Maven architecture . Is this what you are trying to achieve You re much better off requiring your clients to provide you a complete standalone jar file with all dependencies included . Comment : Suggestion : Try walking before you run . See if you can save the files in the jar to the file system and use ProcessBuilder or Runtime.exec to run javac and compile them", "Question : null .. . Answer : I am trying to compile a simple java class using JavaCompiler class but I see following errors : Exception in thread main java.lang.NullPointerException at com.coderbd.compile.JDK6FirstCompile.main JDK6FirstCompile.java : 12 .. . .. . I am using JDK 1.8.31 Please help me to solve the issue . Coder Is here : .. . .. . Any help will be appreciated . Comment : Use full path to Foo.java or place it where classes are outputed . Most likely built main class can t access Foo.java using relative-path Comment : Hi Thanks I used Ibcs src com coderbd compile Foo.java and compile Foo.java respectively but same error . Comment : I removed package spec from code outputed it to file cat JDK6FirstCompile.java compiled from terminal and successfully executed . That Ibcs src .. . is it in your root folder If it is relative-path then Ibcs src .. .", "Question : I writed a code that generates two class which I write them to buffer and compile them with JavaCompiler . My classes are like this in .java files .. . .. . and .. . .. . something like this . However the name of the classes are randomly generated and when I create the file it gives an error like this .. . .. . . src A.java : 4 : error : cannot find symbol .. . .. . 4th line is the ...extends ArrayList.. . and there is a symbol under A .. . .. . My code generator compiles like this .. . .. . First I fill the buffer with my template for A type classes then compile like this : .. . .. . after that I create another buffer and fill it with my template for B type classes then compile like this .. . .. . f is .. . .. . How can I solve this problem Comment : How do you compile the classes A and B The java compiler needs to know about class A when class B is to be compiled . Comment : Maybe your compilation code itself is right and you miss in B.java only the import java.util.ArrayList statement . Comment : Instead of calling JavaCompiler run which actually is Tool run you might have to create a dedicated compilation task with JavaCompiler getTask https : docs.oracle.com javase 8 docs api javax tools JavaCompiler.html getTask-java.io.Writer-javax.tools.JavaFileManager-javax.tools.DiagnosticListener-java.lang.Iterable-java.lang.Iterable-java.lang.Iterable- : It allows you to add the information that is required for the compilation - particularly the compilation units . Also see stackoverflow.com a 30038318 3182664 http : stackoverflow.com a 30038318 3182664 but it might also work with some manual classpath fiddling .. . Answer : As mentioned in the comment the compiler need to know about class A when class B is compiled . In the example below we add the output directory for the compiled classes tmp bin to the classpath for the compiler in optionList . You could either prevent to create the source files on the filesystem if you don t need them as such .. . .. . or you create the Java source files on the file system . Similar code as above with a small change for the compilationUnits . It s assumed the files have been already stored on the given location .", "Question : null .. . Answer : My in tension is to create a plugin at at the run time using java code.First a created executable-jar using the java.util.jar.JarOutputStream and used javax.tools.JavaCompiler for compiling the classes . And I was able to execute the jar from command-line properly . Then I tried to create a pluign by including the plugin.xml file in the jar package and compiled the classes by using the above packages and plugin is created with out any errors . But I was using an extension point for the plugin and it is not detecting while I am putting my plugin in the eclipse product . Then I exported it by using eclispe export option and it is working properly for me . I unzipped both the jar created programtically and by using eclispe and the contents are same . How can I solve this issue Comment : If the contents are the same then they should both work or both not work . So there must be some difference in the contents . Comment : Same in the sense the jar entries...Plugin.xml and Manifest files are same.But there are some differences in the .class files.But the source file I used for both is same.Is it something related to compilation issue . .", "Question : So I m working on building a program that uses the built-in JavaCompiler API to compile a directory of .java files . I got it parse through a directory to compile the files and even compiles them just not in the order I need . I get back the classic cannot find symbol since certain classes are reliant on one another . So a group of files that compiled fine with javac fail with my program . I need a way to either compile them in a certain order my last option is actually parsing through the file for references but I d rather not or compiling at the same time . Here s my code : .. . .. . EDIT : Wildcards ie .java do not work in JavaCompiler.. . .. . .. . ANSWER : From the comments I tried instead of files i .getPath to pass the compiler a String containing all paths for all files . Works Great Thanks Comment : did you try with javac .java Comment : It looks like you ought to be passing all the files to compiler.run in one go not just one at a time Instead of files i .getPath pass it a String containing all paths for all files . Comment : Mr . Wasserman you are a life saver I didn t realize the solution was that simple . I got the files .getName into a string array and sent it in instead and I m compiling groups of javas now perfectly . Thank you a bunch sir Comment : If you have answered your question please feel encouraged to add it as an answer instead . It increases the visibility of the solution . Comment : I will do that then .. . Answer : From the comments I tried instead of files i .getPath to pass the compiler a String containing all paths for all files . Below is the solution .", "Question : I have been working on Java from more than 8 years . Last week in a small meeting in my company one of my colleague has asked me how exactly does Java Compiler work I was with no answer . I tried explaining like Java Compiler takes statements one by one and converts them to byte code that is not targeted to any OS but to JVM . No one satisfied with that answer even me . Now the main question is how exactly java compiler works . i.e . How many steps or stages or phases are there which will be done by the compiler in case of compiling a Java file . What exactly the Java s compiler architecture What if there are multiple Java classes in same .java file . Then how many classes will be compiled . What if there are imports pointing to un-compiled Java classes Then the un-compiled classes be compiled or ignored I googled for more than half a day and all are providing same answer as I gave to my colleagues . But finally I found some useful tutorial here http : www.bearcave.com software java comp arch.html . But the tutorial also covering not too in-depth and I could not visualize that tutorial . Still I am not satisfied and eager to learn something more about this from you . So if any one knows something more than me and the above blog something by using which I can visualize what exactly the internal architecture of Java Compiler please explain me . Comment : The JVM specification is quite detailed : docs.oracle.com javase specs jvms se8 html index.html https : docs.oracle.com javase specs jvms se8 html index.html Comment : How exactly does java compilation take place http : stackoverflow.com questions 3406942 how-exactly-does-java-compilation-take-place . Comment : The Java Virtual Machine https : www.artima.com insidejvm ed2 jvmP.html . Comment : @W rgspa yes you are absolutely correct . But Just see the documentation yourself . It is quite complex and takes lot of time to understand . Now a days time is something that we don t have . So I thought here some people might have got same questions already and might have done lot of research already . If my question is seen by such people they can give me answer so with less effort I can learn . Not only me this question will be seen by thousands and will be helpful to all of them . That was my intention actually . Any way thanks for your time and info . : Comment : @YoungHobbit Thanks but I have see the How exactly does java compilation take place already and my question is for some kind of in-depth answer for the existing question . and the article The Java Virtual Machine is explaining JVM architecture about which I know already . I want to know Java Compiler architecture . : .. . Answer : There are different steps on a compiler but here are the most important : .. . .. . Lexical analysis First step is the lexical-analysis . Basically this steps extract tokens from java code keywords operators separators comments variable names.. . .. . .. . Syntax analysis parser The second step is the syntax analysis . Tokens are taken as input from lexical-analysis and are combined to form expressions and instructions . Optimization and conversion to byte code The last macro step is converting the previous step to byte code . Here the code can be modified to be equivalent to the original code but more efficient . .. . .. . Note : This process is not related only to java but it is common to all compilers . Also compilers that don t generate an intermediate byte code but a machine code like compilers for C or C++ . Generally there are tools to create a lexical analyzer and a syntax analyzer because this steps have many commons parts between different languages . An open-source lexical analizer is flex https : en.wikipedia.org wiki Flex lexical analyser A useful syntactic analizer is yacc https : en.wikipedia.org wiki Yacc .. . .. . Both works with C and C++ that are the most used languages to create compilers java and others too but there are also similar alternatives for other programming-languages to create a compiler in another language not for another language . Basically language in which a compiler is written is not related to the language the compiler compiles .", "Question : null .. . Answer : I want to use reflection to get all the methods of a newly created java class . Like bellow I created the java Class by copying from another file then I use JavaCompiler to compile the newly created Java . But I don t know why the target class file was not created . PS : If I give the wrong source target java file path there will be compile info like javac : cannot find file : codeGenerator Service.java . Thank you all . compile method :", "Question : My application generates java code during runtime and compiles it using the JavaCompiler API . Some of the generated files can be rather large - up to a few hundred thousand lines . I find that when I run the javac command on the generated code in the command-line or alternatively if I use an application that does just the compilation via the JavaCompiler API I can compile many of these files 500 even if they are very large in under two minutes . However if I call the API via my application when it is running on a Tomcat server the compilation time runs upwards of twelve minutes . I would appreciate any suggestions on how to improve the performance of the compilation . Thanks Comment : I cannot place my finger on exactly why but when I switched from using the default system compiler via a call to ToolProvider.getSystemJavaCompiler but instead used Eclipse s JDT compiler things sped up significantly . An explanation will happily be accepted as the answer . Comment : a guess would be eclipse has an incremental compiler so it isn t doing a clean build every time . This could be wrong though . Also doesn t answer the main question .. . Answer : Try to set the thread-priority to the highest value on the thread or thread pool :", "Question : I m first time here so.. . The task is in compilation dynamic class created from string and subsequent creating instantiation . The problem is in importation my custom package classes placed in different folders to dynamic class . For example : after import controller . an error occurs : .. . .. . but standard packages libraries have been imported well without any issues and compilation ended the same way . I ve tried to solve via getTask method of JavaCompiler Api by sending optionList with path but without success . So how to correct import custom package Here is my code : .. . .. . Thanks in advance .. . Answer : The problem has been solved : .. . .. . I have added path to my jar controller.jar in addition to System.getProperty java.class.path . Here is the code :", "Question : I want to use reflection to get all the methods of a newly created java class . Like bellow I created the java Class by copying from another file then I use JavaCompiler to compile the newly created Java . But I don t know why the target class file was not created . PS : If I give the wrong source target java file path there will be compile info like javac : cannot find file : codeGenerator Service.java . Thank you all . compile method : .. . Answer : Finally I successfully compiled the target Service.java in above way . Thank you all .", "Question : If I declare that my object implements an interface but fail to implement those methods when I compile my code I get a compiler error . How does the java compiler know that I haven t implemented all of the methods of an interface Comment : It has access to both the interface and your class . Why would it not know Comment : This question is similiar to asking : How does the compiler know that a string literal cannot be assigned to an int variable Comment : @resueman I m looking for a deeper explanation . For example since an interface is an abstract type how is the type checking done and how is an interface represented by the compiler to do these checks . Comment : The deeper explanation is in JLS Sec 8.1.5 https : docs.oracle.com javase specs jls se8 html jls-8.html jls-8.1.5 : Unless the class being declared is abstract all the abstract member methods of each direct superinterface must be implemented 8.4.8.1 either by a declaration in this class or by an existing method declaration inherited from the direct superclass or a direct superinterface because a class that is not abstract is not permitted to have abstract methods 8.1.1.1 . The compiler checks the class declaration against the language spec . Comment : @isnot2bad Yes the question is related to type checking but its not that similar to that quesiton . .. . Answer : How does the java compiler know that I haven t implemented all of the methods of an interface It knows all methods that your class has implemented because it has found and analyzed them during the compilation . It knows all of the methods that were defined in all of the superclasses and interfaces of your class because : .. . .. . 1 . it has either just compiled their source code or loaded their .class files and .. . .. . 2 . it has analysed the interfaces classes and figured out which methods need to be implemented by your class . Then it compares the two sets of methods . Note that the methods don t need to be exactly the same . For example the actual method could return a subtype of the return-type of the method in the interface . The set comparison needs to take account of that . .. . .. . Actually that is just one approach to doing this check . An actual Java compiler might do the checking a bit differently . Comment : This is a good answer to finish this out.. . In Java an interface is an abstract type which is a set of operations with well-defined and mutally consistent semantics . The Java compiler has a type checker which makes sure that the program obeys the type-compatibility rules of the language . So the type checker would just check if the class has a method-signature with the appropriate return-type and then return an error if it does not . Source : cs.columbia.edu aho cs4115 Lectures 15-03-23.html http : www.cs.columbia.edu aho cs4115 Lectures 15-03-23.html", "Question : This question already has an answer here : .. . .. . Why do I get a ClassNotFoundException when using Class.forName questions 4200142 why-do-i-get-a-classnotfoundexception-when-using-class-forname 2 answers .. . .. . I have used JavaCompiler to compile a class that I generate on the fly . The compile task succeeds . I then try to load the compiled class using Class.forName MyClass and it fails with a ClassNotFoundException . Is there a known issue with doing this Comment : Did you check you manifest if the export importing that class How do you build your project . Try to re generate your manifest file . Comment : Manifest I m compiling a class on the fly . I m not sure I understand what a manifest file would do Comment : Compiling the class doesn t automatically add it to the classloader . You ll need to do that yourself . Comment : Hi @Paul Can you post an answer with an approach given the code I listed above please Comment : What is a ClassLoaderResolver I don t see anything like that in the JRE and if I Google for it I see this class in various places including one from Apache . .. . Answer : Try to load the class after compiling it by using Thread.currentThread .getContextClassLoader .loadClass com.ur.class .. . .. . Found this...check if this can help. . .. . .. . For more information refer this : How do you dynamically compile and load external java classes http : stackoverflow.com questions 21544446 how-do-you-dynamically-compile-and-load-external-java-classes Comment : What exactly would the string argument be In the comments section it was suggested that I should use com.amir.method.HelloWorld but that doesn t seem to work.. . Comment : @AmirAfghani What package is the class in Comment : @VinceEmigh - as you can see from the generated code its not in any specific package . There is no package statement in my source . Comment : @AmirAfghani Then you wouldn t use com.amir.method before HelloWorld when loading the class . Youd just use HelloWorld", "Question : I tested class enum interface these 3 ways to encapsulate constant String . After compile they generated 330 bytes 181 bytes and 818 bytes bytecode which means interface ICompany will cost less memory when loaded into jvm . Why is this Comment : Maybe because those are not equivalent data-structures Comment : The interface just needs to have a field name type and value . The enum needs to store multiple different method implementations values and valueOf String as well as static initialization in addition to the constant value . .. . Answer : Use the javap utility to examine the 3 .class files . The short answer is there are some standard methods values valueOf String toString that the enum-class has to implement but the others don t . Having said that the size of a .class-file is not necessarily an accurate predictor of the memory used when a class has been loaded and JIT compiled .", "Question : I m trying to write a java program with an interface that allows the user to create .java file and compile and run it essentially a very simplistic IDE . I m using java swing for the gui and have so far been able to compile a .java file from within the interface into a .class-file . I ve been researching how to run a .class-file from within java code but have found a wide range of answers which I haven t been able to get working . Here is the relevant code for compilation : .. . .. . How can I run a compiled .class-file and capture its output within my code Comment : Here s one suggestion that has nothing to do with your actual question : Don t be so broad Don t ask for generic suggestions ask a specific question that we can answer : Something like How can I run the compiled file and capture the output which incidentally I think has already been covered here Comment : Anyway a couple of related but not duplicate things that you may find helpful : Using a threat to capture process output http : stackoverflow.com questions 1670798 using-a-thread-to-capture-process-output the Oracle tutorial on running a file from the command-line https : docs.oracle.com javase tutorial getStarted cupojava win32.html win32-2c and Execute command-line program http : stackoverflow.com questions 9346077 java-execute-command-line-program . .. . Answer : Once it s compiled you will need to load the Class object and then invoke the main String method . To capture the stdout you will need to use System.setOut .", "Question : I tested class enum interface these 3 ways to encapsulate constant String . After compile they generated 330 bytes 181 bytes and 818 bytes bytecode which means interface ICompany will cost less memory when loaded into jvm . Why is this Comment : Maybe because those are not equivalent data-structures Comment : The interface just needs to have a field name type and value . The enum needs to store multiple different method implementations values and valueOf String as well as static initialization in addition to the constant value . .. . Answer : A single class file defines either a class or interface . Looking at the structure https : docs.oracle.com javase specs jvms se7 html jvms-4.html : .. . .. . An Enum is a class and if you look what it compiles to you can see why there is necessary overhead see here : In java What does such enum type compile to http : stackoverflow.com questions 31039980 in-java-what-does-such-enum-type-compile-to . An interface is an abstract type which is really just a set of operations and constants that a class must conform to . ICompany.class : .. . .. . ECompany.class : .. . .. . From the class files you can see that the interface in the example does not have much added to it in terms of methods or flags hence the smaller size .", "Question : I have been trying to compile some Java Classes in a String using java . I have used javax.tools.JavaCompiler to compile the Classes in the Strings . I have made instances of SimpleJavaFileObject by a Subclass that I have made of SimpleJavaFileObject . and I have made Instances of this class added it to an ArrayList then Got the .. . .. . ToolProvider.SystemJavaCompiler .. . .. . and added compilation options . and then Compiled .. . .. . I have tested this with 3 classes that have circular dependency . it gives the error that it cannot find the symbol of a reference . it seems that unlike javac this Compiler looks at each item in the list individually and tries to compile each alone . how to achieve the same result as Javac using this compiler Someone please point me in the right direction : Thanks . Comment : also note that these 3 test classes are form 3 different packages : Comment : Circular interdependencies between packages aren t such a good idea in the first place.. . Comment : Although I think that the question is reasonably interesting I have voted to close it : Questions seeking debugging help why isn t this code working must include the desired behavior a specific problem or error and the shortest code necessary to reproduce it in the question itself . Questions without a clear problem statement are not useful to other readers . See : How to create a Minimal Complete and Verifiable example http : stackoverflow.com help mcve . Can you update your example so that a we can compile it b it reproduces the issue c it contains specific errors you found . .. . Answer : The following code runs successfully for me pretty much the same as OP s code just replaces undefined symbols with reasonable alternatives : .. . .. . Output :", "Question : I have been trying to compile some Java Classes in a String using java . I have used javax.tools.JavaCompiler to compile the Classes in the Strings . I have made instances of SimpleJavaFileObject by a Subclass that I have made of SimpleJavaFileObject . and I have made Instances of this class added it to an ArrayList then Got the .. . .. . ToolProvider.SystemJavaCompiler .. . .. . and added compilation options . and then Compiled .. . .. . I have tested this with 3 classes that have circular dependency . it gives the error that it cannot find the symbol of a reference . it seems that unlike javac this Compiler looks at each item in the list individually and tries to compile each alone . how to achieve the same result as Javac using this compiler Someone please point me in the right direction : Thanks . Comment : also note that these 3 test classes are form 3 different packages : Comment : Circular interdependencies between packages aren t such a good idea in the first place.. . Comment : Although I think that the question is reasonably interesting I have voted to close it : Questions seeking debugging help why isn t this code working must include the desired behavior a specific problem or error and the shortest code necessary to reproduce it in the question itself . Questions without a clear problem statement are not useful to other readers . See : How to create a Minimal Complete and Verifiable example http : stackoverflow.com help mcve . Can you update your example so that a we can compile it b it reproduces the issue c it contains specific errors you found . .. . Answer : I have found a solution for the problem .. . .. . in the compilation process I have made a ArrayList to hold the SimpleJavaFileObject classes to compile instances instead I have added a LinkedList . with the link list it works fine :", "Question : I want to use reflection to get all the methods of a newly created java class . Like bellow I created the java Class by copying from another file then I use JavaCompiler to compile the newly created Java . But I don t know why the target class file was not created . PS : If I give the wrong source target java file path there will be compile info like javac : cannot find file : codeGenerator Service.java . Thank you all . compile method : .. . Answer : You can t write code that directly depends on Service.class unless Service is already compiled . You would have to dynamically load the class and get the methods from there . At present it is difficult to see how the class containing this code would even load and it certainly won t give the correct answer unless a version of Service.class was present when the class was loaded in which case your code will give the methods of that version not the newly compiled version . You need to get rid of all references to Service.class or indeed Service from your entire source code and load Service with Class.forName after compilation . Do a clean build to ensure no Service.class file is present in your deployment . Comment : Method declaredMethods Class.forName codeGenerator.Service .getDeclaredMethods If I use it this way I still can t get right output . The fact is the class wasn t compiled . Comment : @EJP Clear answer indeed should be upvoted . Comment : @leo So see here http : stackoverflow.com questions 7989135 is-it-possible-to-programmatically-compile-java-source-code-in-memory-only .", "Question : I have a prorgam thats generating source code and want to compile this source code during the java-runtime execution like : .. . .. . I use the JavaCompiler from ToolProvider : .. . .. . Now the important line is where i add the -d classdirectory in the optionlist . I have this genClassDir gen classes where all my .class files are inside including subdirs . Now the problme in my jar file is that the class files are having the genClassDir as prefix before the package structure . instead of .. . .. . or without the leading slash . I am packaging the jar like in the first answer from How to use JarOutputStream to create a JAR file http : stackoverflow.com questions 1281229 how-to-use-jaroutputstream-to-create-a-jar-file .. . .. . Is there a way i get only the package structure of the class files in my jar .. . Answer : You could add a basePath parameter to the add -method of the solution shown in the other question and the strip the base path from each file name before creating the Jarentry .. . .. . Adjust the replacement as necessary leading trailing slashes backslashes instead of slashes etc . Usage : Comment : I was thinking about this but wil then the JarEntries still be found Comment : I don t know honestly and I can t test it . Maybe you should just try it and then see where it goes Comment : ok it s still compiling when i manage to run with all dependencies i can accept this answer", "Question : This question already has an answer here : .. . .. . Java logical operator short-circuiting questions 8759868 java-logical-operator-short-circuiting 8 answers .. . .. . Will this code not evaluate the divide-by-zero portion of the if-statement since the first part evaluates to false If so is this true for all cases in all Java IDEs Or will certain compilers throw the exception Comment : All correct Java compilers and JVMs will run it the same way . As for what it ll do.. . why not just give it a try and see for yourself Comment : Java uses short circuit evaluation http : en.wikipedia.org wiki Short-circuit evaluation for boolean-operations . Only as much as required is evaluated . This is mandated by JLS 15.23 https : docs.oracle.com javase specs jls se8 html jls-15.html jls-15.23 . Comment : Oops closed this for the wrong dupe reason . Let me try and find a better one.. . Comment : @BoristheSpider I don t think this is a short-circuit evaluation problem . It would be if you declare final int n 0 but this isn t the case . Comment : @LuiggiMendoza I don t get you : if a b will not evaluate the expression b is a false . .. . Answer : From JLS 15.23 https : docs.oracle.com javase specs jls se8 html jls-15.html jls-15.23 : .. . .. . The conditional-and operator is like 15.22.2 but evaluates its right-hand operand only if the value of its left-hand operand is true . So no you will not get an exception . Obviously this assumes that you have a single-threaded or thread safe environment - if you introduce visibility problems into the mix then it s anyone s guess ." ] }
[ "yes-answer-long", "yes-answer-short" ]
java
UNK_RELATION
poi-hssf@excel@72
poi-hssf -- hssf is the apache-poi project s java-api for manipulating @placeholder format files .xls and .xlsx .
{ "confidence": [ 69.54810333251953, 68.8018569946289, 65.84403228759766, 65.71961212158203, 65.71961212158203, 64.2560806274414, 62.99651336669922, 60.91517639160156, 60.75069808959961, 59.91166305541992, 59.91166305541992, 57.51515579223633, 57.51515579223633, 57.51515579223633, 54.874656677246094, 52.21635437011719, 52.0281982421875, 52.0281982421875, 50.93956756591797, 50.612308502197266, 50.19025421142578, 49.456207275390625, 49.104007720947266, 48.53941345214844, 47.893280029296875, 47.64470291137695, 47.56694030761719, 47.43095397949219, 47.0095329284668, 46.94010543823242, 46.89967727661133, 46.731727600097656, 46.06374740600586, 45.29663848876953, 44.785850524902344, 44.410335540771484, 44.40580368041992, 44.17658233642578, 43.84175491333008, 43.639461517333984, 43.359771728515625, 43.34064865112305, 43.236976623535156, 42.943016052246094, 42.566009521484375, 42.566009521484375, 42.473724365234375, 42.406585693359375, 41.89714813232422, 41.686065673828125, 41.63329315185547, 41.158233642578125, 41.03837966918945, 40.92493438720703, 40.75463104248047, 40.75463104248047, 40.73462677001953, 40.49681854248047, 40.456993103027344, 40.355628967285156, 40.355628967285156, 40.221561431884766, 40.190582275390625, 39.254737854003906, 39.254737854003906, 39.214542388916016, 39.21034622192383, 38.97871398925781, 38.857120513916016, 38.857120513916016, 38.72783660888672, 38.32373046875, 38.32373046875, 38.31528091430664, 38.31528091430664, 38.0948486328125, 38.03096008300781, 37.974830627441406, 37.974830627441406, 37.974830627441406, 37.974830627441406, 37.483428955078125, 36.99369430541992, 36.99369430541992, 36.96196365356445, 36.900115966796875, 36.79096984863281, 36.54059600830078, 36.49637222290039, 36.49637222290039, 36.49637222290039, 36.49637222290039, 36.49637222290039, 36.49637222290039, 36.49637222290039, 36.1340217590332, 35.95265197753906, 35.93232345581055, 35.93232345581055 ], "content": [ "I m using POI HSSF API for my excel manipulations in Java .", "https : poi.apache.org apidocs org apache-poi hssf usermodel HSSFSheet.html", "See http : poi.apache.org encryption.html - if you re using a recent enough copy of Apache POI eg 3.8 then encrypted .xls files HSSF and .xlsx files XSSF can be decrypted proving you have the password", "Feed response.getOutputStream to POI HSSF to write the workbook to .", ": .. . .. . Is there any way to read the date as it is in HSSF POI", "I ve just learned POI and find the HSSF is very simple to read and create excel file .xls .", "Your question is about poi-hssf I guess .", "also the HSSF sheet docs https : poi.apache.org apidocs org apache-poi hssf usermodel HSSFSheet.html getLastRowNum have some more content regarding this subject .", "HSSF is the POI Project s pure Java implementation of the Excel 97 -2007 file-format .", "I have a question.. . how can I link this to POI HSSF.. .", "Be carefully with the POI HSSF stuff when working with huge Excel sheets .", "also this stackoverflow.com questions 4266888 https : stackoverflow.com questions 4266888 apache-poi-using-both-xssf-and-hssf", "I am using Apache POI HSSF for creating the excel sheet file in the model .", "Try Sheet.getPhysicalNumberOfRows http : poi.apache.org apidocs org apache-poi hssf usermodel HSSFSheet.html getPhysicalNumberOfRows 28 29", "Did you have a read through the Apache POI example for parsing XLS files with eventmodel + handling missing cells https : svn.apache.org repos asf poi trunk src examples src org apache-poi hssf eventusermodel examples XLS2CSVmra.java", "You could take a look at : .. . .. . See the POI Horrible Spreadsheet Format API for more details on HSSFDateUtil : .. . .. . http : poi.apache.org apidocs org apache-poi hssf usermodel HSSFDateUtil.html .. . .. . That also provides some helper methods for returning Excel getExcelDate and Java dates getJavaDate .", "The documentation https : poi.apache.org apidocs org apache-poi hssf usermodel HSSFWorkbook.html write java.io.OutputStream for the method says nothing about flushing the stream .", "I have an existing excel spreadsheet which I am accesssing and reading values from I am using Apache POI HSSF .", "Apache POI is simply enforcing the file-format + Excel limit .", "they are xls but just not the right form that can be recognized by apache-poi .", "We use HSSF library for that .", "Using Java and Hssf to get Excel data how to check if a cell is bolded", "questions 1072561 how-can-i-read-numeric-strings-in-excel-cells-as-string-not-numbers-with-apach 16 answers .. . .. . I am trying to read an excel file using Java POI HSSF .", "The POI class which contains all the spreadsheet format limits https : poi.apache.org apidocs org apache-poi ss SpreadsheetVersion.html EXCEL97 suggests .xls should be fine with cells of up to 32767 characters long .", "Yes built-in formats will still work with .xlsx spreadsheets in Apache POI .", "While XSSF is the POI Project s pure Java implementation of the Excel 2007 OOXML .xlsx File format .", "I would like to save all attached files from an Excel xls HSSF without extension .", "Our project used poi-3.8-20120326.jar poi-ooxml-3.8-20120326.jar and poi-ooxml-schemas-3.8-20120326.jar .", "By using global parents instead of XLS XLSX dependant HSSF XSSF children you can make your code much universal .", "Therefore they cannot be picked up with Java API POI unless they are manually loaded in Microsoft Excel and save-as .xls one by one .", "This works for me with Apache POI 3.11 :", "Apache POI 2.5 is over 10 years old", "Depends if you re using HSSF or XSSF .", "At the time you wrote your question it wasn t easy to do with Apache POI .", "Can I do that in Java POI", "What version of Apache POI are you using", "I am trying to read excel file xls file using apache-poi .", "I want to do it with Apache poi .", "HSSF and XSSF provides ways to read spreadsheets create modify read and write XLS spreadsheets .", "Just replace HSSF with XSSF in that answer s code", "https : poi.apache.org apidocs org apache-poi ss SpreadsheetVersion.html EXCEL97", "Should I use HSSF or XSSF", "It seems you can read password protected but not encrypted files with POI .", "You need to have another look at the POI API for how to store spreadsheet objects as .xlsx .", "Tried using poi-3.5. .", "Same Error as poi 2.5", "If you look at the Apache POI JavaDocs for Cell https : poi.apache.org apidocs org apache-poi ss usermodel Cell.html or the Apache POI Cell examples on the website http : poi.apache.org spreadsheet quick-guide.html CreateCells you will clearly see that org.apache.poi.ss.usermodel.Cell has a number of setCellValue methods including setCellValue double https : poi.apache.org apidocs org apache-poi ss usermodel Cell.html setCellValue 28double 29 and setCellValue String https : poi.apache.org apidocs org apache-poi ss usermodel Cell.html setCellValue 28java.lang.String 29 .. . .. . Most likely you ve imported the wrong class for Cell .", "This sheets could not access by the normal API of POI .", "You can see details of those limits in the Microsoft documentation and also captured nicely in this Apache POI javadoc page https : poi.apache.org apidocs org apache-poi ss SpreadsheetVersion.html .. . .. . If you really need text that long you ll need to switch to another file-format such as CSV", "You can try following method to create xlsx file using apache-poi .", "I am using POI to create an Excel spreadsheet in Java .", "does JODConverter convert excel 4.0 to 97-2004 format so it d be readable by Apache POI", "You have an Excel 4.0 file too old for Apache POI .", "The project uses the POI-2.5-FINAL and JXL jar files for writing data to excel .", "Have you made sure you have the latest Apache POI jars on your classpath", "I am trying to generate an Excel sheet populating the data dynamically using Apache POI .", "As per the Apache POI FAQ mixing POI jars from different versions is not supported http : poi.apache.org faq.html faq-N1019C .", "try this stackoverflow.com questions 14516932 http : stackoverflow.com questions 14516932 insert-a-row-in-excel-using-java-apache-poi", "Does the Apache POI API have any built-in collection object like row and cell for a column in a spreadsheet", "I want to read an Excel Sheet and I am using HSSF .", "HSSF recognizes that 123 is a numeric value getCellType returns CELL TYPE NUMERIC 0 .", "Apache POI does support older Excel files like this Excel 4 but only for extracting as plain text .", ".. . Note : HSSF uses values from -90 to 90 degrees whereas XSSF uses values from 0 to 180 degrees .", "Limitation While Generating Excel Drop Down with Apache POI http : stackoverflow.com questions 8655185 limitation-while-generating-excel-drop-down-list-with-apache-poi .. . .. . This link solves the problem for an HSSFWorkbook .", "Also you can refer Apache POI Excel text formatting through XSSFRichTexString and Jsoup http : stackoverflow.com questions 24613916 apache-poi-excel-text-formatting-through-xssfrichtexstring-and-jsoup", "@Gagravarr Even though i am using only the HSSF workbook related imports on usage of the latest poi jars anything from 3.5 to 3.13 versions on run time loading it looks up for the class org.apache.poi.ss.usermodel.RichtextString .", "There are static color classes provided by the HSSFCell class listed here : .. . .. . http : poi.apache.org apidocs org apache-poi hssf util HSSFColor.html .. . .. . If you want to create your own custom colors you will need to create and modify a custom palette .", "Guys I m currently using the POI 3.9 library to work with excel files .", "Works fine for me with poi 3.9 .", "I know that Tika uses POI.. .", "Tx let me know the path to get the latest POI JAR", "It s all about formats for XLS and XLSX sheets and workbooks - they are different .", "There s a hard limit in both the .xls and .xlsx file formats of 32 767 characters .", "I am using the apache-poi package to generate excel workbooks .", "I have tried your code and Apache POI is not changing the to 23 .", "poi-3.13-20150929.jar poi-example-3.13-20150929.jar poi-excelant-3.13-20150929.jar poi-ooxml-3.13-20150929.jar poi-ooxml-schemas-3.13-20150929.jar poi-scratchpad-3.13-20150929.jar", "possible duplicate of POI reading excel strings as numeric http : stackoverflow.com questions 20430895 poi-reading-excel-strings-as-numeric", "This question already has an answer here : .. . .. . How can I read numeric strings in Excel cells as string not numbers with Apache POI", "Javadoc of String getStringCellValue https : poi.apache.org apidocs org apache-poi ss usermodel Cell.html getStringCellValue 28 29 : For numeric cells we throw an exception .", "Cell https : poi.apache.org apidocs org apache-poi ss usermodel Cell.html setCellValue 28double 29 very much has a setCellValue method", "Why no just use WorkbookFactory http : poi.apache.org apidocs org apache-poi ss usermodel WorkbookFactory.html which does all that for you", "There is a link that stated it could be a bug from HSSF : http : osdir.com ml jakarta.poi.user 2003-02 msg00007.html .. . .. . By the way I solved it by hard coded it .", "Simplified code which works using POI 3.10 .", "Tika uses POI to do it s magic .", "I am using Apache POI to build some excel files and I want to make sure some of the cells are of type Number .", "I need to read from formatted cells in Excel where numbers are stored as text in Java using Apache POI and extract the cells contents as strings in their original format .", "I am using POI HSSFWorkbook to generate excel sheet .", "I understand how to use POI API User Model .", "Maybe you should check the Apache POI : poi.apache.org apidocs index.html http : poi.apache.org apidocs index.html .", "I m using apache-poi 3.7 and I need to put border to a range of cells or merged region .", ".. . .. . final Row row this.sheet.getRow rowNum .. . .. . useful link for apache-poi http : poi.apache.org spreadsheet quick-guide.html Iterator", "Did you try using DataFormatter http : poi.apache.org apidocs org apache-poi ss usermodel DataFormatter.html", "The docs https : poi.apache.org apidocs org apache-poi xssf usermodel XSSFSheet.html getLastRowNum note that it s zero based .", "See stackoverflow.com questions 2281221 http : stackoverflow.com questions 2281221 creating-cell-comments-using-hssfclientanchor-in-apache-poi", "I merged some of the other answers and comments in the following implementation tested with Apache POI v3.9 .", "which version of POI are you using", "I need to convert csv to xls xlsx in my project", "Please Refer this forumsqa.com question http : forumsqa.com question what-is-the-difference-between-xssf-and-hssf", "@Stupid.Fat.Cat this error might be fixed by removing the HSSF prefix from the Workbook class etc ." ] }
{ "confidence": [ 112.59159088134766, 104.91822814941406, 98.20307159423828, 88.67964935302734, 85.05524444580078, 83.93911743164062, 82.33625793457031, 80.05007934570312, 79.47493743896484, 77.65760040283203, 77.38573455810547, 74.84915161132812, 74.38594055175781, 72.45123291015625, 72.31657409667969, 72.19493103027344, 71.36170959472656, 71.299560546875, 69.32258605957031, 68.82528686523438 ], "content": [ "Question : Limitation While Generating Excel Drop Down with Apache POI http : stackoverflow.com questions 8655185 limitation-while-generating-excel-drop-down-list-with-apache-poi .. . .. . This link solves the problem for an HSSFWorkbook . Can we do this for an XSSFWorkbook too Comment : Please Refer this forumsqa.com question http : forumsqa.com question what-is-the-difference-between-xssf-and-hssf Comment : also this stackoverflow.com questions 4266888 https : stackoverflow.com questions 4266888 apache-poi-using-both-xssf-and-hssf Comment : Just replace HSSF with XSSF in that answer s code Comment : DVConstraint s cant be used with XSSFDataValidation .. . Answer : HSSF is the POI Project s pure Java implementation of the Excel 97 -2007 file-format . While XSSF is the POI Project s pure Java implementation of the Excel 2007 OOXML .xlsx File format . HSSF and XSSF provides ways to read spreadsheets create modify read and write XLS spreadsheets . They also provide : .. . .. . 1 . low-level structures for those with special needs .. . 2 . an eventmodel api for efficient read-only access .. . 3 . a full usermodel api for creating reading and modifying XLS files .. . .. . For Further Reference Please gothrough with This Link https : poi.apache.org spreadsheet Comment : How does this in any way answer the question", "Question : I m using POI HSSF API for my excel manipulations in Java . I ve a date value 8 1 2009 in one of my excel cell and while I try to read this value using HSSF API it detects the cell type as Numeric and returns the Double value of my date . See the sample code below : .. . .. . Cell.getCellType returns NUMERIC TYPE and thus this code converts the date to double : .. . .. . Is there any way to read the date as it is in HSSF POI .. . Answer : You could take a look at : .. . .. . See the POI Horrible Spreadsheet Format API for more details on HSSFDateUtil : .. . .. . http : poi.apache.org apidocs org apache-poi hssf usermodel HSSFDateUtil.html .. . .. . That also provides some helper methods for returning Excel getExcelDate and Java dates getJavaDate . You need to be somewhat wary of different date formats though.. . Comment : rant I wish those POI developers would comment their source code.. . rant Comment : Calling DateUtil.isCellDateFormatted will be a step ahead in the way of freeing your code from HSSFs and XSSFs . By using global parents instead of XLS XLSX dependant HSSF XSSF children you can make your code much universal .", "Question : I ve just learned POI and find the HSSF is very simple to read and create excel file .xls . However I found some problem when want to read excel protected with password . It took me an hour to find this solution on internet . Please could you help me to solve this problem . I m very glad if you could give me a code snippet . Thank you . Comment : Did you find or did you not find a solution for this problem If you did it would be nice to put it here . .. . Answer : See http : poi.apache.org encryption.html - if you re using a recent enough copy of Apache POI eg 3.8 then encrypted .xls files HSSF and .xlsx files XSSF can be decrypted proving you have the password At the moment you can t write out encrypted excel files though only un-encrypted ones", "Question : I ve just learned POI and find the HSSF is very simple to read and create excel file .xls . However I found some problem when want to read excel protected with password . It took me an hour to find this solution on internet . Please could you help me to solve this problem . I m very glad if you could give me a code snippet . Thank you . Comment : Did you find or did you not find a solution for this problem If you did it would be nice to put it here . .. . Answer : That is the code for Read Excel file with checking of .xls and .xlsx with password protected or without password protected as complete example code . Comment : Why no just use WorkbookFactory http : poi.apache.org apidocs org apache-poi ss usermodel WorkbookFactory.html which does all that for you Comment : Thank for your suggestion . Our project used poi-3.8-20120326.jar poi-ooxml-3.8-20120326.jar and poi-ooxml-schemas-3.8-20120326.jar . It seems that cannot be supported the Workbook wb WorkbookFactory.create File String . It didn t work the create method with two parameter only for one parameter . Comment : As the dates in those filenames cunningly show those jars are 3.5 years old If you upgrade to a newer version you ll find the method mentioned :", "Question : I ve just learned POI and find the HSSF is very simple to read and create excel file .xls . However I found some problem when want to read excel protected with password . It took me an hour to find this solution on internet . Please could you help me to solve this problem . I m very glad if you could give me a code snippet . Thank you . Comment : Did you find or did you not find a solution for this problem If you did it would be nice to put it here . .. . Answer : At the time you wrote your question it wasn t easy to do with Apache POI . Since then support has come on a long way .. . .. . These days if you want to open a password protected Excel file whether .xls or .xlsx for which you know the password all you need to do is use WorkbookFactory.create File Password http : poi.apache.org apidocs org apache-poi ss usermodel WorkbookFactory.html create 28java.io.File 20java.lang.String 29 eg .. . .. . That ll identify the type of the file decrypt it with the given password and open it for you . You can then read the contents as normal", "Question : I m using POI HSSF API for my excel manipulations in Java . I ve a date value 8 1 2009 in one of my excel cell and while I try to read this value using HSSF API it detects the cell type as Numeric and returns the Double value of my date . See the sample code below : .. . .. . Cell.getCellType returns NUMERIC TYPE and thus this code converts the date to double : .. . .. . Is there any way to read the date as it is in HSSF POI .. . Answer : If you want to reference the date in the same format in as in the Excel file you should use the CellDateFormatter . Sample code : Comment : This way you get raw columns value which make sense.. .", "Question : I m using POI HSSF API for my excel manipulations in Java . I ve a date value 8 1 2009 in one of my excel cell and while I try to read this value using HSSF API it detects the cell type as Numeric and returns the Double value of my date . See the sample code below : .. . .. . Cell.getCellType returns NUMERIC TYPE and thus this code converts the date to double : .. . .. . Is there any way to read the date as it is in HSSF POI .. . Answer : If you using the POI 3.5 you can use the following .. . .. . cell.getDateCellValue method . This will work for excel-2007 as well .", "Question : I m using POI HSSF API for my excel manipulations in Java . I ve a date value 8 1 2009 in one of my excel cell and while I try to read this value using HSSF API it detects the cell type as Numeric and returns the Double value of my date . See the sample code below : .. . .. . Cell.getCellType returns NUMERIC TYPE and thus this code converts the date to double : .. . .. . Is there any way to read the date as it is in HSSF POI .. . Answer : Excel treats dates and times as numbers.. . Jon said it better so I won t echo him here.. . However sample code for what you ve put in the question is at http : poi.apache.org spreadsheet quick-guide.html CellContents", "Question : I understand how to use POI API User Model . However presently this is not helpful to me as I m dealing with XLS files larger than 200 MB in size . In one of the questions here on stack-overflow I learned that I need to use an Event-Driven Approach using POIFS API . POIFS API barely has any detailed explanations available on internet or YouTube videos as well or rather no videos at all . I ve struggling to understand this approach although I have a very good understanding of Event-Driven programming otherwise . I did manage to find a piece of code somewhere on internet using the newer approach however I have not been successful to modify the code to do what I want it to . Below is the code and what I want it to do is extract all the data from first column second row onwards from sheets 18 19 20 21 22 . Any help will he highly appreciated or at least any guidance on how to understand learn this newer approach . Any sources Comment : Did you have a read through the Apache POI example for parsing XLS files with eventmodel + handling missing cells https : svn.apache.org repos asf poi trunk src examples src org apache-poi hssf eventusermodel examples XLS2CSVmra.java Would that not get you pretty close with a bit of logic to only output if you re on a sheet of interest Comment : you may consider using ASPOSE instead .. . Answer : Thank you guys for your little help . I appreciate it . User Model throws OOM error with large excel files . However I just learned about the new SS.usermodel with which you can handle both older newer excel files at the same time XLS XLSX and with this User Model I am also able to process excel files of any size .", "Question : I want to generate a report which includes an excel sheet which is generated from the data from the database . I am using Apache POI HSSF for creating the excel sheet file in the model . Now how to let the user download the file i have created .. . Answer : Just use a servlet . Feed response.getOutputStream to POI HSSF to write the workbook to . Most important bit is the Content-Disposition response header . If you set it to attachment then the browser will pop a Save As dialogue . Then let the download URL point to that servlet if necessary with some request parameters or path info . Comment : hello. . I have a question.. . how can I link this to POI HSSF.. . I m new to this a very simple example would be greatly appreaciated. .", "Question : I ve just learned POI and find the HSSF is very simple to read and create excel file .xls . However I found some problem when want to read excel protected with password . It took me an hour to find this solution on internet . Please could you help me to solve this problem . I m very glad if you could give me a code snippet . Thank you . Comment : Did you find or did you not find a solution for this problem If you did it would be nice to put it here . .. . Answer : Ravi is right . It seems you can read password protected but not encrypted files with POI . See http : osdir.com ml user-poi.apache.org 2010-05 msg00118.html . The following code prints out a trace of the file .. . .. . If you get an output mentioning encryption then you cannot open the file with POI . Comment : Thank Tarski :", "Question : null .. . Answer : I would like to save all attached files from an Excel xls HSSF without extension . I ve been trying for a long time now and I really don t know if this is even possible . I also tried Apache Tika but I don t want to use Tika for this because I need POI for other tasks anyway . I tried the sample code from the Busy Developers Guide https : poi.apache.org spreadsheet quick-guide.html Embedded but this does not extract files in the old office format doc ppt xls . And it throws an Error when trying to create new SlideShow new HSLFSlideShow dn fs Error : Remove argument to match HSLFSlideShow dn .. . .. . My actual code is : .. . .. . So my simple question is : Is it possible to save ALL attachments from an xls file without any extension as simple as possible And can any one provide me a solution Many Thanks Comment : Does the Apache Tika CLI App in -z mode do what you need The code for that is open-source and fairly easy to read Comment : Tika uses POI to do it s magic . Comment : @Gagravarr No it doesn t I know that Tika uses POI.. . Isn t it possible in my suggested way Comment : If you just want to save the file why are you trying to load the powerpoint or word files into POI Why not just stream the contents out to disk as-is Comment : @Gagravarr I don t know what you mean.. . Basically if there are any attachments in this excel file i need to save them in the easiest possible way . Can you give me an example to understand what you mean", "Question : Actually I tried to store some data in HSSFCell using java but i got an error like .. . .. . can anyone suggest me a method to increase the cell length ie more than 32767 characters I used the following code for which I got the above error .. . .. . any suggestions Comment : Could you add your code .. . Answer : Your only option is to switch file formats . There s a hard limit in both the .xls and .xlsx file formats of 32 767 characters . Apache POI is simply enforcing the file-format + Excel limit . You can see details of those limits in the Microsoft documentation and also captured nicely in this Apache POI javadoc page https : poi.apache.org apidocs org apache-poi ss SpreadsheetVersion.html .. . .. . If you really need text that long you ll need to switch to another file-format such as CSV Comment : Thanks @Gagravarr", "Question : My data is stored in a format look down : - means a blank cell on the right may be only 10 columns after the space . Something like this : .. . string0 - string1 string2 string3 . . string10 - .. . .. . How to change this code for : .. . .. . 1 obtain only string0 .. . .. . 2 obtain only string1 string2 string3 . . string10 - .. . .. . I don t know how to stop Iterator . He absorbs all. . .. . Answer : Like you did in the switch block with break . But what i think you want is this : .. . .. . This would stop the while-loop when you found a string cell and will then operate on the next row . Make any possible condition you need to break the while-loop . For example collect string columns and when you found the desired set stop to true to get to the next row . Comment : Be carefully with the POI HSSF stuff when working with huge Excel sheets . I have a running desktop app using POI which handles sheets with several thousands of rows . This sheets could not access by the normal API of POI . In this case i used a trick by defining xlsx as default format and extracting the xml portion i need to work with .", "Question : I ve just learned POI and find the HSSF is very simple to read and create excel file .xls . However I found some problem when want to read excel protected with password . It took me an hour to find this solution on internet . Please could you help me to solve this problem . I m very glad if you could give me a code snippet . Thank you . Comment : Did you find or did you not find a solution for this problem If you did it would be nice to put it here . .. . Answer : POI will not be able to read encrypted workbooks - that means that if you have protected the entire workbook and not just a sheet then it won t be able to read it . Otherwise it should work . Comment : Thank Ravi Wallau :", "Question : I m facing the common issue of java.lang.NoClassDefFoundError during application runtime when i try to create and write a workbook using poi 3.2 final version for .xls files only . I have created this utility as an enterprise application project with ejb and web modules . The workbook creation is triggered through an EJB timer which starts on load of the project to the server . The run time fails for the class org.apache.poi.hssf.usermodel.HSSFWorkbook . The library references are made as far as i m aware . I ve placed the poi 3.2 final jar in ejb META-INF lib folder . I have also added it from the Order and Export tab of the Build path and referenced in the Java EE dependencies . For good measure i have placed it in the web-inf lib folder of the web project also but to no avail . In the same app i am also using the Jsoup jar . After referencing it in the above stated places Jsoup is working fine . Curiously enough this error does not occur when i create the same service as a web application dynamic web project with a regular utility timer . The workbook gets created . The jar is placed in the web-inf lib folder . Could someone please let me know is there any difference in the way this jar is referenced for a web project and an enterprise project Appreciate your patience and help. . Comment : Apache POI 3.2 is over 7 years old now http : poi.apache.org changes.html 3.2-FINAL Why on earth are you using such an ancient version The list of fixes since then is huge http : poi.apache.org changes.html 3.2-FINAL Comment : @Gagravarr You are absolutely right . I was initially using 3.13 poi jar with all the ooxml jars version which sent me on a different run time load issue . Comment : @Gagravarr Even though i am using only the HSSF workbook related imports on usage of the latest poi jars anything from 3.5 to 3.13 versions on run time loading it looks up for the class org.apache.poi.ss.usermodel.RichtextString . I have verified the jars also they seem to have this class in them . Just to make it relevant atleast i tried to use the older version which only loads HSSF packages instead of SS packages . Any ideas Comment : As per the Apache POI FAQ mixing POI jars from different versions is not supported http : poi.apache.org faq.html faq-N1019C . Stop doing that Use only 3.13 jars Comment : @Gagravarr I am not mixing the jar versions . I meant to say i tried using from 3.2 to 3.13 jar versions separately . Below is what i was using which lead to the org.apache.poi.ss.usermodel.RichTextString class load error . poi-3.13-20150929.jar poi-example-3.13-20150929.jar poi-excelant-3.13-20150929.jar poi-ooxml-3.13-20150929.jar poi-ooxml-schemas-3.13-20150929.jar poi-scratchpad-3.13-20150929.jar .. . Answer : This worked when i placed the jars in the META-INF lib folder of the EAR project as opposed to the EJB project and referenced it in the library dependencies .", "Question : This question already has an answer here : .. . .. . How can I read numeric strings in Excel cells as string not numbers with Apache POI questions 1072561 how-can-i-read-numeric-strings-in-excel-cells-as-string-not-numbers-with-apach 16 answers .. . .. . I am trying to read an excel file using Java POI HSSF . Everything was working fine except that when the value is 001001 the HSSFCell will return 1001.0 .. . .. . Is there any way I can use HSSFCell to get the value 001001 I am not supposed to do any modification to the excel file . Thank in advance for any help and suggestion . Edit .. . .. . I have been using the following code : .. . .. . cell.setCellType Cell.CELL TYPE STRING cell.toString .. . .. . I also ran a debug mode and checked on the cell value the moment the HSSF grabs it . It truncate the leading zeros and converted it to double therefore I do not see a way to retrieve the truncated zeros . There is a link that stated it could be a bug from HSSF : http : osdir.com ml jakarta.poi.user 2003-02 msg00007.html .. . .. . By the way I solved it by hard coded it . The number of digits are know in advanced . The link for the code that I used : How to format a java string with leading zero http : stackoverflow.com questions 4051887 how-to-format-a-java-string-with-leading-zero Comment : Try reading it as a string Comment : I have tried the cell.setCellType Cell.CELL TYPE STRING line previously . It helps to save the need of differentiating whether is a numeric value or string value . I also just tried the other 2 lines-of-code I still get 1001 . Comment : I ran on debug mode previously . From the HssfCell value I can see that the value is 1001.0 then how does it know to get back the 2 leading zero if it is already truncated Comment : That question is to distinguish the data value of 2.0 and 2 . To read the it in string format . Therefore the code : cell.setCellType Cell.CELL TYPE STRING will work . For my case is that I would to keep the leading zeros : 001001 but I keep getting 1001 or 1001.0 .. . Answer : Can you try reading it as a string instead of Numeric .. . .. . Changing the cell type usually will not modify the contents of the cell . it can be retrieved with either of the following approaches :", "Question : I ve just learned POI and find the HSSF is very simple to read and create excel file .xls . However I found some problem when want to read excel protected with password . It took me an hour to find this solution on internet . Please could you help me to solve this problem . I m very glad if you could give me a code snippet . Thank you . Comment : Did you find or did you not find a solution for this problem If you did it would be nice to put it here . .. . Answer : Here is a complete example code that reads in a protected excel file decrypts using a password and writes out unprotected excel file", "Question : I have an existing excel spreadsheet which I am accesssing and reading values from I am using Apache POI HSSF . It is initialised like this : .. . .. . I am iterating over all the cells that exist in the sheet which makes a cell object : .. . .. . Please can someone familiar with the framework explain how to create an HSSFColor object to represent the backround color of each cell in the sheet . Many thanks .. . .. . EDIT UPDATE .. . .. . To be clear what I want to know is : how do I create get an HSSFColor object for the background-color of an existing cell This code only returns a short number not an HSSFColor object . Thanks for the answers so far . Comment : or cell.getCellStyle .getFillForegroundColor the excel sheet I m reading return the same color for background-color even though the cell are colored . .. . Answer : There are static color classes provided by the HSSFCell class listed here : .. . .. . http : poi.apache.org apidocs org apache-poi hssf util HSSFColor.html .. . .. . If you want to create your own custom colors you will need to create and modify a custom palette . Apache provides a very clear guide to this as well : .. . .. . http : poi.apache.org spreadsheet quick-guide.html CustomColors", "Question : I wanted to set font of the title row in a spreadsheet bold . I was able to do that in my main function with the following code : .. . .. . Since createCellStyle is method of HSSFWorkbook if I write to the sheet by calling a function which takes the sheet but not the workbook as parameter how do I set the cell style Comment : Convert the fontStyle parameter from local to field and use it in the method .. . Answer : Use getWorkbook to get the parent and proceed with the existing code . https : poi.apache.org apidocs org apache-poi hssf usermodel HSSFSheet.html" ] }
[ "yes-answer-long", "yes-answer-short" ]
excel
UNK_RELATION
iredmail@open-source@32
iredmail -- iredmail is a free @placeholder mail-server solution for linux bsd provides services pop3 imap smtp anti-spam anti-virus etc .
{ "confidence": [ 54.484745025634766, 51.598960876464844, 45.67001724243164, 44.29102325439453, 42.03738021850586, 41.138389587402344, 30.64264678955078, 28.298521041870117, 28.288009643554688, 27.13960838317871, 22.94837188720703, 22.815292358398438, 22.386795043945312, 20.64402198791504, 20.53740882873535, 20.424922943115234, 20.06723403930664, 19.289636611938477, 18.888429641723633, 18.726139068603516, 18.33301544189453, 18.33301544189453, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 14.029838562011719, 12.612445831298828, 10.913662910461426, 10.913662910461426, 10.913662910461426, 10.913662910461426, 10.913662910461426, 10.913662910461426 ], "content": [ "I tried to setup a mail-server using iRedMail in a Docker Container .", "The address http s : xyz.com mail is redirecting to iRedMail login page - and that s ok .", "Let s say I have domains xyz.com abc.com and a server with iRedMail a mail-server application - for example it s IP address is 1.2.3.4 .", "iredmail and ftp error Retrieving directory listing in passive-mode but in active works .", "Here is my config : .. . .. . OS : Ubuntu 14.04.3 LTS .. . Docker : v1.10.0 .. . iRedMail : v0.9.4 .. . .. . iRedMail : .. . .. . Webserv : Nginx .. . Database : PostgreSQL .. . .. . Postfix main.cf config file : .. . .. . Postfix master.cf config file : .. . .. . And the Dockerfile I used to create the iRedMail image : .. . .. . I hope you can help me .", "Client replies to [email protected] and this email is received to [email protected] system picks that mailbox using POP3 and assigns that email to reservation number 1500278 . .. . .. . so all need to know how to create this mail the mail-server running on Centos apache iRedMail thanks for help .", "So i have set up iredmail in iredadmin with 2 virtual domains one is domain.com and another is domain.net .. . .. . The domain.net is used for testing development purposed so since the mail-server launched we stopped using it anymore hence it was disabled in iredadmin .", "I have been asked to create special mailbox with theese functions : .. . .. . 1 Create new mailbox [email protected] SMTP POP3 .", "Two weeks ago I installed iRedMail and all of it s components on my vps at the start it worked very good but now after I installed cloudflare I can send email but if somebody send me one it isn t received .", "I have installed iRedEmail on my mail-server .", "When I use a normal email-client it asks me to TRUST certificate of the mail-server and then it starts Receiving Sending email from the mail-server .. . .. . But if I write my own python program to send email then I don t know how to do the same like email clients .", "So the problem was that there were two services that were not running .. . .. . Below are the two services .", "It seems that the machine on which I am running the python code I should add the certificate or somehow pass to python the certificate of mail-server .", "Okay so I am using iRedmail on a linux ubuntu 14.01 I am trying to configure my password plugin and have granted all the necessary privileges but I am at the following error : .. . .. . Mar 24 13 : 31 : 59 MailServer roundcube : 7vd67dj0 DB Error : 1054 Unknown column id in where clause SQL Query : UPDATE users SET crypt ENCRYPT Password1 CONCAT utf8 5 RIGHT MD5 RAND 8 utf8 WHERE id lauren LIMIT 1 in opt www roundcubemail-1.1.4 program lib Roundcube rcube db.php on line 543 POST mail task settings action plugin.password-save task action .. . .. . It is trying to put it in Database : Roundcubemail Table : id When I search though mysql I have Database : Roundcubemail Table : users .. . .. . I cannot seem to find where-in the files it is calling id because I know its as simple as changing it to users .. . .. . Any help here", "The moment the two services were started the python program was able to send email .", "When I try to send a mail to mydomain.com I just receive a mail back with this error : 550 4.4.7 QUEUE.Expired message expired .", "Sadly when I type htt p : abc.com in a browser the browser redirect me to http s : xyz.com mail .", "the default index.html file will have been replaced by a similar file with a line of html code inside it to redirect any requests to abc.com - abc.com mail .", "Currently python gives error Server Configuration Problem", "Alternatively if all mail to domain.net was to go to a single user one would use virtual aliases : .. . .. . This would redirect all mail to domain.net to your root user .", "In DNS I have A-type redirect from abc.com to 1.2.3.4 server .", "In the server I added a abc.com domain rule in apache2 configuration .", "Now it has default certificate .", "Without your code we can t really help you.. .", "Sorry added the coded .", "But it is not the code problem .", "I dont know", "The first service is related to policy of postfix .. . .. . I just typed the below command on the prompt .. . .. . and also typed below command on the prompt", "i have opened ports 40000 - 40100 .", "Before cloudflare everything worked fine .", "If you want you can log in to roundcube here https : mail.rain4win.com with the username [email protected] and the password examplee .", "Your question would be better on serverfault or superuser as this is not a programming question .", "2 Incomming messages : Arrange that this mailbox will recieve messages to virtual email addresses in [email protected] form .", "Where xxx is any number with variable-length .", "This is typically achieved in catch-all mailbox with regular expression mailrule where TO or CC matches test . [email protected] .. . .. . 3 Outgoing messages : Enable login [email protected] to send email with variable FROM field according to point 2 This is typically achieved by enabling any FROM for that mailbox .", "Overall purpose of this mailbox is this : .. . .. . There exists any reservation number in the system .", "For example 1500278 . employee sends email to client from CRM and email-address [email protected] and this email is registered in CRM .", "done it by Memcached and here is the link http : memcached.org", "But the browser should show me a file from a specific folder defined in apache2 config .", "How can I fix it", "try virtual-hosts : httpd.apache.org docs current vhosts examples.html purename https : httpd.apache.org docs current vhosts examples.html purename", "I ve created virtual host for abc.com domain .", "It s contains everything what is in your link .", "I think I should edit xyz.com virtual host but I don t know how", "there is a tutorial : digitalocean.com community tutorials https : www.digitalocean.com community tutorials how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts After setting up files you enable each virtualhost .", "It is also told in the tutorial .", "just remove index.html and you ll be fine .", "I can send mails to any domain gmail.com hotmail.com mydomain.com but I can only receive mails from my domain mydomain.com .", "And now we re facing problem that we just knew : .. . .. . Everytime we wanted to send email from domain.com to domain.net i always received mailer daemon which is .. . .. . What to do", "Here s my postfix main.cf file : .. . .. . Any advice about how to fix this error", "Thanks in advance", "Postfix doesn t know that it is also responsible for the .net address .", "Just add it to mydestination and everything should be fine .", "No change to mydestination is neccessary in that case ." ] }
{ "confidence": [ 68.81671905517578, 65.96443176269531, 54.34248352050781, 51.6873893737793, 49.838436126708984, 47.420631408691406, 46.61959457397461, 31.54854965209961 ], "content": [ "Question : null .. . Answer : I tried to setup a mail-server using iRedMail in a Docker Container . I can send mails to any domain gmail.com hotmail.com mydomain.com but I can only receive mails from my domain mydomain.com . When I try to send a mail to mydomain.com I just receive a mail back with this error : 550 4.4.7 QUEUE.Expired message expired . Here is my config : .. . .. . OS : Ubuntu 14.04.3 LTS .. . Docker : v1.10.0 .. . iRedMail : v0.9.4 .. . .. . iRedMail : .. . .. . Webserv : Nginx .. . Database : PostgreSQL .. . .. . Postfix main.cf config file : .. . .. . Postfix master.cf config file : .. . .. . And the Dockerfile I used to create the iRedMail image : .. . .. . I hope you can help me .", "Question : I have been asked to create special mailbox with theese functions : .. . .. . 1 Create new mailbox [email protected] SMTP POP3 . 2 Incomming messages : Arrange that this mailbox will recieve messages to virtual email addresses in [email protected] form . Where xxx is any number with variable-length . This is typically achieved in catch-all mailbox with regular expression mailrule where TO or CC matches test . [email protected] .. . .. . 3 Outgoing messages : Enable login [email protected] to send email with variable FROM field according to point 2 This is typically achieved by enabling any FROM for that mailbox . Overall purpose of this mailbox is this : .. . .. . There exists any reservation number in the system . For example 1500278 . employee sends email to client from CRM and email-address [email protected] and this email is registered in CRM . Client replies to [email protected] and this email is received to [email protected] system picks that mailbox using POP3 and assigns that email to reservation number 1500278 . .. . .. . so all need to know how to create this mail the mail-server running on Centos apache iRedMail thanks for help . .. . Answer : done it by Memcached and here is the link http : memcached.org", "Question : Let s say I have domains xyz.com abc.com and a server with iRedMail a mail-server application - for example it s IP address is 1.2.3.4 . The address http s : xyz.com mail is redirecting to iRedMail login page - and that s ok . In DNS I have A-type redirect from abc.com to 1.2.3.4 server . In the server I added a abc.com domain rule in apache2 configuration . Sadly when I type htt p : abc.com in a browser the browser redirect me to http s : xyz.com mail . But the browser should show me a file from a specific folder defined in apache2 config . How can I fix it Comment : try virtual-hosts : httpd.apache.org docs current vhosts examples.html purename https : httpd.apache.org docs current vhosts examples.html purename Comment : I ve created virtual host for abc.com domain . It s contains everything what is in your link . I think I should edit xyz.com virtual host but I don t know how Comment : there is a tutorial : digitalocean.com community tutorials https : www.digitalocean.com community tutorials how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts After setting up files you enable each virtualhost . It is also told in the tutorial . .. . Answer : the default index.html file will have been replaced by a similar file with a line of html code inside it to redirect any requests to abc.com - abc.com mail . just remove index.html and you ll be fine .", "Question : null .. . Answer : iredmail and ftp error Retrieving directory listing in passive-mode but in active works . i have opened ports 40000 - 40100 .", "Question : So i have set up iredmail in iredadmin with 2 virtual domains one is domain.com and another is domain.net .. . .. . The domain.net is used for testing development purposed so since the mail-server launched we stopped using it anymore hence it was disabled in iredadmin . And now we re facing problem that we just knew : .. . .. . Everytime we wanted to send email from domain.com to domain.net i always received mailer daemon which is .. . .. . What to do Here s my postfix main.cf file : .. . .. . Any advice about how to fix this error Thanks in advance .. . Answer : Postfix doesn t know that it is also responsible for the .net address . Just add it to mydestination and everything should be fine . Alternatively if all mail to domain.net was to go to a single user one would use virtual aliases : .. . .. . This would redirect all mail to domain.net to your root user . No change to mydestination is neccessary in that case .", "Question : null .. . Answer : Okay so I am using iRedmail on a linux ubuntu 14.01 I am trying to configure my password plugin and have granted all the necessary privileges but I am at the following error : .. . .. . Mar 24 13 : 31 : 59 MailServer roundcube : 7vd67dj0 DB Error : 1054 Unknown column id in where clause SQL Query : UPDATE users SET crypt ENCRYPT Password1 CONCAT utf8 5 RIGHT MD5 RAND 8 utf8 WHERE id lauren LIMIT 1 in opt www roundcubemail-1.1.4 program lib Roundcube rcube db.php on line 543 POST mail task settings action plugin.password-save task action .. . .. . It is trying to put it in Database : Roundcubemail Table : id When I search though mysql I have Database : Roundcubemail Table : users .. . .. . I cannot seem to find where-in the files it is calling id because I know its as simple as changing it to users .. . .. . Any help here", "Question : null .. . Answer : Two weeks ago I installed iRedMail and all of it s components on my vps at the start it worked very good but now after I installed cloudflare I can send email but if somebody send me one it isn t received . Before cloudflare everything worked fine . If you want you can log in to roundcube here https : mail.rain4win.com with the username [email protected] and the password examplee . Comment : Your question would be better on serverfault or superuser as this is not a programming question .", "Question : I have installed iRedEmail on my mail-server . Now it has default certificate . When I use a normal email-client it asks me to TRUST certificate of the mail-server and then it starts Receiving Sending email from the mail-server .. . .. . But if I write my own python program to send email then I don t know how to do the same like email clients . Currently python gives error Server Configuration Problem Comment : Without your code we can t really help you.. . Comment : Sorry added the coded . But it is not the code problem . It seems that the machine on which I am running the python code I should add the certificate or somehow pass to python the certificate of mail-server . I dont know .. . Answer : So the problem was that there were two services that were not running .. . .. . Below are the two services . The moment the two services were started the python program was able to send email . The first service is related to policy of postfix .. . .. . I just typed the below command on the prompt .. . .. . and also typed below command on the prompt" ] }
[ "yes-answer-long", "yes-answer-short" ]
open-source
UNK_RELATION
webargs@web@109
webargs -- webargs is a python library for parsing http-request arguments with built-in support for popular @placeholder frameworks including flask django bottle tornado and pyramid .
{ "confidence": [ 61.70298385620117, 54.65652847290039, 47.26762008666992, 47.047637939453125, 30.34121322631836, 26.215478897094727, 25.591110229492188, 25.190959930419922, 24.97118377685547, 23.96569061279297, 23.351749420166016, 21.80571174621582, 21.80571174621582, 21.80571174621582, 20.85950469970703, 18.97357940673828, 18.83122444152832, 18.817806243896484, 18.256431579589844, 16.179052352905273, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 14.459208488464355, 12.998438835144043, 12.998438835144043 ], "content": [ "I am using Flask-RESTful for building REST api and webargs for parsing .", "What I totally forgot and we noticed just then was that we use the webargs https : github.com sloria webargs library to parse http parameters .", "I am using webargs for input validation for my api using flask framework .", "The parameters were parsed as strings and there also is a type unicode available in webargs .", "While defining Resource I want argument to be present so I wrote required True for example .. . .. . now .. . .. . while performing unittesting for API explicitly not specifying entries it returns Assertion Error .. . .. . When I checked exc value is .. . .. . and e is .. . .. . Now .. . .. . I ve these ways to handle this exception @app.errorhandler 500 .. . .. . @app.errorhandler ValidationError .. . .. . @app.errorhandler TypeError .. . .. . @app.errorhandler UnprocessableEntity .. . .. . @app.errorhandler 422 .. . .. . @app.errorhandler Exception .. . .. . I don t know why even this is not working .. . .. . @app.errorhandler AssertionError .. . .. . Refered to this : link http : stackoverflow.com questions 36644870 flask-restful-why-do-i-get-an-assertionerror-when-parsing-an-argument-with-the but wasn t able to solve .. . .. . I am using Flask 0.10.1 Flask-Restful 0.3.5 webargs 1.2.0", "Flask handles the faulty querystring gracefully and instead returns an http-error 400 .", "I would expect Flask to be able to handle URL encoded parameters by itself without a workaround in non-library code.. .", "I have no traceback because Flask will trap it and handle it as an HTTP error and return a 400 HTTP status code .", "EDIT : The origin of the exception is in this part of the Flask code site-packages flask app.py : .. . .. . The code skips to the except : and returns a 400 error .", "Is there a setting within Flask that I don t know about that solves this or can it really be the case that Flask can t handle specific URL encoded strings", "No tracebacks are available even when using the Flask debug server", "I m having a weird problem I m running Flask and I have an API function to cancel memberships .", "In certain cases however Flask returns a 400 error before it even reaches my own processing code .", "However the simple Flask testpage worked fine so we went to look for the differences .", "We tried to duplicate the problem in a very simple single-page Flask app so I could put it up here on StackOverflow as an example .", "I have python-dateutils installed in my virtualenv .", "init .. . .. . I understood that this statement forces the Python interpreter to use UTF-8 by default to decode bytestrings instead of ASCII .", "@Ketouem there s no view it returns JSON but it already fails on the request it doesn t even reach my code .", "For example the following URL : .. . .. . Gives me a 400 error : The browser or proxy sent a request that this server could not understand . although it seems to be a perfectly valid URL .", "I am sending a file and some related data from the front-end using the code blurb shown here http : www.angulartutorial.net 2015 03 file-upload-and-sending-data-to-backend.html .", "The URL also contains a parameter to set a reason for cancelation .", "this is a short text and it can contain extended characters so the string is URLencoded by the calling party .", "When I trap the error the underlying error data is : .. . .. . I found out that all is well when I remove the encoded extended character C3 A1 from the URL string .", "I can also solve it by adding this workaround I found elsewhere to my app .", "This gives me a solution to my problem but it feels overly complicated and unnessecary .", "So the real question is what am I missing here", "Thanks for any pointers you can give me .", "@Ketouem yes there is a traceback but only when I put a breakpoint in the code .", "Could you include the code of faulty view with the question", "Found out the solution And it seems I left out some essential information in my question that was needed to resolve the issue .", "Changing the type to unicode solved the problem .", "Thank you @ketouem for your time and trouble and sorry for being incomplete in my question .", "Here is the code on front-end : .. . .. . On the backend I am trying to get the file and the data as follows : .. . .. . This throws up an AssertionError on the backend .", "How do I do this", "Now when the input to API is .. . .. . I get a timezone aware object like this : .. . .. . Then I have to manually convert this object to UTC time to compare with datetime.utcnow as : .. . .. . Is there any better way so that my input time is first parsed timezoneaware and then converted to utc time and then made a naive object", "Thanks .. . .. . HM" ] }
{ "confidence": [ 73.27136993408203, 65.42645263671875, 62.2347412109375, 14.79365348815918 ], "content": [ "Question : null .. . Answer : I am using Flask-RESTful for building REST api and webargs for parsing . While defining Resource I want argument to be present so I wrote required True for example .. . .. . now .. . .. . while performing unittesting for API explicitly not specifying entries it returns Assertion Error .. . .. . When I checked exc value is .. . .. . and e is .. . .. . Now .. . .. . I ve these ways to handle this exception @app.errorhandler 500 .. . .. . @app.errorhandler ValidationError .. . .. . @app.errorhandler TypeError .. . .. . @app.errorhandler UnprocessableEntity .. . .. . @app.errorhandler 422 .. . .. . @app.errorhandler Exception .. . .. . I don t know why even this is not working .. . .. . @app.errorhandler AssertionError .. . .. . Refered to this : link http : stackoverflow.com questions 36644870 flask-restful-why-do-i-get-an-assertionerror-when-parsing-an-argument-with-the but wasn t able to solve .. . .. . I am using Flask 0.10.1 Flask-Restful 0.3.5 webargs 1.2.0", "Question : I m having a weird problem I m running Flask and I have an API function to cancel memberships . The URL also contains a parameter to set a reason for cancelation . this is a short text and it can contain extended characters so the string is URLencoded by the calling party . In certain cases however Flask returns a 400 error before it even reaches my own processing code . For example the following URL : .. . .. . Gives me a 400 error : The browser or proxy sent a request that this server could not understand . although it seems to be a perfectly valid URL . When I trap the error the underlying error data is : .. . .. . I found out that all is well when I remove the encoded extended character C3 A1 from the URL string . I can also solve it by adding this workaround I found elsewhere to my app . init .. . .. . I understood that this statement forces the Python interpreter to use UTF-8 by default to decode bytestrings instead of ASCII . This gives me a solution to my problem but it feels overly complicated and unnessecary . So the real question is what am I missing here Is there a setting within Flask that I don t know about that solves this or can it really be the case that Flask can t handle specific URL encoded strings I would expect Flask to be able to handle URL encoded parameters by itself without a workaround in non-library code.. . I have no traceback because Flask will trap it and handle it as an HTTP error and return a 400 HTTP status code . EDIT : The origin of the exception is in this part of the Flask code site-packages flask app.py : .. . .. . The code skips to the except : and returns a 400 error . Thanks for any pointers you can give me . Comment : No tracebacks are available even when using the Flask debug server Comment : @Ketouem yes there is a traceback but only when I put a breakpoint in the code . Flask handles the faulty querystring gracefully and instead returns an http-error 400 . Comment : Could you include the code of faulty view with the question Comment : @Ketouem there s no view it returns JSON but it already fails on the request it doesn t even reach my code . .. . Answer : Found out the solution And it seems I left out some essential information in my question that was needed to resolve the issue . We tried to duplicate the problem in a very simple single-page Flask app so I could put it up here on StackOverflow as an example . However the simple Flask testpage worked fine so we went to look for the differences . What I totally forgot and we noticed just then was that we use the webargs https : github.com sloria webargs library to parse http parameters . The parameters were parsed as strings and there also is a type unicode available in webargs . Changing the type to unicode solved the problem . Thank you @ketouem for your time and trouble and sorry for being incomplete in my question .", "Question : null .. . Answer : I am using webargs for input validation for my api using flask framework . I have python-dateutils installed in my virtualenv . Now when the input to API is .. . .. . I get a timezone aware object like this : .. . .. . Then I have to manually convert this object to UTC time to compare with datetime.utcnow as : .. . .. . Is there any better way so that my input time is first parsed timezoneaware and then converted to utc time and then made a naive object Thanks .. . .. . HM", "Question : null .. . Answer : I am sending a file and some related data from the front-end using the code blurb shown here http : www.angulartutorial.net 2015 03 file-upload-and-sending-data-to-backend.html . Here is the code on front-end : .. . .. . On the backend I am trying to get the file and the data as follows : .. . .. . This throws up an AssertionError on the backend . How do I do this" ] }
[ "yes-answer-long", "yes-answer-short" ]
web
UNK_RELATION
simple-html-dom@html@123
simple-html-dom -- simple-html-dom is an open-source html dom parser written for php5 + which lets users easily manipulate @placeholder .
{ "confidence": [ 77.03076934814453, 74.33812713623047, 72.5194320678711, 71.24003601074219, 71.24003601074219, 69.32817077636719, 68.9099349975586, 68.45848846435547, 68.3161392211914, 68.3161392211914, 67.0367431640625, 65.6281967163086, 65.25950622558594, 65.25950622558594, 65.25950622558594, 64.80596923828125, 64.35550689697266, 64.34880065917969, 64.34880065917969, 63.34764099121094, 63.201499938964844, 63.201499938964844, 63.201499938964844, 63.201499938964844, 62.561065673828125, 62.505008697509766, 61.66756057739258, 61.289634704589844, 61.289634704589844, 61.289634704589844, 61.289634704589844, 61.05622100830078, 59.44844055175781, 58.99821472167969, 58.99821472167969, 58.99821472167969, 58.99821472167969, 58.99821472167969, 58.981449127197266, 58.48614501953125, 57.89274215698242, 57.49873352050781, 57.203773498535156, 57.203773498535156, 57.203773498535156, 57.203773498535156, 56.31026840209961, 55.58686828613281, 55.58686828613281, 55.291908264160156, 55.291908264160156, 55.291908264160156, 55.291908264160156, 55.291908264160156, 55.291908264160156, 54.24767303466797, 53.469459533691406, 53.29544448852539, 53.29544448852539, 53.00048828125, 53.00048828125, 53.00048828125, 53.00048828125, 53.00048828125, 53.00048828125, 53.00048828125, 53.00048828125, 53.00048828125, 52.48841094970703, 52.27349090576172, 52.27349090576172, 51.89213180541992, 51.73539733886719, 51.73539733886719, 51.40899658203125, 51.111419677734375, 50.837432861328125, 50.72949981689453, 50.60749816894531, 50.60749816894531, 50.36162567138672, 50.36162567138672, 50.36162567138672, 50.36162567138672, 50.31254196166992, 50.31254196166992, 50.20964813232422, 50.20964813232422, 49.379608154296875, 49.042991638183594, 48.8563117980957, 48.66127014160156, 48.477169036865234, 48.07020568847656, 48.07020568847656, 48.07020568847656, 48.07020568847656, 46.90813446044922, 46.653160095214844, 46.56488800048828 ], "content": [ "It is a limitation of simple-html-dom .", "By php simple dom I mean PHP Simple HTML DOM Parser - simplehtmldom.sourceforge.net quot http : simplehtmldom.sourceforge.net quot .", "How to convert that object in to PHP Simple HTML DOM Parser .. . .. . Result", "I have tried and use Simple html dom .", "You can t do this with simple-html-dom .", "The simple-html-dom version is 1.5 Rev : 196 .", "I found ganon to be much slower than PHP s built-in DOM as well as Simple HTML DOM Parser .", "suppose that a simple-html-dom object includes the following .. . .. . How can i get either of texts using simple-html-dom", "Or does anyone know of some cases Simple HTML DOM Parser will fail", "Using Simple HTML DOM Parser I can t seem to get it to work .", "i have to do it using Simple HTML Dom", "Trying to use the Simple HTML Dom Parser in my application .", "Using Simple HTML DOM how to find table that has width 327", "Simple HTML DOM finds on base of attribute with syntax attribute value", "It s not possible with simple-html-dom in simply way of course .", "FYI : blog.futtta.be 2012 05 31 http : blog.futtta.be 2012 05 31 simple-html-dom-parser-not-that-simple", "I don t know how to pass that to Simple HTML DOM Parser to make html- find work properly .", "is there any problem with the function array-unique and simple-html-dom", "Is there any performance difference between this and simple-html-dom", "I am using the Simple HTML DOM http : simplehtmldom.sourceforge.net to scrape a webpage .", "@Kolink It s part of PHP Simple HTML DOM Parser http : simplehtmldom.sourceforge.net manual.htm", "Also beware with Simple HTML DOM Parser : simplehtmldom.sourceforge.net manual faq.htm memory leak http : simplehtmldom.sourceforge.net manual faq.htm memory leak", "They are better memory optimized and Simple HTML DOM Parser is really not necessary any longer for most PHP installments .", "If it go over it s because there is a problem : Simple HTML DOM Parser is known to suffer from memory leak .", "I would have given him the answer to simple-html-dom but that is not the correct way to parse an HTML as it s a custom library .", "What is the advantage over simple-html-dom parse since the html source is infuriatingly irregular with no id s to make it easier", "From the PHP Simple HTML DOM Parser Manual http : simplehtmldom.sourceforge.net manual.htm under the How to find HTML elements", "I can also also use the Simple HTML DOM parser to get the image link that I m looking for .", "I ve found PHP Simple HTML DOM Parser http : sourceforge.net projects simplehtmldom .", "Simple html doc is fine but an order of magnitude slower http : byronwhitlock.com FastCrawl benchmark.php than the built-in dom parser .", "PHP Simple HTML DOM Parser chokes if you try to crawl multiple pages e.g .", "I have a scraping program made with Simple HTML DOM .", "Like this : .. . .. . With PHP simple dom :", "I am screen-scraping page with a bunch of subpages using Simple HTML DOM Parser .", "The interesting stuff happens in get lections and I have markede where I call Simple HTML DOM Parser .", "i m using PHP Simple HTML DOM Parser to get text from a webpage .", "I guess so but I can t recommend Simple HTML DOM Parser but just DOMDocument http : php.net DOMDocument .", "I m new to PHP and am using PHP Simple HTML DOM Parser to fetch a URL .", "I have used PHP Simple HTML DOM Parser http : simplehtmldom.sourceforge.net manual.htm to first convert an HTML string to DOM object by str get html method of simple html dom.php .. . .. . 1 .", "Did you check if the HTML is somehow encoded in a way HTML DOM PARSER doesn t expect", "hey guys i m using simple-html-dom to retrieve content from another website but the thing is theres a character-encoding issue with the stuff retrieved using simple-html-dom .", "Unless you modify the PHP Simple HTML DOM Parser library it gives up if the file is more than 600KB to avoid using too much memory .", "This question already has an answer here : .. . .. . How to extract complete sub links using Simple-HTML-DOM", "I need to extract the text in between divs here The third of four.. . - using Simple HTML Dom PHP library .", "I actually think Simple HTML Dom does not provide tools to do this as there is no get before or get after types of commands .", "And here s the Simple HTML Dom code to get just the first level li items :", "Later I tried using Simple HTML Dom parser because a lot of people on SO as well recommend it .", "Recently I also found ganon http : code.google.com p ganon but in general PHP Simple HTML DOM Parser http : simplehtmldom.sourceforge.net manual.htm is the best", "ganon only load 2 element of my wants and when try to run simple-html-dom parser my computer hanged", "The problem is that when I try to use SimplePie and Simple HTML DOM at the same time I get a 500 error .", "I have been experminting with Simple HTML Dom but not sure what functions to use to best achieve this .", "Simple HTML Dom not fully supports xpath what makes difficult to find sibling elements .", "@Stephen Sarcsam Kamenar yes how to get this value use simple-html-dom", "the reason is that the simple HTML DOM object still has it s internal structure of the element only without its actual content .", "this way the object will be recreated without the deleted content and the simple HTML DOM object will be built without it .", "I added a version with php simple dom .", "the coorect identeficator is position of element in DOM tree of html document .", "My test page : http : snuzzer.dk pub shdp parse.php .. . .. . This is my script and I use a non-modified version of Simple HTML DOM Parser .", "I have a PHP Simple HTML DOM Parser locally in MAMP that pulls information and works well with the Japan version of a website since I m located in Japan .", "I actually tried to combine simple-html-dom with PHPCrawl but looks like it is the same .", "I m using Simple HTML DOM to get elements and values from a website I m scraping .", "I m trying to use simple-html-dom to extract elements from a file that looks like this .", "see stackoverflow.com questions 4550903 http : stackoverflow.com questions 4550903 simple-html-dom-character-encoding-issue", "How should parse with PHP simple-html-dom etc. . background and other images of webpage", "I had this problem too but it was not the charset problem.It was gzip compression that simple-html-dom doesn t handle .", "Im using Simple HTML Dom to parse the data into my own php script .", "@Mark Baker the simple-html-dom tag might have been a good clue", "You want file get html because file-get-contents will load the response body into a string but file get html will load it into simple-html-dom .", "http : stackoverflow.com questions 3577641 how-to-parse-and-process-html-with-php .. . .. . I m looking into HTML DOM parsers for PHP .", "Here is my code I am using simple-html-dom so please answer me on this and can you please tell me in regex also .", "questions 14611721 how-to-extract-complete-sub-links-using-simple-html-dom 3 answers .. . .. . I use simple-html-dom to get site s images .", "I tend to try to make sure my scripts are memory efficient but I m currently needing to parse large amounts of HTML via Simple HTML DOM http : simplehtmldom.sourceforge.net and it is in the parser that I m experiencing out-of-memory issues .", "My tr looks like this : .. . .. . I m using Simple HTML DOM I ve already tried with html- find tr id tr id but don t know to replace everything between including divs and script tags .", "Why not use a library that is more memory optimized simple HTML DOM is just not necessary any longer : .. . .. . More suggestions are available with the reference question about that topic : .. . .. . How to parse and process HTML XML", "Anyway you can try to report a bug to PHP HTML DOM parser project but if the html code you are trying to parse is not really valid HTML I m not sure if you will get this fixed .", "I m using PHP Simple HTML DOM Parser to scrape some data of a webshop also running XAMPP 1.7.2 with PHP5.3.0 and I m running into problems with tbody tag .", "How do you find and replace a string in html page using the native PHP DOM Parser", "Putting it in the context of traversing the DOM tree using smile html DOM how would you therefore write the following using children or childNodes : .. . .. . Problem", "I m new using the Simple HTML DOM Parser class and although I have been investigating about it I don t know the cause of my error .", "PHP : : How can be taken charset value of webpage with simple-html-dom parser http : simplehtmldom.sourceforge.net utf-8 windows-255 etc. .", "I m trying to use SimplePie to pull a list of links via RSS feeds and then scrape those feeds using Simple HTML DOM to pull out images .", "When I comment that line I still have simple-html-dom object in it but I cannot preform anything on it use the methods on it from the simple-html-dom file .", "php simple html DOM has some problem with parentheses in href .. . If you have a sample.php page and it contains : .. . .. . .. . if you do like this : .. . .. . .. . or like this : .. . .. . .. . It works .", "Moreover Simple HTML DOM seems to suffer from heavy memory leakage and you have to manually clean or reuse the allocated objects .", "Thanks but that operator doesn t works for PHP code using Simple HTML DOM class see link of it in my post .", "You need to modify those links to include full path there should be something for that in simple-html-dom .", "I want to parse this drop-down-menu with php simple dom .", "Simple example with php DOM http : www.php.net manual book.dom.php :", "why not use the native PHP DOM parser", "@pguardiario - I d like to play with it Advanced HTML Dom some more is there a list of selectors it supports", "For some reason I get recursion while using Simple DOM Parser Library .", "I would like to use Simple HTML DOM to remove all images in an article so I can easily create a small snippet of text for a news ticker but I haven t figured out how to remove elements with it .", "But When trying to send this string to HTML DOM PARSER method str get html html string It would not upload it returns false from the method invocation .", "I m scraping using PHP simple HTML DOM a number of different news sites with the aim of getting the main content body of text on the page .", "Simple HTML Dom is a great beginners script and I was a real beginner when I started to use it but now I m thinking of an upgrade .", "I m using php simple-html-dom to get some values from a page I m stocked how to use multiple find in foreach loop", "You can get the content of the script using simple-html-dom then as Yurii suggested parse it with regex to get the string you want. .", "I am using PHP Simple HTML DOM Parser http : simplehtmldom.sourceforge.net to fetch data like Page Title Meta Description and Meta Tags from other domains and then insert it into database .", "document will be root of the dom .", "The solution that does work however is as follows : .. . .. . EDIT2 : As this is a bug in the dom parser there is no simple way of doing this ." ] }
{ "confidence": [ 70.92240142822266, 70.04735565185547, 69.5767822265625, 68.5830078125, 68.15316009521484, 67.58631134033203, 67.45401763916016, 65.56796264648438, 64.98561096191406, 64.63412475585938, 64.55482482910156, 64.12918090820312, 64.09405517578125, 63.20454406738281, 63.01720428466797, 62.92363357543945, 62.25969314575195, 61.77070617675781, 61.754722595214844, 61.717369079589844 ], "content": [ "Question : Possible Duplicate : .. . How to parse and process HTML with PHP http : stackoverflow.com questions 3577641 how-to-parse-and-process-html-with-php .. . .. . I m looking into HTML DOM parsers for PHP . I ve found PHP Simple HTML DOM Parser http : sourceforge.net projects simplehtmldom . Are there any others I should be looking at Comment : Why do you think you need something else If it does the job use it . : Comment : Its still a great resource Gordon +1 .. . Answer : Recently I also found ganon http : code.google.com p ganon but in general PHP Simple HTML DOM Parser http : simplehtmldom.sourceforge.net manual.htm is the best Comment : PHP Simple HTML DOM Parser chokes if you try to crawl multiple pages e.g . level 1 : get 300 links e.g . from a listing level2 : go to each link and retrieve page with details and fetch elements . All you get is a collection of reset errors depending on server type - plus it is very slow Comment : ganon only load 2 element of my wants and when try to run simple-html-dom parser my computer hanged Comment : I found ganon to be much slower than PHP s built-in DOM as well as Simple HTML DOM Parser . Moreover Simple HTML DOM seems to suffer from heavy memory leakage and you have to manually clean or reuse the allocated objects .", "Question : I want to parse this drop-down-menu with php simple dom . I need the values and the options for this drop-down-menu . .. . Answer : Like this : .. . .. . With PHP simple dom : Comment : Thank you for your answer By php simple dom I mean PHP Simple HTML DOM Parser - simplehtmldom.sourceforge.net quot http : simplehtmldom.sourceforge.net quot . Comment : I added a version with php simple dom . Comment : Works great . Thank you Comment : It s easy to set the post as solved.. .", "Question : This question already has an answer here : .. . .. . How do you parse and process HTML XML in PHP questions 3577641 how-do-you-parse-and-process-html-xml-in-php 35 answers .. . .. . When ehcoed the error message in the title of this question appears I ve had problems that are similar to this before . In all cases I didn t actually need to increase the memoery in php.ini . Rather there was a missing curly bracket that was needed to close a loop . This page that I m requesting via the file get html function appears fine in my browser but it just won t let me echo the html via php . Any ideas Comment : What is this file get html function Comment : Did you try using file-get-contents instead of file get html Comment : @Kolink It s part of PHP Simple HTML DOM Parser http : simplehtmldom.sourceforge.net manual.htm Comment : Also beware with Simple HTML DOM Parser : simplehtmldom.sourceforge.net manual faq.htm memory leak http : simplehtmldom.sourceforge.net manual faq.htm memory leak Comment : Use DOMDocument SimpleXML instead . They are better memory optimized and Simple HTML DOM Parser is really not necessary any longer for most PHP installments . .. . Answer : Why not use a library that is more memory optimized simple HTML DOM is just not necessary any longer : .. . .. . More suggestions are available with the reference question about that topic : .. . .. . How to parse and process HTML XML http : stackoverflow.com questions 3577641 how-to-parse-and-process-html-xml Comment : - : .. . the : is a typo right This is a good answer but I don t see the use for using DOMDocument just to print the raw source of an HTTP request look like it will generate a useless object and involve useless processing.. . Comment : @FMaz008 : Yes the colon : is a typo . Sure : - Fixed + Thx . - For the example : This is the example the user does in the question so I actually did not judge about how high- or low-level it is just showing that other libraries are able to read a document into memory without triggering the memory limit .", "Question : This question already has an answer here : .. . .. . How do you parse and process HTML XML in PHP questions 3577641 how-do-you-parse-and-process-html-xml-in-php 35 answers .. . .. . When ehcoed the error message in the title of this question appears I ve had problems that are similar to this before . In all cases I didn t actually need to increase the memoery in php.ini . Rather there was a missing curly bracket that was needed to close a loop . This page that I m requesting via the file get html function appears fine in my browser but it just won t let me echo the html via php . Any ideas Comment : What is this file get html function Comment : Did you try using file-get-contents instead of file get html Comment : @Kolink It s part of PHP Simple HTML DOM Parser http : simplehtmldom.sourceforge.net manual.htm Comment : Also beware with Simple HTML DOM Parser : simplehtmldom.sourceforge.net manual faq.htm memory leak http : simplehtmldom.sourceforge.net manual faq.htm memory leak Comment : Use DOMDocument SimpleXML instead . They are better memory optimized and Simple HTML DOM Parser is really not necessary any longer for most PHP installments . .. . Answer : Edit your php.ini file .. . .. . OR add a line in your PHP file : .. . .. . And the error will get resolved . Note : You can put your value instead of 512M . Comment : Unless for whatever reason it takes more than 2GB of memory .", "Question : This question already has an answer here : .. . .. . How do you parse and process HTML XML in PHP questions 3577641 how-do-you-parse-and-process-html-xml-in-php 35 answers .. . .. . When ehcoed the error message in the title of this question appears I ve had problems that are similar to this before . In all cases I didn t actually need to increase the memoery in php.ini . Rather there was a missing curly bracket that was needed to close a loop . This page that I m requesting via the file get html function appears fine in my browser but it just won t let me echo the html via php . Any ideas Comment : What is this file get html function Comment : Did you try using file-get-contents instead of file get html Comment : @Kolink It s part of PHP Simple HTML DOM Parser http : simplehtmldom.sourceforge.net manual.htm Comment : Also beware with Simple HTML DOM Parser : simplehtmldom.sourceforge.net manual faq.htm memory leak http : simplehtmldom.sourceforge.net manual faq.htm memory leak Comment : Use DOMDocument SimpleXML instead . They are better memory optimized and Simple HTML DOM Parser is really not necessary any longer for most PHP installments . .. . Answer : increase your memory limit in php.ini file .. . .. . search for .. . .. . in your php.ini file and increase it to 512M Comment : If it takes more than 33MB to load a 300kb HTML file there s a problem that s bigger than just a memory limit . Comment : It can also be done by setting ini set memory limit 128M directly in PHP file . Comment : The problem has probably to do with the internal processing of the HTML so either fixing the code is an option or increasing the limit . Comment : Unless you modify the PHP Simple HTML DOM Parser library it gives up if the file is more than 600KB to avoid using too much memory . Comment : @Kolink : The problem is the library . And you can t expect to get it actually fixed because it s superfluous in times of DOMDocument and friends . So suggesting to increase the memory limit - even if not very creative - actually sounds not like the worst suggestion here . The alternative is to replace the library and I would go with that normally .", "Question : This question already has an answer here : .. . .. . How do you parse and process HTML XML in PHP questions 3577641 how-do-you-parse-and-process-html-xml-in-php 35 answers .. . .. . When ehcoed the error message in the title of this question appears I ve had problems that are similar to this before . In all cases I didn t actually need to increase the memoery in php.ini . Rather there was a missing curly bracket that was needed to close a loop . This page that I m requesting via the file get html function appears fine in my browser but it just won t let me echo the html via php . Any ideas Comment : What is this file get html function Comment : Did you try using file-get-contents instead of file get html Comment : @Kolink It s part of PHP Simple HTML DOM Parser http : simplehtmldom.sourceforge.net manual.htm Comment : Also beware with Simple HTML DOM Parser : simplehtmldom.sourceforge.net manual faq.htm memory leak http : simplehtmldom.sourceforge.net manual faq.htm memory leak Comment : Use DOMDocument SimpleXML instead . They are better memory optimized and Simple HTML DOM Parser is really not necessary any longer for most PHP installments . .. . Answer : I really don t think this usage justify increasing the memory . If it go over it s because there is a problem : Simple HTML DOM Parser is known to suffer from memory leak . If you just need to retrieve the content of a remote page using HTTP just do the following . This is the simplest and most resource efficient way I know to retrieve content from a remote page : .. . .. . If you need to do more advance queries you may look into cURL : http : php.net manual en book.curl.php", "Question : Possible Duplicate : .. . How to parse and process HTML with PHP http : stackoverflow.com questions 3577641 how-to-parse-and-process-html-with-php .. . .. . I m looking into HTML DOM parsers for PHP . I ve found PHP Simple HTML DOM Parser http : sourceforge.net projects simplehtmldom . Are there any others I should be looking at Comment : Why do you think you need something else If it does the job use it . : Comment : Its still a great resource Gordon +1 .. . Answer : You can look at the builtin DOM .. . .. . http : php.net dom", "Question : fellas I have one nasty html page to parse and i can t figure out how to extract correct data blocks from it using Simple HTML DOM http : simplehtmldom.sourceforge.net because it has no CSS child selector support . Html block : .. . .. . How would i extract only first ul child li elements The node- find ul class ul-block li doesn t work and node- find ul class ul-block li ofc finds also 2nd level nested li s : Comment : Do you depend on using Simple HTML DOM If not have a look at SimpleXML http : php.net manual book.simplexml.php or php DOM http : www.php.net manual book.dom.php . With both you can use xpath queries with which it s no problem to select only child elements . Comment : @Yoshi hey i m not quite depend i have used it for other website scrapping but i don t see why i couldn t add other parser . Thanks for suggestion . .. . Answer : I had the same issue and used the children method to grab just the first level items . And here s the Simple HTML Dom code to get just the first level li items :", "Question : fellas I have one nasty html page to parse and i can t figure out how to extract correct data blocks from it using Simple HTML DOM http : simplehtmldom.sourceforge.net because it has no CSS child selector support . Html block : .. . .. . How would i extract only first ul child li elements The node- find ul class ul-block li doesn t work and node- find ul class ul-block li ofc finds also 2nd level nested li s : Comment : Do you depend on using Simple HTML DOM If not have a look at SimpleXML http : php.net manual book.simplexml.php or php DOM http : www.php.net manual book.dom.php . With both you can use xpath queries with which it s no problem to select only child elements . Comment : @Yoshi hey i m not quite depend i have used it for other website scrapping but i don t see why i couldn t add other parser . Thanks for suggestion . .. . Answer : Simple example with php DOM http : www.php.net manual book.dom.php :", "Question : I am screen-scraping page with a bunch of subpages using Simple HTML DOM Parser . For some reason it parses the first 40 subpages just fine but when it comes to number 41 it dies with no error . I have made this test page http : snuzzer.dk pub shdp parse.php and tried to log everything I do in my script aswell as some of the venets in the Simple HTML DOM Parser but I haven t been able to find the error . Does anyone have an idea why it does when parsing URL number 41 Or does anyone know of some cases Simple HTML DOM Parser will fail My test page : http : snuzzer.dk pub shdp parse.php .. . .. . This is my script and I use a non-modified version of Simple HTML DOM Parser . The interesting stuff happens in get lections and I have markede where I call Simple HTML DOM Parser . .. . Answer : I ran this and it worked fine I got up to 96 . If I had to guess I d say you reached max excution time . Try adding this at the top : set time limit 0 Otherwise try changing your error reporting and post any errors here . Comment : It works fine for you That s strange . Setting set time limit 0 didn t change anything . I guess my webhotel doesn t allow me to do so . It doesn t seem like it s a timeout as it doesn t load for very long . I also find it strange that it stops exactly the same place everytime if it s a timeout . Comment : I just tested on another server . You are right it seems that the max execution-time has been reached .", "Question : Possible Duplicate : .. . How to parse and process HTML with PHP http : stackoverflow.com questions 3577641 how-to-parse-and-process-html-with-php .. . .. . I m looking into HTML DOM parsers for PHP . I ve found PHP Simple HTML DOM Parser http : sourceforge.net projects simplehtmldom . Are there any others I should be looking at Comment : Why do you think you need something else If it does the job use it . : Comment : Its still a great resource Gordon +1 .. . Answer : Yes . Simple html doc is fine but an order of magnitude slower http : byronwhitlock.com FastCrawl benchmark.php than the built-in dom parser . Use that . Comment : is there a way to make query return a node instead of a nodelist For example a page has only one h1 tag . I want to get it s nodeValue but don t think I should have to iterate through a nodelist . Comment : You should be able to use node 0 to get the first node in the list . Or just iterate and break . I just iterate and break . If the query returns nothing I don t get any errors that way .", "Question : Using Simple HTML DOM how to find table that has width 327 For example : .. . .. . Code .. . Answer : Simple HTML DOM finds on base of attribute with syntax attribute value", "Question : I read over 20 related questions on this site searched in Google but no use . I m new to PHP and am using PHP Simple HTML DOM Parser to fetch a URL . While this script works with local test pages it just won t work with the URL that I need the script for . Here is the code that I wrote for this following an example file that came with the PHP Simple DOM parser library : .. . .. . And this is the error message that I get : .. . .. . Please guide me what should be done to make it work . I m new so please suggest a way that is simple . While reading other questions and their answers on this site I tried cURL method to create a handle but I failed to make it work . The cURL method that I tried keeps returning Resources or Objects . I don t know how to pass that to Simple HTML DOM Parser to make html- find work properly . Please help Thanks Comment : I get 200 OK no redirection at all when I try to access that file.. . Comment : Hi Kolink Thanks for your comment . It s weird it shows an Error 500 on my Windows PC and when I run it on my Linux server that s the error message it shows . .. . Answer : Using cURL you would need to have the CURLOPT RETURNTRANSFER option set to true in order to return the body of the request with call to curl exec like this : Comment : Hi Mike Thanks for answering I ve tried that but I just don t know how to pass the handle from cURL to the DOM parser so the find method starts working . I tried this code but please see how should it be written because this code returns a warning and a fatal-error Fatal error : Call to a member function find on a non-object : Comment : @ChandanMishra I am not familiar with the library you are using but in glancing through the documentation there is a function to populate the DOM object from a string which is what you will get back from cURL . Please see my revised answer above . Comment : After trying str get html content I get a Fatal error : Fatal error : Call to a member function find on a non-object in home content html website.in test test.php on line 21 What might be causing this Comment : @ChandanMishra I don t know have you tried doing variable dumps to see where the process is breaking down i.e . you did not get a curl result the DOM object was not created etc . . Comment : Hi Mike A var-dump for content returns False .", "Question : I would like to use Simple HTML DOM to remove all images in an article so I can easily create a small snippet of text for a news ticker but I haven t figured out how to remove elements with it . Basically I would do .. . .. . 1 . Get content as HTML string .. . 2 . Remove all image tags from content .. . 3 . Limit content to x words .. . 4 . Output . Any help .. . Answer : when you only delete the outer text you delete the HTML content itself but if you perform another find on the same elements it will appear in the result . the reason is that the simple HTML DOM object still has it s internal structure of the element only without its actual content . what you need to do in order to really delete the element is simply reload the HTML as string to the same variable . this way the object will be recreated without the deleted content and the simple HTML DOM object will be built without it . here is an example function : .. . .. . put this function inside the simple-html-dom class and you re good . Comment : Good addition to the library . One error though html isn t defined in the class it s normally html new simple-html-dom so it needs to be replaced with this as in foreach this- find selector as node . I ve submitted an edit .", "Question : suppose that a simple-html-dom object includes the following .. . .. . How can i get either of texts using simple-html-dom Comment : document will be root of the dom . You need to traverse from there . Comment : @thinksteep how can i get text nodes using traversing in this case .. . Answer : With jquery try document.body .contents .. . .. . This should you a array of node with the text1 and text2 as text node .", "Question : I am just starting with the mentioned Parser and somehow running on problems directly with the beginning . Referring to this tutorial : .. . .. . http : net.tutsplus.com tutorials php html-parsing-and-screen-scraping-with-the-simple-html-dom-library .. . .. . I want now simply find in a sourcecode tne content of a div with a class ClearBoth Box .. . .. . I retrieve the code with curl and create a simple-html-dom object : .. . .. . Then I wanted to add the content of the div into an array called divs : .. . .. . But now when I print r the divs it gives much more despite the fact that the sourcecode has not more inside the div . Like this : .. . .. . I do not understand why the divs has not simply the code from the div Here is an example of the source code at the site : .. . .. . What am I doing wrong .. . Answer : Comment : with - children 1 - outertext I get : Function name must be a string in . .", "Question : i m using PHP Simple HTML DOM Parser to get text from a webpage . The page i need to manipulate is something like : .. . .. . I need to get the h1 element and the text that has no tags . to get the h1 i use this code : .. . .. . But the other text I also tried this into the foreach but i get the full text : .. . .. . but it returned also the H1 tag.. . Comment : Why do you expext the plaintext member to return something else Comment : i need only the Hello World part is it possible Comment : I guess so but I can t recommend Simple HTML DOM Parser but just DOMDocument http : php.net DOMDocument . It would be - nodeValue then . Comment : I m with the same problem I want to extract the text after a tag that is not within tags.. . .. . Answer : It looks like text- find text 2 gets what you re looking for however I m not sure how well that will work when the amount of text nodes is unknown . I ll keep looking . Comment : it doesn t work nothing has been print on the page.. .", "Question : suppose that a simple-html-dom object includes the following .. . .. . How can i get either of texts using simple-html-dom Comment : document will be root of the dom . You need to traverse from there . Comment : @thinksteep how can i get text nodes using traversing in this case .. . Answer : To grab all plain text elements you can use the following : .. . .. . Your output should look something like this : .. . .. . In the foreach loop you can obviously do whatever filtering you need to . For instance if you re trying to find some text that matches a specific string you can simply do : .. . .. . So if you wanted to replace the found text you could use : .. . .. . and html will contain the new html .", "Question : Using CURL to get content from website . Getting response in object . How to convert that object in to PHP Simple HTML DOM Parser .. . .. . Result .. . Answer : Curl will return a string containing the HTML right Just use the quick start sample http : simplehtmldom.sourceforge.net Comment : Curl is not returning string. . its a OBJECT . check result Comment : curl exec will return a string if you set CURLOPT RETURNTRANSFER to true . If you set it to false it will output the result directly . In that case you re getting a boolean telling you if the exec was succesfull .", "Question : I m currently using this HTML DOM PARSER using php : http : simplehtmldom.sourceforge.net .. . .. . I m confused on how to remove and replace the selected attribute href style.css I want to replace the link with index style.css should I insert only the .. . .. . index .. . .. . or replace the whole attribute from the whole html code Comment : why not use the native PHP DOM parser Comment : what do you mean native PHP DOM PARSER Comment : @dqhendricks The PHP DOM library offers quite a rough feature set . There re many basic features that you need to code yourself . Third-party libraries are a good option if they re solid enough . .. . Answer : This should do it : .. . .. . You could also use PHP s native DOM library http : php.net book.dom :" ] }
[ "yes-answer-long", "yes-answer-short" ]
html
UNK_RELATION
grass@modeling@273
grass -- grass gis commonly referred to as grass geographic resources analysis support system is a free and open-source geographic information system gis software suite used for geospatial data management and analysis image-processing graphics and maps production spatial @placeholder and visualization .
{ "confidence": [ 82.66338348388672, 79.04375457763672, 78.54365539550781, 75.8444595336914, 74.88208770751953, 74.88208770751953, 74.435302734375, 73.70634460449219, 73.70634460449219, 70.18543243408203, 69.00968933105469, 68.70813751220703, 67.65226745605469, 67.65226745605469, 67.65226745605469, 66.49459075927734, 66.47652435302734, 66.47652435302734, 66.47652435302734, 66.33686828613281, 66.31268310546875, 63.92815399169922, 62.33547592163086, 62.33547592163086, 62.271507263183594, 61.646156311035156, 61.12303924560547, 59.558006286621094, 59.452850341796875, 59.21772003173828, 57.913734436035156, 57.913734436035156, 57.913734436035156, 57.913734436035156, 57.913734436035156, 57.913734436035156, 56.836585998535156, 56.73799133300781, 56.73799133300781, 56.73799133300781, 56.73799133300781, 56.69453430175781, 56.69453430175781, 56.639915466308594, 56.29235076904297, 55.51879119873047, 55.42163848876953, 55.328834533691406, 55.14145278930664, 54.72163391113281, 53.84642028808594, 53.486968994140625, 52.979148864746094, 52.390045166015625, 52.390045166015625, 52.390045166015625, 52.390045166015625, 52.390045166015625, 52.33380126953125, 52.33380126953125, 51.881072998046875, 51.359092712402344, 51.150733947753906, 50.777809143066406, 50.56151580810547, 50.56151580810547, 50.56151580810547, 50.2642936706543, 49.92433166503906, 49.455780029296875, 49.385772705078125, 49.385772705078125, 49.385772705078125, 48.517295837402344, 48.49201202392578, 48.49201202392578, 47.88420867919922, 47.88420867919922, 47.09093475341797, 47.09093475341797, 46.47589111328125, 46.11192321777344, 46.11192321777344, 46.11192321777344, 46.11192321777344, 46.11192321777344, 46.11192321777344, 46.11192321777344, 45.277923583984375, 45.277923583984375, 44.936180114746094, 44.936180114746094, 44.54008865356445, 44.30305099487305, 44.10218048095703, 43.75825500488281, 43.52702331542969, 42.859554290771484, 42.82034683227539 ], "content": [ "I am working on a Landsat analysis script using GRASS GIS .", "without starting GRASS GIS explicitly .", "My GRASS is in C : Program Files x86 GRASS GIS 7.0.0beta2 .", "When I use library spgrass6 I get GRASS GIS interface loaded with GRASS version : GRASS not running .", "First use GRASS GIS 7 if possible .", "In general it depends on how you installed GRASS GIS .", "This can be done by manual setting of GRASS GIS environment since GRASS modules require GRASS session to run .", "I just started using GRASS GIS 7.0.0beta2 .", "you start GRASS GIS and then you run the script .", "Also there is a new option https : trac.osgeo.org grass ticket 2579 comment : 11 in the development version of GRASS GIS .", "It seems that you are trying to use GRASS GIS in Python from outside of GRASS session i.e .", "Before running initGRASS grep grass strsplit Sys.getenv PATH T 1 ig T val T is empty here no PATH environment set afterwards it has C : Program Files x86 GRASS GIS 7.0.1 bin C : Program Files x86 GRASS GIS 7.0.1 lib C : Program Files x86 GRASS GIS 7.0.1 tcl-tk bin C : Program Files x86 GRASS GIS 7.0.1 sqlite bin C : Program Files x86 GRASS GIS 7.0.1 gpsbabel C : Program Files x86 GRASS GIS 7.0.1 extrabin C : Program Files x86 GRASS GIS 7.0.1 extralib C : Program Files x86 GRASS GIS 7.0.1 msys bin .", "when using two version of GRASS GIS so it is not recommended .", "Have you tried running r.viewshed in GRASS GIS 7 directly", "You need to configure GRASS GIS to run with Python 3 first .", "The best way how to do is to start ipython-notebook command from the system command console terminal which is already running GRASS GIS session the one with GRASS GIS written in ASCII characters as described in the related tutorial https : github.com wenzeslaus python-grass-addon with-ipython-and-git .", "I am using Grass GIS 7.0.4 iPython 3.5 and Windows 10 .", "I would like to use the Spyder IDE for python scripting in GRASS GIS .", "I recently installed Grass GIS 7 on my Windows 10 .", "Finally there is a new way https : trac.osgeo.org grass ticket 2579 in the development version of GRASS GIS of invoking GRASS modules or any scripts designed to run within GRASS environment session .", "I am not sure whether I should add these paths of GRASS GIS in my system as well .", "However it is possible to do something in between : add GRASS executable to the path then you should be able to call GRASS just with grass70 as it is done on Linux the path can be found in properties of GRASS GIS icon .", "I lauched the script r.diveristy.py in GRASS GIS 6.4.3 from launch script option in file menu .", "GRASS GIS 6.4.3 is rather old and there were problems with running Python scripts on MS Windows r.diversity is a Python script .", "The development version of GRASS GIS trunk contains some experimental support for Python 3 not meant for learning but meant for further developement .", "System specifications .. . .. . Operating system : Windows 7 .. . GRASS GIS : Version 7.0.3 using the OSGeo4W installer .. . Spyder : installed as part of Anaconda 4.0.0", "My problem is with any of the hydrology analysis in GRASS through QGIS .", "or is it internal to Grass", "It depends how GRASS GIS and IPython are installed on your system but GRASS GIS from Linux distro packages will be configured to use the right Python and installing IPython for Python version 2 is likely just a matter of installing the right package ipython-notebook and ipython3-notebook in my case .", "Based on the GRASS source https : trac.osgeo.org grass browser grass trunk lib python script core.py L730 it is trying to run g.parser.exe but is unable to find it .", "Ive heard of some command called r.traveltime but it doesnt work in any version of QGIS or GRASS GIS .", "This will not work well from the Command Console in GUI which is mostly meant for executing GRASS GIS modules .", "You are right about GRASS GIS currently supporting Python 2.7 and not Python 3 .", "I am trying to run GRASS GIS version 7.0.3 from R version 3.2.3 using Windows 7 .", "I installed the R package rgrass7 which provides the interface between GRASS GIS 7 and R from the CRAN repository .", "That s what I just tried and it seems to work here with GRASS GIS 7.01 on Windows 7 .", "In R running as Administrator I tried to initialize GRASS GIS like this after loading rgrass7 library : .. . .. . This is the correct path for my system and I have also added following paths of GRASS GIS and R in windows system path : .. . .. . C : OSGeo4W64 apps grass grass-7.0.3 .. . C Program Files R-3.2.3 bin .. . .. . I am getting following error : .. . .. . Error in system paste g.dirseps.exe -g shQuote Sys.getenv WINGISRC : g.dirseps.exe not found Called from : system paste g.dirseps.exe -g shQuote Sys.getenv WINGISRC intern TRUE .. . .. . Can any one help me find out what is wrong in the path or any other relevant ambiguity", "I have iPython v3.5 installed via Anaconda and a separate installation of Python that was provided with the Grass GIS 7 download v2.7 .", "The development version even contains an simple Python editor which has some special functions specific to GRASS GIS .", "Also you should re-evaluate if you really need to run the thing from outside GRASS GIS .", "I installed Anaconda separately which contains the NumPy module but it is not being recognized by Grass GIS .", "Here is an extraction of basic things from one of them for MS Windows only : .. . .. . However note that the best how to call GRASS GIS functionality modules and Python libraries in Python is from within a GRASS session .", "Cross-posted to GIS SE gis.stackexchange.com questions 179590 grass-parser-error http : gis.stackexchange.com questions 179590 grass-parser-error 179789 please always explicitly state that a question was cross-posted .", "The general syntax is : .. . .. . Note that in general GRASS modules and scripts written specifically for GRASS require GRASS session to be active .", "g.dirseps.exe is in the Grass bin dir .", "In case you want to start the script automatically programmatically without using GRASS GIS GUI you can look at what the grass grass7 grass70 .. . command help gives and option to set GRASS BATCH JOB variable to your script .", "I ve tried to find resources online to link and run my Python script externally from Grass GIS 7 however I have not been successful .", "Another option is to call GRASS GIS directly from your server-side application .", "this question focuses more on Web services then Grass software .", "Feel free to test it and improve it and write how far you get to the grass-dev https : lists.osgeo.org listinfo grass-dev mailing list or in case of patch or a particular error submit a ticket https : trac.osgeo.org grass .", "it calls GRASS functionality right away .", "Got it with the following code : loc - initGRASS C : Program Files x86 GRASS GIS 6.4.3 C : Program Files x86 GRASS GIS 7.0.0beta2 home getwd gisDbase GRASS TEMP override TRUE borrowed from here http : gis.stackexchange.com a 93105 19263 .", "Following the instructions from here http : grasswiki.osgeo.org wiki R statistics when I bring the WinGRASS-windows console in front and type R for opening a R-session command-line mode inside a GRASS-session I get the following error : .. . .. . I would highly appreciate if you help me to configure R and GRASS so that I can use R in GRASS and GRASS in R . I m on Windows 7 with R 3.1.0 and GRASS GIS 7.0.0beta2 .", "And if you installed Grass somewhere other than C : GRASS-64 you obviously need to change that as well .", "Well it s not exactly internal to Grass but it s distributed with Grass rather than as a separate module .", "Then you start GRASS which gives you the right environment - GRASS session where the script can run .", "What if you just do initGRASS C : OSGeo4W64 apps grass grass-7.0.3", "I just tried initGRASS C : OSGeo4W64 apps grass grass-7.0.3 and still the same error .", "I would like to do the same thing with GRASS .", "OS : Windows 10 Grass Version : 7.0 .. . .. . Thanks .", "I tried to initialize the GRASS in R with initGRASS C : Program Files x86 GRASS GIS 7.0.0beta2 home tempdir and this produces the following error message Error in system paste g.dirseps.exe -g shQuote Sys.getenv WINGISRC : g.dirseps.exe not found .", "So is that something that I could just open the Grass GUI to do", "MS-Windows In order to use GRASS functionality via Python from outside some environment-variables have to be set : .. . GISBASE C : GRASS-64 GISRC C : Documents and Settings user .grassrc6 LD LIBRARY PATH C : GRASS-64 lib PATH C : GRASS-64 etc C : GRASS-64 etc python C : GRASS-64 lib C : GRASS-64 bin C : GRASS-64 extralib C : GRASS-64 msys bin C : Python26 PYTHONLIB C : Python26 PYTHONPATH C : GRASS-64 etc python GRASS SH C : GRASS-64 msys bin sh.exe .. . .. . However msys folder is nonexistent after I install the latest version WinGRASS-7.0.3 and 7.0.4 .", "gis.stackexchange.com questions 203310 http : gis.stackexchange.com questions 203310 how-do-i-connect-my-python-script-external-to-the-grass-gis-7-program-in-windows", "I don t know much about the Grass GUI .", "GRASS process will check it and execute script specified in the variable .", "I want to call some grass modules e.g .", "I was impressed that GRASS successfully imported the dtm using the GRASS import menu v.in.dxf as several other tools I have tried failed to do this .", "I am using GRASS and R to analyse some hyperspectral data .", "Actual code is GrassRunner.py GISBASE C : Program Files GRASS-6.4.3 GISRC C : Documents and Settings user .grassrc6 LD LIBRARY PATH C : Program Files GRASS-6.4.3 lib PATH C : Program Files GRASS-6.4.3 etc C : Program Files GRASS-6.4.3 etc python C : Program Files GRASS-6.4.3 lib C : Program Files GRASS-6.4.3 bin C : Program Files GRASS-6.4.3 extralib C : Program Files GRASS-6.4.3 msys bin C : Python27 PYTHONLIB C : Python27 PYTHONPATH C : Program Files GRASS-6.4.3 etc python GRASS SH C : Program Files GRASS-6.4.3 msys bin sh.exe from grass.pygrass.modules import Module", "I want to use R in GRASS and vise versa .", "For this purposeI try to launch Spyder within a GRASS session .", "I am brand new to Python and Grass .", "Finally you can set the environmental variables in your system and thus have the GRASS session always available .", "That s something like grass70 on Linux Applications GRASS GRASS-7.0.app on Mac and C : OSGeo4Win grass70.bat on MS Windows .", "Finally grass.script.setup.init is called which sets up the remaining runtime variables and it also connects the GRASS session to the GRASS Database Location and Mapset which looks like this :", "But I don t know how to specify in parameters the two polygons in GRASS", "Is it possible to change a border-color of a node if a attribute is present or not within the GRASS stylesheet", "i have standalone install GRASS from official web site and i using python-2.7 32b and windows-10 . i trying to works with python api from GRASS GIS 7.0.4 . but i have import errors .", "Consequently you need to do something like the following commands for Linux : .. . .. . See a more in-depth discussion in GRASS GIS ticket 2424 : .. . .. . https : trac.osgeo.org grass ticket 2424 .. . .. . On MS Windows the paths to libraries are stored in the PATH variable mixed with paths to executables so you to use PATH there .", "I used the script from http : gis.stackexchange.com questions 89452 problem-with-python-script-to-control-grass-gis-from-outside-how-to-import-gra 90160 90160 and changed all the relevant path information to suite my installation and apparently now the grass.script module is accessed .", "I am using GRASS 6.4.3 python 2.7.6 under WIN 8.1", "I have a GRASS mapset that uses a 30m resolution DEM for my area .", "Is there anyway to set that in GRASS or am I missing a basic step somewhere", "That s the whole point of setting PYTHONPATH to C : GRASS-64 etc python .", "I am new to GRASS and i do not manage to get started .", "While trying to install qgis-plugin-grass I ran into some problems .", "Then it adds extends PYTHONPATH sys.path with .. . etc python in GRASS installation .", "On MS Windows you should probably use the Python version and run it for example from the GRASS GIS GUI through the Launch script item in the File menu in the Layer Manager .", "You need to rebuild GRASS GIS or untangle multiple installations . .. . .. . I tried different solutions repositories but I allways end up with some sort of conflits between different packages .", "I tried Users user.name Anaconda2 Scripts spyder.exe in the GRASS shell .", "Anaconda downloaded with Python 3.5 and Grass was downloaded with OSGeo64W 7.0.4 version .", "There were big changes in GRASS module parameter names recently which caused the trouble but now it should work without problems .", "This is described on GRASS user wiki http : grasswiki.osgeo.org wiki Working with GRASS without starting it explicitly in documentation http : grass.osgeo.org grass71 manuals libpython script.html module-script.setup and finally on SE Can t run grass tools from python script grass 6.4 python-2.7 win7 http : stackoverflow.com questions 30557132 cant-run-grass-tools-from-python-script-grass-6-4-python-2-7-win7 30563277 30563277 .", "You need to add the libraries on path so you can do what I said the comment : add lib directory from the GRASS GIS installation to the PATH variable .", "To run it either copy and paste the code into the GRASS python shell accessible as a tab on the GRASS GUI layer manager window or save it as a .py file and again from the Python shell use the command execfile foo.py .", "Standard way is to run GRASS program which starts sets the session .", "I m using the comand g.gui.animation in GRASS 7.0 to plot some raster maps with no time information that represent the timing evolution of a physical experiment .", "Again to run it you have to set it as executable chmod u+x export.py first then you can run it in the command-line : .. . .. . Both examples assume you are using Linux Mac OS X or something similar and running the script in system command-line in GRASS GIS ." ] }
{ "confidence": [ 106.90992736816406, 104.5791015625, 96.53340148925781, 94.7283935546875, 91.96209716796875, 90.92588806152344, 90.03375244140625, 89.38988494873047, 86.08123779296875, 85.64015197753906, 84.95793151855469, 81.12230682373047, 80.90711975097656, 80.24507141113281, 79.271240234375, 78.04954528808594, 77.97837829589844, 75.85481262207031, 68.8150634765625, 67.25296783447266 ], "content": [ "Question : I am trying to get started with GRASS scripting using Python and I figured that I would use Ipython notebooks since I m familiar with them . I follow this https : www.youtube.com watch v PX2UpMhp2hc tutorial on youtube but Python crashes when I try to start Ipython notebook in the grass command window see in video at around 10 minutes . The error message is : .. . .. . Fatal Python error : Py Initialize : unable to load the file system codec .. . .. . Possible clue : I use Python 3.5 in my notebooks while GRASS apparently uses Python 2.7 . .. . Answer : The best way how to do is to start ipython-notebook command from the system command console terminal which is already running GRASS GIS session the one with GRASS GIS written in ASCII characters as described in the related tutorial https : github.com wenzeslaus python-grass-addon with-ipython-and-git . This will not work well from the Command Console in GUI which is mostly meant for executing GRASS GIS modules . As far as I understand you are already doing this the right way . You are right about GRASS GIS currently supporting Python 2.7 and not Python 3 . I don t think it is possible both generally and in this case to mix Python 2.7 with Python 3.x in this way . Using IPython for Python 2.7 is the way to go . It depends how GRASS GIS and IPython are installed on your system but GRASS GIS from Linux distro packages will be configured to use the right Python and installing IPython for Python version 2 is likely just a matter of installing the right package ipython-notebook and ipython3-notebook in my case . The development version of GRASS GIS trunk contains some experimental support for Python 3 not meant for learning but meant for further developement . You need to configure GRASS GIS to run with Python 3 first . Feel free to test it and improve it and write how far you get to the grass-dev https : lists.osgeo.org listinfo grass-dev mailing list or in case of patch or a particular error submit a ticket https : trac.osgeo.org grass .", "Question : null .. . Answer : I am trying to run GRASS GIS version 7.0.3 from R version 3.2.3 using Windows 7 . I installed the R package rgrass7 which provides the interface between GRASS GIS 7 and R from the CRAN repository . In R running as Administrator I tried to initialize GRASS GIS like this after loading rgrass7 library : .. . .. . This is the correct path for my system and I have also added following paths of GRASS GIS and R in windows system path : .. . .. . C : OSGeo4W64 apps grass grass-7.0.3 .. . C Program Files R-3.2.3 bin .. . .. . I am getting following error : .. . .. . Error in system paste g.dirseps.exe -g shQuote Sys.getenv WINGISRC : g.dirseps.exe not found Called from : system paste g.dirseps.exe -g shQuote Sys.getenv WINGISRC intern TRUE .. . .. . Can any one help me find out what is wrong in the path or any other relevant ambiguity Comment : What if you just do initGRASS C : OSGeo4W64 apps grass grass-7.0.3 That s what I just tried and it seems to work here with GRASS GIS 7.01 on Windows 7 . Comment : Thank you for your feedback . I just tried initGRASS C : OSGeo4W64 apps grass grass-7.0.3 and still the same error . Comment : I assume g.dirseps.exe is available in the bin folder Before running initGRASS grep grass strsplit Sys.getenv PATH T 1 ig T val T is empty here no PATH environment set afterwards it has C : Program Files x86 GRASS GIS 7.0.1 bin C : Program Files x86 GRASS GIS 7.0.1 lib C : Program Files x86 GRASS GIS 7.0.1 tcl-tk bin C : Program Files x86 GRASS GIS 7.0.1 sqlite bin C : Program Files x86 GRASS GIS 7.0.1 gpsbabel C : Program Files x86 GRASS GIS 7.0.1 extrabin C : Program Files x86 GRASS GIS 7.0.1 extralib C : Program Files x86 GRASS GIS 7.0.1 msys bin . Comment : Is there something wrong related to the version of R because when I load rgrass7 library in R it shows some messages for R ver . 3.2.4 and I am using R ver . 3.2.3 . Secondly I just checked the bin directory of R and could not find g.dirseps.exe . Strange You think this is the root of the problem I am not sure whether I should add these paths of GRASS GIS in my system as well . I could give it a try as well . Comment : g.dirseps.exe is in the Grass bin dir .", "Question : I just started using GRASS GIS 7.0.0beta2 . I want to use R in GRASS and vise versa . Following the instructions from here http : grasswiki.osgeo.org wiki R statistics when I bring the WinGRASS-windows console in front and type R for opening a R-session command-line mode inside a GRASS-session I get the following error : .. . .. . I would highly appreciate if you help me to configure R and GRASS so that I can use R in GRASS and GRASS in R . I m on Windows 7 with R 3.1.0 and GRASS GIS 7.0.0beta2 . Thanks in advance for your help .. . Answer : I m a Linux user so I can t try it but it seems to me that R bins directory is not in your PATH . To test it open a command-line should be cmd.exe and try .. . .. . If the output is the same as above then add R bin directory to PATH so you can call R from whatever directory you want . Check one of the following links https : www.google.it search q add+directory+to+path+windows+7 and apply it to the directory where R bins reside . HTH let me know . Luca Comment : +1 : Thanks @Luca for your helpful answer . It works for calling R but struggling to call GRASS in R Please see the provide link . Any idea . Comment : have you installed spgrass6 which commands do not work and what s the output Comment : Yes I have installed spgrass6 . My GRASS is in C : Program Files x86 GRASS GIS 7.0.0beta2 . When I use library spgrass6 I get GRASS GIS interface loaded with GRASS version : GRASS not running . I tried to initialize the GRASS in R with initGRASS C : Program Files x86 GRASS GIS 7.0.0beta2 home tempdir and this produces the following error message Error in system paste g.dirseps.exe -g shQuote Sys.getenv WINGISRC : g.dirseps.exe not found . Thanks again for your help . Comment : Got it with the following code : loc - initGRASS C : Program Files x86 GRASS GIS 6.4.3 C : Program Files x86 GRASS GIS 7.0.0beta2 home getwd gisDbase GRASS TEMP override TRUE borrowed from here http : gis.stackexchange.com a 93105 19263 . Comment : @MYaseen208 fine", "Question : I am new to GRASS and i do not manage to get started . I am trying to write a python script that will call grass tool at that point it does not really matter what tool I created the location and mapset interactively and set all the definitions . still I can t get grass.gisenv to give any output but . my code : .. . .. . I get no error . only . Please help .. . Answer : There are some ways how to improve your code for example add to environmental variables rather then set them : .. . .. . Then the GISRC variable should point to a temporary file rather then the file in user settings directory in case you want to run GRASS session as a normal user . But anyway I suggest to start over with a new script or approach . First use GRASS GIS 7 if possible . Version 7.0.0 was released several months ago and it is available for MS Windows both as standalone and as part of OSGeo4W . You might get better error-messages-for example . Second review related wiki page http : grasswiki.osgeo.org wiki Working with GRASS without starting it explicitly . It contains a detailed guide what needs to be done with extensive code samples . Here is an extraction of basic things from one of them for MS Windows only : .. . .. . However note that the best how to call GRASS GIS functionality modules and Python libraries in Python is from within a GRASS session . So the usual workflow is that you write a script which relies on the right environment being set i.e . it calls GRASS functionality right away . Then you start GRASS which gives you the right environment - GRASS session where the script can run . Also there is a new option https : trac.osgeo.org grass ticket 2579 comment : 11 in the development version of GRASS GIS . In case you are doing some non-production development yet or you are writing something experimental you can try to use daily build of development version Subversion trunk future 7.1 which contains a possibility to specify script in the command-line of GRASS GIS executable . The call might look like : .. . .. . The advantage of the solution above is that you get proper locking of Mapsets on Linux and Mac OS X plus several other things starting with correctly set GRASS environment without much work . You just need to know path to the executable or have the executable on PATH . Then there is an option similar to the previous one which works in older versions . You can set GRASS BATCH JOB environmental variable . GRASS process will check it and execute script specified in the variable . Unlike the option above passing script as arguments you cannot pass parameters to the called script nor call GRASS modules directly . Finally you can set the environmental variables in your system and thus have the GRASS session always available . GRASS modules would then run as normal programs when the right GISRC variable and file is provided . This option may potentially cause many problems e.g . when using two version of GRASS GIS so it is not recommended . However it is possible to do something in between : add GRASS executable to the path then you should be able to call GRASS just with grass70 as it is done on Linux the path can be found in properties of GRASS GIS icon .", "Question : null .. . Answer : I ve tried to find resources online to link and run my Python script externally from Grass GIS 7 however I have not been successful . I found resources here that provide instructions e.g . https : grasswiki.osgeo.org wiki GRASS and Python MS-Windows but this is my first time using Python and I haven t been able to figure it out . I am using Grass GIS 7.0.4 iPython 3.5 and Windows 10 . I tried to set environment-variables in iPython and IDLE don t know if it matters which I use to link it with Grass with the following code : .. . .. . The gisrc variable links to a text document I created following the recommendation here see Update 2 . I saved the text file as grass.pth and placed it in C : OSGeo4W apps python27 lib site-packages . Not sure if my gisrc variable is correct here since it doesn t link-to the location referenced in the code above : http : gis.stackexchange.com questions 89452 problem-with-python-script-to-control-grass-gis-from-outside-how-to-import-gra .. . .. . When I run the code I receive an error saying that import grass.script as grass importerror : no module named grass.script . What am I doing wrong I have iPython v3.5 installed via Anaconda and a separate installation of Python that was provided with the Grass GIS 7 download v2.7 . Not sure if this matters for linking . Comment : See GIS SE for an answer . GIS SE is a better place to ask this question anyway . gis.stackexchange.com questions 203310 http : gis.stackexchange.com questions 203310 how-do-i-connect-my-python-script-external-to-the-grass-gis-7-program-in-windows", "Question : null .. . Answer : I am working on a Landsat analysis script using GRASS GIS . For that I need to focus on a certain area based on raster landscape using r . mask raster landscape cat foo and then run r.reclass on raster ndvi . I have realized that the two rasters are not perfectly aligned as this close up image shows . non alligned pixels http : i.stack.imgur.com UTMus.png .. . .. . I thought that GRASS would take care of this during import Can someone tell me how to correct this and how I can prevent this from occurring", "Question : null .. . Answer : I would like to use the Spyder IDE for python scripting in GRASS GIS . For this purposeI try to launch Spyder within a GRASS session . How can I start spyder from the GRASS Command Shell in Windows 7 .. . .. . In Linux I managed to do that so far by simply using the following command in the GRASS terminal : .. . spyder -w . 2 dev-null . I tried Users user.name Anaconda2 Scripts spyder.exe in the GRASS shell . However I got the following error message : .. . Traceback most recent call last : File C : Users user.name Anaconda2 Scripts spyder-script.py line 1 in module from spyderlib import start app Import Error : No module named spyderlib .. . .. . Typing the same command Users user.name Anaconda2 Scripts spyder.exe in the OS shell cmd.exe lauches Spyder without any problems . System specifications .. . .. . Operating system : Windows 7 .. . GRASS GIS : Version 7.0.3 using the OSGeo4W installer .. . Spyder : installed as part of Anaconda 4.0.0", "Question : this question focuses more on Web services then Grass software . Do you have some suggestions on how to allow a command Linux to be accessed as a Web service I am actually working with NodeJS but other solutions are welcome . Thank you .. . .. . Regards .. . .. . SB . .. . Answer : This is an older post but I hope my suggestions might be useful to someone anyway . The most common way probably is to use WPS http : en.wikipedia.org wiki Web Processing Service using PyWPS http : pywps.wald.intevation.org or Zoo Project http : www.zoo-project.org both projects offer binding to GRASS GIS . Another option is to call GRASS GIS directly from your server-side application . This can be done by manual setting of GRASS GIS environment since GRASS modules require GRASS session to run . This is described on GRASS user wiki http : grasswiki.osgeo.org wiki Working with GRASS without starting it explicitly in documentation http : grass.osgeo.org grass71 manuals libpython script.html module-script.setup and finally on SE Can t run grass tools from python script grass 6.4 python-2.7 win7 http : stackoverflow.com questions 30557132 cant-run-grass-tools-from-python-script-grass-6-4-python-2-7-win7 30563277 30563277 . Finally there is a new way https : trac.osgeo.org grass ticket 2579 in the development version of GRASS GIS of invoking GRASS modules or any scripts designed to run within GRASS environment session . Here is a Python example : .. . .. . I m not sure how exactly this looks like in NodeJS but you may want to look at execute a command-line binary in node js http : stackoverflow.com questions 20643470 execute-a-command-line-binary-in-node-js . The interface was added just recently and it is not in stable release yet it s quite usable however . In older versions you can get similar but limited functionality by setting the GRASS BATCH JOB environment variable . You can learn more in the documentation http : grass.osgeo.org grass71 manuals grass7.html exec-interface-example or by running grass71 --help . The general syntax is : .. . .. . Note that in general GRASS modules and scripts written specifically for GRASS require GRASS session to be active . Standard way is to run GRASS program which starts sets the session . The session is typically interactive command-line and or GUI . When using GRASS functionality from other programs the session environment must be set up in some way . PyWPS and Zoo Project will help you with that or you can do it completely on your own second suggested option or ideally you can use the actual GRASS executable which will run specified module or script in the proper session using the new --exec flag or GRASS BATCH JOB variable this is the last suggested option .", "Question : I recently installed Grass GIS 7 on my Windows 10 . Upon loading the program I receive an error in the terminal window stating : .. . .. . This module requires the Numeric numarray or NumPy module which could not be imported . It probably is not installed it s part of the standard Python distribution . See the Numeric Python site http : numpy.scipy.org for information on Numeric numarray or NumPy not found . I installed Anaconda separately which contains the NumPy module but it is not being recognized by Grass GIS . How do I have Grass recognize this module is already installed on my computer I have Windows 10 and both Anaconda and Grass were downloaded as 64-bit . Anaconda downloaded with Python 3.5 and Grass was downloaded with OSGeo64W 7.0.4 version . .. . Answer : I m guessing that GRASS brings its own Python interpreter with it rather than using the Anaconda version that you installed . As the notes on GRASS and Python https : grasswiki.osgeo.org wiki GRASS and Python Using a version of Python different from the default installation remark On Windows Python scripts are invoked via GRASS PYTHON so changing that environment variable will-change the interpreter . If you set the GRASS PYTHON environment variable to point to the Anaconda Python binary you may find things start to work better . Comment : How do I go about setting the GRASS PYTHON environment variable And how do I find the Anaconda Python binary location on my computer I am brand new to Python and Grass . Comment : IIRC in Windows you would use a command like set GRASS PYTHON C : path to Python interpreter to set the environment variable . You can add it to your system settings http : www.computerhope.com issues ch000549.htm too . You installed Anaconda . Sorry I have no idea where you put it", "Question : I lauched the script r.diveristy.py in GRASS GIS 6.4.3 from launch script option in file menu . After that the r.diversity GUI appeared in which I gave the input and the output file name and then run . The following error message is displayed : .. . .. . How can I solve the problem .. . Answer : GRASS GIS 6.4.3 is rather old and there were problems with running Python scripts on MS Windows r.diversity is a Python script . Install the latest release currently 7.0.4 and install the r.diversity module from Addons again . There was a lot of improvements regarding Python scripts in the 7.0 series .", "Question : I ve downloaded the graphstyle.grass and added the following property to the pre-existing label : .. . .. . The color property used to be 6DCE9E .. . .. . But now after uploading that new GraSS file to the neo4j browser all CELL -nodes are black . When I examine the GraSS file on the browser it is now : .. . .. . 1 Why did neo4j remove my quotes around the color -reference 2 How can I write the GraSS file so that neo4j recognizes that the color is derived from the color -property of the CELL nodes Thank you . .. . Answer : The neo4j browser does not support setting colors from node relationship properties . Aside from the neo4j browser there are a number of other visualization tools for neo4j http : neo4j.com developer guide-data-visualization library alchemy js open-source graph-visualization . Perfhaps one of them will work better for you .", "Question : i have standalone install GRASS from official web site and i using python-2.7 32b and windows-10 . i trying to works with python api from GRASS GIS 7.0.4 . but i have import errors . some imports work i can import in the python ide and some imports not works and i cant to using . first i read this post grass python http : gis.stackexchange.com questions 49906 grass-geoprocessing-in-python-script and i trying to take pygrass api python code : .. . .. . success imports .. . .. . no success imports .. . .. . 1 . from pygrass.modules import Module .. . .. . error message : No module named pygrass.modules .. . .. . 2 . from grass.pygrass.gis import Mapset .. . .. . error message : .. . .. . 3 . from grass.pygrass.vector import VectorTopo .. . .. . error message : .. . .. . 4 . from grass.pygrass.vector import Vector .. . .. . error message : .. . .. . 5 . from grass.pygrass.raster import RasterRow .. . .. . error message : .. . .. . 6 . from grass.pygrass.gis import Location .. . .. . error message : .. . .. . 7 . from grass.pygrass.gis.region import Region .. . .. . error message : .. . .. . 8 . from grass.pygrass.modules import raster as r .. . .. . error message : ImportError : cannot import name raster .. . .. . 9 . from grass.pygrass.functions import coor2pixel .. . .. . error message : No module named functions .. . .. . 10 . import grass.scripts .. . .. . error message : No module named scripts .. . .. . any idea why to i can import some imports from the pygrass and why i cant import some other imports from pygrass .. . Answer : The import grass.scripts is a typo . You need to use import grass.script because that s the name of the module . The import from pygrass.modules import Module causes No module named pygrass.modules because there is no such module . The name for the module is grass.pygrass.modules as you are using it in the other examples . The import from grass.pygrass.modules import raster as r looks like you want to say from grass.pygrass.modules.shortcuts import raster as r . Is what you are using from some documentation The from grass.pygrass.functions import coor2pixel import should be from grass.pygrass.utils import coor2pixel . It really looks like you are using some outdated wrong documentation . The latest documentation is here : .. . .. . https : grass.osgeo.org grass73 manuals libpython pygrass index.html .. . .. . grass73 currently denotes the development version . Use grass72 for upcoming 7.2 release and grass70 for the current release 7.0 7.0.4 . All the other errors say ImportError : grass gis.7.0.4 not found which in connection with the previous lines e.g . ctypes loader.py...load library shows that the problem is in loading the C dynamic libraries using C types which are not found . It seems that you are trying to use GRASS GIS in Python from outside of GRASS session i.e . without starting GRASS GIS explicitly . First note that this is good to do only when you actually need it . The default solution you should use is to write a Python script which will run inside GRASS session i.e . you start GRASS GIS and then you run the script . You do it from menu File Run script or from the command-line . The development version even contains an simple Python editor which has some special functions specific to GRASS GIS . Writing a script which runs inside a GRASS session removes from you the need to setup the environment in the script and you can just focus on the functionality . It will also make it easier to use it on different computers without changing the paths in the script . Finally it allows you to use easily things like the automatically generated GUI . In case you want to start the script automatically programmatically without using GRASS GIS GUI you can look at what the grass grass7 grass70 .. . command help gives and option to set GRASS BATCH JOB variable to your script . The development version has also --exec option which is little bit more versatile : .. . .. . https : grass.osgeo.org grass72 manuals grass7.html .. . .. . If you really need to want setup the GRASS GIS runtime environment yourself make sure you are using the following the documentation : .. . .. . https : grass.osgeo.org grass73 manuals libpython script.html module-script.setup .. . .. . However PyGRASS depends on the dynamic libraries which are used through ctypes and loaded during import . The operating-system searches for the libraries using its settings and current environmental variables . For the dynamic libraries it uses the environmental variables from the time the process was started . So changing it later in the script for example as grass.script.setup.init does does not influence the process itself but only its subprocesses . Consequently you need to do something like the following commands for Linux : .. . .. . See a more in-depth discussion in GRASS GIS ticket 2424 : .. . .. . https : trac.osgeo.org grass ticket 2424 .. . .. . On MS Windows the paths to libraries are stored in the PATH variable mixed with paths to executables so you to use PATH there . You need to do something like this : .. . .. . You can also change the PATH variable permanently in the MS Windows registry e.g . with xset . There is plenty of material online about that it works the same for any program . Also when dealing with paths in Python I recommend using os.path.join because there are some specifics in dealing with file paths on MS Windows . See the Python documentation for details : .. . .. . https : docs.python.org 2 library os.path.html os.path.join .. . .. . The same applies to constructing PATH variable and other variables containing paths . In general in command-line or Python be aware of spaces backslashes directory separators and separators in PATH LD LIBRARY PATH variables and current values of environmental variables . Comment : thnx you very much @wenzeslaus this is a good help now i will test your tips.but i have question how to fix ImportError : grass gis.7.0.4 not found with ctypes i have windows-10 and python-2.7 and i have ctype lib.because i think this is a big proplem in windows Comment : You need to add the libraries on path so you can do what I said the comment : add lib directory from the GRASS GIS installation to the PATH variable . I added an example how this can be done on MS Windows . Comment : i have to do that and i get this error again . Comment : You will need to put exact steps to your question otherwise there is no chance to know what is happening . Also you should re-evaluate if you really need to run the thing from outside GRASS GIS .", "Question : null .. . Answer : Gooday .. . .. . As my first post I offer a humble apology if this is such a basic question as to make any of you cringe . I feel like I have exhausted my search skills and read through the QGIS documentation frequently and thoroughly . My problem is with any of the hydrology analysis in GRASS through QGIS . I have a GRASS mapset that uses a 30m resolution DEM for my area . The extent of the mapset is set to include only the DEM ie . no whitespace or no-data areas and yet when I run r.fill.dir r.basin or r.watershed I get back an image that has a resolution of nearly 73xxmetres . I am most used to ArcGIS where-in the hydrology tools the user can define the working environment and set the output resolution to match the input resolution . Is there anyway to set that in GRASS or am I missing a basic step somewhere I feel like I set up GRASS correctly as other non analytical map work is working fine . Any help would be much appreciated . Sincere regards .. . .. . Grant McGee Comment : Just FYI : You might get better answers for this particular question on the GIS Stackexchange . gis.stackexchange.com http : gis.stackexchange.com Comment : Thank you very much I will try that . Comment : Perhaps this question can be removed since it was asked and discussed at gis.stackexchange.com questions 108684 http : gis.stackexchange.com questions 108684 qgis-dem-output-cell-size-does-not-match-dem-input-cell-size for the record it seems that g.region raster inputmap -a helped", "Question : I m trying to use GRASS on python-2.7 but I m having some problems at setting my script on IDLE then I m getting an error at parser function : .. . .. . Here is my script : .. . .. . I m getting an error inside subprocess.py : .. . .. . p subprocess.Popen prog -n + argv stdout subprocess.PIPE .. . .. . The full error : .. . .. . What am I missing Comment : Cross-posted to GIS SE gis.stackexchange.com questions 179590 grass-parser-error http : gis.stackexchange.com questions 179590 grass-parser-error 179789 please always explicitly state that a question was cross-posted . .. . Answer : Based on the GRASS source https : trac.osgeo.org grass browser grass trunk lib python script core.py L730 it is trying to run g.parser.exe but is unable to find it . You need to set the PATH environment variable correctly to fix this . You seem to be trying to set the system environment-variables in the bulk of your code as one would do it in bash or batch scripts if I m not mistaken . You are currently only setting and modifying Python variables tough . If you want to actually set the environment-variables so that other subprocesses such as GRASS can see them you need to modify the os.environ variable e.g . instead of .. . .. . Coming back to the problem with the PATH environment variable you are already updating it with sys.path.append .. . and also setting the right locations in the PATH .. . line above . The latter just does not have any effect due to the reason mentioned above . You should only need to add sys.path.append PATH on top of that to get rid of the error you are seeing .", "Question : null .. . Answer : While trying to install qgis-plugin-grass I ran into some problems . I m running ubuntu 15.10 . My sources.list have the following lines : .. . .. . I installed : .. . .. . When running qgis I get the message : .. . .. . GRASS init error : Problem in GRASS initialization GRASS provider and plugin will not work : Module built against version Revision : 64733 but trying to use version Revision : 67364 . You need to rebuild GRASS GIS or untangle multiple installations . .. . .. . I tried different solutions repositories but I allways end up with some sort of conflits between different packages . Any help Thansks in advance Ant nio Comment : I think gis.stackexchange.com http : gis.stackexchange.com is a better place to ask .", "Question : I am trying to learn how to do some scripting to run Grass externally with Python but I can t seem to even find the basic modules called for this type of script . All of the documentation I have seen describes using grass.scripts module but I don t know where to download this . I also saw some information on grass.pygrass but I can t find this either . I thought that maybe it was builtin to a newer version of Grass so I just downloaded 7.0.0 beta2 and I still find grass.scripts files . Is this a python-module like others matploblib numpy scipy etc . or is it internal to Grass Sorry for the remedial questions but I am lost here . I ran the following script taken from http : grasswiki.osgeo.org wiki GRASS and Python with quotations added since I run Python 2.7 .. . .. . and it is fine though I don t know what it does but when I add .. . .. . it returns .. . .. . Normally I would download and install the module and the problem would be fixed but I can t find it anywhere . Comment : Either that s not your actual code or that s not your actual error message and it would be nice to rule out the possibility of a simple typo before digging into this any further Comment : Actual code is GrassRunner.py GISBASE C : Program Files GRASS-6.4.3 GISRC C : Documents and Settings user .grassrc6 LD LIBRARY PATH C : Program Files GRASS-6.4.3 lib PATH C : Program Files GRASS-6.4.3 etc C : Program Files GRASS-6.4.3 etc python C : Program Files GRASS-6.4.3 lib C : Program Files GRASS-6.4.3 bin C : Program Files GRASS-6.4.3 extralib C : Program Files GRASS-6.4.3 msys bin C : Python27 PYTHONLIB C : Python27 PYTHONPATH C : Program Files GRASS-6.4.3 etc python GRASS SH C : Program Files GRASS-6.4.3 msys bin sh.exe from grass.pygrass.modules import Module Comment : Sorry I would ignore that previous comment I ran into the end of the allowed comment and can t edit any longer . That is actual code cut and pasted run with Python from Notepad++ . Full error message is Traceback most recent call last : File G : Drawer Tutorials Python Grass GrassRunner.py line 11 in module from grass.pygrass.modules import Module ImportError : No module named grass.pygrass.modules Comment : You can t usefully paste code into comments . Also your question really needs to have all the information necessary to describe the problem or no new participants will try to help and no one with the same problem will be able to find it . So edit your question . Or if you have additional information that isn t really part of the question you can post somewhere like pastebin.com http : pastebin.com and put a link in the comments . Comment : Anyway as I explained in a comment on an answer the code you ve copied isn t Python code . It s code that you have to run at the command-prompt before running Python or a list of environment-variables that you have to set in some other way . .. . Answer : I m still not sure I understand everything but I seem to be past this hurdle . I used the script from http : gis.stackexchange.com questions 89452 problem-with-python-script-to-control-grass-gis-from-outside-how-to-import-gra 90160 90160 and changed all the relevant path information to suite my installation and apparently now the grass.script module is accessed . Here is my working script Comment : It looks like you were trying to use the batch script from the original article as Python code . That explains why you needed the quotes : GISBASE C : GRASS-64 is a perfectly legal line of cmd.exe batch-script code but it s not legal Python code . It also explains why it wasn t helping even with the quotes : just setting a global variable named PYTHONPATH or LD LIBRARY PATH in Python doesn t affect the Python interpreter any way you need to set them in the environment before launching Python . Comment : @abarnert : I am beginning to understand the separation between what I an wishing to do by running some script in Python and the preliminary leg work of setting up the proper environment before running . So is that something that I could just open the Grass GUI to do I have never run a script through the command-line and don t know much about environment setting in the command-prompt . From what I understand about this now is that I would only need the gisbase .. . and the sys.path.. . calls to direct python to the proper directory to open grass.script . Is that correct Comment : I don t know much about the Grass GUI . But if you want to start developing independent Python scripts rather than scripts that run inside the Grass app you re almost certainly going to either need to learn the basics of using the command-prompt or pick an IDE PyCharm PyDev etc . and learn how to use that instead .", "Question : I want to call some grass modules e.g . r.walk module in my python script . And fortunately I find lots of useful hints on https : grasswiki.osgeo.org wiki GRASS and Python MS-Windows . Here it is . MS-Windows In order to use GRASS functionality via Python from outside some environment-variables have to be set : .. . GISBASE C : GRASS-64 GISRC C : Documents and Settings user .grassrc6 LD LIBRARY PATH C : GRASS-64 lib PATH C : GRASS-64 etc C : GRASS-64 etc python C : GRASS-64 lib C : GRASS-64 bin C : GRASS-64 extralib C : GRASS-64 msys bin C : Python26 PYTHONLIB C : Python26 PYTHONPATH C : GRASS-64 etc python GRASS SH C : GRASS-64 msys bin sh.exe .. . .. . However msys folder is nonexistent after I install the latest version WinGRASS-7.0.3 and 7.0.4 . What I want to know is how to set the environment-variables using the latest version when there is no msys folder . Thanks a lot . .. . Answer : Better guide then the wiki is in the official documentation : .. . .. . https : grass.osgeo.org grass70 manuals libpython script.html module-script.setup .. . .. . You just need to specify the path to your GRASS binary . That s something like grass70 on Linux Applications GRASS GRASS-7.0.app on Mac and C : OSGeo4Win grass70.bat on MS Windows . In general it depends on how you installed GRASS GIS . On MS Windows watch for the difference between OSGeo4W install and standalone installer . Each of them will install GRASS to different directories you also specify the directories during the installation wizard . The boilerplate code uses subprocess.Popen to call the GRASS binary with --config path to get the values needed to set the parameters . Then it adds extends PYTHONPATH sys.path with .. . etc python in GRASS installation . Finally grass.script.setup.init is called which sets up the remaining runtime variables and it also connects the GRASS session to the GRASS Database Location and Mapset which looks like this : Comment : Thanks . I made it . Comment : @fly you are welcome . But please note that the StackExchange forums works in a way that you accept the answer if it solves the problem for you and you upvote it if you think that it is a good one . Then it is clear which questions are answered and which answers are good . That s what makes SE special and different from other forums where you need to read the whole discussion to see what is the best answer or solution .", "Question : I used r.tile http : grass.osgeo.org grass71 manuals r.tile.html to create tiles from a huge geotiff . Now i want to export each tile to a file but havent found an easy way : Using r.out.gdal I only can export one tile at a time which makes it unuseable as I have 100 tiles.. . I havent found any other solution...anyone any ideas .. . Answer : You just call r.out.gdal in a for-loop in some scripting-language . Here is a example for Bash . It is a simple but complete script . It expects the raster map names as command-line parameters and if the parameters are not present it fails with a usage suggestion . To run it you have to set it as executable chmod u+x export.sh first then you can run it in the command-line : .. . .. . Here is an example for Python which is much more convented for bigger tasks . The code does completely the same as the Bash script . Additionally it uses GRASS Python Scripting Library https : grass.osgeo.org grass70 manuals libpython script intro.html to call the r.in.gdal module and print function to be forward compatible with Python 3 . Again to run it you have to set it as executable chmod u+x export.py first then you can run it in the command-line : .. . .. . Both examples assume you are using Linux Mac OS X or something similar and running the script in system command-line in GRASS GIS . On MS Windows you should probably use the Python version and run it for example from the GRASS GIS GUI through the Launch script item in the File menu in the Layer Manager . Comment : Thank you for you Answer....I had the same idea using a bash script...works perfectly Comment : Then please accept my answer so this question is marked as answered closed .", "Question : null .. . Answer : I want to create a Python plugin for QGIS . For this i need to use the r.viewshed function from the processing toolbox . It s one of the Grass7 operations . I think I have to call it with the processing.runalg function . It worked fine for r.circel : .. . .. . Where output is a path to an not existing file which is created by the algorithm and mast coord are the coordinates of the center point for the concentric circles as a String . But if I try it the same way for r.viewshed the programm won t do anything not even showing me any error . I did it like this : .. . .. . Where input is the path to an existing .tif file which contains the elevation data . Can anyone help me Greets Jason Comment : Have you tried running r.viewshed in GRASS GIS 7 directly From what I have seen this sometimes this helps people find the problem .", "Question : I m using the comand g.gui.animation in GRASS 7.0 to plot some raster maps with no time information that represent the timing evolution of a physical experiment . In detail I m using the instruction g.gui.animation raster map1 map2 map3 and then I change the parameters using the graphic interface.I export the result as a GIF animated image . It works but I have two questions about how to improve the quality : .. . .. . 1 . Can I set the resolution number of pixels of the output 2 . I d like to add some text that change during the animation according with the frames somewhere in the image like the number of the frame . Can I do it with GRASS or I have to use other software some advice in postprocessing I need to read the text information from a .txt because I have a lot of frames so it s almost impossible to do it manually . Thanks for your help . .. . Answer : Can I set the resolution number of pixels of the output Unfortunately no you have to stretch the window and rerender to get larger image . Also make sure your computational region resolution is set high enough . I d like to add some text.. . .. . .. . Not implemented yet works only for timestamp when using time-series . But I would suggest to use imagemagick for such task . Export the data as series of images and then add your text into each image and create animated GIF . For example : .. . .. . and then put together : .. . .. . To get most control of the rendering you can use d.mon https : grass.osgeo.org grass70 manuals d.mon.html command in GRASS . If you have further questions I would suggest to continue on GRASS-users mailing list ." ] }
[ "yes-answer-long", "yes-answer-short" ]
modeling
UNK_RELATION
asp.net-4 .0 -- this tag refers to the version 4.0 of the @placeholder web application framework introduced with the .net framework 4 .
{ "confidence": [ 44.195106506347656, 41.812992095947266, 41.44927215576172, 40.47539520263672, 39.676326751708984, 38.48294448852539, 37.33900833129883, 36.40532684326172, 36.3526496887207, 35.62309646606445, 34.925655364990234, 34.81428527832031, 33.627132415771484, 33.08823013305664, 33.08823013305664, 33.08823013305664, 32.733951568603516, 32.44162368774414, 31.230737686157227, 31.162389755249023, 30.893630981445312, 30.801958084106445, 30.751373291015625, 30.72786521911621, 30.47278594970703, 30.328601837158203, 30.321321487426758, 30.203857421875, 30.0089168548584, 29.629865646362305, 29.411874771118164, 29.361644744873047, 29.343929290771484, 29.286235809326172, 29.217723846435547, 29.18001937866211, 28.78816795349121, 28.69108009338379, 28.459617614746094, 28.38396453857422, 28.24235725402832, 27.85662841796875, 27.808374404907227, 27.632020950317383, 27.529251098632812, 27.348344802856445, 27.286436080932617, 27.26221466064453, 27.134510040283203, 27.122638702392578, 27.122638702392578, 27.052682876586914, 26.97254180908203, 26.85634994506836, 26.7451114654541, 26.662715911865234, 26.612882614135742, 26.596473693847656, 26.578096389770508, 26.46493911743164, 26.379186630249023, 26.331836700439453, 26.20842742919922, 26.175264358520508, 26.071542739868164, 26.071542739868164, 26.043275833129883, 26.014041900634766, 26.007360458374023, 25.909053802490234, 25.909053802490234, 25.909053802490234, 25.85254669189453, 25.526880264282227, 25.40616226196289, 25.052091598510742, 24.952754974365234, 24.935192108154297, 24.85795783996582, 24.85795783996582, 24.85795783996582, 24.85795783996582, 24.70431900024414, 24.649335861206055, 24.649335861206055, 24.549240112304688, 24.549240112304688, 24.33405303955078, 24.32048797607422, 24.198043823242188, 24.11785125732422, 24.088130950927734, 24.063573837280273, 24.028474807739258, 23.949115753173828, 23.94091796875, 23.921457290649414, 23.8385066986084, 23.646347045898438, 23.61473846435547 ], "content": [ "My ASP.NET application runs in IIS on my web server and uses Microsoft .NET Framework 4 Beta 2 .", "Getting an ASP.NET 4 application to work on IIS6 http : johan.driessen.se archive 2010 04 13 getting-an-asp.net-4-application-to-work-on-iis6.aspx .. . .. . The framework version on the server is .NET 4 RC .", "I installed .net framework 4 on my windows 2003 enterprise x64 wrote simple asp.net-4.0 application default.aspx page only .", "Its Application Pool is set to .NET Framework version .NET Framework v4.0.21006 .", "We need a web socket implementation that integrates with ASP.Net 4.0 running on .Net framework 3.5 .", "The application is in .NET Framework v4.0 .", ".NET Framework 4.0 is definitely installed .", "I need Visual Studio and its ASP.NET Development Server to recognize the new .NET Framework 4 requestValidationMode attribute .", "Target framework is .NET 4.0 and code is mostly VB.NET .", "I am using Visual Studio 2010 .Net Framework 4", "If not select the framework 4 .", "To solve this issue you need to create application-pool and assigned this application-pool to you framework 4 web application .", "You will see the entire ASP.Net framework list over there by default these frameworks might be prohibited so please select ASP.Net Framework 4 and click allow button .", "I am creating bundle in site containing Webform and .Net Framework 4.0 .", "So no support for sql 2000 in entity-framework v2 in .net-4.0", "You can target the .NET Framework 4.0 using Visual Studio 2008 .", "I have an ASP.NET 4 web app .", "To compile this Web application for version 3.5 or earlier of the .NET Framework remove the targetFramework attribute from the element of the Web.config file .", "If you have .Net 4.5 installed which installs over .Net 4.0 then this might be related to a bug involving the .Net 4.5 framework trust levels with 3rd party framework dlls .", "and revert back The Asp.Net version to 4.0 .", "The application is an ASP.NET 4.0 app .", "I m using .net 4 .", "I ve created several custome types and TypeConverters for use with the ASP.NET 4 Web API framework and that is where I need this to be used as well .", "I am using asp.net-mvc and .net-4.0 .", "Try DynamicPDF .NET libraries http : www.dynamicpdf.com .NET-PDF-Library.aspx there are several of them that supports .NET Framework 4.0 .", "I have installed an ASP.NET 4.0 Web forms application in IIS 7.5 .", "The ScriptHandlerFactory s type string in .NET 4 is : .. . .. . ASP.NET 4 now includes that in its default web.config at the machine level .", "This solves my problem : by default these frameworks might be prohibited so please select ASP.Net Framework 4 and click allow button .", "I ve got an ASP.NET 4.0 web application webforms not mvc asp.net-routing isn t used that runs fine under IIS7 .", "I changed the tag of this question to .Net 4 .", "For asp.net-4.0 on IIS 7 and IIS 7.5 add this to your web.config : .. . .. . UPDATE : I have changed the version to the correct version for ASP.NET 4.0", "With the new .NET 4 framework comes some problems if you are running it on IIS 6 Windows Server .", "Change the ASp.Net Version from 4.0 to 2.0 and apply it .", "Is it possible to use Razor on an existing ASP.NET 4 website", "We have deployed a .net 4 asp.net site on IIS 6.0 .", "Saad .. . .. . When registering a web application with UWS please be sure to use CLR : 4 parameter http : ultidev.com Forums yaf postsm2804 Creating-installers-incorporating-UWS-as-a-redistributable-component.aspx post2804 to ensure your application is going to be loaded into UWS application host process running .NET Framework 4.x .", "As many previous Visual Studio releases you cannot develop a higher version framework application in this question .NET 4.0 using a Visual Studio for a lower version framework in this question Visual Studio 2008 just the same as you can t develop 3.5 applications in Visual Studio 2005 and so on and so forth .", "What happens if you generate model with VS 2008 and then convert that project to VS2010 and change target framework to .Net 4.0", "I m using the new Routing feature in ASP.NET 4 Web forms not MVC .", "Unfortunately currently those features are not supported if your Application Pool is using .NET 4.0 since that would require IIS Manager to load the .NET 4.0 framework in order to call the right providers and that is why .NET Users Membership .NET Roles etc and it is not possible since IIS Manager is a .NET 2.0 application .", "How can I debug my application in .NET 4", "Thus according to the error message above the compilerVersion attribute in the provider options must be v4.0 or later if you are compiling for version 4.0 or later of the .NET Framework .", "I work under ASP.NET 4.0", "But it is available in Visual Studio 2015 .Net Framework 4.5.2", "I m using this article http : msdn.microsoft.com en-us library dd483478.aspx to convert my ASP.NET 2.0 web application to an ASP.NET 4.0 application .", "All .. . .. . I m running into trouble deploying an ASP.NET 4.0 web page .", "Also if you experience any JavaScript issues make sure you choose the correct setting for identifying the IDs in 4.0 : .. . .. . http : weblogs.asp.net asptest archive 2009 01 06 asp-net-4-0-clientid-overview.aspx", "In Asp.Net 4 the OwinHttpModule is dynamically registered .", "In IIS 6 console you need to right-click you project and click the property and check the ASP.Net tab whether Framework 4 is selected or not .", "But what has changed in validation for .net 4", "For example .. . .. . Works for me for MVC3 and .NET 4 .", "You may try updating the references from .NET 3.5 to .NET 4.0 for example using System.dll from .NET 4.0 instead of the one referenced directly by the project every time you develop applications but I don t think it would recognize the new features from the new framework version .", "Will it help if we install the latest .NET 4 version on the server", "Installed ASP.NET MVC 3 using the web-platform-installer .. . 4 .", "I have an MVC .NET 4.0 web application which is using an EF4 Entity Model database generated .", "Because you can just build an web app targeting only one framework version .", "simple ASP.NET 4.0", "Proposed ecosystem : .. . .. . .Net 4.0 .. . IIS .. . IISNode .. . Socket.IO .. . Node.JS .. . SQL Server 2008 .. . .. . This will be built on top of an existing project using the .Net framework IIS etc . .", "Has the production server got the correct .Net Framework installed", "This by the way is actually a new feature in ASP.NET 4 which is why Stack Overflow doesn t spit out an error : it s running on .NET 3.5 .", "Web site is working under .NET 4.0 very similar functionality is implemented for .NET 3.5 but works as expected.. .", "Create Routes in your global.asax file .. . .. . Note : You have to set Application Pool to Asp.net 4.0 application-pool as routing is not working with Asp.net 4.0 Classic Application pool . .. . .. . Hope this will help .", "They are working fine with .NET framework 4.5 or above .", "I ve read all your recipes but my web site ASP.NET 4.0 + VS2010 + Cassini was still not routing correctly .", "What has changed in ASP.NET 4 that could be causing this error", "I m using ASP.NET 4 out-of-the-box forms-authentication method .", "I am using Web Forms Routing in ASP.NET 4 and I am trying to route to a specific location on a page .", "This HttpHandler started failing in the .NET 4 .", "How To Use Entity Framework 4 With Visual Studio 2010 and SQL Server 2000 http : www.skonet.com Articles Archive How To Use Entity Framework 4 With Visual Studio 2010 and SQL Server 2000.aspx", "@Alexandre Brisebois odd are you using .NET 4", "I am building a website using .NET 4 .", "Are you sure .NET 4 is installed on your server", "System.Web.HttpRuntime.FirstRequestInit HttpContext context +11700896 System.Web.HttpRuntime.EnsureFirstRequestInit HttpContext context +141 System.Web.HttpRuntime.ProcessRequestNotificationPrivate IIS7WorkerRequest wr HttpContext context +4869125 .. . .. . -------------------------------------------------------------------------------- Version Information : Microsoft .NET Framework Version : 4.0.30319 ASP.NET Version : 4.0.30319.272 .. . .. . In my web.config file and in my application I am referencing System.Web.WebPages.Razor v1.0.0.0 : .. . .. . .. . dependentAssembly .. . assemblyIdentity name System.Web.WebPages.Razor publicKeyToken 31bf3856ad364e35 culture neutral .. . bindingRedirect oldVersion 0.0.0.0-1.0.0.0 newVersion 1.0.0.0 .. . dependentAssembly .. . .. . .. . I don t even know whether I could be using System.Web.WebPages.Razor v2.0.0.0 with .Net 4 .", "This form worked fine at Asp.Net 2.0 and 3.5 but now it doesn t work in Asp.Net 4+ .", "Read all the changes and have it near you on tests : http : www.asp.net learn whitepapers aspnet4 breaking-changes .. . .. . The validation mode has change : http : stackoverflow.com questions 3132368 can-i-deploy-net-4-0-web-application-on-iis6 3132724 3132724 .. . .. . The default.aspx has change when you try to get the url : http : stackoverflow.com questions 2821514 default-aspx-with-iis-6-0-and-net-4", "Just copy this line to .net 4 web.config which needs it.. .", ".. . Source Error : .. . .. . .. . Line 14 : .. . Line 15 : system.web .. . Line 16 : compilation debug true targetFramework 4.0 .. . Line 17 : .. . Line 18 : authentication mode Forms .. . .. . .. . Source File : C : Program Files x86 Microsoft TestSetup WebApp web.config Line : 16 .. . .. . Version Information : Microsoft .NET Framework Version : 2.0.50727.5466 ASP.NET Version : 2.0.50727.5459 .. . .. . and when i create any app on .net framework 2.0 it work fine . .", "I hope and guess that user role management of a .NET 4.0 application will be supported in the next version of IIS .", "Maybe there is an event an attribute or something I can hook up in asp.net 4", "I am doing URLMapping in asp.net 4 it is working fine .", "Update : .. . .. . I was running ASP.NET 4 thats why : P", "I have asp.net 4 webforms website which references PortableLibrary project .", "One site is in ASP.NET 1.1 and another one is in ASP.NET 4.0 .", "However if the application-pool is set to run ASP.NET 4.0 I am redirected to the login page .", "I ve also tried this with an ASP.NET 4.0 application with the same result which is where the problem initially arose .", "I have implemented URL routing in ASP.NET 4.0 using following route .", "To enable default ASP.Net 4.0 routing with IIS 7.5 : .. . .. . 1 .", ".net-4.0 isapi extension is enabled .", "The Web app is set to be compiled with .net-4.0 I don t have an App Browsers.dll nor a browserCapabilitiesCompiler.compiled file in my bin folder .", "I have a simple ASP.NET 4.0 site no MVC .", "Also if you are using ASP.NET 4 any control that is set Enabled false will be assigned a CSS class named aspNetDisabled .", "But still you might face the same error because of the application-pool you might have same application-pool for two different framework web application .", "Is there any thing in particular I need to take care of or I just select the 4.0 framework and recompile and VS 2010 will update the web.config to reflect the changes", "I m using a Telerik RadChart control on my ASP.NET web application .", "I there a simple way when using ASP.NET 4.0 routing with Web Forms to produce a route that will act as some kind of wildcard", "But they aren t working when I make a project with .NET framework 4.0 .", "Or will my customers who have .NET 4.5 become unable to run my client application because these NuGet packages are for .NET 4.0 only", "The only way to develop for .NET 4 is to use Visual Studio 2010 .", "I know .NET 4 brought us the Task class http : msdn.microsoft.com en-us library system.threading.tasks.task.aspx and some people vaguely cautioning against its use for this purpose http : stackoverflow.com questions 2924819 using-net-4-0-task-in-asp-net .", "I am trying to run a crystal report from my web application which was built using ASP.NET 4.0 and Visual Studio 2010 ." ] }
{ "confidence": [ 55.19440460205078, 51.216514587402344, 50.923336029052734, 50.42082214355469, 50.23916244506836, 50.176002502441406, 48.06118392944336, 47.7918815612793, 46.894432067871094, 46.5806884765625, 46.44818878173828, 46.35353088378906, 45.910675048828125, 45.48011779785156, 45.48011779785156, 44.82258987426758, 44.64379119873047, 42.930931091308594, 42.749359130859375, 42.693416595458984 ], "content": [ "Question : My ASP.NET application runs in IIS on my web server and uses Microsoft .NET Framework 4 Beta 2 . Its Application Pool is set to .NET Framework version .NET Framework v4.0.21006 . It gives this new error : .. . .. . A potentially dangerous Request.Form value was detected from the client.. . This is due to a breaking change http : www.asp.net learn whitepapers aspnet4 breaking-changes in .NET 4 . To revert to the behavior of the ASP.NET 2.0 request validation feature I added the following setting in the Web.config file : .. . .. . Now Visual Studio 2008 throws a compile-time error : .. . .. . The requestValidationMode attribute is not declared . And I can no longer debug on my development-machine using the ASP.NET Development Server that comes with Visual Studio . I need Visual Studio and its ASP.NET Development Server to recognize the new .NET Framework 4 requestValidationMode attribute . How can I debug my application in .NET 4 Must I switch from Visual Studio 2008 to Visual Studio 2010 Beta 2 Comment : Some of the .NET 4 libraries were backported to 3.5 in the Reactive Extensions project - msdn.microsoft.com en-us data gg577609 http : msdn.microsoft.com en-us data gg577609 .. . Answer : As many previous Visual Studio releases you cannot develop a higher version framework application in this question .NET 4.0 using a Visual Studio for a lower version framework in this question Visual Studio 2008 just the same as you can t develop 3.5 applications in Visual Studio 2005 and so on and so forth . You may try updating the references from .NET 3.5 to .NET 4.0 for example using System.dll from .NET 4.0 instead of the one referenced directly by the project every time you develop applications but I don t think it would recognize the new features from the new framework version .", "Question : My ASP.NET application runs in IIS on my web server and uses Microsoft .NET Framework 4 Beta 2 . Its Application Pool is set to .NET Framework version .NET Framework v4.0.21006 . It gives this new error : .. . .. . A potentially dangerous Request.Form value was detected from the client.. . This is due to a breaking change http : www.asp.net learn whitepapers aspnet4 breaking-changes in .NET 4 . To revert to the behavior of the ASP.NET 2.0 request validation feature I added the following setting in the Web.config file : .. . .. . Now Visual Studio 2008 throws a compile-time error : .. . .. . The requestValidationMode attribute is not declared . And I can no longer debug on my development-machine using the ASP.NET Development Server that comes with Visual Studio . I need Visual Studio and its ASP.NET Development Server to recognize the new .NET Framework 4 requestValidationMode attribute . How can I debug my application in .NET 4 Must I switch from Visual Studio 2008 to Visual Studio 2010 Beta 2 Comment : Some of the .NET 4 libraries were backported to 3.5 in the Reactive Extensions project - msdn.microsoft.com en-us data gg577609 http : msdn.microsoft.com en-us data gg577609 .. . Answer : You cannot use Visual Studio 2008 to develop 4.0 applications in a supported manner . Currently only Visual Studio 2010 can be used to develop 4.0 apps . Starting with 2008 you can use it to develop for earlier versions of the framework but not later ones .", "Question : I have a site in ASP.NET 2.0 . I plan to move to 4.0 . Is there any thing in particular I need to take care of or I just select the 4.0 framework and recompile and VS 2010 will update the web.config to reflect the changes .. . Answer : There are some few thinks that you must take care of . Read all the changes and have it near you on tests : http : www.asp.net learn whitepapers aspnet4 breaking-changes .. . .. . The validation mode has change : http : stackoverflow.com questions 3132368 can-i-deploy-net-4-0-web-application-on-iis6 3132724 3132724 .. . .. . The default.aspx has change when you try to get the url : http : stackoverflow.com questions 2821514 default-aspx-with-iis-6-0-and-net-4", "Question : My ASP.NET application runs in IIS on my web server and uses Microsoft .NET Framework 4 Beta 2 . Its Application Pool is set to .NET Framework version .NET Framework v4.0.21006 . It gives this new error : .. . .. . A potentially dangerous Request.Form value was detected from the client.. . This is due to a breaking change http : www.asp.net learn whitepapers aspnet4 breaking-changes in .NET 4 . To revert to the behavior of the ASP.NET 2.0 request validation feature I added the following setting in the Web.config file : .. . .. . Now Visual Studio 2008 throws a compile-time error : .. . .. . The requestValidationMode attribute is not declared . And I can no longer debug on my development-machine using the ASP.NET Development Server that comes with Visual Studio . I need Visual Studio and its ASP.NET Development Server to recognize the new .NET Framework 4 requestValidationMode attribute . How can I debug my application in .NET 4 Must I switch from Visual Studio 2008 to Visual Studio 2010 Beta 2 Comment : Some of the .NET 4 libraries were backported to 3.5 in the Reactive Extensions project - msdn.microsoft.com en-us data gg577609 http : msdn.microsoft.com en-us data gg577609 .. . Answer : You can target the .NET Framework 4.0 using Visual Studio 2008 . You just have to wait for the right plugins create Silverlight 4 projects etc . . For instance you can use .NET Framework 3.5 in Visual Studio 2005 with the correct SDK . Comment : just have to wait for the right plugins - and when are you planning on releasing these plugins Xico :", "Question : 1 . We have deployed a .net 4 asp.net site on IIS 6.0 . 2 . Default.aspx is configured as one of the default document . 3 . When we access the site using the following url .. . .. . http : testsite .. . .. . We expect it to render .. . .. . http : testsite Default.aspx .. . .. . But instead we get 404 Not found error . We did not had this issue when it was deployed on .Net 2.0 . Only thing that has changed on the server is that we use .NET 4 instead of .NET 2.0 . UPDATE : I tried the following link but it did not work . Getting an ASP.NET 4 application to work on IIS6 http : johan.driessen.se archive 2010 04 13 getting-an-asp.net-4-application-to-work-on-iis6.aspx .. . .. . The framework version on the server is .NET 4 RC . Will it help if we install the latest .NET 4 version on the server Update : The issue is resolved now . The problem was a Third party upload control that we were using which added its own HttpHandler in Web.Config . This HttpHandler started failing in the .NET 4 . Comment : just to double check your setting the default document by going into the website properties documents tab and Adding default.aspx to the top of the list Saying default document does make it sound like your on IIS 7.0 Comment : @Kellls : We can set the Default document for IIS 6.0 as well . Comment : @Amitabh : Yes setting the default document in 6.0 was the procedure I was outlining in my previous comment . I just mean that default document is more of an IIS7.0 term . In IIS6.0 it is labeled default content page . I simply wanted to double check that you were using IIS 6.0 . Comment : @Amitabh : After you tried the procedure in that link did you check your logs again Were you getting 404.2 before you tried that Are you still getting it now Are you getting something else Comment : @Kellls : 2010-05-13 16 : 48 : 30 W3SVC36911924 192.168.1.11 GET - 90 - 192.168.1.33 Mozilla 4.0+ compatible +MSIE+7.0 +Windows+NT+6.1 +WOW64 +Trident 4.4E- 302 0 0 .. . Answer : With the new .NET 4 framework comes some problems if you are running it on IIS 6 Windows Server . IIS 6 does not let you have more than one framework at the time running in the same instance like IIS7 that can create Application Pool targeting different framework . When IIS 6 runs under ASP.NET 2.0 3.0 and 3.5 are superset not frameworks you are going to hit this error if the application is 4.0 Configuration Error Description : An error occurred during the processing of a configuration file required to service this request . Please review the specific error details below and modify your configuration file appropriately . Parser Error Message : Unrecognized attribute targetFramework . Note that attribute names are case-sensitive . You have a few options .. . .. . 1 . Downgrade the .NET application to 3.5 that Visual Studio 2010 makes it really easy . Just go to the Website properties - Application tab and there is a drop down with all the framework releases select 3.5 you VS2010 will reload the project and modify the web.config if you added web service-reference that you may have to delete them and re-add them under 3.5 .. . 2 . To configure the IIS6 and web-config to solve the issue . I deal with the second part : .. . .. . 3 . In IIS 6 console you need to right-click you project and click the property and check the ASP.Net tab whether Framework 4 is selected or not . If not select the framework 4 . But still you might face the same error because of the application-pool you might have same application-pool for two different framework web application . IIS 6 does not let you have more than one framework at the time running in the same instance means single application-pool can t use for two different frameworks like IIS7 that can create Application Pool targeting different framework . 1 . To solve this issue you need to create application-pool and assigned this application-pool to you framework 4 web application . To assign the application-pool in IIS console open the properties section of the web application and click on the Home directory tab and selection application-pool which you have created earlier from drop-down-list . 2 . This two might now solve your problem completely sometime . You can get the error as 404 Page is not found . Though you might now have any issue while in development time . 3 . Basically page is not found issue is cause of other problem which is set hidden by is IIS6 . But you need to see the real cause . What you have do here is go to the IIS6 console open web service extension node which is right below the default website node . You will see the entire ASP.Net framework list over there by default these frameworks might be prohibited so please select ASP.Net Framework 4 and click allow button . Browse you website now you get other error beside 404 Page is not found . You might get the error as listed below : .. . 4 . The value for the compilerVersion attribute in the provider options must be v4.0 You ll see following error when browsing the website The value for the compilerVersion attribute in the provider options must be v4.0 or later if you are compiling for version 4.0 or later of the .NET Framework . To compile this Web application for version 3.5 or earlier of the .NET Framework remove the targetFramework attribute from the element of the Web.config file . To solve this issue you need to modify your web-config file as below : .. . .. . Previously the CompilerVersion value is set as v3.5 but we already change our targetFranework to 4 . Thus according to the error message above the compilerVersion attribute in the provider options must be v4.0 or later if you are compiling for version 4.0 or later of the .NET Framework . Hope this will solve your ASP.Net 4 migration and hosting issue at IIS6 . Comment : Thanks for your valuable solution . I had a problm for hosting .Net4.0 site under IIS 2.0 configuration . I created virtual-directory under Default Web Site and bound it to a seperate application-pool . Its worked . Comment : thx the 2nd 3 did it for me . Comment : This solves my problem : by default these frameworks might be prohibited so please select ASP.Net Framework 4 and click allow button . Thank you . Comment : You are a beautiful person and I love you . I ve been trying to fix this for 5 hours 32 minutes now .", "Question : I installed .net framework 4 on my windows 2003 enterprise x64 wrote simple asp.net-4.0 application default.aspx page only . The application works great if request is to default.aspx not to the root site : .. . .. . contoso.com - doesn t work Get 404 error .. . .. . contoso.com default.aspx - works . Default.aspx is in list of default documents in IIS . Please help . Comment : add what and where .. . Answer : Change the ASp.Net Version from 4.0 to 2.0 and apply it . and revert back The Asp.Net version to 4.0 . This Will address the issue .", "Question : I have created a web site on asp.net-4.0 and when I create a set up of this site using UltiDev Web Server the set has been completed successfully and installed and when i run it through shortcut the page show this error .. . .. . Server Error in WebApp Application . .. . .. . Configuration Error .. . .. . Description : An error occurred during the processing of a configuration file required to service this request . Please review the specific error details below and modify your configuration file appropriately . .. . Parser Error Message : Unrecognized attribute targetFramework . Note that attribute names are case-sensitive . .. . Source Error : .. . .. . .. . Line 14 : .. . Line 15 : system.web .. . Line 16 : compilation debug true targetFramework 4.0 .. . Line 17 : .. . Line 18 : authentication mode Forms .. . .. . .. . Source File : C : Program Files x86 Microsoft TestSetup WebApp web.config Line : 16 .. . .. . Version Information : Microsoft .NET Framework Version : 2.0.50727.5466 ASP.NET Version : 2.0.50727.5459 .. . .. . and when i create any app on .net framework 2.0 it work fine . . I had been creating setup for a long time in .net-2.0 .. . Answer : Saad .. . .. . When registering a web application with UWS please be sure to use CLR : 4 parameter http : ultidev.com Forums yaf postsm2804 Creating-installers-incorporating-UWS-as-a-redistributable-component.aspx post2804 to ensure your application is going to be loaded into UWS application host process running .NET Framework 4.x . Comment : Thanks Dear but when I write CLR : 4 in the Arguments it shows another error and doesn t install properly . respectively I try to build setup 2.0 it works successful. .", "Question : I have installed an ASP.NET 4.0 Web forms application in IIS 7.5 . If I set the application-pool to DefaultAppPool .NET Framework 2.0 I get the icons for Providers .NET-Roles and .NET-Users displayed on the configuration page for the application in IIS Manager and I can manage users and roles within IIS . I m using Forms authentication . But if I set the application-pool to ASP.NET v4.0 I get a problem : Double clicking on the icons for Users or Roles in IIS Manager throws an error telling me that I cannot use these features since the providers could not be determined as trusted . If I set in administration.config in the trustedProviders section allowUntrustedProviders true and double click again on one of the icons I get the error that the assembly System.Web Version 4.0.0.0 Culture neutral PublicKeyToken b03f5f7f11d50a3a could not be found . If I restart IIS Manager the icons disappear completely . .NET Framework 4.0 is definitely installed . So this is all quite confusing . I know that .NET 4 uses another GAC than the old one for .NET 2-3 . Could it be possible that IIS Manager is not able to find the new GAC for .NET 4 Do I have to add perhaps some of the new 4.0 assemblies to administration.config Is there another way to add users and roles instead of IIS Thank you for help in advance .. . Answer : Unfortunately currently those features are not supported if your Application Pool is using .NET 4.0 since that would require IIS Manager to load the .NET 4.0 framework in order to call the right providers and that is why .NET Users Membership .NET Roles etc and it is not possible since IIS Manager is a .NET 2.0 application . So for now there is no good workaround other than changing your Application Pool temporarily to 2.0 and adding them and then switching back to 4.0 . But of course you should not do this unless its just a development-machine . Otherwise you could build a page using the CreateUserWizard control and use the built-in Login controls from ASP.NET which should be a one line of markup to get similar functionality . Comment : Thanks for your reply My application has a User management Users with administrative rights can create accounts on the website . My problem was only to create the very first account for the first Admin . For this I wanted to use IIS . But I ve solved it very similar like you describe : Setting the app pool temporarily to .NET 2.0 . I remember that I also had to disable the targetframework attribute 4.0 in web.config temporarily in order to get this working . So it s OK for now . I hope and guess that user role management of a .NET 4.0 application will be supported in the next version of IIS . Comment : That is somethign we are definitely looking into .", "Question : I installed .net framework 4 on my windows 2003 enterprise x64 wrote simple asp.net-4.0 application default.aspx page only . The application works great if request is to default.aspx not to the root site : .. . .. . contoso.com - doesn t work Get 404 error .. . .. . contoso.com default.aspx - works . Default.aspx is in list of default documents in IIS . Please help . Comment : add what and where .. . Answer : I use the following regex as first rule with Ionics Isapi Rewriter for web sites running on ASP.NET 4 on IIS 6 to remedy the problems caused by the breaking change http : www.asp.net 28S 28ywiyuluxr3qb2dfva1z5lgeg 29 29 learn whitepapers aspnet4 breaking-changes 0.1 Toc256770153 introduced with ASP.NET 4 : .. . .. . This let me again use extensionless urls . Note that the second group captures the querystring if present and restitutes it to the rewritten url . And yes it s a feature not a bug http : haacked.com archive 2010 12 22 asp-net-mvc-3-extensionless-urls-on-iis-6.aspx . Comment : this worked for me", "Question : I installed .net framework 4 on my windows 2003 enterprise x64 wrote simple asp.net-4.0 application default.aspx page only . The application works great if request is to default.aspx not to the root site : .. . .. . contoso.com - doesn t work Get 404 error .. . .. . contoso.com default.aspx - works . Default.aspx is in list of default documents in IIS . Please help . Comment : add what and where .. . Answer : You will also get this error on ASP.NET 2.0 virtual directories in IIS6 if you have another virtual-directory on the same site that is set to 4.0 and the DefaultWebSite is set to use ASP.NET 4.0 . The solution is to change the DefaultWebSite back to the ASP.NET 2.0 . Your 4.0 virtual-directory will still do fine underneath that web site .", "Question : I installed .net framework 4 on my windows 2003 enterprise x64 wrote simple asp.net-4.0 application default.aspx page only . The application works great if request is to default.aspx not to the root site : .. . .. . contoso.com - doesn t work Get 404 error .. . .. . contoso.com default.aspx - works . Default.aspx is in list of default documents in IIS . Please help . Comment : add what and where .. . Answer : You will find the answer here http : johan.driessen.se archive 2010 04 13 getting-an-asp.net-4-application-to-work-on-iis6.aspx .. . .. . .Net 4.0 doesn t enable itself to run with IIS so you have to run the command while in the folder c : windows system32 : cscript iisext.vbs EnFile C : WINDOWS Microsoft.NET Framework v4.0.30319 aspnet isapi.dll or in your case since you are running x64 .. . .. . cscript iisext.vbs EnFile C : WINDOWS Microsoft.NET Framework64 v4.0.30319 aspnet isapi.dll Comment : .net-4.0 isapi extension is enabled . Site works fine . Still have no answer Comment : Run cscript iisext.vbs EnFile C : WINDOWS Microsoft.NET Framework v4.0.30319 aspnet isapi.dll and then restart IIS Comment : @Dimonina : Did this work . Comment : Extension is enabled because default.aspx works", "Question : I have installed an ASP.NET 4.0 Web forms application in IIS 7.5 . If I set the application-pool to DefaultAppPool .NET Framework 2.0 I get the icons for Providers .NET-Roles and .NET-Users displayed on the configuration page for the application in IIS Manager and I can manage users and roles within IIS . I m using Forms authentication . But if I set the application-pool to ASP.NET v4.0 I get a problem : Double clicking on the icons for Users or Roles in IIS Manager throws an error telling me that I cannot use these features since the providers could not be determined as trusted . If I set in administration.config in the trustedProviders section allowUntrustedProviders true and double click again on one of the icons I get the error that the assembly System.Web Version 4.0.0.0 Culture neutral PublicKeyToken b03f5f7f11d50a3a could not be found . If I restart IIS Manager the icons disappear completely . .NET Framework 4.0 is definitely installed . So this is all quite confusing . I know that .NET 4 uses another GAC than the old one for .NET 2-3 . Could it be possible that IIS Manager is not able to find the new GAC for .NET 4 Do I have to add perhaps some of the new 4.0 assemblies to administration.config Is there another way to add users and roles instead of IIS Thank you for help in advance .. . Answer : There is a simple work around that is much easier than building administration pages . 1 . Create a new site on your server . You can name it MembershipAdminstrationYourActualSiteName . Binding does not matter as you will not be executing any pages on this site but make sure it is running in the 2.0 default application-pool . 2 . Copy the web.config from your 4.0 site to the folder for the new site . Edit the file removing everything except the connectionString authentication memebership roleManager and profile sections . 3 . Now in IIS Manager access .NET Roles and .NET Users . Assuming you correctly edited the web.config file you should see the users and roles for your 4.0 application .", "Question : My ASP.NET application runs in IIS on my web server and uses Microsoft .NET Framework 4 Beta 2 . Its Application Pool is set to .NET Framework version .NET Framework v4.0.21006 . It gives this new error : .. . .. . A potentially dangerous Request.Form value was detected from the client.. . This is due to a breaking change http : www.asp.net learn whitepapers aspnet4 breaking-changes in .NET 4 . To revert to the behavior of the ASP.NET 2.0 request validation feature I added the following setting in the Web.config file : .. . .. . Now Visual Studio 2008 throws a compile-time error : .. . .. . The requestValidationMode attribute is not declared . And I can no longer debug on my development-machine using the ASP.NET Development Server that comes with Visual Studio . I need Visual Studio and its ASP.NET Development Server to recognize the new .NET Framework 4 requestValidationMode attribute . How can I debug my application in .NET 4 Must I switch from Visual Studio 2008 to Visual Studio 2010 Beta 2 Comment : Some of the .NET 4 libraries were backported to 3.5 in the Reactive Extensions project - msdn.microsoft.com en-us data gg577609 http : msdn.microsoft.com en-us data gg577609 .. . Answer : From ScottGu s blog http : weblogs.asp.net scottgu archive 2009 08 27 multi-targeting-support-vs-2010-and-net-4-series.aspx : .. . .. . There isn t any way to target .NET 4 from VS08 and use new features . Having said that .NET4 is upwards comaptible with .NET 3.5 - so applications you build targeting .NET 3.5 with VS08 should work fine on top of .NET 4 .", "Question : My ASP.NET application runs in IIS on my web server and uses Microsoft .NET Framework 4 Beta 2 . Its Application Pool is set to .NET Framework version .NET Framework v4.0.21006 . It gives this new error : .. . .. . A potentially dangerous Request.Form value was detected from the client.. . This is due to a breaking change http : www.asp.net learn whitepapers aspnet4 breaking-changes in .NET 4 . To revert to the behavior of the ASP.NET 2.0 request validation feature I added the following setting in the Web.config file : .. . .. . Now Visual Studio 2008 throws a compile-time error : .. . .. . The requestValidationMode attribute is not declared . And I can no longer debug on my development-machine using the ASP.NET Development Server that comes with Visual Studio . I need Visual Studio and its ASP.NET Development Server to recognize the new .NET Framework 4 requestValidationMode attribute . How can I debug my application in .NET 4 Must I switch from Visual Studio 2008 to Visual Studio 2010 Beta 2 Comment : Some of the .NET 4 libraries were backported to 3.5 in the Reactive Extensions project - msdn.microsoft.com en-us data gg577609 http : msdn.microsoft.com en-us data gg577609 .. . Answer : The only way to develop for .NET 4 is to use Visual Studio 2010 . However if you do create a managed assembly in Visual Studio 2008 you could run in on a machine with .NET 4 run-time installed .", "Question : My ASP.NET application runs in IIS on my web server and uses Microsoft .NET Framework 4 Beta 2 . Its Application Pool is set to .NET Framework version .NET Framework v4.0.21006 . It gives this new error : .. . .. . A potentially dangerous Request.Form value was detected from the client.. . This is due to a breaking change http : www.asp.net learn whitepapers aspnet4 breaking-changes in .NET 4 . To revert to the behavior of the ASP.NET 2.0 request validation feature I added the following setting in the Web.config file : .. . .. . Now Visual Studio 2008 throws a compile-time error : .. . .. . The requestValidationMode attribute is not declared . And I can no longer debug on my development-machine using the ASP.NET Development Server that comes with Visual Studio . I need Visual Studio and its ASP.NET Development Server to recognize the new .NET Framework 4 requestValidationMode attribute . How can I debug my application in .NET 4 Must I switch from Visual Studio 2008 to Visual Studio 2010 Beta 2 Comment : Some of the .NET 4 libraries were backported to 3.5 in the Reactive Extensions project - msdn.microsoft.com en-us data gg577609 http : msdn.microsoft.com en-us data gg577609 .. . Answer : If you want to develop for .NET 4 without the pricey Visual Studio 2010 Pro you can try Mono http : en.wikipedia.org wiki Mono 28software 29 : .. . .. . Mono Project http : www.mono-project.net Comment : Mono doesn t support .Net 4 fully as of yet and The VS2010 Express versions would work if that was an issue . The question was about using VS2008 . Comment : Although it is not an answer to the question it s an option and any alternative is welcome for me .", "Question : I have a site in ASP.NET 2.0 . I plan to move to 4.0 . Is there any thing in particular I need to take care of or I just select the 4.0 framework and recompile and VS 2010 will update the web.config to reflect the changes .. . Answer : Just use the conversion wizard when prompted and you should be good . Note : if you are using source control with others the version number in the project file will-change vs2008 9 and vs2010 10 . Also if you experience any JavaScript issues make sure you choose the correct setting for identifying the IDs in 4.0 : .. . .. . http : weblogs.asp.net asptest archive 2009 01 06 asp-net-4-0-clientid-overview.aspx Comment : Any inherent advantage moving to .NET 4.0 if I am not using new features Comment : Yes since the migration is painless it s always good to future proof yourself . You can check if there are any specific features you want to avail of here : asp.net learn whitepapers aspnet4 http : www.asp.net learn whitepapers aspnet4", "Question : My ASP.NET application runs in IIS on my web server and uses Microsoft .NET Framework 4 Beta 2 . Its Application Pool is set to .NET Framework version .NET Framework v4.0.21006 . It gives this new error : .. . .. . A potentially dangerous Request.Form value was detected from the client.. . This is due to a breaking change http : www.asp.net learn whitepapers aspnet4 breaking-changes in .NET 4 . To revert to the behavior of the ASP.NET 2.0 request validation feature I added the following setting in the Web.config file : .. . .. . Now Visual Studio 2008 throws a compile-time error : .. . .. . The requestValidationMode attribute is not declared . And I can no longer debug on my development-machine using the ASP.NET Development Server that comes with Visual Studio . I need Visual Studio and its ASP.NET Development Server to recognize the new .NET Framework 4 requestValidationMode attribute . How can I debug my application in .NET 4 Must I switch from Visual Studio 2008 to Visual Studio 2010 Beta 2 Comment : Some of the .NET 4 libraries were backported to 3.5 in the Reactive Extensions project - msdn.microsoft.com en-us data gg577609 http : msdn.microsoft.com en-us data gg577609 .. . Answer : My guess is that you have found one of those fabulous cases where it is just going to complain to no end . You will likely be better off using the beta of VS2010 or removing the validationMode attribute . You could in theory try attaching to appropriate worker process and get some debugging love - but it still might not work .", "Question : I installed .net framework 4 on my windows 2003 enterprise x64 wrote simple asp.net-4.0 application default.aspx page only . The application works great if request is to default.aspx not to the root site : .. . .. . contoso.com - doesn t work Get 404 error .. . .. . contoso.com default.aspx - works . Default.aspx is in list of default documents in IIS . Please help . Comment : add what and where .. . Answer : Found a fix in a seemingly unrelated location - try setting the EnableExtensionlessUrls registry key to 0 : .. . .. . ASP.NET 4 Breaking Changes - ASP.NET 2.0 Applications Might Generate HttpException Errors that Reference eurl.axd http : www.asp.net 28S 28ywiyuluxr3qb2dfva1z5lgeg 29 29 learn whitepapers aspnet4 breaking-changes 0.1 Toc256770153 : .. . .. . In the Windows registry open the following node : HKEY LOCAL MACHINE SOFTWARE Microsoft ASP.NET 4.0.30319.0 .. . .. . 1 . Create a new DWORD value named EnableExtensionlessUrls . 2 . Set EnableExtensionlessUrls to 0 . This enables extensionless URL behavior . 3 . Save the registry value and close the registry editor . 4 . Run the iisreset command-line tool which causes IIS to read the new registry value . Comment : didn t work for me : - Comment : This worked for me Comment : Just as a heads for for anyone who runs into this issue we found that installing the hotfix for this issue stackoverflow.com questions 3720720 http : stackoverflow.com questions 3720720 how-serious-is-this-new-asp-net-security-vulnerability-and-how-can-i-workaround-i erased this reg key which re-created this issue . Once we re-applied this fix default documents worked correctly again Comment : worked for me on WIN2003 SP2 IIS 6 .NET 4 . additional MSDN blog article on the issue here : How to Disable the ASP.NET v4.0 Extensionless URL feature on IIS 6.0 http : blogs.msdn.com b tmarq archive 2010 06 18 how-to-disable-the-asp-net-v4-0-extensionless-url-feature-on-iis-6-0.aspx", "Question : 1 . We have deployed a .net 4 asp.net site on IIS 6.0 . 2 . Default.aspx is configured as one of the default document . 3 . When we access the site using the following url .. . .. . http : testsite .. . .. . We expect it to render .. . .. . http : testsite Default.aspx .. . .. . But instead we get 404 Not found error . We did not had this issue when it was deployed on .Net 2.0 . Only thing that has changed on the server is that we use .NET 4 instead of .NET 2.0 . UPDATE : I tried the following link but it did not work . Getting an ASP.NET 4 application to work on IIS6 http : johan.driessen.se archive 2010 04 13 getting-an-asp.net-4-application-to-work-on-iis6.aspx .. . .. . The framework version on the server is .NET 4 RC . Will it help if we install the latest .NET 4 version on the server Update : The issue is resolved now . The problem was a Third party upload control that we were using which added its own HttpHandler in Web.Config . This HttpHandler started failing in the .NET 4 . Comment : just to double check your setting the default document by going into the website properties documents tab and Adding default.aspx to the top of the list Saying default document does make it sound like your on IIS 7.0 Comment : @Kellls : We can set the Default document for IIS 6.0 as well . Comment : @Amitabh : Yes setting the default document in 6.0 was the procedure I was outlining in my previous comment . I just mean that default document is more of an IIS7.0 term . In IIS6.0 it is labeled default content page . I simply wanted to double check that you were using IIS 6.0 . Comment : @Amitabh : After you tried the procedure in that link did you check your logs again Were you getting 404.2 before you tried that Are you still getting it now Are you getting something else Comment : @Kellls : 2010-05-13 16 : 48 : 30 W3SVC36911924 192.168.1.11 GET - 90 - 192.168.1.33 Mozilla 4.0+ compatible +MSIE+7.0 +Windows+NT+6.1 +WOW64 +Trident 4.4E- 302 0 0 .. . Answer : Check the server logs they will probably give you a better idea of what is going on . You can find the path to the log file by right clicking the website in IIS and go to properties . Then goto the Web Site tab under Enable logging click properties and the logging properties window will show up which displays the path to the log file .", "Question : 1 . We have deployed a .net 4 asp.net site on IIS 6.0 . 2 . Default.aspx is configured as one of the default document . 3 . When we access the site using the following url .. . .. . http : testsite .. . .. . We expect it to render .. . .. . http : testsite Default.aspx .. . .. . But instead we get 404 Not found error . We did not had this issue when it was deployed on .Net 2.0 . Only thing that has changed on the server is that we use .NET 4 instead of .NET 2.0 . UPDATE : I tried the following link but it did not work . Getting an ASP.NET 4 application to work on IIS6 http : johan.driessen.se archive 2010 04 13 getting-an-asp.net-4-application-to-work-on-iis6.aspx .. . .. . The framework version on the server is .NET 4 RC . Will it help if we install the latest .NET 4 version on the server Update : The issue is resolved now . The problem was a Third party upload control that we were using which added its own HttpHandler in Web.Config . This HttpHandler started failing in the .NET 4 . Comment : just to double check your setting the default document by going into the website properties documents tab and Adding default.aspx to the top of the list Saying default document does make it sound like your on IIS 7.0 Comment : @Kellls : We can set the Default document for IIS 6.0 as well . Comment : @Amitabh : Yes setting the default document in 6.0 was the procedure I was outlining in my previous comment . I just mean that default document is more of an IIS7.0 term . In IIS6.0 it is labeled default content page . I simply wanted to double check that you were using IIS 6.0 . Comment : @Amitabh : After you tried the procedure in that link did you check your logs again Were you getting 404.2 before you tried that Are you still getting it now Are you getting something else Comment : @Kellls : 2010-05-13 16 : 48 : 30 W3SVC36911924 192.168.1.11 GET - 90 - 192.168.1.33 Mozilla 4.0+ compatible +MSIE+7.0 +Windows+NT+6.1 +WOW64 +Trident 4.4E- 302 0 0 .. . Answer : I think in 4.0 the default page setting is actually stored in the web.config . With the IIS 7.0 IIS reads the web.config the determine what to do for the default page . I think IIS 6.0 is not reading the setting ." ] }
[ "yes-answer-long", "yes-answer-short" ]
asp.net
UNK_RELATION
httpretty@fakeweb@88
httpretty -- httpretty is a http client mock library for python 100 inspired on ruby s @placeholder .
{ "confidence": [ 54.84795379638672, 53.52067184448242, 53.47745895385742, 50.561092376708984, 49.26784896850586, 49.022544860839844, 49.022544860839844, 46.82529830932617, 46.79821014404297, 45.25354766845703, 44.3492317199707, 44.22753143310547, 43.656761169433594, 41.55317306518555, 41.38783645629883, 40.72073745727539, 40.72073745727539, 40.72073745727539, 40.72073745727539, 40.63198471069336, 40.20518493652344, 40.17807388305664, 39.86117935180664, 39.446956634521484, 39.446956634521484, 38.9314079284668, 36.65079116821289, 35.55085372924805, 34.761940002441406, 34.559391021728516, 33.03273391723633, 32.84187698364258, 32.75041580200195, 32.75041580200195, 32.66973876953125, 30.404998779296875, 30.04144287109375, 29.491519927978516, 26.691082000732422, 22.50688934326172, 19.94842529296875, 19.435653686523438, 18.864133834838867, 18.618301391601562, 18.450754165649414, 18.218324661254883, 18.01365089416504, 17.97073745727539, 17.90038299560547, 17.89258575439453, 17.19031524658203, 17.19031524658203, 16.980314254760742, 16.980314254760742, 16.980314254760742, 16.417211532592773, 16.417211532592773, 16.063697814941406, 15.783001899719238, 15.783001899719238, 15.783001899719238, 15.783001899719238, 15.626741409301758, 15.16684627532959, 14.669431686401367, 14.528358459472656, 14.528358459472656, 14.528358459472656, 14.528358459472656, 14.528358459472656, 14.528358459472656, 14.528358459472656, 13.700366973876953, 13.054362297058105, 12.986080169677734, 12.986080169677734, 12.671591758728027, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777, 12.608298301696777 ], "content": [ "Using the HTTPretty library https : github.com gabrielfalcao HTTPretty for Python I can create mock HTTP responses of choice and then pick them up i.e .", "HTTPretty is blocking HTTP client libraries like requests .", "The following pytest-test uses httpretty to mock a request .", "SOLUTION : Upgrade the version of HTTPretty https : pypi.python.org pypi httpretty .", "The problem comes in when I want to test the calls particularly when using httpretty https : github.com gabrielfalcao HTTPretty to mock HTTP .", "This might be a bug in HTTPretty .", "well the question asks for HTTPretty .", "I am having issues with the HTTPretty https : github.com gabrielfalcao HTTPretty library when performing large stream upload requests .", "I would like to mock all outgoing http calls with httpretty except from elasticsearch calls .", "My issues came apparent when using the moto https : github.com spulec moto framework to mock uploading a key to S3 as it uses HTTPretty https : github.com gabrielfalcao HTTPretty as a dependency to mock HTTP endpoints .", "This can be accomplished by monkey-patching fakesocket.socket in HTTPretty :", "I m using httpretty for mocking the API .", "As such I have written a test which uses a mock actually httpretty https : github.com gabrielfalcao HTTPretty to replace the external API and raises requests.ConnectionError twice before returning something .", "Turns out there was a known issue with a library called HTTPretty issue can be found here https : github.com gabrielfalcao HTTPretty issues 228 that caused the test runner to stall on travis without producing any errors .", "I need to return different desponses depending on the GET parameters via HTTPretty https : github.com gabrielfalcao HTTPretty : .. . .. . This code prints the following : .. . .. . Why", "But i am seeing some weird behavior on using httpretty .", "Any workarounds i can use instead of httpretty for this purpose", "Whenever I enable HTTPretty I m unable to make a connection with PyMongo .", "I know that HTTPretty alters the core socket module is there any way around this", "How does one go about asserting that a target URL was never requested when using HTTPretty to intercept HTTP requests in Python unit tests", "As Httpretty works on the Python socket layer even Twisted web requests should be mocked out .", "Below example shows the difference : .. . .. . And the response is : .. . .. . How can i use httpretty with Twisted web client", "Meanwhile I got it using a HTTPretty callback body https : github.com gabrielfalcao HTTPretty dynamic-responses-through-callbacks seems to produce the desired behaviour .", "That s the small example here s a snippet of httpretty outside of testing context .", "I want to use the machinery from httpretty but need a workaround for parse qs .", "Under the hood httpretty is using urlparse.parse qs from the python standard libraries to parse the querystring .", "Basically I want to do some RESTful tests using python and found the httpretty and sure libraries which look really nice .", "It looks like the Exception being raised has to do with HTTPretty s monkey-patched socket which calls settimeout 0 on its own socket whenever we call sendall on something that isn t an HTTP request see real sendall https : github.com gabrielfalcao HTTPretty blob master httpretty core.py L332 .", "One solution would be to add a generic matcher using Matching regular expressions https : github.com gabrielfalcao HTTPretty matching-regular-expressions and making it failing .", "I can monkey patch httpretty for now but would love to see what else can be done .", "It seems to be because of some Warning being raised described in this github issue https : github.com gabrielfalcao HTTPretty issues 228 .", "I came to realize that the problem was in the monkey patching and my solution was to try my best to just enable and disable httpretty around my mongo calls .", "I narrowed it down to tests that use HTTPretty http : falcao.it HTTPretty and created a small project https : github.com jkeyes travis-nose to highlight the issue and to publish the results of a failed build https : travis-ci.org jkeyes travis-nose builds 56028754 : .. . .. . Right now I don t know how to proceed .", "I believe that HTTPretty https : github.com gabrielfalcao HTTPretty has a performance issue somewhere as this takes 5000ms to send a response where as other libs such as Flask http : flask.pocoo.org seem to send a response in 50ms .. . .. . I know this is a lib issue .", "I have a python file containing : .. . .. . Which is basically the same as the example code provided at https : github.com gabrielfalcao HTTPretty .. . .. . My question is how do I simply run this test to see it either passing or failing", "Have you tried using Mock http : www.voidspace.org.uk python-mock .", "But I would like to try and patch the issue or patch moto https : github.com spulec moto by using a different lib similar to HTTPretty", "To reach this I wrote a test like this imports same as above : .. . .. . It fails because the httpretty decorator seems to have problems with the additional parameter : .. . .. . Any ideas how to fix this", "I then wrote some HTML for a fake results page and tried to use the HTTPretty tool written by Gabriel Falcao to return that page as a response that appears in the browser instead of the real Python.org results page .", "It doesn t mock non-blocking sockets .", "Search http : api.stackexchange.com docs search is laid out like so with tags separated by semi-colons : .. . .. . 2.1 search order desc sort activity tagged python ruby site stackoverflow http : api.stackexchange.com 2.1 search order desc sort activity tagged python ruby site stackoverflow .. . .. . Interacting with the API is just fine .", "My question is : is there a way in Python to mock requests sent by the Selenium WebDriver and have the fake response bodies displayed in the browser instance driven by the driver instead", "Python 3 includes similar functionality in the unittest module which is also available as a backport for Python 2 called unittest2 .", "While making python-intercom things python-intercom Python 3 compatible I ran into an issue on Travis http : travis-ci.org .", "But i found that very cumbersome so a came with a solution to write a simple decorator that would mock the token and then only had to mock the tested resource .", "Have you looked into the unittest library", "Mock out the GET make it return the value you expect to continue testing based on those return values .", "Further info .. . .. . Here is the method s I am testing .. . .. . The console output is :", "I am writing unit tests for a python program using the unittest framework .", "The code works perfectly when I don t try to mock anything .", "There is some effort to create a testing library for Agent -using applications .", "One of the functions of the program is connecting to an external REST API using the requests library .", "Code Example : .. . .. . Raises exception : .. . .. . I am on Windows 8.1 using Python 3.3 .", "I m new to python tests so don t hesitate to provide any obvious information .", "One such solution is python-nose https : nose.readthedocs.org en latest which will look for methods named test and run them .", "If your test is implemented as a Python function then of course simply trying to execute the file isn t going to run the test : nothing in that file actually calls RestTest .", "My best guess is that there is some task running in the background of my Travis build due to depending on asynchronous python libs but how can I debug that on Travis", "The nosetests command doesn t appear to exit when run on Python 3.4 it behaves as expected on Python 2.7 .", "Are there any Python tools or servers proxies that can do that", "It seems to be an issue with the latest release of httppretty in Python 3.4 .", "Perhaps you re not using python-3.4 locally", "I m running Python 3.4.3 installed by Homebrew .", "So far i had to register uri in every test case one to mock the token resource and another to test any other resource .", "with the requests library http : docs.python-requests.org en latest like so : .. . .. . Out : Response 200 .. . .. . Is there also the possibility to register an uri which cannot be reached e.g .", "It writes the fetched data to a file : .. . .. . What I would like to do now is making use of the pytest tmpdir http : pytest.org latest tmpdir.html feature .", "Could you add some code to illustrate the problem", "By default if a request doesn t match any registered URI it goes through .", "Of course your application must fail in such cases .", "Another idea might be to use record .", "Another idea would be to use HTTPretty.record and then analyze the produced file .", "But it feels a bit more complicated .", "Is there a way to exclude them", "It looks like it s actually hardcoded in parse qsl http : hg.python.org cpython file 2.7 Lib urlparse.py l408 .", "See : hg.python.org cpython file 2.7 Lib urlparse.py l150-157 http : hg.python.org cpython file 2.7 Lib urlparse.py l150-157 and no way to overwrite it via arguments .", "I m currently experimenting with using the Python version of Selenium WebDriver https : selenium-python.readthedocs.org along with the Pytest https : selenium-python.readthedocs.org testing frameworkto do automation testing of web-applications .", "I wrote a module named Selenium WebDriver Mocking test.py where I navigate to the official Python website and fill in a search term in the search-box at the top of the page and then press Enter to move to the results page .", "What version of http pretty have you installed locally", "It tries to connect to localhost somehow .", "You can t .", "Ah ok .", "Thanks .", "You could help out with that twistedmatrix.com trac ticket 4024 gt https : twistedmatrix.com trac ticket 4024 gt .", "Can anyone explain this behavior and how to resolve it", "Thanks", "This puts the socket in non-blocking mode .", "The timeout on the socket is never reset after real sendall so subsequent calls to recv fail with WSAEWOULDBLOCK errno 10035 .", "One workaround for this is to reset the timeout on the socket after real sendall .", "This is much better thank you .", "Also the last line should be fakesock.socket MySocket .", "Ah yes thanks for the correction .", "Updated my answer to use the correct class name .", "I tried just executing it using . pythonFile but that doesn t work .", "You need some sort of test framework that will call your tests and collate the results .", "So if you were to rename RestTest to test rest you could run : .. . .. . The nosetests command has a variety of options that control which tests are run how errors are handled and reported and more .", "You could modify your code to take advantage of unittest like this : .. . .. . Running your file would now provide output similar to what we saw with nosetests :", "Have you tried calling your method", "Or does the annotation mean you don t have to explicitly call your method", "If I call your method it seems like it works .", "If I change the value on one side of the expect it complains properly about the values not matching .", "It seems that this decorator does not work well with pytest s funcargs ." ] }
{ "confidence": [ 74.01612854003906, 67.15941619873047, 64.95063781738281, 63.57349395751953, 60.71133804321289, 60.48420333862305, 59.90400695800781, 58.239070892333984, 57.4578971862793, 56.871246337890625, 53.37409973144531, 52.693580627441406, 50.72756576538086, 49.83075714111328, 39.55217361450195, 34.18267059326172 ], "content": [ "Question : As Httpretty works on the Python socket layer even Twisted web requests should be mocked out . But i am seeing some weird behavior on using httpretty . It tries to connect to localhost somehow . Below example shows the difference : .. . .. . And the response is : .. . .. . How can i use httpretty with Twisted web client .. . Answer : You can t . HTTPretty is blocking HTTP client libraries like requests . It doesn t mock non-blocking sockets . Comment : Ah ok . Thanks . Any workarounds i can use instead of httpretty for this purpose Comment : There is some effort to create a testing library for Agent -using applications . You could help out with that twistedmatrix.com trac ticket 4024 gt https : twistedmatrix.com trac ticket 4024 gt .", "Question : TL DR .. . .. . What libraries calls are available to handle query strings containing semi-colons differently than parse qs Full Background .. . .. . I m working with the StackExchange API to search for tagged questions . Search http : api.stackexchange.com docs search is laid out like so with tags separated by semi-colons : .. . .. . 2.1 search order desc sort activity tagged python ruby site stackoverflow http : api.stackexchange.com 2.1 search order desc sort activity tagged python ruby site stackoverflow .. . .. . Interacting with the API is just fine . The problem comes in when I want to test the calls particularly when using httpretty https : github.com gabrielfalcao HTTPretty to mock HTTP . Under the hood httpretty is using urlparse.parse qs from the python standard libraries to parse the querystring . Clearly that doesn t work well . That s the small example here s a snippet of httpretty outside of testing context . I want to use the machinery from httpretty but need a workaround for parse qs . I can monkey patch httpretty for now but would love to see what else can be done . Comment : Unfortunately it s hard coded in urlparse to be a separator . See : hg.python.org cpython file 2.7 Lib urlparse.py l150-157 http : hg.python.org cpython file 2.7 Lib urlparse.py l150-157 and no way to overwrite it via arguments . Comment : Oh hey thanks for linking to the source . It looks like it s actually hardcoded in parse qsl http : hg.python.org cpython file 2.7 Lib urlparse.py l408 . .. . Answer : To get around this I temporarily monkey patched httpretty.core.unquote utf8 technically httpretty.compat.unquote utf8 . This assumes you don t need anything else unquoted . Another option is to only leave the semi-colons percent-encoded before it reaches parse qs .", "Question : null .. . Answer : I am having issues with the HTTPretty https : github.com gabrielfalcao HTTPretty library when performing large stream upload requests . My issues came apparent when using the moto https : github.com spulec moto framework to mock uploading a key to S3 as it uses HTTPretty https : github.com gabrielfalcao HTTPretty as a dependency to mock HTTP endpoints . When I try and upload a large file 8MiB it takes around 5000ms .. . .. . From the debugging I ve done so far I can see that it breaks the requests http : docs.python-requests.org en master lib that boto https : github.com boto boto3 also uses breaks down the stream into 8KiB chunks 8192 bytes therefore my request is sent 1024 times . I believe that HTTPretty https : github.com gabrielfalcao HTTPretty has a performance issue somewhere as this takes 5000ms to send a response where as other libs such as Flask http : flask.pocoo.org seem to send a response in 50ms .. . .. . I know this is a lib issue . But I would like to try and patch the issue or patch moto https : github.com spulec moto by using a different lib similar to HTTPretty Thanks", "Question : null .. . Answer : I need to return different desponses depending on the GET parameters via HTTPretty https : github.com gabrielfalcao HTTPretty : .. . .. . This code prints the following : .. . .. . Why I thought that it should be .. . .. . instead . Comment : What are you looking to test Are you looking to control what GET should return so you can test something else Comment : Have you tried using Mock http : www.voidspace.org.uk python-mock . Mock out the GET make it return the value you expect to continue testing based on those return values .", "Question : null .. . Answer : I would like to mock all outgoing http calls with httpretty except from elasticsearch calls . Is there a way to exclude them", "Question : Whenever I enable HTTPretty I m unable to make a connection with PyMongo . I know that HTTPretty alters the core socket module is there any way around this Code Example : .. . .. . Raises exception : .. . .. . I am on Windows 8.1 using Python 3.3 . Can anyone explain this behavior and how to resolve it Thanks .. . Answer : It looks like the Exception being raised has to do with HTTPretty s monkey-patched socket which calls settimeout 0 on its own socket whenever we call sendall on something that isn t an HTTP request see real sendall https : github.com gabrielfalcao HTTPretty blob master httpretty core.py L332 . This puts the socket in non-blocking mode . The timeout on the socket is never reset after real sendall so subsequent calls to recv fail with WSAEWOULDBLOCK errno 10035 . This might be a bug in HTTPretty . One workaround for this is to reset the timeout on the socket after real sendall . This can be accomplished by monkey-patching fakesocket.socket in HTTPretty : Comment : I came to realize that the problem was in the monkey patching and my solution was to try my best to just enable and disable httpretty around my mongo calls . This is much better thank you . Comment : Also the last line should be fakesock.socket MySocket . Comment : Ah yes thanks for the correction . Updated my answer to use the correct class name .", "Question : I m new to python tests so don t hesitate to provide any obvious information . Basically I want to do some RESTful tests using python and found the httpretty and sure libraries which look really nice . I have a python file containing : .. . .. . Which is basically the same as the example code provided at https : github.com gabrielfalcao HTTPretty .. . .. . My question is how do I simply run this test to see it either passing or failing I tried just executing it using . pythonFile but that doesn t work . Comment : Have you looked into the unittest library Comment : well the question asks for HTTPretty . .. . Answer : Have you tried calling your method Or does the annotation mean you don t have to explicitly call your method If I call your method it seems like it works . If I change the value on one side of the expect it complains properly about the values not matching .", "Question : The following pytest-test uses httpretty to mock a request . It writes the fetched data to a file : .. . .. . What I would like to do now is making use of the pytest tmpdir http : pytest.org latest tmpdir.html feature . To reach this I wrote a test like this imports same as above : .. . .. . It fails because the httpretty decorator seems to have problems with the additional parameter : .. . .. . Any ideas how to fix this .. . Answer : It seems that this decorator does not work well with pytest s funcargs . The only solution I see is to manually call httprertty.enable and httpretty.disable methods . Or create a fixture :", "Question : Using the HTTPretty library https : github.com gabrielfalcao HTTPretty for Python I can create mock HTTP responses of choice and then pick them up i.e . with the requests library http : docs.python-requests.org en latest like so : .. . .. . Out : Response 200 .. . .. . Is there also the possibility to register an uri which cannot be reached e.g . connection timed out connection-refused .. . such that no response is received at all which is not the same as an established connection which gives an HTTP error-code like 404 I want to use this behaviour in unit-testing to ensure that my error-handling works as expected which does different things in case of no connection established and connection established bad bad HTTP status code . As a workaround I could try to connect to an invalid server like http : 192.0.2.0 which would time out in any case . However I would prefer to do all my unit-testing without using any real network connections . .. . Answer : Meanwhile I got it using a HTTPretty callback body https : github.com gabrielfalcao HTTPretty dynamic-responses-through-callbacks seems to produce the desired behaviour . See inline comments below . This is actually not exactly the same as I was looking for it is not a server that cannot be reached and hence the request times out but a server that throws a timeout exception once it is reached however the effect is the same for my usecase . Still if anybody knows a different solution I m looking forward to it .", "Question : How does one go about asserting that a target URL was never requested when using HTTPretty to intercept HTTP requests in Python unit tests Comment : Could you add some code to illustrate the problem .. . Answer : By default if a request doesn t match any registered URI it goes through . One solution would be to add a generic matcher using Matching regular expressions https : github.com gabrielfalcao HTTPretty matching-regular-expressions and making it failing . Of course your application must fail in such cases . Another idea might be to use record . Another idea would be to use HTTPretty.record and then analyze the produced file . But it feels a bit more complicated .", "Question : I m new to python tests so don t hesitate to provide any obvious information . Basically I want to do some RESTful tests using python and found the httpretty and sure libraries which look really nice . I have a python file containing : .. . .. . Which is basically the same as the example code provided at https : github.com gabrielfalcao HTTPretty .. . .. . My question is how do I simply run this test to see it either passing or failing I tried just executing it using . pythonFile but that doesn t work . Comment : Have you looked into the unittest library Comment : well the question asks for HTTPretty . .. . Answer : If your test is implemented as a Python function then of course simply trying to execute the file isn t going to run the test : nothing in that file actually calls RestTest . You need some sort of test framework that will call your tests and collate the results . One such solution is python-nose https : nose.readthedocs.org en latest which will look for methods named test and run them . So if you were to rename RestTest to test rest you could run : .. . .. . The nosetests command has a variety of options that control which tests are run how errors are handled and reported and more . Python 3 includes similar functionality in the unittest module which is also available as a backport for Python 2 called unittest2 . You could modify your code to take advantage of unittest like this : .. . .. . Running your file would now provide output similar to what we saw with nosetests :", "Question : null .. . Answer : I am writing unit tests for a python program using the unittest framework . One of the functions of the program is connecting to an external REST API using the requests library . If there is a connection error or timeout I would like the function to retry up to 3 times before failing . As such I have written a test which uses a mock actually httpretty https : github.com gabrielfalcao HTTPretty to replace the external API and raises requests.ConnectionError twice before returning something . This works fine and the test passes when an exception is not raised no the third attempt but the two exceptions that are raised intentionally and caught and handled by the code are printed to the console polluting the test output . Is there a clean way to stop this happening Further info .. . .. . Here is the method s I am testing .. . .. . The console output is : Comment : Any exception that gets raised should fail your test . Since that apparently doesn t happen you re probably catching the exception but still printing the exception message as a string not as an exception . Are you printing it to stderr though You could redirect the output by re-assigning sys.stdout or sys.stderr temporarily Comment : The code I m testing has a loop in it that catches the exception a maximum of two times before failing on the third loop . The test above is intended to simulate that . I don t print the exception message at all . I ll add the tested code now to make that clear . Comment : If you re not printing anything how then does it clutter the test output . You also say the two exceptions that are raised intentionally and caught and handled by the code are printed to the console . Comment : Or do you just want to catch the third time when the exception is raised as an expected exception Comment : I don t intentionally print anything but something in the unittest framework sees the exception and displays it in the console e.g . as shown at the end of the question this is what I mean by cluttering the test output . There should be no exceptions raised as it should catch the first two and the third time is a success .", "Question : My Travis build is timing out for some reason . Here is the link-to the logs : https : travis-ci.org madedotcom atomicpuppy builds 70202335 .. . .. . And my current travis yml https : github.com madedotcom atomicpuppy blob master .travis.yml .. . .. . I have tried running it with a normal script command .. . .. . As well as creating a bash script that ran the tests and exited with Even this didn t help . My best guess is that there is some task running in the background of my Travis build due to depending on asynchronous python libs but how can I debug that on Travis Is there any way to increase verbosity Worth adding that locally tests are very fast to run and exit with 0 without any problems using the same commands . Comment : Hey Piotr I did some tests by forking your repo and it seems the problem lies in the following test file : tests test posting.py . Indeed when I renamed it so it is not executed your build passed and correctly finished . Maybe you could double-check your tests in the file to see what s wrong Here is the the build report with the change that made the build succeed : travis-ci.org cotsog atomicpuppy builds 70238803 https : travis-ci.org cotsog atomicpuppy builds 70238803 . Hope this helps Comment : Hello Dominic thank you for your answer I will take a closer look at this file . Could you please provide the steps you took to realize the problem was in this file I m still very confused on how to debug travis builds as I could not reproduce the problem locally . It will be really helpful and I will include it into my original post when I find the final solution . Comment : I had a hunch the problem might be in your tests . Hence I renamed your test files one by one to see if I could make at least one test file run successfully . I had a successful build when test posting.py was renamed disabled . Then I renamed re-enabled all the other test files except test posting.py and I had another successful build . Then I concluded the problem was in that file . Kind of a brute-force method . - .. . Answer : SOLUTION : Upgrade the version of HTTPretty https : pypi.python.org pypi httpretty . Turns out there was a known issue with a library called HTTPretty issue can be found here https : github.com gabrielfalcao HTTPretty issues 228 that caused the test runner to stall on travis without producing any errors .", "Question : While making python-intercom things python-intercom Python 3 compatible I ran into an issue on Travis http : travis-ci.org . The nosetests command doesn t appear to exit when run on Python 3.4 it behaves as expected on Python 2.7 . I narrowed it down to tests that use HTTPretty http : falcao.it HTTPretty and created a small project https : github.com jkeyes travis-nose to highlight the issue and to publish the results of a failed build https : travis-ci.org jkeyes travis-nose builds 56028754 : .. . .. . Right now I don t know how to proceed . .. . Answer : It seems to be an issue with the latest release of httppretty in Python 3.4 . I had the same problem and then I downgraded it to 0.8.6 . It seems to be because of some Warning being raised described in this github issue https : github.com gabrielfalcao HTTPretty issues 228 . Comment : That s interesting as I don t see the problem locally on OS X . I ll try the downgrade . Thanks . Comment : Weird I do see the problem locally in os x as well . Perhaps you re not using python-3.4 locally Hope downgrading helps Comment : I m running Python 3.4.3 installed by Homebrew . Downgrading worked thanks . Comment : What version of http pretty have you installed locally Comment : I have 0.8.8 latest installed : d.pr n 1gEyP http : d.pr n 1gEyP", "Question : I have written a decorator that is working correctly but i stumbled with the correct solution by trial and error and my litle knowledge about decorators tells me that something is not well defined . The case is i m mocking a Rest Api to do some TDD and this Rest is behind a token security . So before making any request i first must get my user token . I m using httpretty for mocking the API . So far i had to register uri in every test case one to mock the token resource and another to test any other resource . But i found that very cumbersome so a came with a solution to write a simple decorator that would mock the token and then only had to mock the tested resource . This is my currently working decorator.. . .. . .. . And this is how is called . I had to pass the test case parameter to the inner function cause without it it wouldn t work and that test case is test case one method which i thought it would be passed in the func argument but func in the outer scope holds the object at memory of test case . Should t be func the returned value of a decorator If i do that the decorator doesn t work . When the inner function is passed that parameter .. . Answer : You are decorating methods so your resulting wrapper function needs a self parameter just like normal functions being used in a class . All that is different is that you used a different name fro that self parameter test case . As it happens the instance is callable and calling it runs the test so you are in essence doing self to run the test again . Just name the parameter self and pass it to the wrapped function : .. . .. . The wrapper function then replaces the original test case one function and when the test is run the wrapper function is bound to the test case instance and will be passed that instance as self in your wrapper you can then call the unbound func by simply passing on self to it . For debugging purposes it is often nicer to have some function attributes copied over from the wrapped function to the wrapper the @functools.wraps decorator https : docs.python.org 2 library functools.html functools.wraps can take care of these details for you : Comment : Thanks a lot . Especially about functools.wraps", "Question : I m currently experimenting with using the Python version of Selenium WebDriver https : selenium-python.readthedocs.org along with the Pytest https : selenium-python.readthedocs.org testing frameworkto do automation testing of web-applications . I came across a problem when trying to do HTTP request mocking within my Selenium code . I wrote a module named Selenium WebDriver Mocking test.py where I navigate to the official Python website and fill in a search term in the search-box at the top of the page and then press Enter to move to the results page . The code works perfectly when I don t try to mock anything . Assuming you have both Selenium and Pytest installed you can run it from the command-line interface by typing the following : .. . .. . or by typing the following : .. . .. . The code is shown below . I then wrote some HTML for a fake results page and tried to use the HTTPretty tool written by Gabriel Falcao to return that page as a response that appears in the browser instead of the real Python.org results page . The modified code is shown below . That approach did not work and I got the following message in the log of one of the test iterations : .. . .. . I also tried using the responses tool written by David Cramer . While that did not return any errors it also did not do anything at all and the test proceeded as-if no mocking has happened . My question is : is there a way in Python to mock requests sent by the Selenium WebDriver and have the fake response bodies displayed in the browser instance driven by the driver instead Any help is appreciated . .. . Answer : For your case you can t use standard mocking approach as you obviously interfere with the webdriver communication . Instead i suggest you to use https : pypi.python.org pypi pytest-localserver so there you actually run local server on some random port and server what is needed for you . I use that technique for testing pytest-splinter which I also suggest you to use for your tests actually Here you can see how it all works : https : github.com pytest-dev pytest-splinter blob master tests test plugin.py .. . .. . in case you ll use pytest-splinter your code will look like : .. . .. . requirements i used for this are : .. . .. . pytest pytest-splinter pytest-localserver .. . .. . all latest Comment : Thank you for your answer . I have installed pytest-localserver and then tried to follow the given examples and your example but with no luck . Every time I type httpserver in my IDE editor I get an unresolved reference error . Could you please elaborate on how to implement your method in the Selenium WebDriver Mocking test.py file I posted above . Comment : i ll have some time later today to write an example for you Comment : but for now - your IDE should NOT try to resolve fixtures at all . Fixtures are provided by pytest machinery just use them as function arguments - as in my test . Comment : Thanks again for your help . I tried the second example and it works fine . I also like the yield fixture method . I can see how this approach could be useful in many situations . However I was hoping for a more controlled approach where the desired fake HTML only appears as a result-of pressing Enter in the Search box instead of appearing all the time regardless of my HTTP request . Are there any Python tools or servers proxies that can do that Comment : ah so you wanted to emulate a request-response cycle it s not a problem i ll update answer with the use of from pytest localserver.http import WSGIServer" ] }
[ "yes-answer-long", "yes-answer-short" ]
fakeweb
UNK_RELATION
clr -- the common language runtime clr is a core component of microsoft s @placeholder initiative .
{ "confidence": [ 45.8975715637207, 45.19872283935547, 43.17631530761719, 38.24128723144531, 36.2440185546875, 35.580909729003906, 35.31358337402344, 35.28932189941406, 34.486083984375, 33.8775520324707, 33.77919006347656, 33.42554473876953, 32.470420837402344, 32.470420837402344, 32.360801696777344, 31.966411590576172, 31.78192138671875, 31.78141975402832, 31.762313842773438, 31.38330078125, 31.367292404174805, 31.30319595336914, 31.272796630859375, 31.272796630859375, 31.156293869018555, 31.156293869018555, 31.156293869018555, 31.11772918701172, 31.11772918701172, 30.949871063232422, 30.892547607421875, 30.892547607421875, 30.827226638793945, 30.6729679107666, 30.6729679107666, 30.559696197509766, 30.559696197509766, 30.55159568786621, 30.52750015258789, 30.3597354888916, 30.3597354888916, 30.17282485961914, 30.102256774902344, 29.9801025390625, 29.765045166015625, 29.765045166015625, 29.752246856689453, 29.752246856689453, 29.752246856689453, 29.749162673950195, 29.749162673950195, 29.749162673950195, 29.749162673950195, 29.749162673950195, 29.749162673950195, 29.749162673950195, 29.749162673950195, 29.749162673950195, 29.749162673950195, 29.749162673950195, 29.749162673950195, 29.70732307434082, 29.66437530517578, 29.58806610107422, 29.564186096191406, 29.53631591796875, 29.405040740966797, 29.405040740966797, 29.40445327758789, 29.330307006835938, 29.086292266845703, 29.085805892944336, 29.07941246032715, 28.952604293823242, 28.952604293823242, 28.952604293823242, 28.952604293823242, 28.952604293823242, 28.952604293823242, 28.952604293823242, 28.952604293823242, 28.952604293823242, 28.952604293823242, 28.952604293823242, 28.952604293823242, 28.952604293823242, 28.952604293823242, 28.952604293823242, 28.921714782714844, 28.91908073425293, 28.851085662841797, 28.851085662841797, 28.851085662841797, 28.651065826416016, 28.551538467407227, 28.551538467407227, 28.551538467407227, 28.551538467407227, 28.551538467407227 ], "content": [ "CLR Hosting is Hosting the .NET Common Language Runtime in a process of your choice .", "I was under the impression that CLR is Microsoft terminology for its common runtime .", "Changes the entry-point in the image to an entry-point in the common language runtime CLR .", "A .NET .exe is a special kind of .exe that will first load up the CLR Common Language Runtime .", "Common Language Runtime CLR is interpreter while Just In Time JIT is compiler in .Net Framework .", "The CLR engine will in fact to the mapping at runtime .", "Silverlight Runtime Silverlight CLR is essentially a mini-mini CLR : .", "Returns one row for each function procedure or trigger that is defined by a common language runtime CLR assembly .", "Most probably one of the authors of the Java s TreeMap included the comment to reflect this fact so CLR in the comment indeed means Common Language Runtime .", "There s actually quite an easy way to determine the current runtime version of the CLR .", "The .exe has a CLR Header and CLR Data section .", "I ve developed a small C++ threading client library that uses Common Language Runtime Support clr and am trying to integrate it with an existing application that uses No Common Language Runtime Support .", "CLR API is a COM API .", "What is CLR hosting", "No CLR installed", "The useLegacyV2RuntimeActivationPolicy option changes the behavior when you load an assembly targeting the CLR 2 runtime from within an application executing in the CLR 4 runtime .", "There is no CLR 4.5 it still uses CLR version 4.0.30319 .", "Is there a strong reason why Microsoft chose not to support AppDomains in .NET Core 5 upcoming version of .NET CLR v4.6", "The CLR Data section in the .exe has a metadata and an IL Intermediate Language segment .", "Ngen version is Microsoft R CLR Native Image Generator - Version 2.0.50727.3053", "GC being at the core of the CLR messing around with the GC or the managed heap will crash the CLR quickly if you re very-very lucky .", "Getting the easy questions out of the way first : .. . .. . A good resource for CLR customization is Steven Pratschner s book http : rads.stackoverflow.com amzn click 0735619883 Customizing the Microsoft .NET Framework Common Language Runtime .", "Is there a supported way to unlink the CLR and relaunch it", "SQL Server is hosting the CLR to achieve that .", "After CLR there is no runtime that can represent this object with 2 overloaded constructors .", "This tells me the errors are being thrown from the CLR runtime .", "I have Win32 application which hosts CLR runtime .", "The Wizard prompted me with You are adding a CLR component to a native project .", "The activator then tries to run the component with the exact CLR version specified .", "The CLR loads the assemblies on demand .", "In Common Language Runtime CLR http : msdn.microsoft.com en-us library 8bs2ecf4 28d printer v vs.110 29.aspx Microsoft page it says that both .Net Framework 4 and 4.5 uses the CLR version 4 .", "Microsoft did the work of removing many dependencies to .NET Framework assemblies not part of the Silverlight release .. . .. . Silverlight CLR is a subset of the .NET Framework that contains components and libraries including data-integration extensible Windows controls networking base-class libraries garbage-collection and the common language runtime CLR .", "CLR profiler does not seem to work with the Silverlight CLR .", "This isn t accurate mscoree.dll is the default CLR host the bootstrapper for the CLR for desktop apps .", "My clr version on my workstation is 4.0.30319.1022 the clr version of the dump is 4.0.30319.1008 .", "This will provide most of the benefits that reloading the CLR would provide without actually trying to unload the CLR .", "Im refering to the MS CLR Hosting online docs and the MS Book Customising the CLR I must be doing something stupid", "It is the version of the CLR .", "Hosting the CLR yourself is the simple way .", "If you set this to v4.0 then the 4.0 clr runtime will be used to start the application .", "When it is set to true the 4.0 runtime will be used to load the CLR 2 assembly .", "CLR 2.0 + Infragistics 2010.1 CLR 2.0 + Infragistics 2010.3 and CLR 4.0 + Infragistics 2010.1 we believe we ve identified the problem to have been an issue with an Infragistics component in WinForms 2010.1 no hot fixes .", "The advantage of the CLR is the freedom to write code in whatever programming language the developer chooses since the code will be compiled down to CLR before being interpreted into native calls .", "Checked the project settings - No Common Language Runtime support .. . Checked the clrcomponennt.cpp settings - Common Language Runtime Support clr .. . Opened the dll in OleView - COM interface was present .. . Opened the dll in Red Gate s .NET Reflector - clrcomponent was present", "If you want to be pedantic this only prevents inheritance at the language level not the CLR level .", "not really.. . C++ CLI is a different language and C++ with CLR turned on is different .", "And the CLR is filled to the brim with appcompat switches .", "Is CLR terminology used for Java as well", "CLR metadata myth in a managed module", "CLR is not in mscorlib.dll but in MSCorEE.dll .", "Note that this requires clr to be enabled .", "clr stops it being unmanaged .", "When is the CLR allowed to inline", "When is the CLR allowed to inline", "would it be running under the CLR", "Nullable struct is special for CLR", "How can do it in CLR", "switch CLR instead of oldSyntax .", "Im new to the CLR stuff", "ooh a clr question .", "And even hosting a CLR on top", "But I need to use clr as my clr option .", "ICLRRuntimeHost Start to call into the CLR-hosting COM interface .", "CLR Hosting is Hosting uses .NEt application.When you start the .NET runtime inside a native process that native application becomes a host for the runtime .", "The rest of the code is treated normaly by the clr .", "BTW why you think the CLR would benefit of knowing a name or a version of its host Also the main idea of writing a different CLR hosts is controlling the CLR behavior and i think the CLR should be host unaware anyway", "There specifically seems to be a DynamicMethod class that allows the generation and specification of CLR methods at runtime .", "The strange thing is this issue does not occur with the coreclr runtime only with the default clr .", "I want to implement a custom allocator for C .. . .. . GC is at the core of the CLR .", "1 Error s Verifying hello.exe .. . .. . Why will it not crash in the CLR", "Moreover from the 4.0 version of the runtime it s possible to host more than one CLR in the same process .", "I am working on an extension for a project that will allow hosting the CLR inside the core application .", "If you re producing an executable the PE Header also includes a conventional bootstrapper which is in charge of loading the CLR Common language runtime when you execute you executable .", "What about CLR in general", "The method exists in the CLR .", "CLR versions are in the linked document .", "Enums are specially dealt with by the CLR .", "Why is not CLR running verification", "The CLR will commit the stack of a thread .", "CLR can call it directly .", "In particular the CLR stack is imaginary .", "Is there a way to check clr present", "The JIT is one aspect of the CLR .", "The JIT is basically part of the CLR .", "And they runs as part of CLR i.e .", "Injecting the CLR is dubious at best .", "There is nothing wrong with CLR .", "Or is it just a special CLR version", "Visual C++ - CLR - Class Library Name the project CLR .. . 3 .", "I need to enumerate AppDomains loaded into CLR .", "The 2.0 CLR is already running what I do is inject a 4.0 dll into it which will start the 4.0 CLR .", "You can inject .NET 2 assemblies into CLR 4 and they run under CLR 4 without issue.. .", "So if you call an C DLL with CLR-Hosting the P Invoke calls the CLR-Hosting Dll and not create a new instance .", "See here http : msdn.microsoft.com en-gb library 9x0wh2z3.aspx for information about CLR hosting that was relevant for CLR v2 .NET 2.0 3.0 and 3.5 .", "The CLR is stored in mscorwks.dll clr.dll in 4.0", "That s the CLR that is running your application .", "The .net CLR is the evolution of the discontinued JVM .", "Yes it would be running under CLR .", "Some conversions allowed by the CLR but not by C ." ] }
{ "confidence": [ 49.19005584716797, 47.22651672363281, 46.975257873535156, 45.12470245361328, 44.76372528076172, 44.21293640136719, 44.00480270385742, 43.908905029296875, 43.35354232788086, 42.48995590209961, 41.76168441772461, 41.67209243774414, 40.835208892822266, 40.192535400390625, 40.06355667114258, 39.04499816894531, 38.864646911621094, 38.848167419433594, 38.72847366333008, 38.699825286865234 ], "content": [ "Question : I have a C++ dll which implements several COM interfaces that I m trying to migrate to managed C++ . I set the clr compiler flag and changed the Runtime Library property from MT to MD to avoid the conflict between these two flags but that s all I ve changed . When it attempts to register the dll during the build-process I get the following error : .. . .. . R6033 - Attempt to use MSIL code from this assembly during native-code initialization This indicates a bug in your application . It is most likely the result-of calling an MSIL-compiled clr function from a native constructor or from DllMain . .. . .. . I read about Loader Lock and can t figure it out - I have not added a single call to any managed code . Here s the entire body of the DllMain procedure : .. . .. . Edit - per comment below I added pragma unmanaged to the top of the cpp file with no improvement . The Module init is all code contained in the ATL libraries from what I can tell . .. . Answer : You need to add the clr compiler flag only to the files that use managed code and not for the whole project . This is what the Visual Studio Wizard does here is how I ve tested : .. . .. . Create a Visual C++ ATL Project .. . Added a ATL Simple Object in order to have a COM interface Project- Add Class .. . Added a CLR Component Class . The Wizard prompted me with You are adding a CLR component to a native project . Your project will be converted to have Common Language Runtime support . Compile project compiles fine and registers fine . Checked the project settings - No Common Language Runtime support .. . Checked the clrcomponennt.cpp settings - Common Language Runtime Support clr .. . Opened the dll in OleView - COM interface was present .. . Opened the dll in Red Gate s .NET Reflector - clrcomponent was present Comment : Thanks that got it . I didn t realize I could set the flag on a file-by-file basis - switching the file with the DLL init code to non- clr fixed while leaving the rest of the project with the clr switch on .", "Question : Do you know any good book about the workings of the CLR the .NET Framework http : en.wikipedia.org wiki .NET 5FFramework and CIL http : en.wikipedia.org wiki Common 5FIntermediate 5FLanguage as opposed to any specific .NET language Comment : May I ask what resources you personally found most useful I need to start IL for a CodeDOM project and am having trouble getting started . Thanks . .. . Answer : Regardless of any other books you will definitely need ECMA-335 standard http : www.ecma-international.org publications standards Ecma-335.htm for a detailed specification of CLR and CIL . With sufficient experience it may actually be sufficient on its own . Also Expert .NET 2.0 IL Assembler http : rads.stackoverflow.com amzn click 1590596463 looks like it matches your requirements though I haven t read it and can t comment on its quality . Amazon description looks promising though : .. . .. . Topics include managed executable file structure metadata table structure Microsoft IL instructions structured exception-handling managed and unmanaged code interoperation executable file generation and metadata manipulation API exposed by the common language runtime . Comment : Thanks . This goes very much in the direction I was thinking about . Are there any books that cover the topics of the ecma-335 standard in a more polished and readable way Comment : For the first version of the spec 1.0 pre-generics there was an annotated edition : amazon.com Common-Language-Infrastructure-Annotated-Standard dp http : www.amazon.com Common-Language-Infrastructure-Annotated-Standard dp 0321154932 ref sr 1 9 ie UTF8 s books qid 1257197081 sr 8-9 - I don t think there s one for CLR 2.0 . I haven t seen any externally published specs on CLR 4.0 yet . Comment : There is a reference implemntation of the ECMA spec put out by Microsoft called Shared Source Common Language Infrastructure Rotor . Ted Neward and Joel Pobar wrote a draft to walk one through the project which is a PDF book : tedneward.com files SSCLI2Internals-DRAFT.pdf http : www.tedneward.com files SSCLI2Internals-DRAFT.pdf", "Question : What is the difference between the JIT compiler and CLR If you compile your code to il and CLR runs that code then what is the JIT doing How has JIT compilation changed with the addition of generics to the CLR Comment : I fleshed out my answer since you accepted it . If this makes it too verbose and no longer what you would consider an acceptable answer add a comment to say so and I ll shrink it revert it . It just seemed a shame to lose the info from the other answers .. . Answer : 1 . Common Language Runtime CLR is interpreter while Just In Time JIT is compiler in .Net Framework . 2.JIT is the internal compiler of .NET which takes MicroSoft Intermediate Code Language MSICL code from CLR and executes it to machine specific instructions whereas CLR works as an engine its main task is to provide MSICL code to JIT to ensure that code is fully compiled as per machine specification .", "Question : As Microsoft Documentation declare Runtime Hosts http : msdn.microsoft.com en-us library a51xd4ze.aspx that .NET have more than one Runtime Hosts to support and execute the code of our application my question is How Can I know which Runtime Hosts of the Microsoft Runtime hosts is hosting my code . I am using C language to develop dll class-library which may be used and or hosted by various Runtime hosts so I need to know which Runtime host is now hosting my code to satisfy specify conditions . Comment : Are you implying that the DLL Runtime shared code might be using a newer version of .net Runtime than the code that s calling it Is reading writing to the .config file your only concern .. . Answer : The .NET Framework 4 hosting API provides the CLRCreateInstance function which can return the ICLRMetaHost interface . You can then call the GetRuntime method on this interface to get a specific ICLRRuntimeInfo interface given a particular CLR version . This procedure supersedes the CorBindToRuntimeEx method that is used by the .NET Framework 2.0 hosting API . The .NET Framework version 2.0 hosting API provides the CorBindToRuntimeEx function to initialize the runtime . You can choose which version of the runtime to load but a process can host only one version . If version 2.0 3.0 or 3.5 is loaded the function returns the ICLRRuntimeHost interface which is used to start the runtime and execute managed code . Source : http : msdn.microsoft.com en-us library dd380850.aspx Comment : How can I call these functions and Is there any other simpler approach Comment : After digging deep in MSDN and google i came to the fact that the interfaces provided by MSCorEE.dll do not include a method to define host name or version to CLR the interfaces provide hosting and management functionality of the CLR only One peace of information you can know by using these interfaces is the version of the CLR running your code NOT the host running CLR itself Comment : Please refer to msdn.microsoft.com en-us library a51xd4ze.aspx http : msdn.microsoft.com en-us library a51xd4ze.aspx to double check Comment : BTW why you think the CLR would benefit of knowing a name or a version of its host Also the main idea of writing a different CLR hosts is controlling the CLR behavior and i think the CLR should be host unaware anyway Comment : You right but consider yourself developing DLL Library which need to deal with Configuration file for example now If your dll will be hosted in ASP.NET then you need to deal with the Configuration file through WebConfigurationManager class and if your dll will be hosted in Shell Command Prompt then you need to deal with the Configuration file through ConfigurationManager So my question how can I determine when I have to use either one of those classes", "Question : Assembly in .net Framework is as I understand intermediate-language file + some metadata manifest and maybe something else . CLR translates an assembly to the machine code which can be executed on the given local machine . That means that assembly shouldn t be executable by the machine before being processed by CLR . If it s so then why does it have .exe extension which is executable on Windows machines Comment : Edited tags assembly is for assembly-language questions . Comment : CLR metadata myth in a managed module http : izlooite.blogspot.com 2009 09 what-is-clr-metadata-in-managed-module.html more .. . Answer : A .NET .exe is a special kind of .exe that will first load up the CLR Common Language Runtime . It will then compile the IL code inside the .exe through the CLR . An .exe compiled through the .NET framework is a kind of Portable Executable http : en.wikipedia.org wiki Portable Executable . The .exe has a CLR Header and CLR Data section . When the .exe loads the OS will yield control to the CLR . The CLR Data section in the .exe has a metadata and an IL Intermediate Language segment . The metadata segment contains information about the assembly such as the assembly manifest . The IL segment contains the code for the program in IL format . This is an intermediate format similar to Java bytecode .", "Question : As the title says : Is there a common way in C and especially unmanaged native C++ to determine installed CLR versions This means not just checking whether the Framework is installed according this KB article http : msdn.microsoft.com en-us kb kbarticle.aspx id 318785 . I want to do it by using the CLR interface as done here http : blogs.msdn.com b junfeng archive 2005 07 07 436755.aspx for CLR1 CLR1.1 and CLR2 . In this way I can make sure that they are really installed . But this doesn t apply to CLR4 . Any Ideas My goal is to create an enumeration of available CLR versions like Clrver http : msdn.microsoft.com library ff427522.aspx regardless the process list functionallity does . Comment : where I ve had to do it I ve always used the registry method and any library you pull in will probably be doing the same thing . It would be really nice if there was a better way to do this but I don t think there is . Comment : I think regarding to a common way you are right . The problem is that in this case all versions have to be well known what also accounts to beta versions . But as in the Code example I ve posted sometimes maybe also betaversions need to be considered . And I think that there must be a way because CLRVER of VS2008 also works when installing .NET4 but not VS2010 and a new version of CLRVER . So there must be a way to detect all installed CLR versions without exactly knowing them . .. . Answer : While reading Jeffrey Richters book Applied Microsoft .NET Framework Programming http : www.microsoft.com learning en us book.aspx id 5353 locale en-us tab1 I ve found some interesting hints towards that topic . Towards the topic Loading the Common Language Runtime p . 41 he mentioned to examine the registry path and subkeys HKEY LOCAL MACHINE SOFTWARE Microsoft .NETFramework policy to check for installed runtimes . Therefore I ve found an interesting KB article http : support.microsoft.com kb 315291 towards that topic . Furthermore in the section How the Runtime Resolves Type References p . 132 he mentioned that mscorlib.dll is tied to the CLR version . So i think it should be possible to check the found registry keys against this file and its version to ensure that the found key is installed CLR version . In the following you will find my conclusion about that in code . : I think Clrver does something similar . And I think this solution should be also applicable for a native C++ application since my following code is C and is just using very basic framework functions . Don t mess up with Registry.GetKey .. . - its just a wrapper for the .NET Registry functionality to easify it towards the way I am used to use the registry . In the end you should have the CLR version strings inside the list installedRuntimes as Clrver lists it . Comment : No CLR installed and your code running on WHAT Comment : Good question As you may see this code relies on naming rules which may change in future versions of CLR .NET . So the code still runs but the naming and position of the CLR in registry has changed . In this case method calls like GetKey and submethods will fail . The result will be an empty list of versions . But for the moment this code should work without the try-catch block . Comment : When a target machine does not have any CLR version installed How Your managed code application can detect the installed CLR s before the application code even gets a chance to run . I think you need to rewrite the code in an unmanaged platform like C++ Comment : Regarding the usage of exactly this code you are correct that there is no possibility to run it without any CLR installed . The code above is used to show the rules how Clrver works maybe and could be adopted to any other language and or runtime environment easily .", "Question : What is CLR hosting What is the use-case for that .. . Answer : CLR Hosting is Hosting the .NET Common Language Runtime in a process of your choice . The use-case would be situations where existing environments don t suit your requirements . Some of the existing environments are ASP.NET WinForms Windows Workflow Foundation etc . If these don t suit your requirements you can host it yourself .", "Question : I was looking Java s JDK 1.6 45 TreeMap code to understand a problem I was having and on few methods I saw a comment saying From CLR . I was under the impression that CLR is Microsoft terminology for its common runtime . Is CLR terminology used for Java as well If not then is there a common agreement to use each others implementation after converting of-course or is it just some auto generated comment Example .. . Answer : It looks like Java s TreeMap borrowed part of its implementation from JabberNet s Tree https : github.com dib0 JabberNet blob master Jabber-Net bedrock collections Tree.cs which is written in C here the full C source code https : github.com dib0 JabberNet blob master Jabber-Net bedrock collections Tree.cs . Most probably one of the authors of the Java s TreeMap included the comment to reflect this fact so CLR in the comment indeed means Common Language Runtime . Here a snippet from Java s TreeMap http : grepcode.com file repository.grepcode.com java root jdk openjdk 6-b14 java util TreeMap.java 2187 : .. . .. . And here the corresponding snippet from the JabberNet C code https : github.com dib0 JabberNet blob master Jabber-Net bedrock collections Tree.cs L628 : .. . .. . As you can see the code is almost identical except for indentation node class name and syntax differences . This is also true for other methods marked as From CLR . However the Java code does not seem to be fully auto-generated from the C code cf . this comment in the Java code http : grepcode.com file repository.grepcode.com java root jdk openjdk 6-b14 java util TreeMap.java 2024 :", "Question : As Microsoft Documentation declare Runtime Hosts http : msdn.microsoft.com en-us library a51xd4ze.aspx that .NET have more than one Runtime Hosts to support and execute the code of our application my question is How Can I know which Runtime Hosts of the Microsoft Runtime hosts is hosting my code . I am using C language to develop dll class-library which may be used and or hosted by various Runtime hosts so I need to know which Runtime host is now hosting my code to satisfy specify conditions . Comment : Are you implying that the DLL Runtime shared code might be using a newer version of .net Runtime than the code that s calling it Is reading writing to the .config file your only concern .. . Answer : There s actually quite an easy way to determine the current runtime version of the CLR . As it happens Environment.Version will return a different version if your code is currently run in a different CLR due to SxS Side-by-Side execution . To see how that works in practice in an application that can have two runtimes at the same time check out this article on Demonstrating Side by Side execution http : dotnet.dzone.com news demonstrating-clr-side-side . Note that the .NET 2.0 loader will load the most recent CLR of .NET 2.0 available which will be .NET 3.5 in most cases . It is not possible to run different versions of .NET 2.0 side-by-side in one process . Neither is it possible to run .NET 1.0 or .NET 1.1 side-by-side with .NET 2.0 in .NET 4.0 http : msdn.microsoft.com en-us magazine ee819091.aspx it is possible though to run just 1.0 or 1.1 side-by-side in .NET 4.0 .", "Question : I m fiddling with a project where the CLR is hosted within a C application . Is there a supported way to unlink the CLR and relaunch it Comment : Why do you want to reload In the IIS model the unit of reloading recycling is the worker process itself . I don t know about SQLCLR but I suspect there s something more interesting there . .. . Answer : I don t have the book before my right now but I believe accroding to Customization the Common Language Runtime http : rads.stackoverflow.com amzn click 0735619883 it is not possible to do that . You can unload i.e . disable it but then you cannot reload it in the same process instance . Comment : That s true and it s a pain especially for unit-testing CLR hosting code", "Question : Let s say you write an app in C VB anything with .NET When you hit build does it really compile your code I thought so until I started using redgates reflector on some of my assemblies and saw my code verbatim . I would have expected loops to be unrolled and another plethora of optimizations instead nothing . So when does the compilation actually happen I think when it is built code become IL Intermediary Language and when execution occurs it is loading in the CLR Is it optimized during CLR only and never at build time Comment : Already answered here : stackoverflow.com questions 601974 clr-vs-jit 602010 602010 http : stackoverflow.com questions 601974 clr-vs-jit 602010 602010 Comment : @Jorge I m not sure if that is an exact duplicate . I think this question touches on some of the same issues but is really spurred by the question Why do I see my own code in Reflector Comment : @Rex can you link-to this question I searched the site and google for it but only land right here . Thanks . .. . Answer : When you compile in VS .. . .. . 1 . Your source code is compiled into a byte code known as the common intermediate-language CIL or MSIL Microsoft Intermediate Language . 2 . Metadata from every class and every methods and every other thing : O is included in the PE header of the resulting executable be it a dll or an exe . 3 . If you re producing an executable the PE Header also includes a conventional bootstrapper which is in charge of loading the CLR Common language runtime when you execute you executable . When you execute : .. . .. . 1 . The bootstraper initializes the CLR mainly by loading the mscorlib assembly and instructs it to execute your assembly . 2 . The CLR executes your main entry . 3 . Now classes have a vector table which hold the addresses of the method functions so that when you call MyMethod this table is searched and then a corresponding call to the address is made . Upon start ALL entries for all tables have the address of the JIT compiler . 4 . When a call to one of such method is made the JIT is invoked instead of the actual method and takes control . The JIT then compiles the CIL code into actual assembly code for the appropiate architecture . 5 . Once the code is compiled the JIT goes into the method vector table and replaces the address with the one of the compiled code so that every subsequent call no longer invokes the JIT . 6 . Finally the JIT handles the execution to the compiled code . 7 . If you call another method which haven t yet being compiled then go back to 4.. . and so on.. . I post the answer here too as the other question was not really about this.. . Comment : Answered very nicely Thanks a ton", "Question : I ve googled around a bit and I haven t been able to find a good listing of what classes from the .net CLR are not included in the CoreCLR aka Silverlight . What is Silverlight missing from the Windows .net Framework .. . .. . Also is there anything that the Silverlight runtime has that the .net Framework doesn t .. . Answer : Silverlight Runtime Silverlight CLR is essentially a mini-mini CLR : . Microsoft did the work of removing many dependencies to .NET Framework assemblies not part of the Silverlight release .. . .. . Silverlight CLR is a subset of the .NET Framework that contains components and libraries including data-integration extensible Windows controls networking base-class libraries garbage-collection and the common language runtime CLR . .. . Some parts of the .NET Framework for Silverlight are deployed with your application . These Silverlight Libraries are assemblies not included in the Silverlight runtime and are instead shipped in the Silverlight SDK . When Silverlight Libraries are used in your application they are packaged up with your application and downloaded to the browser . These include new UI controls XLINQ Syndication RSS Atom XML serialization and the dynamic-language-runtime DLR . To read about a detailed comparison see this link http : codebetter.com blogs patricksmacchia archive 2008 10 01 comparing-silverlight-and-the-net-framework.aspx Comment : Right I m probably butchering the terminology sorry . What I m trying to say is : what classes ARE available in standard .net that AREN T included in Silverlight . I guess I m talking about the BCL right Let me know if I can phrase this better . Thanx Comment : Great Link Thanx for the explanation Comment : 3 lines-of-code into my first Silverlight app and I ve noticed that TypeDesciptor is missing . Not cool .", "Question : In Common Language Runtime CLR http : msdn.microsoft.com en-us library 8bs2ecf4 28d printer v vs.110 29.aspx Microsoft page it says that both .Net Framework 4 and 4.5 uses the CLR version 4 . However in this page .NET Framework Versions and Dependencies http : msdn.microsoft.com en-us library bb822049 28d printer v vs.110 29.aspx it writes .Net Framework version 4.5 Included an updated version of CLR 4 .. . .. . Also writes : .. . .. . An executable that targets the .NET Framework 4.5.1 will be blocked from running on a computer that only has the .NET Framework 4.5 installed and the user will be prompted to install the .NET Framework 4.5.1 . In addition .NET Framework 4.5.1 assemblies should not be called from a .NET Framework 4.5 app . .. . .. . QUESTION : If all Net Framework version 4 and 4.5 and 4.5.1 runs the managed code on the same CLR version that is 4 why I cannot run an executable that targeted .Net framework 4.5 on a machine that has only .Net 4.0 installed Do not the compilers produce an IL that is for CLR version 4 in the end regardless you targeted .NET framework 4 or 4.5 or 4.5.1 Comment : Important stuff . good to know . .. . Answer : By Microsoft .. . .. . Every assembly whether static or dynamic contains a collection of data that describes how the elements in the assembly relate to each other . The assembly manifest contains this assembly metadata . Assembly Manifest . http : msdn.microsoft.com en-us library 1w45z383 28v vs.110 29.aspx This manifest has information about the build CLR of that executable and while executing the exe dll .net CLR tries to find out the same CLR version . See the image Build by v 3.5 http : i.stack.imgur.com bPhFE.png Build by v 3.5 and Build by 4.0 http : i.stack.imgur.com qkwKp.png Build by 4.0 .", "Question : I can write compile and successfully run the following IL program with a .maxstack size set to 1 which is too low because the program has two values on the stack at one point in time i.e . 2+2 4 . This program does not crash in the CLR and finishes executing with all the expected output of Hello World followed by the number 4 . However this program will rightfully not pass PEVerify which points out a stack-overflow exception with the following message : .. . .. . Microsoft R .NET Framework PE Verifier . Version 4.0.30319.18020 Copyright c Microsoft Corporation . All rights reserved . .. . IL : Error : C : tmp hello.exe : HelloWorld1.Program : : Main offset 0x00000011 S tack overflow . 1 Error s Verifying hello.exe .. . .. . Why will it not crash in the CLR Comment : .maxstack declares the maximum depth of the CLR stack used by a method . This is not the same as the maximum size of the CPU stack . They are both called stacks but they are not the same stack . In particular the CLR stack is imaginary . It is a theoretical construct of the virtual-machine . Comment : @RaymondChen Why couldn t you have posted that before I finished writing up my answer that assumed the latter : - Comment : @JonathonReinhart if your deleted answer contains valuable technical information to supplement learning can you undelete it . I m unsure if you deleted it because you think it contains wrong info or if it s because you thought you overlapped with +RaymondChen s comment . Comment : @JohnK It s incorrect . Raymond has indicated that .maxstack has nothing to do with the actual CPU stack to which my answer was referring . Comment : This value is mainly used by IL code verification and certain JIT compilers that want to know up front how deep the IL stack will be http : social.msdn.microsoft.com Forums vstudio en-US 8cda95ea-1144-436c-ac1f-fe00af3700fd what-is-the-signifigance-of-maxstack-in-il-or-which-set-accessor-is-more-efficient forum clr . .. . Answer : Answer derived from the question comments via @RaymondChen .. . .. . Common Language Infrastructure CLI .. . Partition III .. . CIL Instruction Set .. . Final Draft Apr 2005 .. . .. . 1.7.4 Must provide maxstack .. . .. . .. . snip .. . .. . Note : Maxstack is related to analysis of the program not to the size of the stack at runtime . It does not specify the maximum size in bytes of a stack frame but rather the number of items that shall be tracked by an analysis tool . end note", "Question : I have a native Win32 application that hosts the CLR to use C as a sophisticated scripting-language . I ve got a memory leak and I decided to try Microsoft s CLR Profiler to investigate . I m not sure if the leak is managed or not and was hoping this tool might help reveal that for one thing . However when I tell CLRProfiler to start my native application although my application always within the first second or so of running starts up the CLR CLRProfiler continues to display the prompt Waiting for application to start common language runtime even though my application is obviously running its managed code . Is CLRProfiler only able to connect to the CLR if it was started by the stub that managed-only programs use to start the CLR and not if the application explicitly loaded and started up MSCOREE.DLL Or am I simply doing something wrong Or is there something hopefully simple my native application needs to do-while starting the CLR to have CLRProfiler get along with it .. . Answer : I got it working after doing two things : .. . .. . 1 . Using the .NET Framework 2.0 version of the CLR Profiler - there s a separate .NET Framework 1.1 version which is the one I had found initially . It probably doesn t work with CLR 2.0 and up and .. . .. . 2 . Running the CLR Profiler and application under an administrator account . So just to confirm yes the CLR Profiler at least the Framework 2.0 version does work for native applications hosting the CLR it only inspects managed code naturally .", "Question : Parrot is the virtual-machine originally designed for Perl 6 . What technical capabilities does the Parrot VM offer that competing virtual machines such as the Java Virtual Machine JVM http : en.wikipedia.org wiki Java virtual-machine Hotspot VM http : en.wikipedia.org wiki HotSpot Java and Common Language Runtime CLR http : en.wikipedia.org wiki Common Language Runtime lack .. . Answer : Parrot is the virtual-machine originally designed for Perl 6 . .. . .. . There are now two VMs originally designed for Perl 6 commits to MoarVM http : moarvm.org began in 2012 . What technical capabilities does the Parrot VM offer that competing virtual machines such as the Java Virtual Machine JVM Hotspot VM and Common Language Runtime CLR lack .. . .. . In another answer on this page http : stackoverflow.com a 25689609 1077672 Reini Urban the current April 2015 Parrot lead dev provides a brief comparison of Parrot with the JVM and CLR VM . According to Reini http : www.reddit.com r perl6 comments 2w3asu suspending rakudo support for parrot a key advantage Parrot has over MoarVM is effectively lock-less threads .", "Question : What is CLR hosting What is the use-case for that .. . Answer : CLR Hosting is Hosting uses .NEt application.When you start the .NET runtime inside a native process that native application becomes a host for the runtime . This lets you add .NET capabilities to your native applications . If the runtime is running but it hasn t got any loaded user code yet . Some internal thread scheduler and garbage collector are surely running because they are part of the CLR runtime It is very complicated than other hosting services .", "Question : I was curious about some serialization stuff so I went poking around FormatterServices and found a method called nativeGetUninitializedObject that actually handles the initialization without calling the custructor of a given type . This method is decorated with the extern keyword and the following attribute : MethodImpl MethodImplOptions.InternalCall SecurityCritical .. . .. . I m left wondering : where does this method actually exist What code does the CLR call to get the given type initialized without calling the constructor .. . Answer : This method actually exists in the native portion of the CLR . The MethodImplOptions.InternalCall signifies a call which is forwarded to the CLR native-code and is implemented there . From MSDN http : msdn.microsoft.com en-us library system.runtime.compilerservices.methodimploptions.aspx : .. . .. . Specifies an internal call . An internal call is a call to a method that is implemented within the common language runtime itself .", "Question : I read a book which referred to the .net CLR as a virtual-machine Can anyone justify this What is the reason we need the concept of virtual machines on some development platforms Isn t it possible to develop a native framework one without virtual-machine that is fully object oriented and as powerful as .net The book which refers to CLR as virtual-machine is Professional .Net Framework 2.0 . Comment : This is really just an argument over what a virtual-machine is . Note that the native x86 instruction-set can be viewed as a virtual-machine instruction-set interpreted by the CPU . So if the CLR runs on top of a virtual-machine is it possible for it to not be considered a virtual-machine as well .. . Answer : The advantage of the CLR is the freedom to write code in whatever programming language the developer chooses since the code will be compiled down to CLR before being interpreted into native calls . The .NET framework uses this JIT compilation to treat everything uniformly and output programs which work for the platform being deployed on which is absent from compiled languages . Comment : interpreted into native calls is just wrong.. . Comment : How is it wrong The VM translates CLR byte code into native CPU instructions does it not Comment : Your comment is right : it compiles translates CLR bytecode called Intermediate Language into native machine code . That s not interpreting . In interpretation the program is data the code of the runtime tests conditions on the data and jumps to other code within the runtime the processor instruction pointer only traverses code which exists within the runtime . In compilation the program is turned into a code section which is executed on the processor the runtime library code still runs when called by the compiled program code but not all code pre-exists in the runtime .", "Question : If you wrote a C program and part of the code was written using the unsafe key word would that code still be considered managed code ie . would it be running under the CLR Comment : Yes it would be running under CLR . See this answer stackoverflow.com a 3771092 1600654 http : stackoverflow.com a 3771092 1600654 It is not fully managed . It s in between managed and unmanaged . .. . Answer : Managed Code from MSDN : .. . .. . Managed code is code written in one of over twenty high-level programming-languages that are available for use with the Microsoft .NET Framework including C J Microsoft Visual Basic .NET Microsoft JScript .NET and C++ . All of these languages share a unified set of class libraries and can be encoded into an Intermediate Language IL . A runtime-aware compiler compiles the IL into native executable code within a managed execution environment that ensures type safety array bound and index checking exception-handling and garbage-collection . By using managed code and compiling in this managed execution environment you can avoid many typical programming mistakes that lead to security holes and unstable applications . Also many unproductive programming tasks are automatically taken care of such as type safety checking memory-management and destruction of unneeded objects . Managed code runs under supervision of the CLR which is responsible among others for memory-management and garbage-collection . Otherwise unmanaged code runs outside of the context of the CLR . Unsafe code still runs under the CLR and it is translated into IL but it will let you access memory directly through pointers ." ] }
[ "yes-answer-long", "yes-answer-short" ]
.net
UNK_RELATION
outlook.application@vba@120
outlook.application -- use to focus your question on the use of an outlook.application object outside of outlook s own @placeholder .
{ "confidence": [ 50.07466506958008, 47.53528594970703, 46.0139274597168, 41.959110260009766, 41.59228515625, 40.54413604736328, 39.66901779174805, 31.86357879638672, 30.516342163085938, 29.245647430419922, 29.099620819091797, 29.018203735351562, 28.02145004272461, 26.233291625976562, 25.732805252075195, 25.51403045654297, 25.092727661132812, 24.913623809814453, 24.556123733520508, 24.107271194458008, 24.107271194458008, 24.107271194458008, 24.107271194458008, 23.82575225830078, 23.754566192626953, 23.599266052246094, 23.599266052246094, 23.59076499938965, 23.01502227783203, 23.01502227783203, 22.9903564453125, 22.632858276367188, 22.184005737304688, 21.86577606201172, 21.803905487060547, 21.54376792907715, 21.54376792907715, 21.54376792907715, 21.54376792907715, 21.356952667236328, 21.091754913330078, 21.091754913330078, 21.091754913330078, 21.091754913330078, 20.623199462890625, 20.22903060913086, 19.915058135986328, 19.841480255126953, 19.81584930419922, 19.620500564575195, 19.579307556152344, 19.242141723632812, 19.038421630859375, 19.038421630859375, 18.982757568359375, 18.974262237548828, 18.356739044189453, 18.344594955444336, 18.305763244628906, 18.20552635192871, 18.07298469543457, 17.85622787475586, 17.833473205566406, 17.657001495361328, 17.621702194213867, 17.62118911743164, 17.62118911743164, 17.356266021728516, 17.31887435913086, 17.31887435913086, 17.270402908325195, 17.119165420532227, 17.050996780395508, 17.050996780395508, 16.435632705688477, 16.282258987426758, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715, 14.552618980407715 ], "content": [ "CreateObject Outlook.Application is returning Error no 424 object required", "I want to send email using outlook 2010 windows-7 IE8 what is code required to get the Outlook.Application object .", "I tried with CreateObject Outlook.Application but getting error Object Required", "Check to be sure that Outlook is registered correctly The following registry key should exist HKEY CLASSES ROOT Outlook.Application CLSID .", "I think you need a comma pathname class : GetObject Outlook.Application", "yes you will need to create object like Set oolApp CreateObject Outlook.Application Set email oolApp.CreateItem 0", "I m using Outlook.Application to send emails from my C code .", "Do you need to use Outlook", "The above code does not use Outlook at all .", "Assuming that you have Outlook installed on the machine that is running the script you could use Outlook Automation .", "Have you looked at Application.Session.CurrentUser in the Outlook Object Model", "You can use the Outlook Object Model to resolve the name and get its details - call Application.Session.CreateRecipient name returns Recipient object call Recipient.Resolve read Recipient.AddressEntry propertty to get the AddressEntry object use AddressEntry.Fields to read raw MAPI properties or use AddressEntry.GetExchangeUser to get the ExchangeUser object which exposes the JobTitle property .", "Below is the code that I used to create an Outlook Object : .. . .. . Set ObjOutlook CreateObject Outlook.Application .. . CreateItem 0 opens a New Email window...MailItem .. . set objMail ObjOutlook.CreateItem 0 .. . objMail.Display .. . .. . .. . What I did Not even sure if this is the right way to do it : .. . .. . Set ObjShell CreateObject WScript.Shell .. . ObjShell.Run Outlook.exe .. . .. . .. . Why can t I just do ObjShell.Quit after I call the SendEmail Function", "Please let me know what property to use to retrieve fields such as Manager Name and Jobtitle and location details from outlook .", "I don t think any user will appreciate your code closing Outlook .", "Open Outlook .. . 2 .", "Newest version of Outlook will automatically exist if there are no open explorers or inspectors even if you hold a reference to an Outlook object - that was done to guard ageist misbehaving apps that leaked references .", "Note : I m using outlook 2010 .", "I need to retrieve few fields from outlook like Fullname jobtitle from outlook server using VBscript .", "If the function-call succeeds this means that Outlook is currently running :", "First of all I was having trouble opening Outlook .", "Firstly what if it was the user who opened Outlook", "I m designing a contact form in Outlook 2010 .", "You could try obtaining the Outlook Application object using the GetObject http : msdn.microsoft.com en-us library kdccchxa VS.85 .aspx function .", "To prevent Outlook from closing hodl a reference to an Explorer object t even if you do not show it - call Namespace.getDefaultFolder olFolderInbox then hold a reference to the object returned by MAPIFolder.GetExplorer .", "How to check if Outlook is running using vbscript I need this for my installation procedure to ask the user to close outlook before installing my application .", "Part of the script contains a call to open Outlook as follows : .. . .. . This runs outlook as expected but what he wants is for only that call to run under the logged in user s account .", "First Argument path to Outlook .", "You can send an email using CDO which is the subsystem that Outlook uses .", "This will help you till opening the Outlook and navigate you to Inbox", "Second Argument Outlook attachment command .", "possible duplicate of Opening outlook 2010 through vbscript http : stackoverflow.com questions 9391849 opening-outlook-2010-through-vbscript", "it open default microsoft account instead of outlook .", "If your default mail client is a microsoft account that s what it opens IF the users default mail client is outlouk it opens outlook .", "I use Outlook to edit the subject and body text using following code : .. . .. . End Sub .. . .. . If I close outlook before pressing OK in the message box produced by the code i receive the runtime-error The remote-server machine does not exist or is unavailable in line PutSubjectBody MyMail.Subject MyMail.HTMLBody .", "Close Outlook AFTER the email has been sent .. . .. . Where I m stuck : .. . .. . 1 .", "I just want to close the Outlook application once the email has been sent and I can t figure out how .", "See this http : stackoverflow.com questions 7041938 vbscript-to-send-email-without-running-outlook .", "You might want to check that both Application.Explorers.Count and Application.Inspectors.Count are zero before closing Outlook .", "Maybe have a look at this : rondebruin.nl win s1 outlook signature.htm http : www.rondebruin.nl win s1 outlook signature.htm", "I Have java code which open outlook in server .", "but i want to opent outlook on client machine and fill Body with HTML content .", "a href mailto : [email protected] Click here to mail a .. . .. . Once clicked it will open Outlook .", "can we open outlook uisng java code on client machine", "Here s a MS kb article that might help you get started : Programming examples for referencing items and folders in Outlook 2000 http : support.microsoft.com kb 208520 .. . .. . And then look at the MailItem http : msdn.microsoft.com en-us library aa210946 28v office.11 29.aspx object which might contain the information you need .", "Most VBScripters use the CDO library to send e-mail .", "You can t check a MailItem s properties while it s in the process of sending", "You can either use Recipient.AddressEntry.GetExchangeUser to retrieve the ExchangeUserObject or use AddressEntry.PropertyAccessor to retrieve raw MAPI properties - have a look at the available properties and their DASL names in OutlookSpy http : www.dimastr.com outspy click IMAPISession button then QueryIdentity .", "I think could be wrong this is in the Trust Center settings for Outlook .", "Actually it will open the default mail client .. . .. . Java : .. . .. . Sample code : open Outlook and add an attachment .", "Maybe I can use this somehow", "Secondly after calling Send use Namespace SyncObjects collection to retrieve the very first SyncObject .", "What can I use instead of IsNull", "Can I use this Send Secure in my code", "Guess that rules out my next idea.. . checking to see if the MailItem s parent folder is the Sent folder .", "VBS sample .. . .. . Of course you MUST add object validation in this code .", "Well the object is null.. .", "I ve done some searching but can t find a method to change the permission level for the outlook session .", "In this case I would use an On Error detect that specific Err.Number and handle it gracefully .", "Yes after calling Send the only allowed operation on the MialItem object is releasing it - the message now belongs-to the spooler .", "Where is your code running", "If the object is IDispatch based and supports type info OutlookSpy will show its properties and methods select the Object property click Browse .", "That s what I d found out which was why I d asked the question seeing as the runas was not an option .", "Another problem may be if you have a 64 bit version of office installed since QTP is a 32-bit application it can t create 32-bit objects as explained here http : stackoverflow.com questions 2429477 cannot-use-createobject-from-vb-scripts-on-windows-7 although that refers to InprocServer s I m not sure if it applies to LocalServer s", "I tried with : .. . .. . but getting Object Required error .", "For your information-IE has nothing to do with this", "@Bk I tried your code and it worked perfectly", "Object required is vbscript s way of telling you that you tried to call a method of something which isn t an object most likely it s NULL or Nothing .", "As You can see I have tried to use IsNull to determine MyMail is still alive or not .", "You can try to use error-handling - .. . .. . add the line in the beginning of the sub .. . .. . add-on the end of the sub :", "Can you tell me what your last chunk of code is doing", "I ve attempted to do this via the following VBScript note the field to be populated with type Recipient is called RecipientControl3 : .. . .. . This gives the following error : Object doesn t support this property or method : AssignedTo.Value .. . .. . I can t seem to find any guidance online on how to set the recipient using VBScript obviously using .Value to assign a recipient object isn t working", "The only object you re working with is objOutlook so probably CreateObject failed .", "There is an interface exposed by the VoltageAdddIn dll which has the SendSecureButtonClicked object ribbonControl method .", "Using the attached VBA code in Excel to open an outlook msg file : .. . .. . Opening the msg file like this hides the Signature button that is normally under the Message ribbon in the Include group .", "The closure of the automation object is not going to be reflected in the state of the MyMail variable itself it would need to implement a IsConnectedToInstance property and it does not .", "Thanks", "Maybe add an On Error Goto 0 at the end so that any other errors in the procedure do not get suppressed .", "Beware.. . is my vista64 version going to be an instance of a win32 process", "what you have to do", "Do you want to send Email or What", "Yes I want to send email", "Sample Code : -", "You can find more information in my article Sending Emails Using CDO in WSH http : www.aspfree.com c a Windows-Scripting Sending-Emails-Using-CDO-in-WSH on ASP Free .", "Try This simple code .", "I would like to know the time i.e when the email was readed using VBScript .", "Could anyone help me to figurout this .", "Thanks in advance .", "What research have you done so far", "I m asking this for a colleague just to determine if it s possible .", "He has a vbscript file that runs under the System account .", "is this possible", "Thanks .. . Martin", "You can do this by using the runas http : en.wikipedia.org wiki Runas command .", "That s what i thought initially but then found you d need the password which is not going to be available .", "Thanks anyway .", "That s true .", "There is no way to run a program as another user without providing their credentials ." ] }
{ "confidence": [ 65.45313262939453, 65.45313262939453, 65.2662582397461, 60.78327178955078, 55.01797103881836, 54.75992202758789, 50.26302719116211, 49.600826263427734, 47.04169845581055, 39.087257385253906, 31.61174774169922, 29.4312686920166, 26.482025146484375, 25.032093048095703, 24.995006561279297, 24.691814422607422, 24.5765380859375, 24.15310287475586, 24.15310287475586, 21.3160400390625 ], "content": [ "Question : I want to send email using outlook 2010 windows-7 IE8 what is code required to get the Outlook.Application object . I tried with CreateObject Outlook.Application but getting error Object Required Comment : yes you will need to create object like Set oolApp CreateObject Outlook.Application Set email oolApp.CreateItem 0 Comment : CreateObject Outlook.Application is returning Error no 424 object required Comment : what you have to do Do you want to send Email or What Comment : Yes I want to send email Comment : For your information-IE has nothing to do with this .. . Answer : You can send an email using CDO which is the subsystem that Outlook uses . You can find more information in my article Sending Emails Using CDO in WSH http : www.aspfree.com c a Windows-Scripting Sending-Emails-Using-CDO-in-WSH on ASP Free .", "Question : I want to send email using outlook 2010 windows-7 IE8 what is code required to get the Outlook.Application object . I tried with CreateObject Outlook.Application but getting error Object Required Comment : yes you will need to create object like Set oolApp CreateObject Outlook.Application Set email oolApp.CreateItem 0 Comment : CreateObject Outlook.Application is returning Error no 424 object required Comment : what you have to do Do you want to send Email or What Comment : Yes I want to send email Comment : For your information-IE has nothing to do with this .. . Answer : Try This simple code . This will help you till opening the Outlook and navigate you to Inbox", "Question : I want to send email using outlook 2010 windows-7 IE8 what is code required to get the Outlook.Application object . I tried with CreateObject Outlook.Application but getting error Object Required Comment : yes you will need to create object like Set oolApp CreateObject Outlook.Application Set email oolApp.CreateItem 0 Comment : CreateObject Outlook.Application is returning Error no 424 object required Comment : what you have to do Do you want to send Email or What Comment : Yes I want to send email Comment : For your information-IE has nothing to do with this .. . Answer : Sample Code : -", "Question : I want to send email using outlook 2010 windows-7 IE8 what is code required to get the Outlook.Application object . I tried with : .. . .. . but getting Object Required error . Comment : possible duplicate of Opening outlook 2010 through vbscript http : stackoverflow.com questions 9391849 opening-outlook-2010-through-vbscript .. . Answer : Object required is vbscript s way of telling you that you tried to call a method of something which isn t an object most likely it s NULL or Nothing . The only object you re working with is objOutlook so probably CreateObject failed . Check to be sure that Outlook is registered correctly The following registry key should exist HKEY CLASSES ROOT Outlook.Application CLSID . Another problem may be if you have a 64 bit version of office installed since QTP is a 32-bit application it can t create 32-bit objects as explained here http : stackoverflow.com questions 2429477 cannot-use-createobject-from-vb-scripts-on-windows-7 although that refers to InprocServer s I m not sure if it applies to LocalServer s", "Question : I want to send email using outlook 2010 windows-7 IE8 what is code required to get the Outlook.Application object . I tried with : .. . .. . but getting Object Required error . Comment : possible duplicate of Opening outlook 2010 through vbscript http : stackoverflow.com questions 9391849 opening-outlook-2010-through-vbscript .. . Answer : You should probably be using something like CDO . Sending Emails Using CDO in WSH http : www.aspfree.com c a Windows-Scripting Sending-Emails-Using-CDO-in-WSH", "Question : How to check if Outlook is running using vbscript I need this for my installation procedure to ask the user to close outlook before installing my application . Thanks .. . Answer : You could try obtaining the Outlook Application object using the GetObject http : msdn.microsoft.com en-us library kdccchxa VS.85 .aspx function . If the function-call succeeds this means that Outlook is currently running : Comment : I think you need a comma pathname class : GetObject Outlook.Application Comment : Maybe add an On Error Goto 0 at the end so that any other errors in the procedure do not get suppressed .", "Question : Here is the code I have so far : .. . .. . What I m trying to automate using VBScript : .. . .. . 1 . Open Outlook .. . 2 . Send an email .. . 3 . Wait for email to send Outbox to finish sending .. . 4 . Close Outlook AFTER the email has been sent .. . .. . Where I m stuck : .. . .. . 1 . First of all I was having trouble opening Outlook . Below is the code that I used to create an Outlook Object : .. . .. . Set ObjOutlook CreateObject Outlook.Application .. . CreateItem 0 opens a New Email window...MailItem .. . set objMail ObjOutlook.CreateItem 0 .. . objMail.Display .. . .. . .. . What I did Not even sure if this is the right way to do it : .. . .. . Set ObjShell CreateObject WScript.Shell .. . ObjShell.Run Outlook.exe .. . .. . .. . Why can t I just do ObjShell.Quit after I call the SendEmail Function Using .Quit gives me an error . 2 . I just want to close the Outlook application once the email has been sent and I can t figure out how . Comment : Do you need to use Outlook Most VBScripters use the CDO library to send e-mail . See this http : stackoverflow.com questions 7041938 vbscript-to-send-email-without-running-outlook . .. . Answer : MailItem has a Sent https : msdn.microsoft.com EN-US library office ff868242.aspx property that indicates when the message has been sent . Try this : Comment : This will never work . The message becomes sent after it is sent and moved to the Sent Items folder . It will be a different message from the one you sent . More than that touching a message in any way after calling Send will abort the submission process . Comment : @DmitryStreblechenko Really You can t check a MailItem s properties while it s in the process of sending Seems odd . Guess that rules out my next idea.. . checking to see if the MailItem s parent folder is the Sent folder . Comment : Yes after calling Send the only allowed operation on the MialItem object is releasing it - the message now belongs-to the spooler .", "Question : Here is the code I have so far : .. . .. . What I m trying to automate using VBScript : .. . .. . 1 . Open Outlook .. . 2 . Send an email .. . 3 . Wait for email to send Outbox to finish sending .. . 4 . Close Outlook AFTER the email has been sent .. . .. . Where I m stuck : .. . .. . 1 . First of all I was having trouble opening Outlook . Below is the code that I used to create an Outlook Object : .. . .. . Set ObjOutlook CreateObject Outlook.Application .. . CreateItem 0 opens a New Email window...MailItem .. . set objMail ObjOutlook.CreateItem 0 .. . objMail.Display .. . .. . .. . What I did Not even sure if this is the right way to do it : .. . .. . Set ObjShell CreateObject WScript.Shell .. . ObjShell.Run Outlook.exe .. . .. . .. . Why can t I just do ObjShell.Quit after I call the SendEmail Function Using .Quit gives me an error . 2 . I just want to close the Outlook application once the email has been sent and I can t figure out how . Comment : Do you need to use Outlook Most VBScripters use the CDO library to send e-mail . See this http : stackoverflow.com questions 7041938 vbscript-to-send-email-without-running-outlook . .. . Answer : Firstly what if it was the user who opened Outlook I don t think any user will appreciate your code closing Outlook . You might want to check that both Application.Explorers.Count and Application.Inspectors.Count are zero before closing Outlook . Newest version of Outlook will automatically exist if there are no open explorers or inspectors even if you hold a reference to an Outlook object - that was done to guard ageist misbehaving apps that leaked references . To prevent Outlook from closing hodl a reference to an Explorer object t even if you do not show it - call Namespace.getDefaultFolder olFolderInbox then hold a reference to the object returned by MAPIFolder.GetExplorer . Secondly after calling Send use Namespace SyncObjects collection to retrieve the very first SyncObject . Hook up the SyncObject.SyncEnd event and call SyncObject.Start . When SyncEnd event fires you will be all done . But I don t think you can work with events in VB script.. .", "Question : Here is the code I have so far : .. . .. . What I m trying to automate using VBScript : .. . .. . 1 . Open Outlook .. . 2 . Send an email .. . 3 . Wait for email to send Outbox to finish sending .. . 4 . Close Outlook AFTER the email has been sent .. . .. . Where I m stuck : .. . .. . 1 . First of all I was having trouble opening Outlook . Below is the code that I used to create an Outlook Object : .. . .. . Set ObjOutlook CreateObject Outlook.Application .. . CreateItem 0 opens a New Email window...MailItem .. . set objMail ObjOutlook.CreateItem 0 .. . objMail.Display .. . .. . .. . What I did Not even sure if this is the right way to do it : .. . .. . Set ObjShell CreateObject WScript.Shell .. . ObjShell.Run Outlook.exe .. . .. . .. . Why can t I just do ObjShell.Quit after I call the SendEmail Function Using .Quit gives me an error . 2 . I just want to close the Outlook application once the email has been sent and I can t figure out how . Comment : Do you need to use Outlook Most VBScripters use the CDO library to send e-mail . See this http : stackoverflow.com questions 7041938 vbscript-to-send-email-without-running-outlook . .. . Answer : Try this : Comment : Thank you all @Bk I tried your code and it worked perfectly Can you tell me what your last chunk of code is doing Comment : @Edrei Of course . The line SendMail calls the subroutine Sub Sendmail the second line . After the code is processed between Sub Sendmail and End Sub from top to down it goes back again to the second-to-last line SendMail . The next line creates a Messagebox with the text Done .", "Question : I m using Outlook.Application to send emails from my C code . I have this Voltage Encryption Add-In which allows you to Send Secure a message rather than the normal Send . Can I use this Send Secure in my code Is there some way to access add-ins I can loop through Microsoft.Office.Core.COMAddIns and see that it is there but cannot really do anything with these Add-Ins . Just see basic info about them . There is an interface exposed by the VoltageAdddIn dll which has the SendSecureButtonClicked object ribbonControl method . Maybe I can use this somehow .. . Answer : If the addin designer did not explicitly give you that ability you can t . You can access COM addins through the Application.COMAddins collection you can play with it in OutlookSpy http : www.dimastr.com outspy - click Application button select COMAddins property click Browse go to the IEnumVariant tab If addin decides to expose its objects for external consumption COMAddin.Object property will be null . Comment : Well the object is null.. . But for those that aren t null how are they accessed They just return a System . ComObject which isn t particularly helpful . Comment : You will need to know which particular interface they expose . If the object is IDispatch based and supports type info OutlookSpy will show its properties and methods select the Object property click Browse .", "Question : I need to retrieve few fields from outlook like Fullname jobtitle from outlook server using VBscript . The above script works to get the fullname if id is given in sUser . But the line .. . .. . is not working in the same way to retrieve the title field . Please let me know what property to use to retrieve fields such as Manager Name and Jobtitle and location details from outlook . Note : I m using outlook 2010 . .. . Answer : The above code does not use Outlook at all . Where is your code running Is it a COM addin or a standalone application Have you looked at Application.Session.CurrentUser in the Outlook Object Model You can either use Recipient.AddressEntry.GetExchangeUser to retrieve the ExchangeUserObject or use AddressEntry.PropertyAccessor to retrieve raw MAPI properties - have a look at the available properties and their DASL names in OutlookSpy http : www.dimastr.com outspy click IMAPISession button then QueryIdentity . Comment : It is standalone script . When I execute the enire script I get the user names in a separate text file . User ids are feeded to the script from a text file This is the rest of the script on how the data is passed . Set objFSO CreateObject Scripting.FileSystemObject Open the text file - strData now contains the whole file strData objFSO.OpenTextFile strTextFile ForReading .ReadAll Set objTextFile objFSO.OpenTextFile strWriteFile ForWriting True Split the text file into lines arrLines Split strData vbCrLf Step through the lines For Each strLine in arrLines sUser strLine Comment : You can use the Outlook Object Model to resolve the name and get its details - call Application.Session.CreateRecipient name returns Recipient object call Recipient.Resolve read Recipient.AddressEntry propertty to get the AddressEntry object use AddressEntry.Fields to read raw MAPI properties or use AddressEntry.GetExchangeUser to get the ExchangeUser object which exposes the JobTitle property .", "Question : I would like to know the time i.e when the email was readed using VBScript . Could anyone help me to figurout this . Thanks in advance . Comment : What research have you done so far .. . Answer : Assuming that you have Outlook installed on the machine that is running the script you could use Outlook Automation . Here s a MS kb article that might help you get started : Programming examples for referencing items and folders in Outlook 2000 http : support.microsoft.com kb 208520 .. . .. . And then look at the MailItem http : msdn.microsoft.com en-us library aa210946 28v office.11 29.aspx object which might contain the information you need .", "Question : I use Outlook to edit the subject and body text using following code : .. . .. . End Sub .. . .. . If I close outlook before pressing OK in the message box produced by the code i receive the runtime-error The remote-server machine does not exist or is unavailable in line PutSubjectBody MyMail.Subject MyMail.HTMLBody . As You can see I have tried to use IsNull to determine MyMail is still alive or not . What can I use instead of IsNull .. . Answer : In this case I would use an On Error detect that specific Err.Number and handle it gracefully . The closure of the automation object is not going to be reflected in the state of the MyMail variable itself it would need to implement a IsConnectedToInstance property and it does not . You could wire up the event Outlook.Application.Quit but then you would need to check a flag and there would be cases when it gets missed . Comment : Ofcause I havn t thought that way . Thanks", "Question : I Have java code which open outlook in server . but i want to opent outlook on client machine and fill Body with HTML content . is it possible using javaScript VbScript or any other Technology . .. . Answer : HTML - Javascript : Simple mailto in html a tag see below for the simple markup . a href mailto : [email protected] Click here to mail a .. . .. . Once clicked it will open Outlook . Actually it will open the default mail client .. . .. . Java : .. . .. . Sample code : open Outlook and add an attachment . First Argument path to Outlook . Second Argument Outlook attachment command . Third Argument Attachment path . Comment : but this code not working properly in Windows-8 . it open default microsoft account instead of outlook . Comment : yes as I said this opens the users default mail client . If your default mail client is a microsoft account that s what it opens IF the users default mail client is outlouk it opens outlook . Assuming you want to send a mail the client is not relevant wether it s outlouk mail or something else Comment : can we open outlook uisng java code on client machine Comment : Sure I added a java code example .", "Question : How to check if Outlook is running using vbscript I need this for my installation procedure to ask the user to close outlook before installing my application . Thanks .. . Answer : Comment : Beware.. . is my vista64 version going to be an instance of a win32 process", "Question : null .. . Answer : I m designing a contact form in Outlook 2010 . I select an Assigned To field from the field chooser Field Chooser - All Task Fields - Assigned To and drag it onto my form page . When I run this form it will let me click Assigned To and choose a contact from the Exchange Global Address List and add the contact as type Recipient . I d like to set a default for this when the form opens i.e . assign to the user . I ve attempted to do this via the following VBScript note the field to be populated with type Recipient is called RecipientControl3 : .. . .. . This gives the following error : Object doesn t support this property or method : AssignedTo.Value .. . .. . I can t seem to find any guidance online on how to set the recipient using VBScript obviously using .Value to assign a recipient object isn t working Any help much appreciated", "Question : I use Outlook to edit the subject and body text using following code : .. . .. . End Sub .. . .. . If I close outlook before pressing OK in the message box produced by the code i receive the runtime-error The remote-server machine does not exist or is unavailable in line PutSubjectBody MyMail.Subject MyMail.HTMLBody . As You can see I have tried to use IsNull to determine MyMail is still alive or not . What can I use instead of IsNull .. . Answer : You can try to use error-handling - .. . .. . add the line in the beginning of the sub .. . .. . add-on the end of the sub : Comment : Thanks to you too", "Question : I m asking this for a colleague just to determine if it s possible . He has a vbscript file that runs under the System account . Part of the script contains a call to open Outlook as follows : .. . .. . This runs outlook as expected but what he wants is for only that call to run under the logged in user s account . is this possible Thanks .. . Martin .. . Answer : You can do this by using the runas http : en.wikipedia.org wiki Runas command . Comment : That s what i thought initially but then found you d need the password which is not going to be available . Thanks anyway . Comment : That s true . There is no way to run a program as another user without providing their credentials .", "Question : I m asking this for a colleague just to determine if it s possible . He has a vbscript file that runs under the System account . Part of the script contains a call to open Outlook as follows : .. . .. . This runs outlook as expected but what he wants is for only that call to run under the logged in user s account . is this possible Thanks .. . Martin .. . Answer : No you can t because you ll then need the password of the logged on user . Plus you ll need to find out what the logged on user s account is in the first place although that is relatively easy . Comment : That s what I d found out which was why I d asked the question seeing as the runas was not an option .", "Question : null .. . Answer : Using the attached VBA code in Excel to open an outlook msg file : .. . .. . Opening the msg file like this hides the Signature button that is normally under the Message ribbon in the Include group . signature button hidden http : i.stack.imgur.com 9uggj.jpg .. . .. . The Signature button is visible when opening the msg file directly from windows-explorer .. . .. . signature button visible http : i.stack.imgur.com QhJZg.jpg .. . .. . Opening either through windows-explorer or programatically the Signature item is grayed out under the Include group . customize toolbars showing grayed out options under include http : i.stack.imgur.com 5qe3P.jpg .. . .. . When the msg file is opened programatically attempting to add the Signature button to a custom group the Signature button is grayed out . Grayed out Signature item http : i.stack.imgur.com 6spEC.jpg .. . .. . How do I include the Signature button when opening an msg file programatically Comment : I m thinking the issue is that the Session https : msdn.microsoft.com en-us library office ff866436.aspx property is read only . Maybe have a look at this : rondebruin.nl win s1 outlook signature.htm http : www.rondebruin.nl win s1 outlook signature.htm Comment : Tim - Thanks I ve done some searching but can t find a method to change the permission level for the outlook session . Any pointers Comment : I think could be wrong this is in the Trust Center settings for Outlook . I think you need to enable Macros which is a bad plan . It might possibly be a registry setting that you could toggle with code . I d try enabling macros and checking if it works then before trying to find a registry key for this setting . Comment : Will do . Thanks" ] }
[ "yes-answer-long", "yes-answer-short" ]
vba
UNK_RELATION
aurelia-binding@javascript@140
aurelia-binding -- use for questions related to the aurelia-binding library a part of the aurelia platform that implements databinding for @placeholder and html .
{ "confidence": [ 69.00628662109375, 67.10842895507812, 66.6658935546875, 66.58970642089844, 64.15594482421875, 63.22509002685547, 60.709136962890625, 57.88887405395508, 57.34452438354492, 57.11664962768555, 56.971439361572266, 55.24391174316406, 54.983665466308594, 54.983665466308594, 54.983665466308594, 54.89719772338867, 54.24826431274414, 54.24826431274414, 54.24826431274414, 53.6024169921875, 53.086158752441406, 52.89915084838867, 52.788047790527344, 52.717872619628906, 51.60395050048828, 51.257652282714844, 51.257652282714844, 51.257652282714844, 51.20528793334961, 51.20528793334961, 51.20528793334961, 51.20528793334961, 51.20528793334961, 51.20528793334961, 51.20528793334961, 51.20528793334961, 51.20528793334961, 50.88365173339844, 50.88365173339844, 49.982933044433594, 49.92161178588867, 49.88180923461914, 49.674896240234375, 49.674896240234375, 49.53453826904297, 49.53453826904297, 49.39826202392578, 49.28820037841797, 49.177364349365234, 48.33985137939453, 47.94017028808594, 47.94017028808594, 47.94017028808594, 47.840675354003906, 47.840675354003906, 47.840675354003906, 47.2099609375, 47.08340835571289, 47.08340835571289, 47.08340835571289, 47.08340835571289, 47.08340835571289, 47.08340835571289, 47.08340835571289, 47.08340835571289, 47.08340835571289, 47.08340835571289, 47.08340835571289, 47.08340835571289, 46.87532424926758, 46.60759735107422, 46.55699920654297, 45.553016662597656, 45.553016662597656, 45.553016662597656, 44.90308380126953, 44.88633346557617, 44.40513610839844, 44.25347137451172, 43.87601852416992, 43.87601852416992, 43.6755256652832, 42.510372161865234, 42.510372161865234, 42.510372161865234, 42.510372161865234, 42.021934509277344, 41.53847122192383, 41.53847122192383, 41.53847122192383, 41.53847122192383, 41.53125762939453, 41.53125762939453, 41.53125762939453, 41.53125762939453, 41.53125762939453, 41.53125762939453, 41.53125762939453, 41.53125762939453, 41.53125762939453 ], "content": [ "github.com aurelia-binding issues 94 https : github.com aurelia-binding issues 94", "Possible duplicate of Binding a select to an array of objects in Aurelia and matching on ID http : stackoverflow.com questions 33920610 binding-a-select-to-an-array-of-objects-in-aurelia-and-matching-on-id", "Coincidentally I just pushed https : github.com aurelia-binding commit 0719de3e3e45e51eaf935fe68b232808d7f61caf a set of exhaustive docs on checkbox radio and select binding to the Aurelia binding repo .", "This is done via the Aurelia data-binding system .", "jspm packages npm [email protected] aurelia-binding.d.ts 353 49 : error TS2304 : Cannot find name Map .", "Guess am missing something in aurelia-binding concept .", "Aurelia absolutely supports binding to ad-hoc arbitrary properties on a DOM element .", "It seems like a good solution but not related to Aurelia bindings .", "What is the best way to track down a subtle binding or templating error in Aurelia", "Here s why : Aurelia does not implement a custom html parser .", "In Aurelia changes are immediately applied for the most part .", "Am very new to react js and aurelia js my requirement is use react for view and aurelia for model routing and all .", "The Aurelia way of doing this would be :", "All fine with Aurelia", "will Aurelia know that the property was changed", "support for this is coming in the next release of aurelia-validation + aurelia-validatejs .", "jspm install aurelia-framework .. . 5 .", "jspm install aurelia-bootstrapper .. . 6 .", "I m not sure how to do this in Aurelia .", "When I use Aurelia binding .. . .. . and set .. . .. . button is still enabled for some time and a user could click this button again .", "tsc .. . .. . At this point you should stumble across the errors : jspm packages npm [email protected] aurelia-binding.d.ts 331 25 : error TS2304 : Cannot find name Map .", "The problem is that in aurelia you typically inject and attaches some aurelia objects such as router or eventaggregator to the viewmodel .", "Jeremy got me thinking about this in this bug https : github.com aurelia-binding issues 309 .", "But that needs the current instance of the Aurelia object .", "Best place is cheat sheet in Aurelia docs : aurelia.io docs.html aurelia framework 1.0.0-beta.1.2.4 doc http : aurelia.io docs.html aurelia framework 1.0.0-beta.1.2.4 doc article cheat-sheet", "If you re using aurelia-breeze the binding system is using the breeze system so ultimately you are indirectly using the breeze system .", "That s probably because Aurelia binding uses micro tasks which are slower than the DOM .", "Aurelia automatically chooses the correct default binding-mode for attributes of built-in elements like inputs or selects .", "If so how can I do this in Aurelia", "How would I achieve this using Aurelia", "It does sound like a non-Aurelia issue .", "Furthermore DataAttributeObserver is not in the docs or even the aurelia-binding.d.ts file .", "I m attempting to convert a Durandal navbar to an Aurelia navbar .", "Is there any analogues functions apply or digest in Aurelia", "I don t think Aurelia has this feature .", "Aurelia sets some sensible defaults e.g .", "This is the way Aurelia uses conventions and it works well .", "What is the reason the sourcemaps are not working is it Aurelia", "This is now supported in the aurelia-validation alpha .", "See https : github.com aurelia-binding issues 307 .. . .. . In short for mixed case properties you must use a hyphen to split words :", "Aurelia provides model.bind for use on option elements inside a select .", "Here s an example : https : gist.run id 28c0fedb21b5d8100913d3bc5500499f .. . .. . target-updated.js .. . .. . http : aurelia.io hub.html doc article aurelia-binding latest binding-binding-behaviors .. . .. . @MathewJamesDavis s answer is perfectly valid I m just offering this as a second option .", "But my instances of Box are created by BreezeJs not Aurelia .", "We are thinking about using Aurelia for a new app .", "Am new to aurelia-react js i followed to this link https : github.com Vheissu aurelia-react-example to integrate .", "Much of the validation presentation logic in the aurelia-breeze plugin will be removed and instead you ll be able to plug breeze validation into aurelia-validation", "The composition engine expects a view slot so it does more than you want and without any aurelia context you can t get aurelia to process the html without running it through the compiler one way or another .", "This isn t an aswer but there is discussion of this issue right now here : github.com aurelia skeleton-navigation issues 606 https : github.com aurelia skeleton-navigation issues 606", "Possible duplicate of Aurelia load routes dynamically from fetch http : stackoverflow.com questions 37647971 aurelia-load-routes-dynamically-from-fetch", "The binding behavior s bind method is invoked immediately before https : github.com aurelia-binding blob 1.0.0-beta.1.3.6 src binding-expression.js L86-L88 the binding instance applies the model value to the target element https : github.com aurelia-binding blob 1.0.0-beta.1.3.6 src binding-expression.js L99-L100 which explains why the div s children don t exist yet- the string markdown part of the binding expression hasn t been applied yet .", "Usage : .. . .. . ul mdl-for.bind id .. . ul .. . .. . This kind of scenario may be supported in a future release : https : github.com aurelia templating-binding issues 94", "I am trying to render my aurelia view dynamically using compose within repeater and it is working fine but my two-way binding not working .", "My binding doesn t work because Aurelia doesn t deep check for changes and pre textContent.bind . . should read pre text-content.bind . .", "That s the whole point of event-delegation with Aurelia .", "Recently validation files has been updated in Aurelia .", "aurelia-validation is in the middle of a rewrite that will enable this type of scenario .", "I have the latest version of Aurelia although I believe it had been fixed last year https : github.com aurelia framework issues 35 I am still having issues .", "I am looking at a way to add a class dynamically to aurelia template .", "But in the end I decided to go with a different solution that uses the aurelia property observer .", "How can I pass an object to a custom component through an attribute in Aurelia", "It also confused me as to why implementing it was not a higher priority for the Aurelia Team .", "They haven t been published to the official Aurelia docs app yet but they should be there on Tuesday .", "we had the same issues using Moment in TypeScript with Aurelia .", "I still believe aurelia needs a better out-of-the-box solution for this .", "Aurelia only uses dirty checking for computed properties properties with a getter function .", "just understand passing value to components custome-component in aurelia component in react .", "In both aurelia and react it works nearly same like call-back function .", "Aurelia definitely needs more examples and explanations on the docs page .", "I think you should rewrite your code using aurelia features .", "stackoverflow.com questions 36049391 http : stackoverflow.com questions 36049391 is-there-a-callback-or-promise-for-aurelia-show-bind", "react-example.js .. . .. . my-react-element.jsx .. . .. . Note : Basic knowledge of react and aurelia required and compare the doc http : ilikekillnerds.com 2015 03 how-to-use-react-js-in-aurelia to fix .", "I think an aurelia custom attribute would be a better fit for this use-case .", "I am starting with a simple TODO app with Aurelia RethinkDB Socket.IO .", "Are there any guidelines info to passing data in and out of components in Aurelia", ".. . Are there any guidelines info to passing data in and out of components in Aurelia", "The @bindable decorator has the following sig : .. . .. . One of the best places to check for quick reference is the Aurelia cheat-sheet in the docs : .. . .. . http : aurelia.io docs.html aurelia framework 1.0.0-beta.1.2.4 doc article cheat-sheet", "I don t think we need the equivalent of ko.toJson .. . because we use POJOs with Aurelia- we can use JSON.stringify .", "Right now we have the following code which fills kind of dirty with the power of aurelia bindings : .. . .. . HTML .. . .. . Javascript .. . .. . Is there any way to improve this is there any built-in functionality on aurelia my concern is that if I want to have different lists on a single page this code is going to be a mess", "I am using Aurelia framework for my website and have implemented validations as per the example shown in the following answer http : stackoverflow.com questions 37653206 aurelia-trigger-validation-on-tab-outblur-event 37821945 37821945 .", "maybe i m now making a complete fool out of me but why not use aurelia-history navigate . . command", "I refered this doc http : ilikekillnerds.com 2015 03 how-to-use-react-js-in-aurelia for installation it works well .", "data- and aria- work because Aurelia can assume your intent is to bind to the html attributes in those two cases because they re well-known html attribute prefixes", "Also- if you see anything weird with items whose id is zero- there s a fix https : github.com aurelia-binding commit 9d39a1adee1175e44d20634593a297ba5cdc674a going out on Tuesday for that as well .", "FYI I got the following javascript error while using this behavior when replacing a parent : viewmodel : Uncaught in promise TypeError : binding behaviorKey .unbind is not a function unbind @ aurelia-binding.js : 1266", "If you re using this for something other than time-based bindings binding to something that uses Date.now or new Date or internationalization locale-changed events.. . you might not be doing it the Aurelia way .", "Working solution see also Aurelia repeat.for binding on a custom-element https : gist.run id 0efbaea028450163d98e : .. . .. . repeat and bind on a custom attribute of the template and viewmodel class : .. . .. . The viewmodel class :", "When creating a custom-element in the DOM and adding a respective view model which implements bindable from the aurelia-framework my view renders perfectly .", "When save changes is clicked replace the original model with the clone : .. . .. . let clone JSON.parse JSON.stringify model .. . .. . .. . Btw consider using aurelia-dialog https : github.com aurelia-dialog plugin .", "I have an aurelia application updated to the latest beta 1.0.0-beta.1.2.1 https : github.com aurelia framework releases tag 1.0.0-beta.1.2.1 at the time of this writing .", "This version of aurelia already uses Babel 6 and my application is based on the based on the ASP.NET 5 ES2016 navigation skeleton https : github.com aurelia skeleton-navigation tree master skeleton-es2016-asp.net5 .", "I have a tree structure shamelessly acquired from building a treeview in aurelia http : www.syntaxsuccess.com viewarticle building-a-treeview-in-aurelia .. . .. . This works great when I push nodes onto the tree .", "Example .. . .. . I want to add the active class on below code .. . .. . As well how do I pass an event Object on aurelia", "Aurelia can t quite figure out what I m doing in the ValueConverter and so it isn t updating properly .", "But I realize that my question was perhaps not really fair that perhaps it really should be posed as a feature request for Aurelia .", "Creating getters setters like you are doing here is most definitely the wrong way to do this in Aurelia .", "If you are doing this in your own Aurelia applications I implore you to stop doing this .", "There is plenty of valid aurelia attributes you can have that aren t standard on a UL element .", "However when using Aurelia the loop variable row is not yet in scope since the repeat.for is on the li tag as well .", "Like this : .. . .. . More information at http : aurelia.io hub.html doc article aurelia templating latest templating-custom-elements 2", "I believe this is how the Aurelia @bindable and @observable methods work behind the scenes in most cases ." ] }
{ "confidence": [ 82.87055206298828, 80.6495361328125, 79.4537582397461, 77.07154846191406, 75.279296875, 74.66954040527344, 72.86653900146484, 72.04212188720703, 71.93565368652344, 71.73039245605469, 71.67526245117188, 71.561767578125, 70.85440063476562, 70.51861572265625, 70.29336547851562, 69.65084838867188, 69.29721069335938, 67.56027221679688, 67.42300415039062, 67.21682739257812 ], "content": [ "Question : In my web app I m using a Markdown value converter to render HTML from a Markdown string e.g . This works nice and inside the div I get an HTML rendering of the Markdown content in string . The value converter is able to render an Aurelia custom-element in the output but being that element inside the value converter output as a string it s not enhanced by the Aurelia s templating-engine . Would a binding behavior be able to use the TemplatingEngine to enhance the output of the value converter once rendered in the DOM every time the source value changes Something like : .. . .. . I ve tried this but it doesn t work it s being evaluated before target gets its children : .. . .. . Would it be possibile at all .. . Answer : The binding behavior s bind method is invoked immediately before https : github.com aurelia-binding blob 1.0.0-beta.1.3.6 src binding-expression.js L86-L88 the binding instance applies the model value to the target element https : github.com aurelia-binding blob 1.0.0-beta.1.3.6 src binding-expression.js L99-L100 which explains why the div s children don t exist yet- the string markdown part of the binding expression hasn t been applied yet . I think an aurelia custom attribute would be a better fit for this use-case . Something like : .. . .. . Or even : .. . .. . Either of these would give you better control over the process .", "Question : In order to use a library I need to be able to bind to the for attribute of a UL element . This does not work : .. . .. . Based on testing I assume this is because ul elements don t normally have a for attribute . How do I work around this This was a trivial in Durandal knockout which I believed was something like : .. . .. . data-bind attr : for : data.id .. . .. . Do I really have to create a custom attribute Is this going to conflict with the built-in attribute used for label Any other obvious workaround Comment : No - it s a requirement of the library so it must be for getmdl.io components index.html menus-section https : getmdl.io components index.html menus-section Comment : That s helpful but I don t really buy the reasoning . There is plenty of valid aurelia attributes you can have that aren t standard on a UL element . I think a simple way to bind to arbitrary attributes should be included just like it was included in durandal knockout . Comment : I think this could be supported . Open a ticket in the templating-binding repo and someone should get back to you with suggestions for a PR . .. . Answer : Aurelia absolutely supports binding to ad-hoc arbitrary properties on a DOM element . When you write ul for id .. . ul Aurelia is going to assign the value of the id property to an ad-hoc property on the ul element . It s the equivalent of doing ul.for id or ul for id . The part you re missing is setting an arbitrary property on a DOM element does not automagically create a corresponding HTML attribute . In other words there s a difference between ul.for id and ul.setAttribute for id . This is easy to forget because we typically work with standard html attributes and the DOM has special logic to mirror the value of the HTML attribute with the corresponding DOM property . This special logic does not exist for arbitrary properties that you might add-in your code bindings . You can force the binding to use setAttribute instead of the standard behavior by creating a binding behavior : .. . .. . https : gist.run id feedfd7659d90c0bdf6d617a244288a6 .. . .. . set-attribute.js .. . .. . usage : Comment : This looks like a better solution than mine posted below since it can work for other attributes as well however I still think this is very unsatisfying . When I do id.bind id it sets the id attribute . When I do data-foo.bind id it sets the data-foo attribute . It is surprising and un-intuitive that the default behavior here is to set a property on the DOM element which doesn t even exist . Furthermore DataAttributeObserver is not in the docs or even the aurelia-binding.d.ts file . I still believe aurelia needs a better out-of-the-box solution for this . Comment : id is a built-in . Whether you use setAttribute id .. . or el.id .. . the DOM is going to sync the attribute value and the property value . Looking at this very narrowly with only your use-case in mind it may seem like the current behavior is undesirable . For other use cases the performance implications of calling setAttribute for no reason would be a deal-breaker . I do agree there should be more docs . It never hurts to have more docs . The DOM can be confusing . For example keeping your for attribute example but using a label element instead the property is htmlFor Comment : I see . I suppose data- works the same way as id Perhaps some sort of attr.bind syntax or similar would be useful . Comment : data- and aria- work because Aurelia can assume your intent is to bind to the html attributes in those two cases because they re well-known html attribute prefixes Comment : FYI I got the following javascript error while using this behavior when replacing a parent : viewmodel : Uncaught in promise TypeError : binding behaviorKey .unbind is not a function unbind @ aurelia-binding.js : 1266", "Question : I m building an app with Aurelia and really liking the framework so far but I ve stumbled upon an issue where I m trying to display a list of checkboxes whose values are numbers ID : s in reality and Aurelia seems to convert them to strings and thus comparison fails . I basically have something like : .. . .. . And in my view : .. . .. . For this to work I actually have to do this.selectedItems 0 2 which just leads to a bunch of other comparison problems in my own code . I also don t want to send the selected item as a string to the server later on when saving the data . I ve tried using a simple value converter that converts toString toView and parseInt fromView but I can t run this converter on the array of selectedItems : .. . .. . How would you go about solving this .. . Answer : You almost have it . There s one small problem with this part : .. . .. . The input element s value attribute coerces everything it s assigned to a string . Not only that a string interpolation binding eg .. . also coerces everything to a string . You need to preserve the numeric item id . Replace value item.id with model.bind item.id and it will work . No need for a converter . Coincidentally I just pushed https : github.com aurelia-binding commit 0719de3e3e45e51eaf935fe68b232808d7f61caf a set of exhaustive docs on checkbox radio and select binding to the Aurelia binding repo . They haven t been published to the official Aurelia docs app yet but they should be there on Tuesday . Also- if you see anything weird with items whose id is zero- there s a fix https : github.com aurelia-binding commit 9d39a1adee1175e44d20634593a297ba5cdc674a going out on Tuesday for that as well . Finally I know this is not your question but for others that land here looking for binding numbers in forms here s a couple basic examples using a custom-element and custom attribute : .. . .. . https : gist.run id d9d8dd9df7be2dd2f59077bad3bfb399 Comment : Oh man thank you so much Can you explain why I need to use model.bind as opposed to value.bind though I really liked Aurelia for its simplicity basically just adding .bind to any attribute you want to bind to this feels a little more Angular to me : Btw : The value item.id was actually a typo I was using value.bind in my code Comment : The html-input element s value attribute coerces everything to a string so we have to store it somewhere else to preserve the real value Comment : Alright : I ve now changed all my value.bind : s to model.bind : s and it works like a charm . However I also changed it on an input type range which completely stopped working . Do you know why it doesn t work the same for all inputs Is it because range already is numeric Comment : It s only for checkbox inputs radio inputs and option elements", "Question : in knockoutjs you can output the ViewModel in a nice json format for debugging .. . .. . if there is a way to accomplish the same in Aurelia .. . Answer : The closest I ve got is to define a Value Converter . So in json.js I have .. . .. . then in my view-model index.js I have my data : .. . .. . and finally the view index.hml binds and uses the converter : .. . .. . However I m stumped at the moment by the lack of live binding between the model and the HTML so this may not fully answer your question Comment : My binding doesn t work because Aurelia doesn t deep check for changes and pre textContent.bind . . should read pre text-content.bind . . Comment : Will you fix it", "Question : How can I pass an object to a custom component through an attribute in Aurelia My custom component class looks like this : .. . .. . And in an html file I use that component like this : .. . .. . This works fine for strings like title and subTitle but I m not sure how to pass an object to the component . Is this possible If so how can I do this in Aurelia .. . Answer : Use the bind command to bind a property to the element s title bindable property : .. . .. . or use the bind command in conjunction with an object-literal binding expression : .. . .. . Note : ES6 object-literal shorthand syntax is supported- assuming you have foo bar and baz props on your VM this would work :", "Question : Is there any analogues functions apply or digest in Aurelia How immediately call changes bindingValue My case : I have tree each node contain list of item screen 1 . I have parent component names : tree and node component names : node . Each node have a toggle button . When i m toggle my items parent component should know how changes content height . View : .. . .. . My parent component catch this event and check content size : .. . .. . .. . .. . Now code execute that : 1 this.current.children i .visible false when node collapse 2 Fire my event toggle-agents 3 Subscriber catch my event recalculate height 4 In depth at Aurelia ObserverLocator update my visible property in DOM and height changes . I need : 1 this.current.children i .visible false when node collapse 2 In depth at Aurelia ObserverLocator update my visible property in DOM and height changes . 3 Fire my custom event . 4 Subscriber catch my event and recalculate height when height content actually changes . .. . Answer : In Aurelia changes are immediately applied for the most part . Aurelia only uses dirty checking for computed properties properties with a getter function . If you wanted to manually invoke the dirty-checking you could do something like this : .. . .. . In practice this sort of thing is never needed in an Aurelia app . If you have specific bindings that you want to force to update you can use the signal binding behavior : .. . .. . Try to stay away from these two techniques if you can . If you re using this for something other than time-based bindings binding to something that uses Date.now or new Date or internationalization locale-changed events.. . you might not be doing it the Aurelia way . Comment : I m tried use signal technique but it s not yielded results . Maybe I m doing something wrong . I m added description of my case .", "Question : I have a view with button and event handler on button click that calls API and redirects to another view . I d like to disable this button when event click is triggered . When I use Aurelia binding .. . .. . and set .. . .. . button is still enabled for some time and a user could click this button again . I ve used a little workaround of it that looks not very good . .. . .. . Make ref for button with two-way binding .. . .. . Then I explicitly set disable for button . Comment : As I understand doSomeWork this.loading false doSomeWork ... . doing .. . you wana false to be true in second one doSomeWork . False can t be true this way . All fine with Aurelia .. . Answer : That s probably because Aurelia binding uses micro tasks which are slower than the DOM . Rather than manipulate the DOM in your code you should check the state of your loading property . Comment : Yep sounds good thanks :", "Question : Edit 3 : @jeremy-danyow suggested that .. . .. . html should be well formed : menu-item within ul is not correct using containerless attribute helps by removing the menu-item element .. . custom elements should always have a closing tag I have adapted the code . Also I made a plunker : Aurelia repeat.for binding on a custom-element https : gist.run id 0efbaea028450163d98e .. . .. . That plunker works provided a @bindable attribute .. . .. . Edit 2 : in this post I typed items in menuItems that s not correct it should be item of menuItems . But that was not the cause of my struggling I had it mis-typed in this post only -end edit .. . .. . Using Aurelia I am struggling with binding and repeat.for : suppose I have in my viewmodel with a property menuItems an array of MenuItem I would like to repeat the menuitems with a custom template : .. . .. . In my app template I use use a custom-element .. . .. . My custom template menu-item.html : .. . .. . Edit : I see in the output the html of templates repeated for as many there are MenuItems . But these items are not bound : the li is empty . I expected to see the labels . -End edit- .. . .. . What is the correct way the get the template bound or access the bound MenuItem I ve tried the following : label and item.label but that does not work . I can see in the bind bindingContext callback that bindingContext has a property item : bindingContext.item which is the MenuItem that is being bound . I also tried to create bindable attribute on the MenuItem class : .. . .. . and the following repeater : .. . .. . and a corresponding template .. . .. . This approach also does not work . Other explorations included not using a custom-element worked using compose view-model MenuItem model.bind item does not work in this example either and would be to elaborate I think . Working solution see also Aurelia repeat.for binding on a custom-element https : gist.run id 0efbaea028450163d98e : .. . .. . repeat and bind on a custom attribute of the template and viewmodel class : .. . .. . The viewmodel class : .. . Answer : Browsers only allow li elements inside ul elements . ul menu-item menu-item ul is invalid markup in the same way that ul div div ul is invalid markup . Consider making a menu element whose template contains the ul and it s li elements instead . One other thing- only a few standard elements are self closing - eg inputs etc . Custom elements must always have a closing tag . Bad : menu-item Good : menu-item menu-item .. . .. . You might be wondering why can t aurelia figure this out for me Valid question . Here s why : Aurelia does not implement a custom html parser . It uses the DOM to parse standard HTML . This is different than other frameworks folks might be accustomed to that implement custom parsers for non-standard markup syntaxes . Comment : Your suggestion about well structured html is helpful and to the point . In my real world application I use the containerless attribute or the @containerless decorator . Also the requirement of custom-element needing a closing tag is good to know . I ll edit the question . But the binding question remains open . Could you say anything about that", "Question : Here are the steps to reproduce the problem : .. . .. . 1 . mkdir and cd into it. . .. . 2 . npm init and accept the defaults .. . 3 . jspm init . . accept defaults except don t use a transpiler .. . 4 . jspm install aurelia-framework .. . 5 . jspm install aurelia-bootstrapper .. . 6 . Add an empty tsconfig.json file to the directory. . I ve tried many tsconfig settings to fix this problem but it works just the same with a simple configuration . I ve even tried various mutations of https : github.com aurelia skeleton-navigation blob master skeleton-typescript-asp.net5 src skeleton-navigation-typescript-vs tsconfig.json to no avail . 7 . tsc .. . .. . At this point you should stumble across the errors : jspm packages npm [email protected] aurelia-binding.d.ts 331 25 : error TS2304 : Cannot find name Map . jspm packages npm [email protected] aurelia-binding.d.ts 353 49 : error TS2304 : Cannot find name Map . .. . .. . I m guessing a dependency is missing In this repro you ll also see some TS2304 errors in other aurelia .d.ts files but I m not actually seeing those in my actual environment for some reason . I ve tried type adding the typings.json file from https : github.com aurelia skeleton-navigation blob master skeleton-typescript-asp.net5 src skeleton-navigation-typescript-vs typings.json and then issued typings install but that didn t change anything . Oddly enough it didn t even help if I tried typings install es6-promise --save . No matter what I try I always get the same errors when I run tsc .. . .. . For the record I m running the following versions.. . .. . .. . npm v3.9.0 .. . jspm v0.16.34 .. . tsc v1.8.10 .. . .. . Any help is greatly appreciated . Comment : Target ES6 in your tsconfig compiler-options or add the d.ts files for ES6 collections Comment : Just wanted to say Hey Alex missed ya Comment : @JeremyDanyow for the win . Comment : @basarat for the awesome . Comment : Also @JeremyDanyow post an answer and I ll award it to you . Can you give any tips for what I might have binged to discover that answer on my own I spent a fair amount of time trying to figure it out on my own but it seems like your solution came so easily . I m wondering if maybe I have a knowledge gap somewhere . .. . Answer : You can use the new --lib option --lib es6 to just use the lib file for ES6 and still keep your compile target to be ES5 . More .. . .. . More on lib option : https : github.com Microsoft TypeScript issues 6974 .. . .. . PS : its supported in alm https : github.com alm-tools alm", "Question : So I have a list of all users which populates the options of a select . And I have an incoming group record which has a list of users attached to it . I follow the cheat sheat http : aurelia.io docs.html aurelia framework 1.0.0-beta.1.0.2 doc article cheat-sheet instructions and bind it to a single index of the model . So the incoming user in the group is identical to one of the users in the list : .. . .. . But when the group is loaded and bound to the view the correct user is not chosen from the select . Actually I would expect this as JavaScript would look for referential equality . Ideally I d like Aurelia to find that the incoming record is as above and a search through the list of options testing equality b that I ve defined in some extension maybe a filter c select it in the list and d propagate that selection back into the record so that the record is now referentially in sync . I would rather not fall back to a trigger that manually does this because I will have lots and lots of these kinds of selects throughout my application . I would settle albeit sadly for a and c . Comment : github.com aurelia-binding issues 94 https : github.com aurelia-binding issues 94 .. . Answer : Specify a matcher function equality comparer : .. . .. . .. . .. . Below is the original answer before 11 30 2015 release .. . .. . .. . Until this is supported natively by aurelia s select binding I would try something like this : .. . .. . Here s a plunker : http : plnkr.co edit 15XHkQ p preview .. . .. . You ll probably want to make the converter generic so you can reuse it throughout your app.. . maybe something like this : .. . .. . Keep an eye on this issue https : github.com aurelia-binding issues 94 for updates on native framework support for this scenario . Comment : I used a variant on this pattern worked great . Comment : I ll have to try the updated pattern . Comment : tried it worked great good work jeremy", "Question : I have an aurelia application updated to the latest beta 1.0.0-beta.1.2.1 https : github.com aurelia framework releases tag 1.0.0-beta.1.2.1 at the time of this writing . This version of aurelia already uses Babel 6 and my application is based on the based on the ASP.NET 5 ES2016 navigation skeleton https : github.com aurelia skeleton-navigation tree master skeleton-es2016-asp.net5 . All of a sudden whenever I try to open my untranspiled javascript source files in Chrome Version 49.0.2623.110 m 64-bit Developer tools for instance main.js all I get to see is the html of Index.cshtml . It doesn t matter which javascript file I try to open it always shows the html of Index.cshtml instead of javascript . The transpiled files are displayed correctly in Chrome Dev Tools . I ve had this before but it usually meant I had a binding or templating error somewhere but in this case the application works perfectly so it probably has to do with the sourcemaps.. . Or does it My questions are : .. . .. . 1 . What is the best way to track down a subtle binding or templating error in Aurelia Everything I ve tried to do in my applcation works fine but I don t want to rule out this being my own fault just yet . 2 . In case it s not my fault has anybody come across this before What is the reason the sourcemaps are not working is it Aurelia is it Babel 6 s Is it Chrome s .. . .. . Update .. . .. . It doesn t seem to be a Chrome issue the same problem occurs in Edge . Update 2 .. . .. . By turning off Enable javascript sourcemaps on Chrome Developer Tools I can debug de transpiled code . The transpilation gulp tasks I m using are copy pasted from the version mentioned above . Has anybody else come across this issue Comment : Sounds like your web server isn t serving the source properly . Not sure why but the body of the response would probably be more telling . Comment : @PWKad good call I ll try and add the body of the response here . Comment : @PWKad The body of the response is of course the transpiled js file sorry . It s when I try to open the untranspiled raw source that I get html . .. . Answer : Ok I think I ve found the problem . I changed includeContent to true for sourcemaps.write in the build-system gulp task defined in build tasks build.js so that line 23 of that file looks as follows : .. . .. . This comes set to false in the navigation skeleton so more people should have this same issue . Anyhow this seems to have solved the problem . I also removed the sourceRoot : src parameter in that call as it is only necessary when includeContent is false .", "Question : Situation .. . .. . We have been able to pass an array from the parent screen to the template . The customAttribute works but the historyItems does not . parent-template.html .. . .. . child-template.html .. . .. . child-template.ts .. . .. . Question .. . .. . How can we pass the historyItems array .. . Answer : You have to use history-items.bind history 0 .HistoryItems . By convention Aurelia hyphenates custom-element names and bindable property names that have mixed casing . That is because HTML is case-insensitive so an expression like historyItems.bind wouldn t be different than historyitems.bind . However the same is not valid for JavaScript which is case-sensitive . See https : github.com aurelia-binding issues 307 .. . .. . In short for mixed case properties you must use a hyphen to split words :", "Question : I am trying to render my aurelia view dynamically using compose within repeater and it is working fine but my two-way binding not working . The view that is getting rendered using compose element doesn t update the property of parent view model . my code for parent view js file is .. . .. . my parent html is as below . In this html i got custom-element on which my two binding works but not with compose .. . .. . My child view model .. . .. . and child view html is .. . Answer : I know the issue now . I am passing simple property into my compose which doesn t gonna work . It has to be an object", "Question : I am starting with a simple TODO app with Aurelia RethinkDB Socket.IO . I seem to have problem with re-rendering or re-evaluating an object that is changed through Socket.IO . So basically everything works good on the first browser but doesn t get re-rendered in the second browser while displaying the object in the console does show differences in my object . The problem is only on updating an object it works perfectly on creating deleting object from the array of todo items . HTML .. . .. . NodeJS with RethinkDB changefeeds .. . .. . Aurelia code watching Socket.on .. . .. . The socket.on todo update .. . is not making the second browser re-render but showing the object in the console before after update does show differences in the object itself . I even changed the todo title property and that too doesn t get re-rendered . How can I get Aurelia to re-render in my second browser with the new object properties Don t be too hard on me I m learning Aurelia RethinkDB NodeJS Socket.IO all the same time.. . .. . Answer : Aurelia observes changes to the contents of an array by overriding the array s mutator methods push pop splice shift etc . This works well for most use-cases and performs really well no dirty-checking extremely lightweight in terms of memory and cpu . Unfortunately this leaves one way of mutating an array that aurelia can t see : indexed assignment.. . eg myArray 6 foo . Since no array methods were called the binding system doesn t know the array changed . In your case try changing this : Comment : Fantastic the explanation are exactly what I wanted to know and stays out of dirty checking.. . is that document somewhere by any changes This information is gold :", "Question : null .. . Answer : NOTE : This scenario is the same as the one from this question : Data binding parent-child relationships in Aurelia http : stackoverflow.com q 35560880 16241 .. . .. . The Code : .. . .. . usage : .. . .. . widget-picker.js .. . .. . widget-picker.html .. . .. . The Problem : .. . .. . I am trying to build a componentized UI and have a single control element that controls selecting a Widget widget-picker . But I also need to have breeze know that shipment.widget is required and show it on the widget control . But there are two things blocking this . 1 . In aurelia-validation.js the subscribe method only looks at the bindings on the view that has the breeze-validation custom attribute . This could easily be fixed by looking at the view s controllers views and get the bindings on that : .. . .. . this.view.controllers.forEach function controller if controller.view controller.view.bindings.forEach function binding existingListOfCurrentViewsBindings.push binding .. . .. . 2 . But because shipment.widget passes through an @bindable it does not have a source property . This means that even if aurelia-validation had looked at the child custom elements the current method of finding the breeze property would fail . The Question : .. . .. . Is there a way to get aurelia-breeze to support validating into custom elements on the control that failed .. . .. . NOTE : I could just have the validation show up in a general validation area but since most of my UI runs as custom-elements I would have almost all my UI that way . This is not nearly as user friendly as something near the control that has failed . Comment : aurelia-validation is in the middle of a rewrite that will enable this type of scenario . Much of the validation presentation logic in the aurelia-breeze plugin will be removed and instead you ll be able to plug breeze validation into aurelia-validation Comment : @JeremyDanyow cool good to know . any rough estimate when validation lib will be ready Comment : we re targeting having it ready within the next week or two", "Question : In my application I have made a lot of services which I can inject in my viewmodels to save som redundancy and time . Now I m looking to take it 1 step further and make those form elements select text checkboxes - a select dropdown for starters and turn them into custom elements injecting the service in only the custom-element . I can get it working to some extent . The custom-element select in this case is showing when I require it in the parent view however when I change the selected value of the custom select element it does not bind to the parent viewmodel which is my requirement . I want to be able to bind my selected value from the custom-element to a property on the parent viewmodel via the bind attribute in it s template . I ll update which a little code snippet in a few minutes . create.js what I refer to as parent viewmodel .. . .. . create.html parent view .. . .. . my-custom.js .. . .. . What happens is initially the create.html view outputs initial value and as I change the value of the custom-element select the newly selected value gets alerted out but it does not update the bound parent variable which is still just displaying initial value . .. . Answer : There are a couple of issues here : .. . .. . 1 . You need to kebab-case any property names in the DOM due to case-insensitivity .. . .. . selected-value.bind property .. . .. . not .. . .. . selectedValue.bind property .. . .. . 2 . You need to bind two-way . When creating a @bindable using the decorator one of the arguments is BindingMode which you use to set the default binding-mode . Aurelia sets some sensible defaults e.g . the default for input value.bind . . is two-way without being explicit .. . .. . If you don t want to set a default binding-mode you can just be explicit with your binding : .. . .. . selected-value.two-way prop .. . .. . Hope this helps : .. . .. . Edit : I think the API changed a little after this answer . The @bindable decorator has the following sig : .. . .. . One of the best places to check for quick reference is the Aurelia cheat-sheet in the docs : .. . .. . http : aurelia.io docs.html aurelia framework 1.0.0-beta.1.2.4 doc article cheat-sheet Comment : Wow thanks so much . What an amazing answer . Actually the snake-case thing was just a typo in the sample code but the .two-way did all the difference : D Can I ask you what you prefer - decorator or .two-way Comment : You should set the default binding-mode to what other people or yourself would expect it to be . I d say set it to two-way by default in this example as it s the most natural use of your control - you d almost always want selected-value to bind two-way . This is the way Aurelia uses conventions and it works well . Comment : +1 and thanks for the snake-casing mention . I didn t see that mentioned in docs as the example were one word variables . Going crazy trying to figure out a binding wasn t worked when it was done just hte same as the others . Comment : What s the syntax for passing in the BindingMode to the @bindable decorator I m having a hard time finding documentation on that . Would it look like @bindable selectedValue two-way or maybe @bindable two-way selectedValue or @bindable selectedValue BindingMode.twoWay Comment : @bindable defaultBindingMode : bindingMode.twoWay etc . Best place is cheat sheet in Aurelia docs : aurelia.io docs.html aurelia framework 1.0.0-beta.1.2.4 doc http : aurelia.io docs.html aurelia framework 1.0.0-beta.1.2.4 doc article cheat-sheet", "Question : Custom elements allow you to access the inner html of the custom tag when it is used via the content content selector along with some specification for which content is pulled into this view . I d like to be able to access this data in my class without wrapping the tag . I tried the following : content ref content content and this.content to reference it following the databinding ref attribute http : aurelia.io hub.html doc article aurelia framework latest cheat-sheet 5 strategy Rob Eisenberg favors but console.log this.content yields undefined at every phase in the element lifecycle . A workaround I thought of was to place the content-tag in another element pull out the text using jquery cache it and remove that element via ref attribute but this seems inelegant . How can I access this data in the es6 class associated with the custom-element Example scenario : .. . .. . some-view.html .. . .. . customelement.html .. . .. . customelement.js .. . .. . In this example the custom-element could be assumed to be included globally . Comment : would the @processContent decorator work for you aurelia.io hub.html doc article aurelia framework latest http : aurelia.io hub.html doc article aurelia framework latest cheat-sheet 9 not sure if I fully understand your scenario- consider adding an example showing the intended usage of your custom-element . Comment : @JeremyDanyow Looking at the docs I m not sure how to proceed and how the process function would look given those parameters . I ve updated my question with a minimal example hopefully this clears it up .. . Answer : We no longer use the content element . As of the RC we use the slot element . That being said the slot element doesn t support the ref binding as the slot element kinda disappears and is replaced with the content being projected . This is because in the Shadow DOM spec slot s aren t actually elements they are processing instructions . Comment : Okay no problem . How do I access the data without using either a content-tag or slot I d prefer to grab the content without modifying the DOM of the output .", "Question : In playing around with Arelia I created a table with a repeating table row and added a select element bound to a service . When I select an option from the select I want to populate the description field with the value from the property object . How can I accomplish this It looks like I can use a value converter - when the toView gets hit in the debugger I can see the correct product and see the description . So how do I then take the value and inject it into line.description Here s a sample of what I m trying to make : .. . .. . My js looks like Comment : Possible duplicate of Binding a select to an array of objects in Aurelia and matching on ID http : stackoverflow.com questions 33920610 binding-a-select-to-an-array-of-objects-in-aurelia-and-matching-on-id .. . Answer : If I understand the question correctly the goal is to have select element select the OrderLine instance s productId and description . Try changing your select s value binding to something like this : Comment : isn t there a built-in matcher function for this purpose Comment : the matcher is used to compare two values and return true false they are equal . I think the OP s question is how do I assign two properties when a selection is made . If I m reading it correctly", "Question : I have the latest version of Aurelia although I believe it had been fixed last year https : github.com aurelia framework issues 35 I am still having issues . Does anyone else have this issue Custom Element : .. . .. . Place referenced : .. . .. . HTML Generated : Where has the input gone enter image description here http : i.stack.imgur.com fnapg.png .. . .. . enter image description here http : i.stack.imgur.com ysI1q.jpg .. . Answer : The CE needs closing off correctly .", "Question : In order to use a library I need to be able to bind to the for attribute of a UL element . This does not work : .. . .. . Based on testing I assume this is because ul elements don t normally have a for attribute . How do I work around this This was a trivial in Durandal knockout which I believed was something like : .. . .. . data-bind attr : for : data.id .. . .. . Do I really have to create a custom attribute Is this going to conflict with the built-in attribute used for label Any other obvious workaround Comment : No - it s a requirement of the library so it must be for getmdl.io components index.html menus-section https : getmdl.io components index.html menus-section Comment : That s helpful but I don t really buy the reasoning . There is plenty of valid aurelia attributes you can have that aren t standard on a UL element . I think a simple way to bind to arbitrary attributes should be included just like it was included in durandal knockout . Comment : I think this could be supported . Open a ticket in the templating-binding repo and someone should get back to you with suggestions for a PR . .. . Answer : I ended up creating an attribute for this . Usage : .. . .. . ul mdl-for.bind id .. . ul .. . .. . This kind of scenario may be supported in a future release : https : github.com aurelia templating-binding issues 94" ] }
[ "yes-answer-long", "yes-answer-short" ]
javascript
UNK_RELATION
excel-web-query@web@61
excel-web-query -- excel-web-query internet inquiry iqy - a @placeholder query is a feature in excel that allows you to retrieve data stored on an intranet the internet or the world wide web .
{ "confidence": [ 77.63491821289062, 75.97576141357422, 68.20579528808594, 67.66441345214844, 63.85200119018555, 60.27373504638672, 60.010738372802734, 59.55928039550781, 59.36354446411133, 58.481170654296875, 58.481170654296875, 58.481170654296875, 56.861148834228516, 55.86476516723633, 55.791473388671875, 53.99375534057617, 52.96056365966797, 52.64560317993164, 52.33790588378906, 52.10439682006836, 51.27547073364258, 50.4862174987793, 50.15784454345703, 49.452640533447266, 49.452640533447266, 49.210147857666016, 48.823368072509766, 48.823368072509766, 48.39266586303711, 48.33228302001953, 48.01738357543945, 47.46452713012695, 47.18924331665039, 47.175010681152344, 47.127845764160156, 46.88173294067383, 46.6309814453125, 46.424198150634766, 46.292442321777344, 46.26616287231445, 46.026451110839844, 45.61912155151367, 45.36850357055664, 45.24760818481445, 45.24760818481445, 45.010963439941406, 44.52925491333008, 44.32707595825195, 43.53022384643555, 43.104637145996094, 43.06932830810547, 43.06932830810547, 42.96997833251953, 42.84128952026367, 42.16370391845703, 42.098018646240234, 40.899654388427734, 40.79169464111328, 40.630584716796875, 40.54562759399414, 40.54368591308594, 40.243438720703125, 40.224151611328125, 40.224151611328125, 40.21910095214844, 39.77144241333008, 39.69170379638672, 39.69170379638672, 39.69170379638672, 39.42903137207031, 39.16274642944336, 39.01056671142578, 38.48798751831055, 38.32513427734375, 38.28251647949219, 38.253013610839844, 37.919273376464844, 37.91325378417969, 37.83729553222656, 37.78249740600586, 37.75006866455078, 37.75006866455078, 37.068931579589844, 36.939823150634766, 36.81818389892578, 36.81818389892578, 36.65812301635742, 36.43620300292969, 36.35454177856445, 36.29254913330078, 36.2172737121582, 35.93896484375, 35.93896484375, 35.93896484375, 35.74155807495117, 35.592010498046875, 35.472434997558594, 35.472434997558594, 35.472434997558594 ], "content": [ "I m trying to implement a page that allows Excel users to use the data it provides via the Web Query feature provided by Excel .", "This means you cannot use Excel Web Query .", "Excel Web Query Window http : i.stack.imgur.com 1RBiK.png", "I am trying to load a table data into excel using web query .", "Is there a way to get Excel 2007+ to refresh a web query automatically", "Is there a way that excel can automatically show edit web query window every time the excel file is opened so the users can provide username and password", "I can run the Web Query from excel spreadsheet but when I put into VBA then it gets no data .", "See my answer on this question : How can I post-process the data from an Excel web query when the query is complete", "How can I escape these characters in my web query .iqy file", "The website I am trying to Excel web query is http : www.hkexnews.hk sdw search search sdw.asp .", "We want our users to be able to access this page via excel by using web query .", "I m trying to use excel-web-query to to get the production firm name of all the movies in my list .", "I want to execute a bunch of functions every time a refresh happens on the web query i have on the same excel file .", "In Excel go to Data Get External Data Run Saved Query .. . 6 .", "I have a html web page at work that I want to query data from tables into excel-2007 .", "http : stackoverflow.com questions 32974553 how-can-i-post-process-the-data-from-an-excel-web-query-when-the-query-is-comple 32974554 32974554 .. . .. . The tradeoff of that approach is you have to manage processing the data you get back yourself - Excel won t put it in a given destination for you .", "it is tricky to automate the Login via Excel Web queries .", "I am trying out webpage parsing to fetch some data from the webpages in Excel using Excel Web Queries .", "The query works within the macro as long as I don t close out of excel .", "Information is from a web query .", "However if you download Microsoft s Excel Power Query Add-in or use Excel 2016 then I found that it detects the table correctly .", "If you are using Excel 2010 or above this might be easier with Power Query", "The web query is fetching data every 10 mins and a pivot sits on the data .", "Does anyone have a way that I can use a web query or another automated VBA way to import the full html code of a page into an excel page", "We have a web query on an Excel worksheet that goes to MoneyFacts Moneyfacts website http : www.moneyfacts.co.uk for the latest Bond ISA savings rates .", "I am using excel s web query feature for the first time .", "Problem 1 : The web query does not return data until the form is closed .", "I m download stock data for about 500 stocks using a Web Query .", "Browser : Internet Explorer 9 .. . .. . Excel : Microsoft Excel Standard 2010 .. . .. . These are set by my company and cannot be upgraded or bypassed .", "I m having some trouble with two different web queries in Excel .", "Have you tried Import Data from Web page option under DATA tab option in excel for a start", "I have am getting many tables from a web page to Excel using Web Queries .", "I am trying to write a macro in VBA that will pull data tables a number of web pages into excel .", "Excel Web Query Window http : i.stack.imgur.com BmJvQ.png .. . .. . The little yellow selection arrow is only appearing in the top-left corner of the page and not alongside each table .", "In other words to do something like Web query get table not navigating to website but get data from Internet Explorer Application after the button is clicked .", "Each time we chose entered the data and the web query refreshed .", "If I add the url as web query it will be redirected to the login page which is good .", "After downloading powery query simply go to the Power Query tab instead of data and select from web and enter the website .", "But if I go into the Excel Data ribbon select From Web and then go to http : my.url.com in their mini web browser I am prompted for userid and password .", "I am trying to extract data from the web using a web query .Add Connection Destination sql .", "When i reenter excel it seems the cookie is lost and it does not work unless i login to yahoo via the query interface .", "I am running a web query for an Excel sheet and have been able to pull data correctly however I want to reference a cell that can be changed in the worksheet .", "This jsFiddle http : jsfiddle.net CS98V contains the following code : .. . .. . CSS .. . .. . HTML .. . .. . I am pulling this into Excel with the following query file paste into notepad and save with .iqy extension to run : .. . .. . My question is if and how can I apply Excel theme styles to the rows", "The table is not in a good format for excel from web in the data tab from my test .", "Type in the address of a web service that I know returns a valid response select the returned xml and the data appears in Excel .", "I now have to run this web query 800+ times .", "You could consider the following : .. . .. . For each stock create a worksheet which contains a web query to that stock s web page .", "extract the data from a web service using post data but also ensure excel correctly interprets the comma delimited format", "If you want full access to the results of the web call you could open the URL as another workbook instead of using a Web Query .", "Have tried using the encoded values of the characters but still no luck in opening the iqy file in excel .", "If to use Web query it shows the website without button pressed .", "Edit 1 : Used VBA instead of web query and its working fine .", "I have a web service that produces a large amount of CSV data which I need to import into excel-2013 .", "The stock ticker value is then passed to a web query that connects to yahoo-finance and retrieves data from the site .", "The Excel Query will load the page but either will not display the selection arrow on the box I need or it wont load the necessary pieces of information at all .", "I came across web queries option in excel just an hour ago so please pardon my naivety .", "http : chandoo.org wp 2015 08 21 import-web-data-power-query", "Turns out when this is included the Web Query table selecting option breaks .", "Is there any way I can use Excel to automate the process of capturing such data", "I am looking to use Excel s Web Query feature to give users access to constantly changing datasets .", "When I save the file in Mac OS Plain Text Format it s greyed out in the Excel Run Saved Query dialog and can t be selected .", "it gives the initial login page into excel but not the page with data .", "Now the part that makes me wonder is this : .. . .. . This issue occurs when Excel cannot initiate a connection because of the settings on the secure Web server .", "See Different Ways of Using Web Queries in Microsoft Office Excel 2003 http : msdn.microsoft.com en-us library Aa203721 as a starting point .", "for example following query will create a new column A and the data from A column will now be in Column B .. . .. . is it possible that the destination of web query remain fixed lets say A1", "If you authenticate via the Web Query interface then it sets the proper cookie and you can automate .", "But it always puts the webquery in the same cell I recorded the macro on not the in the cell next to the cell I select for the web query .", "If I have a web query connection established what s the best way to update the URL and refresh the connection with VBA", "So far I have been able to record a macro where I create a web query for a single page table .", "I find the answer and I am really happy and posting for those who are looking for the same question you can get your answer through this link.. . .. . .. . http : www.dummies.com how-to content using-a-web-query-to-load-tables-in-excel-2011-for.html comments", "For danielsoper the results are generated via ASP so you won t be able to get them form a web query .", "So by not sending these headers Excel was suddenly able to access the data :", "Then I am to navigate to several sub accounts and download-as-Excel or copy-paste into an Excel tab gobs of historical data in table form-for me to then manipulate via standard Excel functions .", "Convert the query to a function query e.g .", "If anyone out there would like to offer some other avenue to web-scraping dynamic pages using vba for excel I am all ears .", "If possible we don t want to use vba in excel book as customers will have to either use the excel we provide or knows how to type in the vba code .", "It works fine with Excel 2010 but not with 2013 .", "I have created a webquery in excel which fetches data from the webpage in Excel file .", "For the past few hours I have been attempting to figure out how to collect some piece of information using Excel Query from a website but I have failed miserably .", "The server-side web framework PHP5 Expression Engine 1.6.7 was sending a Pragma : no-cache on every request even though my web-query results page set Pragma : public I guess the framework overrode it .", "I would expect that pulling down a text file the Text parameter from the web should be faster than a URL query .", "PS : I tried to open a web browser connect to it and then run the .. . .. . with required query parameters .", "How to load CSV data into Excel 2013 using https with basic-authentication", "Select Data From Web .", "I am not very fluent with excel programming only simple scripts .", "I m not sure how to write the excel-formula that will achieve this goal .", "I am having a hard time finding good documentation for this really handy feature of Excel .", "I had the same issue once in one of my solutions I had to refresh the Web Query results within some macro execution via VBA .", "However if I close and open the excel workbook again the worksheet actually shows the login page not the data page .", "This reads the IE7 cookie cache and I re-POST the data to connect to the server s security by clicking retry when it says the web query returned no data .", "I want to be able to specify the year in the query using a cell replacing the myParm with a cell value and refreshing on change can do it with excel native need to know how to do it with powerquery .. . 2 .", "In excel still the login page is getting copied .", "I mean running above populates table in excel .", "Excel uses different cookies than IE .", "2 Get the data from the web site .", "you want to access the excel webquery and use it in c", "I m calling the following login script before I continue with the web query set reference to XML library .", "Are there specific settings that must be used when marking up an HTML table to be compatible with Excel s Web Query tool", "I compared my code with the code of another webpage where the tables were highlighting properly in Web Query ." ] }
{ "confidence": [ 83.79656219482422, 72.29806518554688, 71.58512878417969, 70.33731079101562, 70.01718139648438, 67.77091217041016, 67.76734924316406, 67.53308868408203, 66.30511474609375, 64.68452453613281, 63.52433395385742, 63.296592712402344, 62.64352035522461, 62.014183044433594, 61.477806091308594, 61.40752410888672, 61.148292541503906, 61.06125259399414, 61.05425262451172, 60.73641586303711 ], "content": [ "Question : null .. . Answer : I am trying to load a table data into excel using web query . The URL used has special-characters in the parameter names . Have tried using the encoded values of the characters but still no luck in opening the iqy file in excel . Throws invalid file-format error . Example URL : https : app.com servers details test OpenEmails dateFrom Start Date Enter the start date OpenEmails dateTo End Date Enter the end date http : Example 20URL .. . .. . Encoded values of the characters used : .. . .. . Also used the escape character . How can I escape these characters in my web query .iqy file Edit 1 : Used VBA instead of web query and its working fine . Comment : Have you tried the entities for brackets 91 and 93 Comment : @SammyB : Yes I did . No luck with them as well .", "Question : null .. . Answer : We have a url say : http : www.example.com myexcelbigdata data.aspx which requires authentication . We want our users to be able to access this page via excel by using web query . If I add the url as web query it will be redirected to the login page which is good . Then I type in username and password and login myexcelbigdata data.aspx will be displayed again . However if I close and open the excel workbook again the worksheet actually shows the login page not the data page . Is there a way that excel can automatically show edit web query window every time the excel file is opened so the users can provide username and password If possible we don t want to use vba in excel book as customers will have to either use the excel we provide or knows how to type in the vba code .", "Question : null .. . Answer : I am having a hard time finding good documentation for this really handy feature of Excel . Please see the below code and jsFiddle for reference . This jsFiddle http : jsfiddle.net CS98V contains the following code : .. . .. . CSS .. . .. . HTML .. . .. . I am pulling this into Excel with the following query file paste into notepad and save with .iqy extension to run : .. . .. . My question is if and how can I apply Excel theme styles to the rows I understand how to style them with CSS but I am looking to style them using the user s defined theme specifially I want to set THEAD to Excel s Header 4 style and the TFOOT to the Total style .", "Question : I m trying to implement a page that allows Excel users to use the data it provides via the Web Query feature provided by Excel . It s all working out pretty nicely as long as I use HTTP even BASIC user authentication works . As soon as I switch that over to HTTPS Excel won t download the data anymore it s even a fully official SSL certificate so it s not a problem with a self-signed one . This Microsoft knowledge base article http : support.microsoft.com kb 290347 EN-US pretty much describes the problem . Now the part that makes me wonder is this : .. . .. . This issue occurs when Excel cannot initiate a connection because of the settings on the secure Web server . This seems to imply that there is some way to get this working but there s not even a hint at the direction I need to look at . Should the because of the settings on the secure Web server be taken at face value or is it just a Microsoft way of saying this won t work unless you buy the right software from us Comment : Did you try their test in the More information section Comment : Yes it couldn t open it either . But that really doesn t tell me anything new . Comment : I think it may tell you you re out of luck . Are there warnings of any kind when you look at the HTTPS information in IE Comment : @Matthew : no IE and all other browsers displays the page just fine without any warnings . Even the almost-browser-dialog that pops up in Excel displays the page correctly . .. . Answer : Joachim s answer solved the problem for me . The server-side web framework PHP5 Expression Engine 1.6.7 was sending a Pragma : no-cache on every request even though my web-query results page set Pragma : public I guess the framework overrode it . Once I removed it everything started working . IE and Office behavior for Pragma : no-cache is similar to that described in MS KB Article : Internet Explorer is unable to open Office documents from an SSL Web site http : support.microsoft.com kb 316431 .. . .. . See also this caching tutorial s Warning : Pragma no-cache Deprecated http : www.websiteoptimization.com speed tweak cache . With this in mind I set Expression Engine Output and Debugging Generate HTTP Page Headers option to No . Other frameworks have similar config options . But some of the other automatically sent headers were needed for successfully caching the rest of the site so I opted for commenting out the Pragma : no-cache lines in the framework source code . If you do not have the option of modifying the HTTP headers sent by your web server framework the only MS-Office-client-side-only option will be to use VBA macros to automate an Internet Explorer component to get around Office s caching behavior . See Different Ways of Using Web Queries in Microsoft Office Excel 2003 http : msdn.microsoft.com en-us library Aa203721 as a starting point .", "Question : null .. . Answer : I ve made an Excel Vba code that downloads tables from different pages of the website using Web queries but now I want to change it to do the following : .. . .. . 1 . Navigate to Website now I do this by creating New Internet Explorer Application .. . 2 . Click a button after doing this the needed information is shown in the proper way .. . 3 . Get table that contains needed information after the button is clicked and put the data into Excel . I ve done the first and the second steps but I don t know how to do the third step . If to use Web query it shows the website without button pressed . This is a part of the new code without third stage : Comment : Does your URL has php variables you can get the results easier and it in lesser time and code . Comment : In other words to do something like Web query get table not navigating to website but get data from Internet Explorer Application after the button is clicked . No the website is in ASP but I ve already tried passing variables in URL and it doesn t show the result as-if to click a button", "Question : I am using Excel VBA s WebQuery using something similar to this example : This example is actually copy-pasted from here : http : support.microsoft.com kb 213730 and I am using a different URL with different POST arguments .. . .. . I need to be able to make particularly large queries for example let s say I m getting stock price information for 20 000 securities and when I do so Excel locks up and doesn t display any progress while it is working although the query does successfully complete . Using this syntax is there any way to get access to the stream of data as it is coming in This would help in 2 ways : I could process data in smaller chunks as it is received and I could create a progress meter to display to the user . Thanks . .. . Answer : If you want full access to the results of the web call you could open the URL as another workbook instead of using a Web Query . See my answer on this question : How can I post-process the data from an Excel web query when the query is complete http : stackoverflow.com questions 32974553 how-can-i-post-process-the-data-from-an-excel-web-query-when-the-query-is-comple 32974554 32974554 .. . .. . The tradeoff of that approach is you have to manage processing the data you get back yourself - Excel won t put it in a given destination for you . But it sounds like that s maybe ok with you It s a synchronous call but you do get a progress-bar so the user-experience is better . We ended up going this route after we tried something pretty similar to what you seem to have been doing . Comment : Not a bad hack. . Where were you 4 years ago when I was working on this project : We ended up going in an entirely different direction Comment : Ha Sorry : Turns out I was running in the same direction just oh 4 years or so behind you . Comment : Dunno if you saw but someone actually came back with the real answer http : stackoverflow.com a 32975304 3782 to this question . Go figure . :", "Question : null .. . Answer : The website I am trying to Excel web query is http : www.hkexnews.hk sdw search search sdw.asp . Where I need to input stock code E.g . 1237 and press search button to get the search result . However parameter is not shown in the link . Is there any way I can use Excel to automate the process of capturing such data Comment : A POST request with Content-Type application x-www-form-urlencoded is used to submit the form-data in this page . This means you cannot use Excel Web Query . What you want can be automated in VBA . Search how to execute a POST request in VBA using WinHttpRequest . Use Fiddler http : www.telerik.com fiddler to understand what kind of data you need to submit in the body of the request . Comment : Thanks for showing the direction", "Question : I m extracting data from a site using excel powerquery the site is http : www.timeanddate.com holidays south-africa 2014 .. . .. . The web table presents dates in the format mmm dd so .. . .. . Jan 01 .. . Mar 20 .. . Mar 21 ...etc . To get results for different years I can invoke a prompt to request year input and replace the relevant value in the URL as follows .. . .. . However - without the year specified in the web results table when imported into excel it understandably plonks its own values in Excel native just uses current year being 2015 powerquery interprets the info completely differently alla such .. . .. . 2001 01 01 .. . 2020 03 01 .. . 2021 03 01 .. . .. . herewith the questions : .. . .. . 1 . I want to be able to specify the year in the query using a cell replacing the myParm with a cell value and refreshing on change can do it with excel native need to know how to do it with powerquery .. . 2 . I want to be able to replace the year value on the resultant year column data with whatever is in the aforementioned cell .. . Answer : Another solution from Colin Banfield .. . .. . 1 In Excel create a table with Year as the column name and enter the year as the row value . Then create a query from the table . Your query should have one column and one row value . Name the query appropriately and save . 2 Get the data from the web site . Assume we name the query HolidayTable . Convert the query to a function query e.g . 3 Add this function as a new column in the step 1 query and add a new date custom column . After a couple other transformations column reorder column removal you should end up with a query that looks like the following : .. . .. . Notes : .. . .. . a The first two lines are from the original table query in step 1 . b The Added Custom step adds a new custom column which passes the value in the Year column to the HolidayTable function .. . .. . c The Added Custom1 step adds a new custom column that creates a new date from the value in the Year column and the month and day values from the original Date column .", "Question : I m trying to implement a page that allows Excel users to use the data it provides via the Web Query feature provided by Excel . It s all working out pretty nicely as long as I use HTTP even BASIC user authentication works . As soon as I switch that over to HTTPS Excel won t download the data anymore it s even a fully official SSL certificate so it s not a problem with a self-signed one . This Microsoft knowledge base article http : support.microsoft.com kb 290347 EN-US pretty much describes the problem . Now the part that makes me wonder is this : .. . .. . This issue occurs when Excel cannot initiate a connection because of the settings on the secure Web server . This seems to imply that there is some way to get this working but there s not even a hint at the direction I need to look at . Should the because of the settings on the secure Web server be taken at face value or is it just a Microsoft way of saying this won t work unless you buy the right software from us Comment : Did you try their test in the More information section Comment : Yes it couldn t open it either . But that really doesn t tell me anything new . Comment : I think it may tell you you re out of luck . Are there warnings of any kind when you look at the HTTPS information in IE Comment : @Matthew : no IE and all other browsers displays the page just fine without any warnings . Even the almost-browser-dialog that pops up in Excel displays the page correctly . .. . Answer : It seems I ve found the problem : .. . .. . MS Excel seems to be unable to use the data on the page if the HTTP headers of the page specify that it should not be cache and it is transfered via HTTPS the same headers sent via HTTP seem to get ignored . So by not sending these headers Excel was suddenly able to access the data :", "Question : I am trying to import data from a website on my worksheet but when I click on import data from a new database query it shows an error of saying : .. . .. . Microsoft Query is not installed .. . .. . I have searched every where but could not find the solution . Please help me out. . .. . Answer : Both jonaz s method and User 2413421 s reference at dummies.com work for me if the query file is in SimpleText Format i.e . MS-DOS plain text with CR LF line delimitation . When I save the file in Mac OS Plain Text Format it s greyed out in the Excel Run Saved Query dialog and can t be selected . I haven t found a way to save in MS-DOS format from Pages or TextEdit but it s easy enough to do in Word for Mac 2011 . My queries work fine without the .iqy suffix described at dummies.com .", "Question : In VBA I am trying to leverage WebQuery for a tool I am writing that retrieves financial data . I create a WebQuery with similar code to this : .. . .. . The problem I am coming across is that my.url.com requires a Basic Authentication https : en.wikipedia.org wiki Basic access authentication userid and password . If I simply run this code I get a Runtime Error 1004 it does not prompt for authentication credentials . But if I go into the Excel Data ribbon select From Web and then go to http : my.url.com in their mini web browser I am prompted for userid and password . After closing this window and then re-running my VBA code without changing anything the query works . But upon closing Excel and re-running it fails again unless I go through this extremely ugly manual authentication step . Even if I have told Internet Explorer to save these credentials permanently . How can I get VBA to programmatically authenticate a WebQuery with Basic Authentication so I don t need to take this extra step Edit : Either this or is there a setting within Excel to force this prompt to happen regardless of how the WebQuery was initiated I am using Excel 2010 32-bit on Windows 7 but my target users might be using a variety of Excel versions all on Windows . .. . Answer : If you want to use QueryTables authentication is tricky . So much so that it s not even worth it IMO . Excel uses different cookies than IE . So even if you authenticated via IE the QueryTable wouldn t recognize it . If you authenticate via the Web Query interface then it sets the proper cookie and you can automate . The right way is to avoid the QueryTable and do it all yourself through the MS XML object library . Create an HTTP Request object send a POST request etc . If it s not RESTFUL I think you have to use a HTTPServer object . See JP s comment at http : dailydoseofexcel.com archives 2011 03 08 get-data-from-website-that-requires-a-login for more information on using XML . Of course that s a lot more work because you have to do all the stuff the querytable would normally do . And you have to handle refreshes if you want that function . Comment : Yeah this is entirely something I m doing to be able to Refresh simple requests in the background without rewriting it in VBA and probably screwing something up . It s part of a larger codebase that already uses MSXML for non-refreshing requests which works fine .", "Question : null .. . Answer : Is there a way to get Excel 2007+ to refresh a web query automatically Scenario : I create a spreadsheet . Select Data From Web . Type in the address of a web service that I know returns a valid response select the returned xml and the data appears in Excel . However when selecting the data just imported clicking on Data Connections Properties and ticking Refresh Every 1 Minutes the spreadsheet does not refresh every minute as it should - it does not refresh at all . However the data can be refreshed by manually right clicking and selecting refresh . This is not the case for data that is imported from a database using a DSN to connect it only happens for data from the web .", "Question : I came across web queries option in excel just an hour ago so please pardon my naivety . I am trying to pull a table from this page http : data.bls.gov timeseries CES2000000001 data tool XGtable on BLS however I am getting only first part of the table whereas I need only the second part of the table or the full table . I am trying to import the part with historical data just below download xlsx button . It is part of the table which starts from Series Id : CES2000000001 and ends at P : preliminary . One thing I noticed that the table does not have any id and excel reads its name as 3 .. . Answer : The table is not in a good format for excel from web in the data tab from my test . However if you download Microsoft s Excel Power Query Add-in or use Excel 2016 then I found that it detects the table correctly . After downloading powery query simply go to the Power Query tab instead of data and select from web and enter the website . You ll get a screen like below . Please note however if this is a one time deal you can simply select the HTML table by dragging over it with your mouse copy it and paste it directly into excel . Example of PowerQuery Table for your selection . http : i.stack.imgur.com b0v94.png Comment : Thanks this helps", "Question : I ve been working on a mock stock portfolio in Excel and I ve been looking for ways to automatically update the data eg . stock price and P E ratio . I have tried using a web query to MSN Money but that just brings up the whole stock quote across multiple cells I want data to be updated in individual cells only . The only web query solution I can think of is if someone hosted a website where each value in the stock quote was saved on a different HTML file . I could then WebQuery to that file for each cell requiring that value . However no website offers this . So in essence is there any tool on Excel 2011 Mac that will let me pull individual values from a stock quote and assign them to a single cell .. . Answer : You could consider the following : .. . .. . For each stock create a worksheet which contains a web query to that stock s web page . Next create a summary sheet from where you link-to the cells on the individual stock worksheets which contain the data you need . Then with refresh all connections your data on the summary worksheet would update . Comment : This is actually a brilliant idea thanks", "Question : I am looking to use Excel s Web Query feature to give users access to constantly changing datasets . Why not ODBC straight to the database Well there are several databases on several servers that I m dealing with . To avoid granting users varying levels of complicated ODBC access and to avoid then training those users on how to use ODBC to access the data they need I thought I d create a simple web app that outputs the data the users need in clean HTML tables . After creating the pages though I m having the following problem . Excel Web Query Window http : i.stack.imgur.com BmJvQ.png .. . .. . The little yellow selection arrow is only appearing in the top-left corner of the page and not alongside each table . If I import using the top-left selection arrow the entire page is imported when I only really want the Output table . Are there specific settings that must be used when marking up an HTML table to be compatible with Excel s Web Query tool .. . Answer : I compared my code with the code of another webpage where the tables were highlighting properly in Web Query . Through some trial and error I found the problem . In the head section of my webpage I had the following meta tag . Turns out when this is included the Web Query table selecting option breaks . Based on the disappearing Bootstrap rounded-corners I m guessing Web Query is using some sort of IE Compatibility Mode and the above meta tag breaks it . Excel Web Query Window http : i.stack.imgur.com 1RBiK.png", "Question : In VBA I am trying to leverage WebQuery for a tool I am writing that retrieves financial data . I create a WebQuery with similar code to this : .. . .. . The problem I am coming across is that my.url.com requires a Basic Authentication https : en.wikipedia.org wiki Basic access authentication userid and password . If I simply run this code I get a Runtime Error 1004 it does not prompt for authentication credentials . But if I go into the Excel Data ribbon select From Web and then go to http : my.url.com in their mini web browser I am prompted for userid and password . After closing this window and then re-running my VBA code without changing anything the query works . But upon closing Excel and re-running it fails again unless I go through this extremely ugly manual authentication step . Even if I have told Internet Explorer to save these credentials permanently . How can I get VBA to programmatically authenticate a WebQuery with Basic Authentication so I don t need to take this extra step Edit : Either this or is there a setting within Excel to force this prompt to happen regardless of how the WebQuery was initiated I am using Excel 2010 32-bit on Windows 7 but my target users might be using a variety of Excel versions all on Windows . .. . Answer : You have to go into the source code and find id s for the button username textbox and password textbox then something like : Comment : Ick . Really There s no direct way to do this and keep authentication persistent even when the spreadsheet is reloaded I think I ll have to take my alternative option which is to write a stupid PHP in the middle that takes the user and password as POST arguments talks to the real script with curl using basic auth and spits back the results to the WebQuery . Disappointing . Comment : I m sure there are probably lots of other ways to do it but VBA is not known for its eloquence . That just happens to be a pretty easy way to have the macro log on for you .", "Question : In VBA I am trying to leverage WebQuery for a tool I am writing that retrieves financial data . I create a WebQuery with similar code to this : .. . .. . The problem I am coming across is that my.url.com requires a Basic Authentication https : en.wikipedia.org wiki Basic access authentication userid and password . If I simply run this code I get a Runtime Error 1004 it does not prompt for authentication credentials . But if I go into the Excel Data ribbon select From Web and then go to http : my.url.com in their mini web browser I am prompted for userid and password . After closing this window and then re-running my VBA code without changing anything the query works . But upon closing Excel and re-running it fails again unless I go through this extremely ugly manual authentication step . Even if I have told Internet Explorer to save these credentials permanently . How can I get VBA to programmatically authenticate a WebQuery with Basic Authentication so I don t need to take this extra step Edit : Either this or is there a setting within Excel to force this prompt to happen regardless of how the WebQuery was initiated I am using Excel 2010 32-bit on Windows 7 but my target users might be using a variety of Excel versions all on Windows . .. . Answer : Judging by other answers I think my correct course of action is not to even try and get WebQuery to authenticate and to use a server-side script in the middle that takes userid and password as POST arguments and communicates through to the real back-end over Basic Auth . I ve already written and tested one and this seems to solve the actual problem I am trying to address .", "Question : I wont to pull data from a webpage on the basis of a criteria s into excel however I am unable to do so . Website from which I wont to pull data can be logged in only via another website and not by just url . For E.g . My site name is Elsc and to login into it I have to via another site Gatekeeper and elsc cannot be logged into in any other way . So is there a solution to get data from such website by Macro . Thanks in advance : Comment : Have you tried Import Data from Web page option under DATA tab option in excel for a start Which doesn t needs the macro . Comment : Yes I did .. . However it didn t work. . My elsc window open outside the selection box . .. . Answer : I don t think Excel will give you this kind of control controlling one URL from another URL . I tried to do this a long time ago it never worked right . Can you just login to that URL and then run a simple VBA script to download the data Also consider using a Power Query to do this for you . http : chandoo.org wp 2015 08 21 import-web-data-power-query", "Question : for example following query will create a new column A and the data from A column will now be in Column B .. . .. . is it possible that the destination of web query remain fixed lets say A1 .. . Answer : Yes . Add .RefreshStyle xlOverwriteCells inside your With clause . This will force the external data to A1 instead of adding a new column . Comment : i have updated the code you can see above however it is still not working excel always inserts a new column Comment : I suggest you add only that one row to your previous code . also change destination property to range A 1 . it worked for me on excel-2010 . no column was added the new data overwrites whatever is on cell a1", "Question : I am using excel s web query feature for the first time . The site I am using it on is here http : quotes.morningstar.com fund f t PIXDX . I put a check mark next to the table TTM Yield Load etc . . I click import but a different table than the one I selected is produced in excel . It s one far down the page . What am I doing wrong .. . Answer : After further reflection I discovered that it is the dynamic nature of this web site that appears to be causing some trouble . I have opted to use selenium for vba and so far the solution has proven to be effective yet slow . If anyone out there would like to offer some other avenue to web-scraping dynamic pages using vba for excel I am all ears . Thanks ." ] }
[ "yes-answer-long", "yes-answer-short" ]
web
UNK_RELATION
afnetworking@https@145
afnetworking -- afnetworking is a networking library for ios and mac os x.cocoa pod link : https : cocoapods.org pods afnetworkinggithub link : @placeholder : github.com afnetworking afnetworking .
{ "confidence": [ 119.77186584472656, 111.9588851928711, 107.72315216064453, 106.87982940673828, 106.87982940673828, 106.80136108398438, 106.54047393798828, 105.86907958984375, 105.86907958984375, 105.86907958984375, 104.81961059570312, 104.81961059570312, 103.92156219482422, 103.07823944091797, 102.06748962402344, 101.8934326171875, 101.8934326171875, 101.13531494140625, 101.13531494140625, 100.42877960205078, 99.85272216796875, 98.17639923095703, 96.90519714355469, 96.06187438964844, 95.09033966064453, 95.0511245727539, 94.77445220947266, 94.77445220947266, 94.77445220947266, 93.7925033569336, 93.1544189453125, 93.13237762451172, 92.93327331542969, 92.93327331542969, 92.93327331542969, 92.81278991699219, 91.86117553710938, 91.86117553710938, 91.59815979003906, 91.01785278320312, 91.01785278320312, 91.01785278320312, 91.01785278320312, 90.41727447509766, 90.28112030029297, 90.0071029663086, 90.0071029663086, 90.0071029663086, 89.44786834716797, 87.59379577636719, 86.8275375366211, 86.8275375366211, 86.79666137695312, 85.78874969482422, 85.08224487304688, 85.08224487304688, 85.01861572265625, 83.9465103149414, 83.9465103149414, 83.9465103149414, 83.9465103149414, 83.9465103149414, 83.22412872314453, 83.16681671142578, 83.10318756103516, 83.10318756103516, 82.21337890625, 82.15606689453125, 82.09243774414062, 82.09243774414062, 81.62431335449219, 81.42521667480469, 81.05364990234375, 80.97041320800781, 80.73444366455078, 79.5097885131836, 78.51085662841797, 77.89613342285156, 77.50052642822266, 77.1370849609375, 76.84580993652344, 75.8416976928711, 75.76680755615234, 75.64259338378906, 75.64259338378906, 75.64259338378906, 75.29458618164062, 75.06234741210938, 74.93038940429688, 73.91963958740234, 73.85701751708984, 73.7271728515625, 73.7271728515625, 73.0136947631836, 73.0136947631836, 72.71642303466797, 69.84959411621094, 68.1024169921875, 67.50708770751953 ], "content": [ "Refer this for serialization : github.com AFNetworking AFNetworking https : github.com AFNetworking AFNetworking", "From AFNetworking https : github.com AFNetworking AFNetworking docs .", "I ve asked this question here : github.com AFNetworking AFNetworking pull https : github.com AFNetworking AFNetworking pull 3174 issuecomment-217256726", "You might be interested in this bug then : github.com AFNetworking AFNetworking issues 953 https : github.com AFNetworking AFNetworking issues 953", "Check this how to install it with github.com AFNetworking AFNetworking installation-with-carthage https : github.com AFNetworking AFNetworking installation-with-carthage", "yeah you can check here github.com AFNetworking AFNetworking blob master AFNetworking https : github.com AFNetworking AFNetworking blob master AFNetworking AFURLSessionManager.h", "Link to bug report on GitHub https : github.com AFNetworking AFNetworking issues 1782", "I used the manual download at github.com AFNetworking AFNetworking https : github.com AFNetworking AFNetworking by clicking download zip", "Please check out this issue : github.com AFNetworking AFNetworking issues 2131 https : github.com AFNetworking AFNetworking issues 2131 .", "Also there are many issues eg like this : github.com AFNetworking AFNetworking issues 2784 https : github.com AFNetworking AFNetworking issues 2784 .", "I ve created an issue https : github.com AFNetworking AFNetworking issues 1775 on AFNetworking .", "https : github.com AFNetworking AFNetworking blob 1272e3e32dbd447d18d75bc35e7a2f0f04f33d61 AFNetworking AFHTTPSessionManager.m L115", "github.com AFNetworking AFNetworking blob experimental-1.0RC1 https : github.com AFNetworking AFNetworking blob experimental-1.0RC1 AFNetworking UIImageView 2BAFNetworking.m L70", "See a similar problem in AFNetworking 1.x github.com AFNetworking AFNetworking issues 661 https : github.com AFNetworking AFNetworking issues 661", "there s a longstanding AFNetworking issue about this but no progress : github.com AFNetworking AFNetworking issues 2866 https : github.com AFNetworking AFNetworking issues 2866", "I am using AFNetworking https : github.com AFNetworking AFNetworking to achieve the communication .", "The SDK uses AFNetworking 2.6 https : github.com AFNetworking AFNetworking internally .", "still belive its a bad design issue github.com AFNetworking AFNetworking issues 1793 https : github.com AFNetworking AFNetworking issues 1793", "By the way I also gave them a pullrequest some days ago github.com AFNetworking AFNetworking pull 3306 https : github.com AFNetworking AFNetworking pull 3306 .", "Correct me if I m wrong but AFNetworking also uses NSURLCache and by default doesn t cache to disk : github.com AFNetworking AFNetworking wiki AFNetworking-FAQ https : github.com AFNetworking AFNetworking wiki AFNetworking-FAQ", ".. . .. . https : github.com AFNetworking AFNetworking .. . .. . https : github.com RestKit RestKit", "In AFNetworking 2 AFHTTPRequestOperationManager https : github.com AFNetworking AFNetworking blob 3e12404b2d1693f7bdea3ff435f2e419d5c7a531 AFNetworking AFHTTPRequestOperationManager.h L160-L167 has a completionQueue property .", "EDIT : As of AFNetworking 1.0RC1 https : github.com AFNetworking AFNetworking wiki AFNetworking-FAQ this is an explicit feature .", "AFNetworking doesn t seem to support this https : github.com AFNetworking AFNetworking wiki AFNetworking-FAQ though the work around is simple enough .", "README.md https : github.com AFNetworking AFNetworking tree 2.0 tells it requires either iOS 7.0 and above while AFNetworking 2.0 Migration Guide https : github.com AFNetworking AFNetworking wiki AFNetworking-2.0-Migration-Guide tells it requires either iOS 6.0 and above .", "AFHTTPRequestOperation class is removed from AFNetworking 3.0 https : github.com AFNetworking AFNetworking wiki AFNetworking-3.0-Migration-Guide", "https : github.com AFNetworking AFNetworking .. . .. . How do I dial down the timeout", "I ve filed an issue https : github.com AFNetworking AFNetworking issues 1418 for that .", "https : github.com AFNetworking AFNetworking .. . .. . If you re using Xcode 6 give it a try .", "AFNetworking Library https : github.com AFNetworking AFNetworking .. . .. . You can do this by simply using following example : -", "ok thanks for answer I will ask as well Matt to help here also I ve created question here : github.com AFNetworking AFNetworking issues 3491 https : github.com AFNetworking AFNetworking issues 3491", "AFHTTPClient is splitted into AFHTTPRequestOperationManager AFHTTPSessionManager https : github.com AFNetworking AFNetworking wiki AFNetworking-2.0-Migration-Guide afhttpclient--afhttprequestoperationmanager--afhttpsessionmanager .", "I am trying to setup Reachability using the new 2.0 AFNetworking https : github.com AFNetworking AFNetworking network-reachability-manager .", "You can check the official migration guide here https : github.com AFNetworking AFNetworking wiki AFNetworking-3.0-Migration-Guide", "I ve checked the migration guide https : github.com AFNetworking AFNetworking wiki AFNetworking-3.0-Migration-Guide .", "Here are few issues that your problem mentioned please check them out .. . .. . https : github.com AFNetworking AFNetworking issues 2895 .. . .. . https : github.com AFNetworking AFNetworking issues 2312", "This is a bug in the latest version of AFNetworking discussed in issue 2563 https : github.com AFNetworking AFNetworking issues 2563 .", "I m using AFNetworking https : github.com AFNetworking AFNetworking in my app I m checking for internet connectivity by their inbuilt class .", "Does anyone have a nice working solution for getting the download progress when using the UIImageView+AFNetworking https : github.com AFNetworking AFNetworking blob master UIKit 2BAFNetworking UIImageView 2BAFNetworking.h category and AFNetworking 3.0 https : github.com AFNetworking AFNetworking wiki AFNetworking-3.0-Migration-Guide .", "I have integrated AFNetworking from here https : github.com AFNetworking AFNetworking in my project .", "https : github.com AFNetworking AFNetworking issues 393 .. . .. . Basically AFNetworking doesn t support this functionality .", "There was a thread in AFNetworking github : https : github.com AFNetworking AFNetworking issues 378 But seemed the issue is not addressed at all .", "There is a discussion thread in AFNetworking exactly for this problem : https : github.com AFNetworking AFNetworking issues 566 .. . .. . Thanks for guykogus tips and experiments on this issue .", "github.com AFNetworking AFNetworking blob https : github.com AFNetworking AFNetworking blob 32cf30a2451917c25d853fccb9e112b64415595e UIKit 2BAFNetworking AFAutoPurgingImageCache.m L110 You can see this function which actually caches the thing .", "Here is the git link-to the branch https : github.com AFNetworking AFNetworking tree 1.x Example .", "And the example project is in the AFNetworking repository https : github.com AFNetworking AFNetworking tree master Example .", "There was a discussion about this on the AFNetworking github page : https : github.com AFNetworking AFNetworking issues 2191 .. . .. . Domains and ip addresses are checked differently .", "https : github.com AFNetworking AFNetworking wiki AFNetworking-3.0-Migration-Guide .. . .. . I hope this will help .", "Self Signed certificate SSL Issue 189 AFNetworking AFNetworking https : github.com AFNetworking AFNetworking issues 189 .. . .. . Please help me.. .", "The best fix appears to be to update to the latest AFNetworking https : github.com AFNetworking AFNetworking blob master AFNetworking AFHTTPRequestOperation.h which passes the operation into the block as an argument .", "See the answer from Mattt Thompson here https : github.com AFNetworking AFNetworking issues 1504 regarding this issue .", "See this pull request on its github https : github.com AFNetworking AFNetworking pull 1412 and other ones related .", "You ll need to add the certificate s or public-key s to your app s Bundle and enable the feature by setting either the defaultSSLPinningMode https : github.com AFNetworking AFNetworking blob 776c879c9d3cd20b9a3c15490666e8ab6d1f2bf1 AFNetworking AFHTTPClient.h L144 property on AFHttpClient or the SSLPinningMode https : github.com AFNetworking AFNetworking blob 776c879c9d3cd20b9a3c15490666e8ab6d1f2bf1 AFNetworking AFURLConnectionOperation.h L178 property on AFURLConnectionOperation .", "Thanks Sendoa for the link-to the GitHub issue where Mattt explains https : github.com AFNetworking AFNetworking issues 1504 why this functionality is not working anymore .", "Check out + AFURLConnectionOperation batchOfRequestOperations : progressBlock : completionBlock : .. . .. . Although it s not documented implementation https : github.com AFNetworking AFNetworking blob master AFNetworking AFURLConnectionOperation.m L525 is self-explanatory .", "https : github.com AFNetworking AFNetworking .. . .. . But I am curious about why the official AFNetworking method does not works for its installation in my project", "I ve found solution at GitHub https : github.com AFNetworking AFNetworking issues 2410 : .. . .. . And then assign it to your manager :", "Documentation page https : github.com AFNetworking AFNetworking has example with section Creating a Download Task : .. . .. . NB", "If that s the case then use the solution referred to by the accepted answer : https : github.com AFNetworking AFNetworking issues 1397 .", "On January 24th an attempt to resolve some other issue https : github.com AFNetworking AFNetworking issues 2523 this bug was introduced .", ".. . .. . Note : This was fixed 26 March 2015 in commit 7d8e286 https : github.com AFNetworking AFNetworking commit 7d8e2867e026c303c12b82896b734fb39ed60d9e .", "It seem s to be related to this issue : .. . .. . https : github.com AFNetworking AFNetworking issues 2314 .. . .. . I m performing a http-get using nsurlsession in this example .", "Linking to all articles related to this answer : one http : stackoverflow.com questions 14002422 afnetworking-afhttpclient-offline-mode-not-working-with-nsurlrequestreturncach two https : github.com AFNetworking AFNetworking issues 378 three https : github.com AFNetworking AFNetworking issues 566", "With work having recently stopped on ASIHTTPRequest http : allseeing-i.com 5Brequest release 5D it seems like attention is shifting to AFNetworking https : github.com AFNetworking AFNetworking .", "To more information take a look to the 3.x requirements https : github.com AFNetworking AFNetworking blob master README.md requirements .", "There s an example of setting the pinning mode https : github.com AFNetworking AFNetworking blob master Example Classes AFAppDotNetAPIClient.m in the AppDotNet example .", "However during AFNetworking development there were some troubles https : github.com AFNetworking AFNetworking issues 1268 with this automatic removal behaviour so finally manual cache clearing https : github.com AFNetworking AFNetworking blob master UIKit 2BAFNetworking UIImageView 2BAFNetworking.m L75 was added when receiving UIApplicationDidReceiveMemoryWarningNotification .", "Try to integrate AFNetworking latest version 2.0 as guided here https : github.com AFNetworking AFNetworking don t forget to add AFSecurityPolicy.h AFSecurityPolicy.m file .", "https : github.com AFNetworking AFNetworking issues 1397 .. . .. . gfiumara is the dev who came up with this .", "I would suggest you to refer to the example in git by them https : github.com AFNetworking AFNetworking tree master Example .", "In AFNetworking 3 the completionQueue property has been moved to AFURLSessionManager https : github.com AFNetworking AFNetworking blob 326ccb170d2ea2202e324e562196a82e8618f94a AFNetworking AFURLSessionManager.h L156-L159 which AFHTTPSessionManager extends .", "for more details please visit AFNetworking 3.0 https : github.com AFNetworking AFNetworking or my old answear with AFNetworking 2.0 http : stackoverflow.com questions 33767908 volunteermatch-api-objective-c 33886449 33886449 .", "try NSSet setWithObject : @ application rss+xml and manager.responseSerializer AFXMLResponseSerializer new reference link https : github.com AFNetworking AFNetworking issues 1381", "for more details please visit AFNetworking https : github.com AFNetworking AFNetworking or here http : stackoverflow.com questions 33767908 volunteermatch-api-objective-c 33886449 33886449 .", "What version of AFNetworking you are using - .. . .. . AFNetworking 3.0 is the latest major release of AFNetworking a delightful networking library for iOS Mac OS X .", "And you could look here https : github.com AFNetworking AFNetworking wiki AFNetworking-3.0-Migration-Guide to know AFNetworking-3.0-Migration-Guide the differences between versions .", "See the source code for reference : UIImageView+AFNetworking.m https : github.com AFNetworking AFNetworking blob master UIKit 2BAFNetworking UIImageView 2BAFNetworking.m L93 .", "https : github.com AFNetworking AFNetworking commit d184833fa015a783742b573cf48a3080b863a900 .. . .. . Looking at the changelog. . .. . .. . https : cocoapods.org pods AFNetworking changelog .. . .. . Version 2.6.0 supports watchOS.. . .. . .. . This release now supports watchOS 2.0 which relys on target conditionals that are only present in Xcode 7 and iOS 9 watchOS 2.0 OS X 10.10 .", "This answer s great and all but check out github.com AFNetworking AFNetworking blob master https : github.com AFNetworking AFNetworking blob master UIKit 2BAFNetworking UIImageView 2BAFNetworking.h a lot of donkey work done for you if you re just putting an image in an image view", "Aelam https : github.com aelam provided the following method in this Github issue https : github.com AFNetworking AFNetworking issues 2119 issuecomment-92345504 : .. . .. . Add this to your podfile .", "On this page https : github.com AFNetworking AFNetworking issues 783 Mattt says : The structure you re describing can t deterministically be represented with query-string encoding .", "Using code instead of words this is the example code from the AFNetworking documentation https : github.com AFNetworking AFNetworking with the call to NSLog replaced by a UI update : .. . .. . Should it be written like this instead", "I am able to use an NSMutableURLRequest with an NSURLConnection to connect to a SOAP web service as follows : .. . .. . How could I do the same using AFNetworking https : github.com AFNetworking AFNetworking or STHTTPRequest https : github.com nst STHTTPRequest", "3 similar problem http : stackoverflow.com questions 27852606 afhttpsessionmanager-block-is-not-called-when-app-is-on-background .. . .. . 4 about AFNetworking background https : github.com AFNetworking AFNetworking issues 1775 .. . .. . P.S .", "According to the migration guide https : github.com AFNetworking AFNetworking wiki AFNetworking-2.0-Migration-Guide AFHttpClient still exists and still has the responsibility of executing Http requests for your app", "As you can see in the implementation of this class https : github.com AFNetworking AFNetworking blob master AFNetworking AFHTTPSessionManager.m tasks are immediately started task resume and not added to any sort of queue .", "Can I do it with AFNetworking https : github.com AFNetworking", "As you can read in the AFNetworking read me page https : github.com AFNetworking AFNetworking network-reachability-manager .. . .. . Here s also a link-to the official documentation http : cocoadocs.org docsets AFNetworking 2.0.0 Classes AFNetworkReachabilityManager.html api name setReachabilityStatusChangeBlock 3a .", "Here s the change I made on the client : .. . .. . Here s the change I made to the server : .. . .. . See also https : github.com AFNetworking AFNetworking issues 3544", "This site may help someone fix this http : www.indelible.org ink trusted-ssl-certificates .. . .. . Example .. . .. . https : github.com AFNetworking AFNetworking tree 1.x", "Well In AFNetworking 3.0 You can do like this way for uploading multiform part data Check this https : github.com AFNetworking AFNetworking .. . .. . AFNetworking 3.0 is the latest major release of AFNetworking 3.0 removes all support for the now deprecated NSURLConnection based APIs .", "As the FAQ https : github.com AFNetworking AFNetworking wiki AFNetworking-FAQ says : .. . .. . Simply take the HTTPBody from a NSMutableURLRequest compress the data and re-set it before creating the operation using the request .", "In the Migration Guide https : github.com AFNetworking AFNetworking wiki AFNetworking-2.0-Migration-Guide AFHTTPClient.m is separated to AFHTTPRequestOperationManager AFHTTPSessionManager but I can t find AFHTTPClient registerHTTPOperationClass : in either AFHTTPRequestOperationManager or AFHTTPSessionManager .", "http : stackoverflow.com questions 6062178 can-an-asihttprequest-be-retried .. . .. . This is AFNetworking if you are unfamiliar https : github.com AFNetworking AFNetworking readme .. . .. . I was unable to find an equivalent api in AFNetworking has anyone found a solution for retrying network requests in the event of timeout using AFNetworking", "For example you code would become : .. . .. . You should read the documentation http : cocoadocs.org docsets AFNetworking 2.0.0 and the migration guide https : github.com AFNetworking AFNetworking wiki AFNetworking-2.0-Migration-Guide to understand the new concepts that come with the version 2.0 of AFNetworking .", "It seems to me that the proper place to do this is in AFURLSessionManager in setting the taskWillPerformHTTPRedirection https : github.com AFNetworking AFNetworking blob 914d2ae02dc6a2224643e0b495133d56783e0840 AFNetworking AFURLSessionManager.m L673 block but I am unsure of the best way to handle it .", "Using AFNetworking as outlined here - AFNetworking .", "Refer this : - https : github.com AFNetworking AFNetworking issues 2986 .. . .. . The 3.0.0 branch has Carthage Support that does enable bitcode and to my knowledge there is nothing specific a library maintainer needs to do in order to support bitcode for Cocoapods .", "AFNetworking .. . .. . You re right the AFNetworking category implementation UIImageView+AFNetworking is bare-bones ." ] }
{ "confidence": [ 120.96755981445312, 116.826171875, 114.08968353271484, 113.5870361328125, 112.5238037109375, 109.45968627929688, 109.06231689453125, 105.63201904296875, 104.31424713134766, 103.92650604248047, 102.2573471069336, 101.98811340332031, 101.83167266845703, 101.69379425048828, 101.41284942626953, 101.1393051147461, 101.05140686035156, 100.48407745361328, 99.5378646850586, 99.52854919433594 ], "content": [ "Question : AFNetworking 2.0 was announced last week . But I find different requirements for AFNetworking 2.0 . README.md https : github.com AFNetworking AFNetworking tree 2.0 tells it requires either iOS 7.0 and above while AFNetworking 2.0 Migration Guide https : github.com AFNetworking AFNetworking wiki AFNetworking-2.0-Migration-Guide tells it requires either iOS 6.0 and above . Dose AFNetworking 2.0 support iOS 6.0 Comment : One way or the other you should file a bug report about this . Comment : +1 to cancel out the down vote . This is confusing as the docs and other places disagree with each other . .. . Answer : AFNetworking 2.0 is supported in iOS 6 . My problem was that I had previously installed it with the platform set to iOS 7 . I fixed it by doing this : .. . .. . 1 . Deleted everything from my Podfile .. . 2 . Ran pod install which deleted all my pods . 3 . Added everything back to my Podfile with platform : ios 6.0 .. . .. . And I was able to still use my existing AFNetworking code with no problems .", "Question : AFNetworking 2.0 was announced last week . But I find different requirements for AFNetworking 2.0 . README.md https : github.com AFNetworking AFNetworking tree 2.0 tells it requires either iOS 7.0 and above while AFNetworking 2.0 Migration Guide https : github.com AFNetworking AFNetworking wiki AFNetworking-2.0-Migration-Guide tells it requires either iOS 6.0 and above . Dose AFNetworking 2.0 support iOS 6.0 Comment : One way or the other you should file a bug report about this . Comment : +1 to cancel out the down vote . This is confusing as the docs and other places disagree with each other . .. . Answer : I didn t use pod at all . Instead I downloaded it and dragged the files to the project and then encountered this problem as well . To fix it I simply deleted the AFURLSessionManager and AFHTTPSessionManager files from the project . Then it worked .", "Question : First of all let me tell you that i am using xcode 4.6.3 and iOS 6.1 . i have been trying to build connection using AFNetworking or CocoaPods . it throws errors due to backward compatibility issues . Current error is xctest xctest.h Is there any way out to this problem I am highly confused on this . Any help would be appreciated . .. . Answer : What version of AFNetworking you are using - .. . .. . AFNetworking 3.0 is the latest major release of AFNetworking a delightful networking library for iOS Mac OS X . To keep this library maintainable moving forward 3.0 removes all support for the now deprecated NSURLConnection based APIs . https : github.com AFNetworking AFNetworking wiki AFNetworking-3.0-Migration-Guide .. . .. . I hope this will help .", "Question : AFNetworking 2.0 was announced last week . But I find different requirements for AFNetworking 2.0 . README.md https : github.com AFNetworking AFNetworking tree 2.0 tells it requires either iOS 7.0 and above while AFNetworking 2.0 Migration Guide https : github.com AFNetworking AFNetworking wiki AFNetworking-2.0-Migration-Guide tells it requires either iOS 6.0 and above . Dose AFNetworking 2.0 support iOS 6.0 Comment : One way or the other you should file a bug report about this . Comment : +1 to cancel out the down vote . This is confusing as the docs and other places disagree with each other . .. . Answer : You can use AFNetworking 2.0 .Just have to ensure that the deployment-target is set to 6.0 while installing using cocoa pods.I had initially installed AFNetworking when my deployment-target was 7.0 .So had to remove it from cocoa pods set deployment-target to 6.0 and then do install again .", "Question : I ve been trying to modify my project to support WatchOS2 architecture . Currently I have a networking framework that is based on AFNetworking . I ve been using it with my watch app so far . Now I m trying to build the framework for watchos watchsimulator platforms . What I m getting is SystemConfiguration SystemConfiguration.h file-not-found error for some AFNetworking classes . I know that system configuration is not one of the available system frameworks for watchOS2 . And for networking apple says https : developer.apple.com library prerelease watchos documentation General Conceptual AppleWatch2TransitionGuide LeverageSystemTechnologies.html apple ref doc uid TP40015234-CH8-SW1 : .. . .. . Networking .. . .. . Support for network-based operations includes the following technologies : .. . .. . WatchKit extensions can access the network directly using an NSURLSession object . WatchKit extensions have full access to the NSURLSession capabilities including the ability to download files in the background . For information on how to use this class see URL Loading System Programming Guide . The Watch Connectivity framework supports bidirectional communication between your Watch app and iOS app . Use this framework to coordinate activities between the two apps . For more information see Communicating with Your Companion iOS App . .. . .. . I want to support both iOS and watchos for my networking sdk . Is there a way to make this project built for watchOS platform Or is that mean I am only allowed to use NSURLConnection inside my watch app .. . Answer : Here is a recent commit on github for AFNetworking to support watchOS . https : github.com AFNetworking AFNetworking commit d184833fa015a783742b573cf48a3080b863a900 .. . .. . Looking at the changelog. . .. . .. . https : cocoapods.org pods AFNetworking changelog .. . .. . Version 2.6.0 supports watchOS.. . .. . .. . This release now supports watchOS 2.0 which relys on target conditionals that are only present in Xcode 7 and iOS 9 watchOS 2.0 OS X 10.10 . If you install the library using CocoaPods AFNetworking will define these target conditionals for on older platforms allowing your code to complile . If you do not use Cocoapods you will need to add the following code your to PCH file .", "Question : AFNetworking 2.0 was announced last week . But I find different requirements for AFNetworking 2.0 . README.md https : github.com AFNetworking AFNetworking tree 2.0 tells it requires either iOS 7.0 and above while AFNetworking 2.0 Migration Guide https : github.com AFNetworking AFNetworking wiki AFNetworking-2.0-Migration-Guide tells it requires either iOS 6.0 and above . Dose AFNetworking 2.0 support iOS 6.0 Comment : One way or the other you should file a bug report about this . Comment : +1 to cancel out the down vote . This is confusing as the docs and other places disagree with each other . .. . Answer : Yes it does support iOS6 except for the NSURLSessionTask parts which are iOS7 only . I was confused as well but it looks during the transition from 1.x - 2.0 not all the docs had yet been updated . They have been now and it works just fine in my project that supports iOS6 .", "Question : Does anyone have a nice working solution for getting the download progress when using the UIImageView+AFNetworking https : github.com AFNetworking AFNetworking blob master UIKit 2BAFNetworking UIImageView 2BAFNetworking.h category and AFNetworking 3.0 https : github.com AFNetworking AFNetworking wiki AFNetworking-3.0-Migration-Guide . This category https : gist.github.com martinpilch 5269512 which I did use for versions up till 3.0 has stopped working now . Here is my own experimental version https : gist.github.com knutigro 85d3463f06f660d7a67d which sadly for the moment crashes randomly . Comment : Did you check this one - github.com xmartlabs XLRemoteImageView https : github.com xmartlabs XLRemoteImageView Comment : please refer my answer below . I ve made a pull request to AFNetworking unfortunately it s rejected . Till then you can use this if you don t want to change upgrade your AFNetworking version . Comment : Thats a good effort @iOSEnthusiatic . By the way I also gave them a pullrequest some days ago github.com AFNetworking AFNetworking pull 3306 https : github.com AFNetworking AFNetworking pull 3306 . .. . Answer : Here is the modified version of AFNetworking 3.0 in which you can show a progress while loading image from server using UIImageView+AFNetworking category . https : github.com rushisangani AFNetworking .. . .. . Please replace following files with original AFNetworking files . NOTE : If you update your pod then this will be removed .", "Question : I am using AFNetworking in the project which is using cocoapods to import .. . .. . And the project required me to turn on the BitCode .. . .. . So I switch the AFNetworking to 3.0 version .. . .. . And AFNetworkActivityLogger also require to use 3.0.0 version Therefore I add the below code into the Podfile .. . .. . pod AFNetworkActivityLogger : git https : github.com AFNetworking AFNetworkActivityLogger.git : branch 3 0 0 .. . .. . pod install is completed with no error found .. . .. . But the project is build failed with below error : .. . .. . AFNetworkActivityConsoleLogger.o was built without full bitcode . All object-files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64 .. . .. . Can t find any related post May i have some helps on this issue . .. . Answer : Refer this : - https : github.com AFNetworking AFNetworking issues 2986 .. . .. . The 3.0.0 branch has Carthage Support that does enable bitcode and to my knowledge there is nothing specific a library maintainer needs to do in order to support bitcode for Cocoapods . Comment : Thanks But I have already using the 3.0.0 branch with the above Podfile It still states that AFNetworkActivityConsoleLogger is not support bitcode Comment : Your pod will not work you have install it using Carthage Check this how to install it with github.com AFNetworking AFNetworking installation-with-carthage https : github.com AFNetworking AFNetworking installation-with-carthage Comment : I see Thanks for your answer I think I require another huge processes to work with Carthage . Comment : Hi Vizllx when i am adding the AFNetworkActivityLogger by Carthage i find the branch is not exist anymore it display the error like github.com Carthage Carthage issues 1167 https : github.com Carthage Carthage issues 1167", "Question : I m trying to make a GET request to a server with an If-Modified-Since header in order to avoid loading identical content . When I make a request I know that the server is sending back a 304 indicating that the content has not changed but NSURLCache or AFNetworking is responding with a 200 with the cached content . In order to prevent this I set the request serializer s cache policy to NSURLRequestReloadIgnoringLocalCacheData however this does not solve the problem . .. . Answer : This is a bug in the latest version of AFNetworking discussed in issue 2563 https : github.com AFNetworking AFNetworking issues 2563 . On January 24th an attempt to resolve some other issue https : github.com AFNetworking AFNetworking issues 2523 this bug was introduced . To resolve it either .. . .. . roll back to a previous version of AFNetworking 2.5.0 or .. . manually post the KVO notifications yourself : .. . .. . self.requestSerializer willChangeValueForKey : @ cachePolicy .. . self.requestSerializer setCachePolicy : NSURLRequestReloadIgnoringLocalCacheData .. . self.requestSerializer didChangeValueForKey : @ cachePolicy .. . .. . .. . The lack of response regarding this bug is quite disappointing . Assuming this is indeed the issue you re suffering from try one of the above and see if it remedies your problem please join us and post your own comment in the discussion under issue 2563 https : github.com AFNetworking AFNetworking issues 2563 . The more people chime in on this the more likely it is to be fixed . .. . .. . Note : This was fixed 26 March 2015 in commit 7d8e286 https : github.com AFNetworking AFNetworking commit 7d8e2867e026c303c12b82896b734fb39ed60d9e . Comment : Both of your proposed solutions fixed the problem . Thanks", "Question : Does AFNetworking call the completion block on the main thread or is it called in the background requiring me to manually dispatch my UI updates to the main thread Using code instead of words this is the example code from the AFNetworking documentation https : github.com AFNetworking AFNetworking with the call to NSLog replaced by a UI update : .. . .. . Should it be written like this instead Comment : @tdarr all the source code are available take a look and you can know it all .. . Answer : In AFNetworking 2 AFHTTPRequestOperationManager https : github.com AFNetworking AFNetworking blob 3e12404b2d1693f7bdea3ff435f2e419d5c7a531 AFNetworking AFHTTPRequestOperationManager.h L160-L167 has a completionQueue property . The dispatch queue for the completionBlock of request operations . If NULL default the main queue is used . In AFNetworking 3 the completionQueue property has been moved to AFURLSessionManager https : github.com AFNetworking AFNetworking blob 326ccb170d2ea2202e324e562196a82e8618f94a AFNetworking AFURLSessionManager.h L156-L159 which AFHTTPSessionManager extends . The dispatch queue for completionBlock . If NULL default the main queue is used . Comment : This should be accepted answer Comment : I agree I edited the answer to include AFNetworking 3 and to add links to the source of both versions . Comment : @thomasd thanks . There are some rejections on your edit so I can t accept it but I just copied it again .", "Question : I have to use version 1.x and 3.0 of AFNetworking in same project . i went through with the questions on SO . Using two versions of afnetworking http : stackoverflow.com questions 27698872 using-2-versions-of-afnetworking-in-same-ios-project .. . .. . Two Versions in same class http : stackoverflow.com questions 20663673 use-two-versions-of-the-same-library .. . .. . But the problem is I don t understand the answer . .. . Answer : This is not possible : if you want to include multiple version of the same framework in the same project you end to cause duplicate symbol errors . To make an example of AFN RestKit depends on AFN 1.x while another library you want to use requires 3.x . You won t be able to use both of them in the same class . To more information take a look to the 3.x requirements https : github.com AFNetworking AFNetworking blob master README.md requirements . And you could look here https : github.com AFNetworking AFNetworking wiki AFNetworking-3.0-Migration-Guide to know AFNetworking-3.0-Migration-Guide the differences between versions .", "Question : Does anyone have a nice working solution for getting the download progress when using the UIImageView+AFNetworking https : github.com AFNetworking AFNetworking blob master UIKit 2BAFNetworking UIImageView 2BAFNetworking.h category and AFNetworking 3.0 https : github.com AFNetworking AFNetworking wiki AFNetworking-3.0-Migration-Guide . This category https : gist.github.com martinpilch 5269512 which I did use for versions up till 3.0 has stopped working now . Here is my own experimental version https : gist.github.com knutigro 85d3463f06f660d7a67d which sadly for the moment crashes randomly . Comment : Did you check this one - github.com xmartlabs XLRemoteImageView https : github.com xmartlabs XLRemoteImageView Comment : please refer my answer below . I ve made a pull request to AFNetworking unfortunately it s rejected . Till then you can use this if you don t want to change upgrade your AFNetworking version . Comment : Thats a good effort @iOSEnthusiatic . By the way I also gave them a pullrequest some days ago github.com AFNetworking AFNetworking pull 3306 https : github.com AFNetworking AFNetworking pull 3306 . .. . Answer : If you look at AFImageDownloader this it is used by the UIImageView category to download images . In this class you .. . .. . It returns a receipt which has a NSURLSessionDataTask task property . NSURLSessionDataTask has different properties of how bytes download expected bytes to receive etc . Perhaps you can use this and achieve your task .", "Question : I am using the AFNetworking library . I can t figure out how to download a file and save it to the documents directory . .. . Answer : From AFNetworking https : github.com AFNetworking AFNetworking docs . Save to loaded file to your documents . AFNetworking 3.0", "Question : null .. . Answer : I am using cocoapods to import AFNetworking I get the following error after I try pod install .. . .. . Unable to satisfy the following requirements : .. . .. . AFNetworking 3.0 required by Podfile .. . .. . Specs satisfying the AFNetworking 3.0 dependency were found but they required a higher minimum deployment-target . I am using pod version 0.39.0 and the project Deployment Target is 8.0 .. . .. . Here is my Podfile content : .. . .. . Which is same as the requested by AFNetworking from https : github.com AFNetworking AFNetworking .. . .. . May I have any idea about the error Comment : is that your entire Podfile Comment : No There are a quiet long Podfile so i only write the part of it . Comment : The rest of them just the others library which the app required Comment : I found out the error is due to i also pod AFNetwortActivityLogger Comment : But how to due with it My project also required AFNetwortActivityLogger", "Question : I am using the AFNetworking library . I can t figure out how to download a file and save it to the documents directory . .. . Answer : Documentation page https : github.com AFNetworking AFNetworking has example with section Creating a Download Task : .. . .. . NB Code work with iOS 7+ tested with AFNetworking 2.5.1 Comment : when i download video and click on back witho download completion . and again i click on video that time i get this error MediaPlayerErrorDomain Code -11800 .. . so plz help me", "Question : I have recently migrated from ASIHTTPRequest to AFNetworking which has been great . However the server that I am connecting with has some issues and sometimes causes my requests to timeout . When using ASIHTTPRequest it was possible to setup a retry count on a request in the event of a timeout using the following selector .. . .. . This can be further referenced in this post Can an ASIHTTPRequest be retried http : stackoverflow.com questions 6062178 can-an-asihttprequest-be-retried .. . .. . This is AFNetworking if you are unfamiliar https : github.com AFNetworking AFNetworking readme .. . .. . I was unable to find an equivalent api in AFNetworking has anyone found a solution for retrying network requests in the event of timeout using AFNetworking .. . Answer : Matt Thompson developer of AFNetworking was kind enough to answer this for me . Below is the github link explaining the solution . https : github.com AFNetworking AFNetworking issues 393 .. . .. . Basically AFNetworking doesn t support this functionality . It is left to the developer to implement on a case by case basis as shown below taken from Matt Thompson s answer on github Comment : I believe this should be if ntimes 0 if failure .. . else if success success .. . : otherwise there will be no response if this was successful on the last retry . Comment : in AFNetworking3.0 AFHTTPRequestOperation has removed how this code should implement with AFNetworking3.0", "Question : Since i updated the AFNetworking from 3.0.4 to 3.1.0 i am getting errr -999 when downloading a file . I am making a post request to the server with some data and if the data is valid a file will be download otherwise and error JSON will be return . here is the code : .. . .. . I have tried changing to this but with the same result . .. . Answer : Here are few issues that your problem mentioned please check them out .. . .. . https : github.com AFNetworking AFNetworking issues 2895 .. . .. . https : github.com AFNetworking AFNetworking issues 2312 Comment : I have checked that but those are all old issues . and this was cause by the last update .", "Question : NB : This is related to this question http : stackoverflow.com q 28086512 89035 on project structure but I have decided to a vastly the use-case to better abstract the problem . .. . .. . Problem .. . .. . How do I include afnetworking questions tagged afnetworking in my iOS App and an accompanying iOS Extension ios8-extention questions tagged ios8-extention ios8-today-widget questions tagged ios8-today-widget or ios8-share-extension questions tagged ios8-share-extension via CocoaPods Issues .. . .. . For use in Extensions AFNetworking needs to be build with define AF APP EXTENSIONS does this mean I need 2 versions AFNetworking One for the Extension and one for the App How do I set up the Podfile so frameworks are built and copied to the correct places Documentation on use frameworks is a bit thin . Comment : For people coming across this in the future : as of time of writing AFNetworking seems to have fixed this in their latest versions so try updating the pod before attempting the solutions below . .. . Answer : Update : .. . .. . As Rhythmic Fistman mentioned the original answer s method gets overwritten when doing a new pod install . Aelam https : github.com aelam provided the following method in this Github issue https : github.com AFNetworking AFNetworking issues 2119 issuecomment-92345504 : .. . .. . Add this to your podfile . remember to replace the target name .. . .. . Obsolete answer : .. . .. . 1 Be sure that pod AFNetworking is included for both targets your container app and extension in your podfile . Example in my case : .. . .. . 2 In XCode click on Pods on the hierarchy view to bring its build options . Then on the build options select the target for which you are looking at the build options in the dropdown . There select Pods- Extension Target Name -AFNetworking it should have been created automatically by pod install . Then select Build Settings . Then under Apple LLVM 6.0 - Language verify that Prefix header has a filename . That filename on my case was Target Support Files Pods- Extension Target Name -AFNetworking Pods- Extension Target Name -AFNetworking-prefix.pch . If it doesn t have such a filename or similar then add it . 3 Go to that prefix header file that was named there or you added there . It ll be almost empty then add the following line at the end : .. . .. . That should allow your container app to point to a version of AFNetworking built normally and your extension app to another built with the flag set . So only one version of the library but built-in two different ways each on one of the targets . Comment : That pch file is regenerated every time you do a pod install which wipes out your modification . Comment : You re my god damn hero . Comment : I received this issue while installing cocoapods Unable to find a specification for SDKThatInternallyUsesAFNetworking am I supposed to replace SDKThatInternallyUsesAFNetworking with something else Comment : @Geet SDKThatInternallyUsesAFNetworking is just an example name for a pod which internally uses AFNetworking . There is no pos by that name Comment : Its still giving error in my today s extension while importing AFNetworking . import AFNetworking AFNetworking.h", "Question : null .. . Answer : My iOS app uses AFNetworking 2.6.1 and my highest ranking crash is : .. . .. . This is how most stack traces look like in Crashlytics : .. . .. . I don t use kvo and my app uses location and stays in the background at all times . Any ideas on how to debug recreate I can t manage to recreate the issue in a simulator or on a device Even catching the exception without knowing where it is or how to handle it correctly would suffice in this case.. . Comment : Check this link-to how create an Exception breakpoint it will point the line that is causing the crash stackoverflow.com questions 17802662 http : stackoverflow.com questions 17802662 exception-breakpoint-in-xcode Comment : If only I could recreate it in a simulator device - that would help but I get these crashes via Crashlytics as they only happen in the wild Comment : @UlyssesR EXC BAD ACCESS is not a thrown exception . An exception backtrace will never work for that kind of crash . Comment : there s a longstanding AFNetworking issue about this but no progress : github.com AFNetworking AFNetworking issues 2866 https : github.com AFNetworking AFNetworking issues 2866", "Question : Recently I ve installed cocoapods v 1.0.0 in my mac successfully I am trying to install AFNetworking 3.0 dependency in my pod file of my project directory . which I ve created successfully by putting following code in my pod file .. . .. . but when I write pod install in terminal it giving me following error .. . .. . could anyone suggest me why I am getting this error how to resolve this issue .. . Answer : After submitting this question I further explored its solution come to know at https : guides.cocoapods.org using the-podfile.html that I should write simply this code in my podefile .. . .. . instead of above which I found at github AFNetworking official dependency installation guide . https : github.com AFNetworking AFNetworking .. . .. . But I am curious about why the official AFNetworking method does not works for its installation in my project could anyone answer it please anyway Thanks to cocoapods official website ." ] }
[ "yes-answer-long", "yes-answer-short" ]
https
UNK_RELATION
flacbox@audio@71
flacbox -- flacbox is a library which allows reading and writing flac @placeholder data as wave data-stream .
{ "confidence": [], "content": [] }
{ "confidence": [], "content": [] }
[ "yes-answer-long", "yes-answer-short" ]
audio
UNK_RELATION
webrick@server@49
webrick -- webrick is a zero-configuration http @placeholder stack chiefly used as the web server for the ruby-on-rails framework development and test-environments .
{ "confidence": [ 57.57096862792969, 51.60122299194336, 47.4263916015625, 45.97687530517578, 45.265350341796875, 45.209228515625, 44.92231369018555, 44.77475357055664, 44.143333435058594, 43.7141227722168, 43.333641052246094, 43.255126953125, 43.090755462646484, 42.88155746459961, 42.470645904541016, 42.368953704833984, 42.18040466308594, 42.107208251953125, 41.62284851074219, 41.53667449951172, 40.55372619628906, 40.487144470214844, 40.40675735473633, 40.15155792236328, 40.06343078613281, 39.56232833862305, 39.536163330078125, 39.3266487121582, 39.3266487121582, 39.31432342529297, 39.306190490722656, 38.89246368408203, 38.88246154785156, 38.88246154785156, 38.78123474121094, 38.78123474121094, 38.67967987060547, 38.62697982788086, 38.118019104003906, 37.88723373413086, 37.88359451293945, 37.776004791259766, 37.776004791259766, 37.776004791259766, 37.776004791259766, 37.776004791259766, 37.64704132080078, 37.62232971191406, 37.573150634765625, 37.573150634765625, 37.543399810791016, 37.40738296508789, 37.40738296508789, 37.202022552490234, 37.20094299316406, 36.98645782470703, 36.67243576049805, 36.57120895385742, 36.57120895385742, 36.57120895385742, 36.4227180480957, 36.40215301513672, 36.36835479736328, 36.239986419677734, 36.239986419677734, 36.239986419677734, 36.19679260253906, 36.19679260253906, 36.104454040527344, 36.09754943847656, 36.045108795166016, 35.80607986450195, 35.506195068359375, 35.506195068359375, 35.506195068359375, 35.41748809814453, 35.37586975097656, 35.197357177734375, 35.13688278198242, 35.08112335205078, 35.08112335205078, 35.08112335205078, 35.08112335205078, 35.08112335205078, 35.03583526611328, 35.0036735534668, 34.87869644165039, 34.86880111694336, 34.702877044677734, 34.68098068237305, 34.59636306762695, 34.591339111328125, 34.36885070800781, 34.346012115478516, 34.22819900512695, 34.22819900512695, 34.22819900512695, 34.05168533325195, 33.86061096191406, 33.85234832763672 ], "content": [ "The Ruby on Rails Webrick development server does the same thing for Rails code .", "It uses a webrick server for development .", "@KenThompson the problem is Webrick not Rails .", "I m using Webrick http server .", "I am using rails 4 with server webrick .", "Following WEBrick documentation http : ruby-doc.org stdlib-1.9.3 libdoc webrick rdoc WEBrick.html I read it as WEBrick is able to install a SIGINT handler .", "See here development on ruby-doc.org stdlib-2.2.3 libdoc webrick rdoc http : ruby-doc.org stdlib-2.2.3 libdoc webrick rdoc WEBrick.html module-WEBrick-label-HTTPS", "Note that I m not using the rails framework only webrick + .rhtml files .. . .. . Thanks", "The Ruby Webrick documentation above has information on that .", "I m facing a problem when I run my program in a browser with the WEBrick server http : ruby-doc.org stdlib-2.1.1 libdoc webrick rdoc WEBrick.html .", "WEBrick fails to even kick off .. . .. . By way of example in other similar questions here http : stackoverflow.com questions 16283936 webrick-rails-server-wont-start and here http : stackoverflow.com questions 16992302 trouble-starting-rails-server-webrick both of the inquirers receive the following .. . .. . etc ..etc....before the failure of WEBrick .", "Webrick should not be used in production .", "I can t use the WEBrick web server using the command rails server giving to me several problems .", "The webrick server on our development PC renders the same .js.erb file twice .", "Is there a way to start the WEBrick server with no verbosity .", "How do I get Ruby On Rails Webrick to work with self-signed SSL certificate on localhost just to test https", "I have a Rails app hosted on a server machine running Webrick .", "and according to the documentation for WEBrick : : Config http : ruby-doc.org stdlib-2.1.1 libdoc webrick rdoc WEBrick Config.html .. . .. . WEBrick can automatically create a self-signed certificate if : SSLCertName is set .", "There is no DoNotReverseLookup option in ruby 1.8.x webrick .", "When I using WEBrick as my web server everything goes ok .", "I ve recently found that some people prefer using unicorn rails instead of the default WEBrick as a web server for developing Rails applications .", "If you don t want WEBrick just to serve files you will have to add custom behavior http : ruby-doc.org stdlib-2.1.1 libdoc webrick rdoc WEBrick.html module-WEBrick-label-Custom+Behavior to your web server inside the 2loop.rb script .", "Does thing not show rails logging like webrick", "Consulting the Ruby Documentation for Webrick http : ruby-doc.org stdlib-2.0.0 libdoc webrick rdoc WEBrick.html led me to some code-snippets that got me going in the right direction .", "Also is there any benefit to using Webrick for development", "Rails has WEBrick installed as an out of the box APPLICATION server .", "Is there a way of configuring webrick to provide the appropriate http header within rails", "This is what happens when I try and start a new web server with WEBrick .", "Is there a different web server I should use instead of WEBrick", "When I try to log in in development mode with WEBrick I get a WEBrick : : HTTPStatus : : RequestURITooLarge error .", "start rubyw script rails server webrick .. . .. . start - start in another console rubyw - run ruby detached from console", "I think it must be due to changes in WEBrick in Ruby 1.9.3.. .", "I m running Apache on port 80 and Rails Webrick on port 3000 .", "I ve got a rails 4 application and I want to run it with SSL on webrick .", "WEBrick is blocking I O .. .", "It is indeed a WEBrick issue .", "Is there a Webrick config", "If you really want to keep webrick and have it handle SSL you change bin rails as described in this other answer http : stackoverflow.com questions 3640993 how-do-you-configure-webrick-to-use-ssl-in-rails .", "I abandoned WEBrick in development because it constantly crashes when using the debugger in ruby-1.9.3 .", "JRebel won t load Ruby code and Webrick won t load Java code .", "The following are the things I ve already tried so far : .. . .. . rails server options .. . .. . The rails server command doesn t come with an ssl option rails server --help : .. . .. . Custom WEBrick instance with automatically generated self-signed SSL certificate .. . .. . My Code .. . .. . Following along with the WEBrick documentation for HTTPS http : ruby-doc.org stdlib-2.1.1 libdoc webrick rdoc WEBrick.html module-WEBrick-label-HTTPS I made the following Ruby script that I run as ruby server.rb : .. . .. . According to the documentation I linked to above : .. . .. . This will start the server with a self-generated self-signed certificate .", "lvh.me isn t a webrick thing .", "Also the problem may be with Webrick .", "Webrick is very slow to respond .", "WHY can t it see by the webrick", "This happens even with WEBrick .", "WEBrick should probably never be used for production anyway .", "Source : WEBrick and Socket.do not reverse lookup : A Tale in Two Acts http : vais.github.io 2014 10 01 webrick-do-not-reverse-lookup", "I always assumed WEBrick was primitive and designed for development only .", "As I said I typically use WEBrick for development to dynamically reload classes .", "The full answer to getting WEBrick to work with SSL looks to be answered here : How do you configure WEBrick to use SSL in Rails", "I have run rails s trying to find WEBrick server but I m getting this in return .", "When I try to run the rails server it doesnt load WEBrick for some reason .", "Then I start webrick in production mode .", "Okay I figured out what was wrong I should ve paid closer attention to the instructions for HTTPS in WEBrick http : ruby-doc.org stdlib-2.1.1 libdoc webrick rdoc WEBrick.html module-WEBrick-label-HTTPS this is the exact code from the example : .. . .. . See that line that says require webrick https", "Can this be the reason I couldn t boot WEBrick http : stackoverflow.com questions 20829330 cant-boot-webrick-the-folder-for-rails-gem-is-empty for my sample project", "running bundle exec rails s loads Booting WEBrick", "Definitely a webrick limitation .", "Mongrel Thin Webrick Passenger", "Its WEBrick 1.3.1", "It looks like WEBrick has CGI support http : craiccomputing.blogspot.com 2008 03 ruby-webrick-and-cgi-scripts.html which implies that you can get PHP running by invoking it as a CGI script .", "I m running a debian vm and inside there there runs my rails application on a webrick server .", "The consensus seems to be : Webrick is ok for development but Thin or Unicorn is the choice for production period .", "I m using webrick the built-in ruby webserver to serve .rhtml files html with ruby code embedded --like jsp .", "Use your favorite editor to open this file : .. . .. . .rvm rubies ruby-version lib ruby-1.9.1 webrick httpresponse.rb .. . .. . .. . 2 .", "This problem has been fixed in Ruby s trunk branch with this commit https : github.com ruby ruby commit 0cbec6027cfb755972f80aab57920008d50fe842 to webrick .", "That is my only reason for preferring Webrick .", "Webrick now feels very speedy .", "Is switching from WEBrick to Puma http : puma.io an option", "If you are using rails 3 then modify the script rails file as .. . .. . The above code was modified from the example in Configuring WEBrick to use SSL in Rails 3 https : www.altamiracorp.com blog employee-posts configuring-webrick-to-use-ssl .", "Using un.rb to start WEBrick is done like this : .. . .. . and starts a web server in the document root .", "The Wikipedia article scares me http : en.wikipedia.org wiki WEBrick : Despite its popularity WEBrick has gained some notoriety since the code is completely undocumented", "They were not installing properly until I restarted the WEBrick server .", "Will I always have to restart the WEBrick server after installing new gems", "The fix was to set the config parameter DoNotReverseLookup to true when creating the WEBrick server :", "http : stackoverflow.com questions 1156759 webrick-very-slow-when-accessing-applications-from-remote-desktop .. . .. . Look for the file usr lib ruby-1.9.1 webrick config.rb and edit it .", "I searched the internet for a Hello World type program for Webrick in Ruby but could not find anything that worked .", "I am running a Rails app on the webrick server and wanted to get error messages to be displayed to me in the console .", "While I am developing though I hope to just use webrick as I am used to doing with rails .", "I tried this with Webrick and Thin neither worked .", "I don t think webrick is designed to run in production .", "One of the things I love most is WEBrick .", "This is so much better than ignore it or patch webrick .", "Another workaround that removes the offending line from webrick .", "There is a simple method of serving a folder over HTTP with WEBrick http : onestepback.org index.cgi Tech Ruby WEBrick.rdoc .", "Possible duplicate of How do you configure WEBrick to use SSL in Rails 3 http : stackoverflow.com questions 3640993 how-do-you-configure-webrick-to-use-ssl-in-rails-3 .", "I don t always have the luxury of working on a Ruby on Rails app so I was wondering how I might configure or modify WEBrick to be able to use it to serve up my PHP projects and Zend Framework applications .", "To bind webrick to a specific ip see this documentation : smyck.net 2007 03 11 how-to-bind-webrick-to-any-ip-address http : smyck.net 2007 03 11 how-to-bind-webrick-to-any-ip-address", "From the WEBrick source https : www.omniref.com ruby 2.2.1 symbols WEBrick : : HTTPRequest : : MAX URI LENGTH line 410 : .. . .. . If you need really long URI s then set it to something absurd like 9223372036854775807", "Browsing the documentation http : www.ensta.fr diam ruby online ruby-doc-stdlib libdoc webrick rdoc index.html it looks like you should have an HTTPRequest http : www.ensta.fr diam ruby online ruby-doc-stdlib libdoc webrick rdoc classes WEBrick HTTPRequest.html from which you can get the query-string .", "I configured webrick according to this post : http : www.nearinfinity.com blogs chris rohr configuring webrick to use ssl.html .. . .. . Now I want webrick to serve both http and https .", "I have a webserver behind an nginx when I send a bad request to the Rail application ex : to an URL that does not exist in the app - error 404 I get an error message from webrick like this : .. . .. . Now as you can see this message contains the web server name WEBrick the version as well as the Ruby version .", "The reason your server is returning that 404 is because the script you ve set up is just for an empty WEBrick server it doesn t actually mount your Rails app .", "A couple important reasons .. . .. . 1 . it s written in Ruby see http : github.com ruby ruby tree trunk lib webrick .. . 2 .", "yes it seems it is not possible to set https with webrick I used Nginx instead", "Usually Webrick is used for debugging so a small monkey-patch will not harm you", "WEBrick can be used in production provided it s rather a low-traffic website .", "Yes delayed-job is unrelated to Webrick unless your jobs use Webrick APIs which is honestly a code-smell as it couples .", "On Debian squeeze RVM-installed Ruby version 1.9.3-p327 WEBrick still gives these problematic warnings .", "Need to specify some options OutputBufferSize for webrick for rails application and didn t found any description of how I can do this ." ] }
{ "confidence": [ 62.335906982421875, 61.60392379760742, 61.53536605834961, 60.68674850463867, 60.48046112060547, 60.37723922729492, 60.009864807128906, 59.659934997558594, 59.453922271728516, 59.20857620239258, 59.190185546875, 59.005455017089844, 58.62283706665039, 58.41848373413086, 58.21219253540039, 58.108436584472656, 57.409820556640625, 57.2658576965332, 57.11259841918945, 56.96498489379883 ], "content": [ "Question : I am using OmniAuth to allow users to log in with their Google OpenID accounts . When I try to log in in development mode with WEBrick I get a WEBrick : : HTTPStatus : : RequestURITooLarge error . When I deploy it to my rails host it works fine . Is there a different web server I should use instead of WEBrick .. . Answer : The url size limit changed from 1024 to 2083 in the latest ruby source already . I hope an updated ruby version with this fix included will be released soon : .. . .. . https : github.com ruby ruby blob trunk lib webrick httprequest.rb L291 Comment : Usually Webrick is used for debugging so a small monkey-patch will not harm you Comment : Yeah but it s ugly and there s really no need for such a low limit...good they already fixed it :", "Question : I ve recently found that some people prefer using unicorn rails instead of the default WEBrick as a web server for developing Rails applications . I understand that if I wanted to use unicorn in production it could make kind of sense to try it out in development but since the configuration is different in production is it even relevant Is there any real tangible advantage that I would get from using thin or unicorn instead of WEBrick for developing a Rails application such as speed or some additional features Or is this just a matter of personal preference Comment : Interesting question . I abandoned WEBrick in development because it constantly crashes when using the debugger in ruby-1.9.3 . Using thin things come up sooo much faster . I always assumed WEBrick was primitive and designed for development only . I m very happy using thin for development and unicorn gives me 1-second downtime on deployments . I couldn t get unicorn to work with the RubyMine Debugger no such problem with thin . Comment : Thanks for not asking another one of those What s the best.. . questions that will be closed as not constructive . This question is very helpful for a community like SO : .. . Answer : In addition to the other answers giving a pretty good overview already there is also a technical reason you might want to consider using unicorn over WEBrick : .. . .. . WEBrick does not support subdomains . Support for HTTPS is rather hacky to implement http : stackoverflow.com questions 3640993 how-do-you-configure-webrick-to-use-ssl-in-rails-3-or-4 . .. . .. . So if you have an SaaS application using subdomains or if you simply want to have admin api .. . subdomain then WEBrick is not an option . There is POW http : pow.cx for Mac OS X but this won t work for Linux developers . Comment : +1 for mentioning POW . Makes life simple if you re on a Mac .", "Question : Since upgrading to Rails 3.1 I m seeing this warning message in my development log : .. . .. . WARN Could not determine content-length of response body . Set content-length of the response or set Response chunked true .. . .. . What does this mean and how can I remove it Is it a problem Comment : Same here for me it is happening when it s a remote call via JS . Comment : I started getting this as soon as I upgraded to Ruby 1.9.3 today . Wasn t seeing it before . I think it must be due to changes in WEBrick in Ruby 1.9.3.. . Comment : It is indeed a WEBrick issue . In the meantime you could add the thin gem to your Gemfile and boot Rails with that instead of WEBrick e.g . rails s thin Ta-da No more warnings . .. . Answer : Asked the same question to one of Rails-Core s members : .. . .. . https : twitter.com luislavena status 108998968859566080 .. . .. . And the answer : .. . .. . https : twitter.com tenderlove status 108999110136303617 .. . .. . ya it s fine . Need to clean it up but nothing is being hurt . Comment : Thank you I thought this question to be lost in the pits of despair in a hoarse voice imitating the torture guy from The Princess Bride Comment : fyi if the messages bother you as a workaround you can use thin add gem thin to your gemfile start your server using rails server thin . oops just noticed that @Scott Lowe already said this above . Comment : I find this annoying when these kinds of things are put in the category of nothing is being hurt . Just the fact that thousands of people are wasting time having to figure out what is going on is enough to dispute that . Comment : @KenThompson the problem is Webrick not Rails . Webrick do not support keep-alive connections and thus raises the warning issue we re seeing . It is recommended you use a proper better webserver like thin or passenger standalone for web . Upcoming versions of Ruby will fix this issue . Comment : The webrick server on our development PC renders the same .js.erb file twice . The twice rendering problem disappears on our production server which is running nginx . So this is a REAL problem in cases like ours .", "Question : I searched the internet for a Hello World type program for Webrick in Ruby but could not find anything that worked . I found this guide on SO http : stackoverflow.com questions 6397515 how-to-run-a-simple-ruby-script-in-any-web-server-apache-or-mongrel-or-any-thin but for the life of me could not get it to work . Consulting the Ruby Documentation for Webrick http : ruby-doc.org stdlib-2.0.0 libdoc webrick rdoc WEBrick.html led me to some code-snippets that got me going in the right direction . There were no easy-to-follow tutorials so I wanted to add my answer on SO . I was using Ubuntu 14.04 without Apache or Nginx and wanted my server for a virtual host . Webrick by default does not respond to requests concurrently but for me this was a plus in addition to its small footprint . I was hoping to get it working without the Rails framework for an even lighter footprint . .. . Answer : To get started I installed Ruby with the Ubuntu package manager . If you are using CentOS or another Linux distribution you can adapt this step to your particular package manager . Also make sure port 80 is open on your web server . It s possible to get SSL with Webrick but I chose not to at this point . Here is the script which I named myapp.rb that I am using . I placed it var www myapp . Ideally I think it should not be in document root . You should also create a special user and group just to run the script to improve security I have not outlined those steps here .. . .. . The require statement above tells Ruby to include the Webrick classes when running the program . The second line of the script creates an instance of Webrick with the following options : .. . .. . Use Port 80 .. . Disable SSL .. . Set the document root to var www myapp .. . Set the Server Alias to myapp.example.com .. . .. . Of course you ll have to configure your particular domains DNS . The server.mount proc is telling Ruby to serve the response Hello world at document root . I think you can specify a subdirectory there if you life . The Ruby Webrick documentation above has information on that . The line that begins with trap means that the web server can be stopped with Ctrl-C . To start the script I typed the following at the SSH command-line : Comment : Consider using rvm Ruby enVironment Manager rvm.io https : rvm.io makes your life a whole lot easier - Comment : @Rogier will have to look into that . Thanks . Comment : FYI you can accept your own answer so it doesn t list as unanswered anymore . Comment : @Rogier It says I have to wait 5 hours but I will create a reminder", "Question : I want to develop my Ruby on Rails application locally with SSL HTTPS but I m having trouble trying to setup a server to use SSL . The following are the things I ve already tried so far : .. . .. . rails server options .. . .. . The rails server command doesn t come with an ssl option rails server --help : .. . .. . Custom WEBrick instance with automatically generated self-signed SSL certificate .. . .. . My Code .. . .. . Following along with the WEBrick documentation for HTTPS http : ruby-doc.org stdlib-2.1.1 libdoc webrick rdoc WEBrick.html module-WEBrick-label-HTTPS I made the following Ruby script that I run as ruby server.rb : .. . .. . According to the documentation I linked to above : .. . .. . This will start the server with a self-generated self-signed certificate . and according to the documentation for WEBrick : : Config http : ruby-doc.org stdlib-2.1.1 libdoc webrick rdoc WEBrick Config.html .. . .. . WEBrick can automatically create a self-signed certificate if : SSLCertName is set . The Errors .. . .. . When I start the server I get the following output : .. . .. . However when I try to access https : localhost : 4430 robots.txt I get the following error in Chrome 33.0.1750.117 : .. . .. . enter image description here http : i.stack.imgur.com WuzQc.png .. . .. . and the following error when I try the same url in Firefox 27.0.1 : .. . .. . enter image description here http : i.stack.imgur.com iw5yZ.png .. . .. . I looked up the ssl error rx record too long http : stackoverflow.com questions 119336 ssl-error-rx-record-too-long-and-apache-ssl error and it looks like it can be caused by a few different things . Maybe WEBrick is still listening for HTTP requests on port 80 but that seems odd considering I explicitly set it to enable SSL on port 4430 . Access Logs .. . .. . Additionally here are the access log contents from WEBrick when I make the request for https : localhost : 4430 robots.txt from Chrome but I have no idea what any of it means it looks like it s encoded in hex or something : .. . .. . Ruby Source for SSL Module .. . .. . Also I checked the Ruby source code for the SSL module https : github.com ruby ruby blob v2 1 1 lib webrick ssl.rb L107-L109 but I don t see anything obvious in there for why this might not be working : .. . .. . My Environment .. . .. . Here are the following things I m using for development : .. . .. . 1 . OS X Mavericks . 2 . Ruby 2.1.1 . 3 . Rails 4.0.3 . Summary .. . .. . So this is where I m at currently and I m not sure how to proceed . I m aware that I can just pass my own self-signed certificate file generated with something like OpenSSL to WEBrick but the documentation says that WEBrick can automatically generate its own and I m really interested in getting that to work . I m also aware that I can use a different webserver like Thin with its --ssl option but again I wanted to use WEBrick because it s the out-of-the-box web server for Rails I want to be able to easily and quickly setup a development SSL web server without having to download additional gems and stuff like that . I m also aware that this solution https : www.altamiracorp.com blog employee-posts configuring-webrick-to-use-ssl exists but again I m interested in having WEBrick automatically generate its own certificate and besides that solution seems to be a little overly complicated for what I m trying to do . So does anyone have any ideas of what might be wrong .. . Answer : Okay I figured out what was wrong I should ve paid closer attention to the instructions for HTTPS in WEBrick http : ruby-doc.org stdlib-2.1.1 libdoc webrick rdoc WEBrick.html module-WEBrick-label-HTTPS this is the exact code from the example : .. . .. . See that line that says require webrick https I didn t have that in my original config . I didn t think that I d need it . .. . .. . Once I added it my script started serving over HTTPS and I could finally connect to https : localhost : 4430 robots.txt . face-palm Comment : If I m following a Sinatra example does this just get copied into the app.rb Or do I create a server.rb that loads the app.rb Comment : In recent versions of OpenSSL the SSLCertName needs to be specified like this : CN localhost OpenSSL : : ASN1 : : PRINTABLESTRING Comment : @cupcake can you write a tutorial on how to make your localhost rails to https Comment : @user1735921 unfortunately I don t have time for such a thing . Not only that but this is probably not a proper way to implement https in a Rails application either either locally or in production . Comment : @Cupcake hmm ok. .", "Question : I am running a Sinatra application locally . Ever since I installed Thin my Sinatra app always uses it as the web server . However I have been having performance issues with Thin serving the large amount of static files required by my application and I would like to switch to either Mongrel or WEBrick . I cannot seem to figure out how to switch my application over to Mongrel or WEBrick . Even when I put require mongrel or require webrick at the top of my app.rb upon a ruby app.rb Sinatra still starts with Thin . So my question is : how do you specify the web server for Sinatra to use in development mode Also how could I do so in production mode .. . Answer : You can set the server Sinatra uses with the : server configuration setting see full list http : www.sinatrarb.com configuration.html : .. . .. . In production it is much better to use a more sophisticated server like Phusion Passenger https : www.phusionpassenger.com or Unicorn http : unicorn.bogomips.org since they have better performance than Thin Mongrel or WEBrick . If you choose Passenger or Unicorn you would not configure the server within your Sinatra app file itself but instead typically configure it separately using a Rackup file https : github.com rack rack wiki 28tutorial 29-rackup-howto . This previous question is aimed at Rails apps but is still very relevant for Sinatra apps : .. . .. . Ruby on Rails Server options http : stackoverflow.com questions 4113299 ruby-on-rails-server-options", "Question : I ve recently found that some people prefer using unicorn rails instead of the default WEBrick as a web server for developing Rails applications . I understand that if I wanted to use unicorn in production it could make kind of sense to try it out in development but since the configuration is different in production is it even relevant Is there any real tangible advantage that I would get from using thin or unicorn instead of WEBrick for developing a Rails application such as speed or some additional features Or is this just a matter of personal preference Comment : Interesting question . I abandoned WEBrick in development because it constantly crashes when using the debugger in ruby-1.9.3 . Using thin things come up sooo much faster . I always assumed WEBrick was primitive and designed for development only . I m very happy using thin for development and unicorn gives me 1-second downtime on deployments . I couldn t get unicorn to work with the RubyMine Debugger no such problem with thin . Comment : Thanks for not asking another one of those What s the best.. . questions that will be closed as not constructive . This question is very helpful for a community like SO : .. . Answer : My personal experience is that WEBrick is faster in my development-environment than Unicorn and Thin OS X in a pretty big Rails app lots of gems routes etc . But you should measure it yourself with your app in your machine to see I tested using ab http : httpd.apache.org docs 2.2 programs ab.html and using Chrome s developer tools . However using the same server in production and development is a very good idea .", "Question : I am a PHP developer who has started learning Ruby on Rails . I love how easy it is to get up and running developing Rails applications . One of the things I love most is WEBrick . It makes it so you don t have to configure Apache and Virtual Hosts for every little project you are working on . WEBrick allows you to easily start up and shut down a server so you can click around your web application . I don t always have the luxury of working on a Ruby on Rails app so I was wondering how I might configure or modify WEBrick to be able to use it to serve up my PHP projects and Zend Framework applications . Have you attempted this What would be the necessary steps in order to achieve this Comment : Are you sure you want to use it The Wikipedia article scares me http : en.wikipedia.org wiki WEBrick : Despite its popularity WEBrick has gained some notoriety since the code is completely undocumented .. . Answer : It looks like WEBrick has CGI support http : craiccomputing.blogspot.com 2008 03 ruby-webrick-and-cgi-scripts.html which implies that you can get PHP running by invoking it as a CGI script . The line at the top of each executable file would just need to point towards the absolute path to php-cgi.exe . It s worth noting that you d need to remove the line when moving the file to any other server that doesn t think of PHP as a CGI script which would be .. . uh .. . all of em .", "Question : How do I get Ruby On Rails Webrick to work with self-signed SSL certificate on localhost just to test https Basically Ived followed the work that has been done here : Configure WEBrick to use automatically generated self-signed SSL HTTPS certificate http : stackoverflow.com questions 22165854 configure-webrick-to-use-automatically-generated-self-signed-ssl-https-certifica .. . .. . And produce the script like the following : .. . .. . When I tried to access https : localhost : 8000 it did warn about trust but just went ahead instead I had nothing come out but this . BTW https works fine just it seems its not getting the right route for SSL . console prints this : .. . Answer : The reason your server is returning that 404 is because the script you ve set up is just for an empty WEBrick server it doesn t actually mount your Rails app . The thread you linked to seemed to be using that script just as a minimal test for the SSL functionality . The full answer to getting WEBrick to work with SSL looks to be answered here : How do you configure WEBrick to use SSL in Rails http : stackoverflow.com questions 3640993 how-do-you-configure-webrick-to-use-ssl-in-rails .. . .. . However I wouldn t recommend you bother . WEBrick is strictly meant as a development-only server and isn t suitable for use in production which is why it s hard to get it to do things like use SSL . Instead either set up nginx as a SSL-serving proxy to your app http : shiny-bits-of-code.tumblr.com post 4749553253 ssl-proxy-with-nginx or use a server which supports SSL easily like thin does http : stackoverflow.com a 16395695 5154683 .", "Question : I ve recently found that some people prefer using unicorn rails instead of the default WEBrick as a web server for developing Rails applications . I understand that if I wanted to use unicorn in production it could make kind of sense to try it out in development but since the configuration is different in production is it even relevant Is there any real tangible advantage that I would get from using thin or unicorn instead of WEBrick for developing a Rails application such as speed or some additional features Or is this just a matter of personal preference Comment : Interesting question . I abandoned WEBrick in development because it constantly crashes when using the debugger in ruby-1.9.3 . Using thin things come up sooo much faster . I always assumed WEBrick was primitive and designed for development only . I m very happy using thin for development and unicorn gives me 1-second downtime on deployments . I couldn t get unicorn to work with the RubyMine Debugger no such problem with thin . Comment : Thanks for not asking another one of those What s the best.. . questions that will be closed as not constructive . This question is very helpful for a community like SO : .. . Answer : My personal experience is that Unicorn is much much faster then WEBrick when using a remote machine ubuntu 4 cores 8G mem connecting though VPN - ssh as your development-environment as I do -- I see sub-1 second page load times with Unicorn while WEBrick takes 3 to 5 second or more . I m not sure why it may have more to do with my network then anything else but that is what I personally see . I haven t used Thin for development as I ve read that it requires an additional gem to allow for class reloading in development mode I can t personally validate the accuracy of that . Also I am more familiar with Unicorn and use it in production . Comment : Which gem would one use with Unicorn to support for class reloading when the class changes . That is my only reason for preferring Webrick . Comment : Without doing some more research I couldn t name a gem . However you could use a watcher and the HUP signal with the proper config . See : unicorn.bogomips.org SIGNALS.html http : unicorn.bogomips.org SIGNALS.html . As I said I typically use WEBrick for development to dynamically reload classes .", "Question : I m facing a problem when I run my program in a browser with the WEBrick server http : ruby-doc.org stdlib-2.1.1 libdoc webrick rdoc WEBrick.html . It shows me my code as written in the 2loop.rb file . When I run ruby -run -e -httpd . -p 5000 at the command-prompt and load http : localhost : 5000 2loop.rb in the browser it shows the code from 2loop.rb instead of running it . How can I execute the 2loop.rb program instead Comment : You should check out something like sinatra . .. . Answer : TL DR .. . .. . You re doing this to yourself by serving your current working directory as the root of your web server . You aren t actually running the code in your file you re just telling WEBrick http : www.ruby-doc.org stdlib-2.1.1 libdoc webrick rdoc WEBrick.html to serve any file you name in the URI . http : localhost : 5000 2loop.rb will serve 2loop.rb as text html in your posted example . Using un.rb .. . .. . The flag you re using isn t actually run . Instead the -r flag actually loads a module which in this case is the un.rb http : ruby-doc.org stdlib-2.1.1 libdoc un rdoc un rb.html module . Using un.rb to start WEBrick is done like this : .. . .. . and starts a web server in the document root . In this case the dot means to use the current working directory as the root . This is not really what you want to start code you ve placed inside a Ruby file . Running WEBrick Programmatically .. . .. . Using some snippets from the WEBrick documentation http : www.ruby-doc.org stdlib-2.1.1 libdoc webrick rdoc WEBrick.html you will see that you can create a file named 2loop.rb containing the following : .. . .. . This will serve files out of the tmp public html directory on port 5000 which you can reach at http : localhost : 5000 . You can then make the file executable and start the server with . 2loop.rb or just run ruby 2loop.rb if you don t want to make your file executable for some reason . If you don t want WEBrick just to serve files you will have to add custom behavior http : ruby-doc.org stdlib-2.1.1 libdoc webrick rdoc WEBrick.html module-WEBrick-label-Custom+Behavior to your web server inside the 2loop.rb script . This is a fairly low-level thing to do but may suit your needs . Sensible Alternatives .. . .. . You should probably use a web framework like Ruby on Rails http : rubyonrails.org or Sinatra http : www.sinatrarb.com if you don t want to have write all the low-level behaviors yourself . Sinatra in particular is a very lightweight alternative . This example : .. . .. . will create a URL at http : localhost : 5000 hello with a custom-action that returns Hello World as an in-browser response . Comment : Hi this is not working I have run this command in command-prompt ruby -run -e httpd . -p 5000 ------- after open browser with my file. . which i have write down this code -------------- require webrick root File.path tmp public html server WEBrick : : HTTPServer.new : Port 5000 : DocumentRoot root trap INT do server.shutdown end server.start ary 0 fred 1 10 2 3.14 3 This is a string 4 last element ary.each do key-value puts key-value end It show me as it is :", "Question : I am a PHP developer who has started learning Ruby on Rails . I love how easy it is to get up and running developing Rails applications . One of the things I love most is WEBrick . It makes it so you don t have to configure Apache and Virtual Hosts for every little project you are working on . WEBrick allows you to easily start up and shut down a server so you can click around your web application . I don t always have the luxury of working on a Ruby on Rails app so I was wondering how I might configure or modify WEBrick to be able to use it to serve up my PHP projects and Zend Framework applications . Have you attempted this What would be the necessary steps in order to achieve this Comment : Are you sure you want to use it The Wikipedia article scares me http : en.wikipedia.org wiki WEBrick : Despite its popularity WEBrick has gained some notoriety since the code is completely undocumented .. . Answer : You can use nginx http : nginx.org or lighttpd http : www.lighttpd.net .. . .. . Here s a minimal lighttpd config . 1 . Install PHP with FastCGI support and adjust the bin-path option below for your system . You can install it with MacPorts http : www.macports.org using sudo port install php5 +fastcgi .. . 2 . Name this file lighttpd.conf .. . 3 . then simply run lighttpd -f lighttpd.conf from any directory you d like to serve . 4 . Open your webbrowser to localhost : 8000 .. . .. . lighttpd.conf : .. . .. . If you d like to use a custom php.ini file change bin-path to this : .. . .. . If you d like to configure nginx to do the same here s a pointer http : wiki.nginx.org Configuration PHP via FastCGI . Comment : didn t even know about lighttpd or nginx . I ll have to try this out . thanks", "Question : I ve recently found that some people prefer using unicorn rails instead of the default WEBrick as a web server for developing Rails applications . I understand that if I wanted to use unicorn in production it could make kind of sense to try it out in development but since the configuration is different in production is it even relevant Is there any real tangible advantage that I would get from using thin or unicorn instead of WEBrick for developing a Rails application such as speed or some additional features Or is this just a matter of personal preference Comment : Interesting question . I abandoned WEBrick in development because it constantly crashes when using the debugger in ruby-1.9.3 . Using thin things come up sooo much faster . I always assumed WEBrick was primitive and designed for development only . I m very happy using thin for development and unicorn gives me 1-second downtime on deployments . I couldn t get unicorn to work with the RubyMine Debugger no such problem with thin . Comment : Thanks for not asking another one of those What s the best.. . questions that will be closed as not constructive . This question is very helpful for a community like SO : .. . Answer : It is important to develop as closely as possible to the production environment . It helps ensure that an application will work as expected when deployed into production instead of stumbling upon bugs at runtime . This issue is alleviated with the use of Continuous Testing on a Build server that replicates the production environment . Even though you are not actively developing on an identical environment the Continuous Testing gives you coverage that the application is functioning in the expected way . As to speed the performance hit running a Rails app in development mode will negate any benefit the various web servers brings .", "Question : I have a Rails application that I m running on my server . When I go to a remote desktop and attempt to load the application the server takes a good 3-4 minutes to respond with a simple HTML page . However when I load up the page locally on the server the page shows up in just a second . I tried pinging the server from my remote desktop and the pings are going through successful in a reasonable amount of time . This all seems to have started after I installed Oracle s basic client and SQLPLUS . Should I suspect Oracle Has anyone experienced anything similar to this Comment : Maybe this should now be moved to serverfault Comment : There is no need this can be solved by simply modifying a line in a configuration file Comment : @AmigableClarkKant Webrick s more of a developer tool so seems better to stay on SO . Comment : goodness and all along I attributed the problem to vmware burn in hell webrick : .. . Answer : This is an old question and answer thread that helped me solve the : DoNotReverseLookup issue on a local development virtual-machine and wanted to add additional info . This web page explains the regression error http : vais.github.io 2014 10 01 webrick-do-not-reverse-lookup in Ruby core that lead to this issue appearing for some emphasis is mine the long an short of all of this is there is a GitHub pull request for a Ruby core fix to this and hopefully it will be approved and merged in a soon-ish release of Ruby : .. . .. . After a few hours of troubleshooting it turned out that it was Apparently somewhere along the evolution of Ruby s standard lib from 1.8.6 to 2.0.0 WEBrick acquired a new configuration option : DoNotReverseLookup that is set to nil by default . Then deep in the guts of WEBrick s request processing code it sets the do not reverse lookup flag on the incoming connection socket instance to the value of config : DoNotReverseLookup . Since this value is nil which is falsy the effect is the same as setting it to false overriding the global Socket.do not reverse lookup flag . So unless you have : DoNotReverseLookup true in your WEBrick config reverse DNS lookup will always happen for each new connection potentially causing serious latency . .. . .. . Related to this discovery is a GitHub pull request from the author https : github.com ruby ruby pull 731 proposing how to repair the issue in the Ruby WEBrick source code : Fix regression bug in WEBrick s : DoNotReverseLookup config option implementation 731 https : github.com ruby ruby pull 731 .. . .. . The solution as outlined in the request is to change line 181 in lib webrick server.rb from this : .. . .. . To this : .. . .. . Sharing here if anyone stumbles over this well regarded question answer thread and are interested in the progress in solving this issue in Ruby core . Hopefully this pull will be merged or the underlying issue be dealt with in some way in the next release of Ruby maybe 2.1.6", "Question : Since upgrading to Rails 3.1 I m seeing this warning message in my development log : .. . .. . WARN Could not determine content-length of response body . Set content-length of the response or set Response chunked true .. . .. . What does this mean and how can I remove it Is it a problem Comment : Same here for me it is happening when it s a remote call via JS . Comment : I started getting this as soon as I upgraded to Ruby 1.9.3 today . Wasn t seeing it before . I think it must be due to changes in WEBrick in Ruby 1.9.3.. . Comment : It is indeed a WEBrick issue . In the meantime you could add the thin gem to your Gemfile and boot Rails with that instead of WEBrick e.g . rails s thin Ta-da No more warnings . .. . Answer : You can also use Thin instead of the default Webrick . Add this to Gemfile gem thin .. . .. . then rails s thin will use thin and the warning will disappear . Comment : Yes . This is what I ve ended up doing in more recent months . Ryan Bates also mentioned in a recent Railscast . Comment : @cam song : almost correct : rails s thin will use thin instead of Webrick and the warn will disappear . Comment : I put thin in development group . Rails 4 seems picking it up automatically when running rails s", "Question : I am a PHP developer who has started learning Ruby on Rails . I love how easy it is to get up and running developing Rails applications . One of the things I love most is WEBrick . It makes it so you don t have to configure Apache and Virtual Hosts for every little project you are working on . WEBrick allows you to easily start up and shut down a server so you can click around your web application . I don t always have the luxury of working on a Ruby on Rails app so I was wondering how I might configure or modify WEBrick to be able to use it to serve up my PHP projects and Zend Framework applications . Have you attempted this What would be the necessary steps in order to achieve this Comment : Are you sure you want to use it The Wikipedia article scares me http : en.wikipedia.org wiki WEBrick : Despite its popularity WEBrick has gained some notoriety since the code is completely undocumented .. . Answer : To get php support in webrick you can use a handler for php files . To do this you have to extend HttpServlet : : AbstractServlet and implement the do GET and do POST methods . These methods are called for GET and POST requests from a browser . There you just have to feed the incoming request to php-cgi . To get the PHPHandler to handle php files you have to add it to the HandlerTable of a specific mount . You can do it like this : .. . .. . The first statement initializes the server . The second adds options to the DocumentRoot mount . Here it enables directory listings and handling php files with PHPHandler . After that the server can be started with s.start . I have written a PHPHandler myself as I haven t found one somewhere else . It is based on webricks CGIHandler but reworked to get it working with php-cgi . You can have a look at the PHPHandler on GitHub : .. . .. . https : github.com questmaster WEBrickPHPHandler", "Question : null .. . Answer : I m trying to connect Redmine http : www.redmine.org to Tivoli ldap server https : en.wikipedia.org wiki IBM Tivoli Directory Server but have very strange issue . When I run Redmine on Webrick it works fine connecting to ldap by using its username and pussword But when I run it on Nginx + Passenger it doesn t login throwing an exception that username or password are wrong . At the same time when I try to perform a test connection from settings page to Ldap it works fine on Webrick and Nginx + Passenger . I m using the following configuration : .. . .. . Ubuntu 14.04.01 .. . Ruby 2.2.3p173 .. . Rails 4.2.4 .. . ldap gem : net-ldap 0.11 .. . Nginx I couldn t find how to check its version but I think that 1.9.6 because I ve installed it today .. . Passenger 5.0.21 .. . .. . UPDATE : if I add rails env development to nginx.conf it begin to work . UPDATE 2 : I was able to localize the problem when I ve changed a line config.eager load true to config.eager load false at redmine config environments production.rb it begun to work now I don t really know why it has such effect", "Question : Since upgrading to Rails 3.1 I m seeing this warning message in my development log : .. . .. . WARN Could not determine content-length of response body . Set content-length of the response or set Response chunked true .. . .. . What does this mean and how can I remove it Is it a problem Comment : Same here for me it is happening when it s a remote call via JS . Comment : I started getting this as soon as I upgraded to Ruby 1.9.3 today . Wasn t seeing it before . I think it must be due to changes in WEBrick in Ruby 1.9.3.. . Comment : It is indeed a WEBrick issue . In the meantime you could add the thin gem to your Gemfile and boot Rails with that instead of WEBrick e.g . rails s thin Ta-da No more warnings . .. . Answer : Another workaround that removes the offending line from webrick . It s just not that useful : .. . .. . you may need to sudo", "Question : I m using webrick the built-in ruby webserver to serve .rhtml files html with ruby code embedded --like jsp . It works fine but I can t figure out how to access parameters e.g . http : localhost mypage.rhtml foo bar from within the ruby code in the .rhtml file . Note that I m not using the rails framework only webrick + .rhtml files .. . .. . Thanks .. . Answer : Browsing the documentation http : www.ensta.fr diam ruby online ruby-doc-stdlib libdoc webrick rdoc index.html it looks like you should have an HTTPRequest http : www.ensta.fr diam ruby online ruby-doc-stdlib libdoc webrick rdoc classes WEBrick HTTPRequest.html from which you can get the query-string . You can then use parse query to get a name value hash . Alternatively it s possible that just calling query will give you the hash directly.. . my Ruby-fu isn t quite up to it but you might want to at least give it a try . Comment : The problem is I need to get the instance of HTTPRequest associated with the request . Comment : query within the .rhtml fails By the way the class name HTTPRequest is available within the .rhtml and also I can access the webrick HTTPServer object", "Question : Thanks for taking a look at this . I started a beginner s tutorial on RoR through lynda.com . I followed the instructions to the letter . Everything was working so far until I got to accessing Webrick . When I typed in rails server to begin work I got this error message below . I m using a .. . .. . iMac .. . Ruby 1.87 .. . Gem 1.7.2 .. . .. . Since I m not experienced with anything Ruby I m lost on how to fix this . Thanks in advance for your attention and help if possible . .. . Answer : Correct way that worked for me was : .. . .. . cd command .. . .. . nano .bash-profile command .. . .. . add this line of code : .. . .. . .. . export DYLD LIBRARY PATH usr local mysql lib : DYLD LIBRARY PATH .. . .. . ctrl+x save .. . .. . y yes .. . .. . cd Sites sitename command .. . .. . rails server run WEBrick server .. . .. . and you should get this message : .. . .. . .. . Booting WEBrick .. . Rails 3.2.11 application starting in development on localhost : 3000 .. . Call with -d to detach" ] }
[ "yes-answer-long", "yes-answer-short" ]
server
UNK_RELATION
cublas@cuda@155
cublas -- the nvidia cuda basic linear-algebra subroutines cublas library is a gpu-accelerated version of the complete standard blas library for use with @placeholder capable gpus .
{ "confidence": [ 55.32093811035156, 54.58763885498047, 53.62737274169922, 52.975860595703125, 50.711692810058594, 49.935665130615234, 48.93670654296875, 48.848228454589844, 48.33137893676758, 48.238792419433594, 48.19786071777344, 47.77134704589844, 47.08692169189453, 47.061073303222656, 46.70048522949219, 46.28046417236328, 46.08472442626953, 45.75517272949219, 45.679962158203125, 45.647884368896484, 45.213348388671875, 44.96815872192383, 44.70384979248047, 44.217803955078125, 44.174713134765625, 44.03627014160156, 43.95966339111328, 43.72163772583008, 43.72163772583008, 43.55195617675781, 43.36840057373047, 43.09554672241211, 42.9853401184082, 42.870704650878906, 42.87019729614258, 42.72985076904297, 42.64408874511719, 42.516632080078125, 42.516632080078125, 42.49851608276367, 42.40713882446289, 42.013648986816406, 42.013648986816406, 41.84538269042969, 41.84538269042969, 41.75713348388672, 41.75713348388672, 41.75713348388672, 41.553550720214844, 41.26567077636719, 41.19154357910156, 41.08852767944336, 40.987518310546875, 40.47079849243164, 40.280914306640625, 40.27606201171875, 40.21882629394531, 40.21882629394531, 40.21882629394531, 40.20946502685547, 39.666481018066406, 39.55450439453125, 39.362648010253906, 39.34144592285156, 39.19830322265625, 38.93233108520508, 38.67115783691406, 38.590553283691406, 38.50495147705078, 38.39292907714844, 38.128173828125, 38.030982971191406, 38.016197204589844, 38.003780364990234, 38.003780364990234, 38.003780364990234, 37.975181579589844, 37.891944885253906, 37.891944885253906, 37.58689880371094, 37.54863739013672, 37.263160705566406, 37.19057846069336, 36.966644287109375, 36.881004333496094, 36.78321075439453, 36.46547317504883, 36.46547317504883, 36.46547317504883, 36.46547317504883, 36.46547317504883, 36.46547317504883, 36.46547317504883, 36.3536376953125, 36.3536376953125, 36.3536376953125, 36.3536376953125, 36.3536376953125 ], "content": [ "Since CUDA 5.5 the CUBLAS library contains routines for batched matrix-factorization and inversion cublas t getrfBatched http : docs.nvidia.com cuda cublas index.html cublas-lt-t-gt-getrfbatched and cublas t getriBatched http : docs.nvidia.com cuda cublas index.html cublas-lt-t-gt-getribatched respectively .", "I cannot write my own kernel I have to use CUBLAS or another standard NVIDIA library if it is really not possible with CUBLAS .", "Cublas is a host api and library .", "I m a beginner in Cuda and in Cublas .", "Is there any cuda cuBLAS.. . API doing that", "I was confronted by the problem that cuBLAS doesn t export the standard BLAS function names they have a cublas prefix .", "The version of CUBLAS bundled with the CUDA 5 toolkit contains a BLAS-like method cublasgeam that could be used to transpose a matrix .", "Here http : docs.nvidia.com cuda cublas device-api you can find all the details about cuBLAS device API such as : .. . .. . Starting with release 5.0 the CUDA Toolkit now provides a static cuBLAS Library cublas device.a that contains device routines with the same API as the regular cuBLAS Library .", "Please refer to cuBlas document for more detail .. . .. . http : docs.nvidia.com cuda cublas index.html cublas-lt-t-gt-syrk", "I m not seeing how to twist the cuBLAS library into doing that .", "I m trying to inverse a matrix using linear-equation solver through cublas CUDA library .", "For a limited example replacing a single BLAS function -- Dgemm of using the cublas thunking interface in an application Octave that uses the BLAS library see here http : stackoverflow.com questions 17493270 converting-octave-to-use-cublas 17493698 17493698 .", "I am learning cuda and cublas for a month and I want to test the performance of cublas for further use .", "CUBLAS already comes with a built-in set of Fortran bindings and a thunking wrapper interface - see docs.nvidia.com cuda cublas http : docs.nvidia.com cuda cublas index.html appendix-b-cublas-fortran-bindings", "So as one example let s add the cublas library .", "In the cublas API http : docs.nvidia.com cuda cublas index.html topic 9 1 : .. . .. . and specifying the transa operator as CUBLAS OP T for transpose", "A kernel could on a supported GPU use the CUBLAS device API .", "It certainly is possible http : docs.nvidia.com cuda cublas index.html topic 3 7 to call CUBLAS routines from device code a new feature in CUDA 5 .", "Does the access to cublas library required sudo authority", "I have experience with CUDA BLAS LAPACK etc but unfortunately there is no kron A B function in the common GPU implementations magma cuBLAS cula etc .", "Problems begins with matrix inversions based on cublas t getrfBatched and cublas t getriBatched functions see here http : docs.nvidia.com cuda cublas index.html cublas-lt-t-gt-getribatched .", "CUBLAS returns an index 1 higher than the others because CUBLAS uses 1-based indexing http : docs.nvidia.com cuda cublas index.html data-layout .", "Moreover the library cuBLAS library doesn t include LAPACK routines .", "There isn t a way I am aware of to do what you are asking in CUBLAS nor in standard BLAS .", "EDIT2 : The method described in this video http : youtu.be P2Ew4Ljyi6Y t 1m59s requires the use of the fortran thunking library bindings for cublas http : docs.nvidia.com cuda cublas index.html topic 11 .", "Is there any implementation for multiplying matrices of int32s or int64s using cuBLAS or any other CUDA based library", "cublas iii .", "But SAXPY http : docs.nvidia.com cuda cublas index.html cublas-lt-t-gt-axpy implements y alpha x+y .", "http : docs.nvidia.com cuda cublas index.html appendix-b-cublas-fortran-bindings .. . .. . You should be able to run your application with it .", "I am porting my c++ code to CUDA CUBLAS .", "I am currently implementing Stochastic Gradient Descent on a GPU using CUDA Thrust and cuBLAS .", "For cuBlas the API name is cublas t syrk .", "If you want to use CUBLAS and you have a GPU with compute capability 3.5 K20 Titan than you can use CUBLAS with dynamic parallelism .", "Currently I m just trying to implement simple Linear Regression algorithm in matrix-form based on cuBLAS with CUDA .", "For dense vector A : BLAS Time 0.0291584 CUBLAS Time 0.00639274 which is good BUT... .", "You are suppose to call cublasSgetrfBatched http : docs.nvidia.com cuda cublas cublas-lt-t-gt-getrfbatched to do LU factorization before this function .", "I would like to solve a linear-equation with CuBLAS using cublasSgetrsBatched function .", "Is there any maximum batchsize limitation for cublasDgetrfBatched from CUBLAS library", "I know that CUBLAS library uses column-major matrix storage .", "I am wondering how the GEMM http : docs.nvidia.com cuda cublas cublas-lt-t-gt-gemm Transpose works .", "Just a general question about cublas .", "cublasSetMatrix doesn t do allocation http : docs.nvidia.com cuda cublas index.html cublassetmatrix .", "It s documented here http : docs.nvidia.com cuda cublas index.html topic 9 1 .", "As you can read in the cublas documentation http : docs.nvidia.com cuda cublas cublas-lt-t-gt-gemv x is a vector of n column elements only if CUBLAS OP N is used .", "CUBLAS has a separate function http : docs.nvidia.com cuda cublas index.html topic 9 1 for each type of data but I want to call CUBLAS from within a template e.g .", "But oddly enough that s not in cuBLAS .", "This kernel uses cublas functions .", "cuBLAS calls are executing asynchronously .", "There seems to be a bug in the current CUBLAS library implementation of cublas t getrfBatched for matrices of dimension n such that 3 n 16 when there is a zero pivot as you say .", "Have you studied the batched cublas cuda sample code http : docs.nvidia.com cuda cuda-samples index.html batchcublas", "There are no published limits to the batch size http : docs.nvidia.com cuda cublas index.html cublas-lt-t-gt-getrfbatched other than implicit memory limits .", "Starting with the Tesla K20 GPU and CUDA 5 you will be able to call CUBLAS routines from device kernels using CUDA Dynamic Parallelism .", ".. . In order to use those library routines from the device the user must include the header file cublas v2.h corresponding to the new cuBLAS API and link against the static cuBLAS library cublas device.a .", "However cublas is not detected and I have a compilation error in any cublas call .", "Although I succeeded in using the nonsymmetric version cublas t gemm I couldn t use the cublas t symm function properly .", "CUBLAS is based on the reference BLAS and the reference BLAS http : www.netlib.org blas level 1 has never contained a Hadamard product complex or real .", "How cublas handle NaNs", "Unfortunately there is no HAD operation in CUBLAS .", "A row col in c . But in cublas it will be A col row .", "According to the doc of cublasSgetrsBatched http : docs.nvidia.com cuda cublas cublas-lt-t-gt-getrsbatched the type of your d A and d B should be const float and float but you use float .", "in many cublas or cusparse function-calls they use scalar variables which we can pass in either host pointer or device pointer such as the alpha and beta variable here http : docs.nvidia.com cuda cublas cublas-lt-t-gt-gemm .. . .. . How is this actually implemented", "The CUBLAS APIs like any BLAS support operating on matrices stored in transposed order ie .", "cuBLAS does provide a F77 style interface See : http : docs.nvidia.com cuda cublas appendix-b-cublas-fortran-bindings .. . .. . The OpenACC solution is to manage your data as you normally would using the data directive but then call the CUDA C routine from within a host data region .", "You might want to refer to the cuda sample codes http : docs.nvidia.com cuda cuda-samples index.html simpledevlibcublas-gpu-device-api-library-functions--cuda-dynamic-parallelism- that show how to use cublas from the device and include makefiles that you can study .", "Are you really using cuBLAS", "However the method there did not involve any modification of GNU Octave source but instead uses the LD PRELOAD capability of Linux http : www.linuxjournal.com article 7795 to intercept the BLAS library calls and re-direct the appropriate ones to the cublas library .", "And I don t know how to use cublas with row-major data http : docs.nvidia.com cuda cublas index.html data-layout unless you do some sort of transpose .", "To use this you need to use the cublasSetPointerMode http : docs.nvidia.com cuda cublas index.html cublassetpointermode call to tell the CUBLAS context to expect pointers for scalar arguments to be device pointers by using the CUBLAS POINTER MODE DEVICE mode .", "I believe CUBLAS functions from CUDA Toolkit 5.0 can now be called from device functions but I only reviewed the headers I have no experience using CUBLAS .", "The presenter is using the fortran bindings http : docs.nvidia.com cuda cublas index.html topic 11 Specifically we need to use the thunking wrapper version of these bindings .", "Alternately you may use cublas gemmBatched http : docs.nvidia.com cuda cublas index.html cublas-lt-t-gt-gemmbatched accessing your dense matrix by blocks of row or columns and defining your block-diagonal as a set of smaller dense matrices potentially reusing same data .", "Indexing is described at the 1.1 DataLayout http : docs.nvidia.com cuda cublas index.html introduction section : .. . .. . define IDX2C i j ld j ld + i .. . .. . Then use the cublasSgemm http : docs.nvidia.com cuda cublas index.html cublas-lt-t-gt-gemm for example with lda parameter equal to the number of lines .. . .. . the cuBLAS library uses column-major storage .. . .. . of the original matrix and m n k for the sub-matrices .", "CUBLAS doesn t support in-place operations in fact no parallel BLAS I am aware of supports it .", "And I could write my own CUDA code to do it but then it s likely not anywhere near as fast as the cuBLAS code .", "It is right in the documentation http : docs.nvidia.com cuda cublas index.html topic 9 1 if you care to look... .", "But I realized that cublas t geam is only available at CUDA-5 which seems not an option for me .", "Is there an equivalent of cudaGetErrorString in cuBLAS", "Yes but the output from cublas is also in column major .", "But calling a cublas function is not the same as a bare kernel call .", "Transpose matrix-multiplication in cuBLAS howto http : stackoverflow.com questions 14595750 transpose-matrix-multiplication-in-cublas-howto 14596388 14596388", "I compared the the cublas and thrust approaches .", "I need the compute the element wise multiplication of two vectors Hadamard product of complex-numbers with NVidia CUBLAS .", "cublasGetVector will the cublas kernel functions eg cublasDgemm automatically be synchronized with the host", "With those you see that the function docs http : docs.nvidia.com cuda cublas index.html cublas-lt-t-gt-spmv call out the matrix as stored in packed format and define the packed storage format .", "I get some weird numbers in return of a call to the cuBLAS library function cublasSgemm from a C host code .", "Here s what I get : .. . .. . Matrix Multiply CUBLAS - Starting.. . .. . GPU Device 0 : Tesla M2070 with compute capability 2.0 .. . .. . Computing result using CUBLAS.. . .. . Computations completed .", "My goal is to insert a cublas process in my cuda kernel so i looked at simpleDevLibCUBLAS example .", "Read carefully the defintion of the storage type http : docs.nvidia.com cuda cublas index.html cublasfillmode t .", "from description : The element of the maximum magnitude : http : docs.nvidia.com cuda cublas index.html topic 6 1 .. . .. . result will be 4", "But I fail to see how this has anything to do with CUDA or CUBLAS it is a generic C++ programming question .", "Is there any method in CUDA or cublas to transpose this matrix to FORTRAN style where A number of rows becomes the leading dimension", "It seems that using cublas t geam as suggested below is a very efficient way to perform matrix transposition in CUDA .", "What is most efficient way using cuda cublas to do dot of matrix A and B with reduction along given axis .", "I also have a similar question about cublas .", "The CUBLAS API is asynchronous for the most part including cublasSaxpy .", "Are you looking to interface with cuBLAS or is this more general", "I cannot believe there is no way to achieve this with CUBLAS .", "Is there any other way to achieve that with CUBLAS for complex-numbers" ] }
{ "confidence": [ 87.776123046875, 84.70891571044922, 77.32935333251953, 76.12832641601562, 76.09381103515625, 75.36979675292969, 75.21376037597656, 74.8678207397461, 73.8505630493164, 72.1399154663086, 71.44338989257812, 69.8883056640625, 69.18133544921875, 68.81401824951172, 67.61876678466797, 67.3810806274414, 65.21398162841797, 64.81182861328125, 64.26507568359375, 63.53131103515625 ], "content": [ "Question : I need the compute the element wise multiplication of two vectors Hadamard product of complex-numbers with NVidia CUBLAS . Unfortunately there is no HAD operation in CUBLAS . Apparently you can do this with the SBMV operation but it is not implemented for complex-numbers in CUBLAS . I cannot believe there is no way to achieve this with CUBLAS . Is there any other way to achieve that with CUBLAS for complex-numbers I cannot write my own kernel I have to use CUBLAS or another standard NVIDIA library if it is really not possible with CUBLAS . .. . Answer : CUBLAS is based on the reference BLAS and the reference BLAS http : www.netlib.org blas level 1 has never contained a Hadamard product complex or real . Hence CUBLAS doesn t have one either . Intel have added v Mul https : software.intel.com en-us node 470448 to MKL for doing this but it is non-standard and not in most BLAS implementations . It is the kind of operation that an old school fortran programmer would just write a loop for so I presume it really didn t warrant a dedicated routine in BLAS . There is no standard CUDA library I am aware of which implements a Hadamard product . There would be the possibility of using CUBLAS GEMM or SYMM to do this and extracting the diagonal of the resulting matrix but that would be horribly inefficient both from a computation and storage stand point . The Thrust template library can do this trivially using thrust : : transform https : thrust.github.io doc group transformations.html gacca2dd17ae9de2f7bcbb8da6d6f6fce4 for example : .. . .. . would iterate over each pair of inputs from the device pointers x and y and calculate z i x i y i there is probably a couple of casts you need to make to compile that but you get the idea . But that effectively requires compilation of CUDA code within your project and apparently you don t want that .", "Question : I am using a commercial simulation software on Linux that does intensive matrix manipulation . The software uses Intel MKL by default but it allows me to replace it with a custom BLAS LAPACK library . This library must be a shared object .so library and must export both BLAS and LAPACK standard routines . The software requires the standard Fortran interface for all of them . To verify that I can use a custom library I compiled ATLAS and linked LAPACK from netlib inside it . The software was able to use my compiled ATLAS version without any problems . Now I want to make the software use cuBLAS in order to enhance the simulation speed . I was confronted by the problem that cuBLAS doesn t export the standard BLAS function names they have a cublas prefix . Moreover the library cuBLAS library doesn t include LAPACK routines . I use readelf -a to check for the exported function . On another hand I tried to use MAGMA http : icl.cs.utk.edu magma to solve this problem . I succeeded to compile and link it against all of ATLAS LAPACK and cuBLAS . But still it doesn t export the correct functions and doesn t include LAPACK in the final shared object . I am not sure if this is the way it is supposed to be or I did something wrong during the build-process . I have also found CULA http : www.culatools.com dense but I am not sure if this will solve the problem or not . Did anybody tried to get cuBLAS LAPACK or a proper wrapper linked into a single .so exporting the standard Fortran interface with the correct function names I believe it is conceptually possible but I don t know how to do it Comment : See stackoverflow.com q 11576073 681865 http : stackoverflow.com q 11576073 681865 for a discussion about why what you want to do isn t a very good idea . Comment : For a limited example replacing a single BLAS function -- Dgemm of using the cublas thunking interface in an application Octave that uses the BLAS library see here http : stackoverflow.com questions 17493270 converting-octave-to-use-cublas 17493698 17493698 . In this particular case for large matrix multiplies the overhead cost of transferring the data to the GPU is more than offset by the reduced computation time . .. . Answer : Updated .. . .. . As indicated by @talonmies CUDA has provided a fortran thunking wrapper interface . http : docs.nvidia.com cuda cublas index.html appendix-b-cublas-fortran-bindings .. . .. . You should be able to run your application with it . But you probably will not get any performance improvement due to the mem alloc copy issue described below . Old .. . .. . It may not easy . CUBLAS and other CUDA library interfaces assume all the data are already stored in device memory however in your case all the data are still in CPU RAM before calling . You may have to write your own wrapper to deal with it like .. . .. . On the other hand you probably have noticed that every single BLAS call requires 2 data copies . This may introduce huge overhead and slow down the overall performance unless most of your callings are BLAS 3 operations . Comment : CUBLAS already comes with a built-in set of Fortran bindings and a thunking wrapper interface - see docs.nvidia.com cuda cublas http : docs.nvidia.com cuda cublas index.html appendix-b-cublas-fortran-bindings Comment : Great . Then the only problem is mem alloc copy which probably will make this kind of wrapper slower than MKL . Comment : the thunking interface includes memory allocation and transfers - and the documentation contains a warning about the negative performance effects that entails", "Question : I have a M N host memory matrix and upon copying into a device memory I need it to be transposed into a N M matrix . Is there any cuda cuBLAS.. . API doing that I am using CUDA 4 . Thanks Comment : It is right in the documentation http : docs.nvidia.com cuda cublas index.html topic 9 1 if you care to look... . Comment : Thanks But I am using CUDA4 instead of CUDA5 due to the observed cublas regression and no response after submitting a nVidia bug-report after a long time . .. . Answer : In the cublas API http : docs.nvidia.com cuda cublas index.html topic 9 1 : .. . .. . and specifying the transa operator as CUBLAS OP T for transpose Comment : Thanks Robert But I realized that cublas t geam is only available at CUDA-5 which seems not an option for me . But thanks anyway Comment : In many cases no explicit transposition is needed as you can simply use the transposition flags provided by most BLAS functions . Here is a whitepaper describing how to efficiently implement transposition if it must be done as a separate step : docs.nvidia.com cuda samples 6 Advanced transpose doc http : docs.nvidia.com cuda samples 6 Advanced transpose doc MatrixTranspose.pdf Comment : See also this previous question : stackoverflow.com questions 13782012 http : stackoverflow.com questions 13782012 how-to-transpose-a-matrix-in-cuda-cublas rq 1", "Question : I m trying to parallelize an existing application I have most of the application parallelized and running on the GPU I m having issues migrating one function to the GPU .. . .. . The function uses a function dtrsv which part of the blas library see below . I ve been able to call the equivalent cuda cublas function as per below and the results produced are equivalent to the fortran dtrsv sub routine . My problem is that I need to be able to call cublasDtrsv from a device or global function like below .. . .. . In cuda 4.0 if I try to compile the below I get the below error does anyone know if there is a means by which cublas functions can be called from a device or global function error : calling a host function cublasDtrsv v2 from a device global function Dtrsv dev is not allowed Comment : no this isn t not possible . Cublas is a host api and library . Comment : Thanks very much for the quick answer Does anyone know if there is an equivalent which can be called from a device function or a global function .. . Answer : CUDA Toolkit 5.0 introduced a device linker that can link device object-files compiled separately . I believe CUBLAS functions from CUDA Toolkit 5.0 can now be called from device functions but I only reviewed the headers I have no experience using CUBLAS . Comment : I can compile the CU file that references the CUBLAS from device code I m trying to figure out how to link it : Comment : I don t understand how this can possibly ever work . The CUBLAS libraries are supplied as IA32 x86-64 binary only libraries and internally the routines call host side runtime API functions launch kernels . How could such code ever run the GPU Comment : @talonmies Separate compilation . The libraries themselves contain relocatable device code . Comment : Thanks all for the replies what I have tried to do since has been to compile the code in netlib.org clapack cblas dtrsv.c http : www.netlib.org clapack cblas dtrsv.c to a device function so far It seems to be okay when I have finished my development I ll confirm whether it works Comment : It certainly is possible http : docs.nvidia.com cuda cublas index.html topic 3 7 to call CUBLAS routines from device code a new feature in CUDA 5 . I m not sure why this answer was downvoted . It uses the dynamic parallelism feature and therefore requires a cc 3.5 or better device . Upvoting . Please upvote again so we can get this off the unanswered list .", "Question : cublasSaxpy computes y a x + y where x and y are vectors and a is scalar . It turns out I need to compute y a y + x instead . I m not seeing how to twist the cuBLAS library into doing that . Of course I could compute y a y then y y + x but y is read too often in that case . And I could write my own CUDA code to do it but then it s likely not anywhere near as fast as the cuBLAS code . I m just surprised there s no apparent way to do saypx directly . Added There are functions similar to saxpby in Intel s version of cblas which would do what I need . But oddly enough that s not in cuBLAS . Added 2 It looks like I can use the cudnnAddTensor function with some aliasing of descriptors I have a FilterDescriptor that points to the tensor which AddTensor won t accept but I should be able to alias a TensorDescriptor to the same memory and shape . .. . Answer : There isn t a way I am aware of to do what you are asking in CUBLAS nor in standard BLAS . What you have found in MKL is an extension added by Intel but I don t recall seeing something similar in other host and accelerator BLAS implementations . The good news is that your assertion that I could write my own CUDA code to do it but then it s likely not anywhere near as fast as the cuBLAS code is untrue at least for an operation as trivial as saxpy . Even a na ve implementation of saxpy will get very close to CUBLAS because there really aren t that many was to read two arrays perform an FMAD and write back the result . As long as you get memory coalescing correct it is pretty simple to write performant code . For example : .. . .. . This demonstrates that a very simple axpy kernel can be easily adapted to perform both the standard operation and the version you want and run within 10 of the runtime of CUBLAS on the compute 5.2 device I tested it on : Comment : Okay . Also thanks for the excellent short tutorial on how to write CUDA code and profile it under linux The Windows structure is much more complex . I wonder if using fmad would take care of the last 10 .", "Question : How cublas handle NaNs Do cublas functions always handle NaNs the way whenever the operation has a IEEE 754 defined behavior with NaNs I am particularly interested in how they handle NaNs in their gemm and batched gemm routines so far as I tested the results with NaNs are in line with the standard however there is no mention about this in cuda documents so I am a little bit unsure about it and to handle NaNs correctly is critical to the correctness of my codes . Comment : What in particular in the handling of NaNs is critical to your code and why How do you address this issue when you use BLAS on the host I do not recall seeing documentation about NaN handling for any of the commonly used BLAS implementations . .. . Answer : CUDA GPUs should adhere to IEEE-754 floating-point arithmetic rules . There should be no non-standard handling of NaN . This should apply to all libraries that use floating-point arithmetic and should not vary from function to function . This document http : docs.nvidia.com cuda floating-point index.html abstract has considerable discussion about GPUs usage of IEEE-754 floating-point arithmetic .", "Question : I am currently implementing Stochastic Gradient Descent on a GPU using CUDA Thrust and cuBLAS . In my initial implementation I used plain CUDA to perform matrix-vector operations and now I m trying to optimize this by using cuBLAS for such operations instead . What I m observing currently is that for matrices of size rows x cols for small number of cols plain CUDA consistently outperforms cuBLAS apparently regardless of the number of rows . For large number of cols however the cuBLAS implementation wins out . So I was wondering : Are there any rules of thumb guidelines about what should be the minimal dimensions of matrices vectors after which using BLAS or cuBLAS will be better performing than plain C CUDA or is this completely dependent on the application BLAS function Comment : Related question : stackoverflow.com q 26417475 209882 http : stackoverflow.com q 26417475 209882 Comment : Note that BLAS2 matrix-vector operations tend to be limited by memory throughput . If possible you would want to use BLAS3 operations . There are many different BLAS2 operations each with their own performance characteristics which may further differ by GPU architecture so your question seems too broad . Check whether any of the batched operations are applicable to your use-case as they offer better performance for small matrices which otherwise only use a portion of the machine resources . Comment : You do exactly what was in the question you linked to - benchmark for your problem size domain and hardware and use that data to drive your heuristics . I am very tempted to close this as duplicate of that question . Comment : @talonmies I was wondering if anyone already had experience with this . I have run the benchmarks and posted as an answer I hope that is OK . .. . Answer : I have run a few benchmarks which I will post here : The results are for linear-regression task running for 10 iterations of SGD on datasets with 10000 rows . The implementation and more results are available here : https : github.com thvasilo cuda-sgd-sese-project .. . .. . Runtimes for 10-100 features columns : .. . .. . enter image description here http : i.stack.imgur.com G6GIR.png .. . .. . So for my implementation the change-point at which plain CUDA becomes slower is at 50 columns . There is a jump in runtime for 100 features for cuBLAS but that could be an artifact these experiments were only run once and the differences are not that large anyway . When running with more columns BLAS Lvl . 2 consistently performs better : .. . .. . enter image description here http : i.stack.imgur.com XpUQ0.png", "Question : I am using the following kernel to optimize vector-matrix multiplication for the case where both the vector and the matrix have a large number of zeros . The use of this kernel may reduce the time taken for such a multiplication by up to half of the time taken by cublasSgemv for the case where there are more than 90 zeros . But it is still much longer than an equivalent blas gemm host call on Ubuntu 14.04 .. . .. . vec 1 x m mat m x m and prod 1 x m all are in row-major order .. . .. . m 5000 .. . .. . What can be done to further enhance the performance of this kernel apart from libraries like cuSparse Would be nice if this optimization was compatible with Compute Capability of 1.2 .. . .. . Thanks .. . .. . EDIT .. . .. . Corrected : prod 1 x m .. . .. . GPU Quadro FX 1800M Cuda v.5.0 on Ubuntu 14.04 .. . .. . EDIT .. . .. . Complete code that performs multiplication using i . blas ii . cublas iii . above kernel for m 6000 . Please enter 0 when asked to enter a value .. . .. . Results .. . .. . At least on my system blas is still the fastest for such a scenario .. . .. . Things get even more interesting if every 1200th element instead of 600th is set to 0 Comment : prod 1xm not mxm . the result-of a matrix-vector or vector-matrix multiply is a vector not a matrix . Put vec in constant memory for m up to about 16000 float . Provide a full test case for comparison - including timing of both the GPU and CPU versions you are comparing . Also provide relevant details like CUDA version and GPU you are running on . Comment : b and a aren t defined anywhere in your kernel so you re obviously not running that code . Why not post the code that you actually did the timing measurement on to make this claim : The use of this kernel reduces the time taken for such a multiplication by up to half of the time taken by cublasSgemv for the case where there are more than 90 zeros . Comment : @RobertCrovella : This kernel is even faster : global void calc v m float vec float mat float prod int m . Up to 100 faster to be precise . Comment : This is completely silly . When I run your code on my Ubuntu 14 system CBLAS is 100 times slower than CUBLAS and 10 times slower than your Optimal Kernel . Comment : @talonmies Refrain from using words like silly because they expose your shallowness of intellect and lack of maturity .. . Answer : The important thing to recognise here is that the gemv operation you are concerned with is fundamentally memory throughput limited on GPUs rather than compute throughput limited . This implies that an optimisation as you have shown in your kernel : .. . .. . isn t really an optmisation at all simply because the memory transactions are the performance bottleneck in the kernel not the floating-point arithmetic and your code must perform most of the memory transactions irrespective of whether the multiply add operation will be performed because of zero detection or not . Consider the following instrumented version of roughly the same code : .. . .. . Here I have added two optional arguments which control whether the kernel will load from global memory and whether the kernel will store to global memory . This allows me to quantify the performance impact of the memory loads computation and memory stores independently . The results using your test code are instructive : .. . .. . All benchmarking done on a GTX970 using the CUDA 7.5 release toolchain and CUBLAS 7.5 library .. . .. . In no particular order : .. . .. . The full instrumented kernel runtime is within a few percent of the equivalent CUBLAS call .. . The memory fetches from global memory are the bottleneck .. . The actual computations in the kernel only constitute 5 of the kernel running time .. . The fire-and-forget nature of write operations in CUDA means that the latency of the write has no significant effect on throughput . Your optimised kernel is considerably slower than either CUBLAS or the instrumented kernel probably because all you are introducing is branch divergence without addressing the source of the kernel bottleneck the latency of the memory loads . The only times conditionally executing the FMAD operation makes sense would be in an architecture where memory has near zero latency and floating-point throughput was severely constrained . The GPU definitely doesn t fall into that category . The only other option for optimising this would be to exploit a priori information about the sparsity patterns in the LHS matrix to remove the need to read zero entries . Which is precisely what sparse-matrix formats and linear-algebra codes are designed to accommodate .", "Question : Say I have a matrix with a dimension of A B on GPU where B number of columns is the leading dimension assuming a C style . Is there any method in CUDA or cublas to transpose this matrix to FORTRAN style where A number of rows becomes the leading dimension It is even better if it could be transposed during host- device transfer while keep the original data unchanged . Comment : Because CUBLAS can operate on both transposed and normal matrices you probably don t need to explicitly calculate the matrix transpose even when working with matrices which are in row major order . Comment : It seems that using cublas t geam as suggested below is a very efficient way to perform matrix transposition in CUDA . For a full code and a comparison with matrix transposition using Thrust see What is the most efficient way to transpose a matrix in CUDA http : stackoverflow.com questions 15458552 what-is-the-most-efficient-way-to-transpose-a-matrix-in-cuda 21803459 21803459 . .. . Answer : The version of CUBLAS bundled with the CUDA 5 toolkit contains a BLAS-like method cublasgeam that could be used to transpose a matrix . It s documented here http : docs.nvidia.com cuda cublas index.html topic 9 1 .", "Question : Is there an efficient way of using cuBlas when multiplying a large dense matrix with its transpose Specifically is there any function that makes use of the fact that the resulting matrix is symmetric therefore reducing the number of multiplications by a factor of 2 . .. . Answer : The standard BLAS API syrk is what you need . For cuBlas the API name is cublas t syrk . Please refer to cuBlas document for more detail .. . .. . http : docs.nvidia.com cuda cublas index.html cublas-lt-t-gt-syrk", "Question : I have a M N host memory matrix and upon copying into a device memory I need it to be transposed into a N M matrix . Is there any cuda cuBLAS.. . API doing that I am using CUDA 4 . Thanks Comment : It is right in the documentation http : docs.nvidia.com cuda cublas index.html topic 9 1 if you care to look... . Comment : Thanks But I am using CUDA4 instead of CUDA5 due to the observed cublas regression and no response after submitting a nVidia bug-report after a long time . .. . Answer : To answer your question on efficiency I have compared two ways to perform matrix transposition one using the Thrust library and one using cublas t geam as suggested by Robert Crovella . The result-of the comparison is the following on a Kepler K20c card : .. . .. . As it can be seen the cublas t geam outperforms the version using Thrust . Below is the code to perform the comparison . Comment : +1 very illuminating . Comment : can you try to explain where the huge differences stem from are they caused by a significantly different algorithm can the memory access be optimized in the thrust version", "Question : Since CUDA 5.5 the CUBLAS library contains routines for batched matrix-factorization and inversion cublas t getrfBatched http : docs.nvidia.com cuda cublas index.html cublas-lt-t-gt-getrfbatched and cublas t getriBatched http : docs.nvidia.com cuda cublas index.html cublas-lt-t-gt-getribatched respectively . Getting guide from the documentation I wrote a test code for inversion of an N x N matrix using these routines . The code gives correct output only if the matrix has all non zero pivots . Setting any pivot to zero results in incorrect results . I have verified the results using MATLAB . I realize that I am providing row major matrices as input while CUBLAS expects column major matrices but it shouldn t matter as it would only transpose the result . To be sure I also tested on column major input but getting same behavior . I am confused as cublas t getriBatched expects pivot exchange information array P as input which is the output from cublas t getrfBatched . So if any zero pivots are eliminated by row exchange then the inversion routine should handle it automatically . How to perform inversion of matrices which contain a zero pivot using CUBLAS Following is a self-contained compile-able example with different test cases : Comment : @RobertCrovella.. . Thankyou for your input . I am facing same behavior with CUDA 5.5 as well as CUDA 6.0 RC . .. . Answer : There seems to be a bug in the current CUBLAS library implementation of cublas t getrfBatched for matrices of dimension n such that 3 n 16 when there is a zero pivot as you say . A possible workaround is to identity-extend your A matrix to be inverted when n 17 to a size of 17x17 using matlab nomenclature : .. . .. . continuing you can then use cublas t getriBatched in an ordinary fashion : .. . .. . You can also leave everything at n 17 call getri that way and then extract the result as the first 3x3 rows and columns of invA . Here is a fully worked example borrowing from the code you supplied showing the inversion of your supplied 3x3 zero pivot matrix using the zero pivot war matrix as an identity-extended workaround : .. . .. . The above result appears to me to be correct based on a simple test elsewhere http : www.quickmath.com webMathematica3 quickmath matrices inverse basic.jsp . I don t have any further technical details about the nature of the possible bug in CUBLAS . From what I can tell it is present in both CUDA 5.5 and CUDA 6.0 RC . Detailed bug discussions for NVIDIA-supplied assets e.g . CUBLAS library should be taken up on the NVIDIA developer forums https : devtalk.nvidia.com or directly at the bug filing portal on developer.nvidia.com https : developer.nvidia.com you must be a registered developer to file a bug . Comment : Superb Thankyou very much for the workaround . I am getting correct output now . I hope the bug gets fixed soon : Comment : This appears to be fixed in CUDA 6 production release 6.0.37 on linux which is now available http : www.nvidia.com getcuda Comment : Thanks . I tested on windows . The bug is fixed and gives perfect result . : Comment : note that with newer versions of CUBLAS it may be necessary to cast the A d parameter passed to the getriBatched function with const float for compliance with the newer API .", "Question : In my main.cpp I am creating some vectors on host then copying them on the device . I also create a cublas handle because I want to use cublas : .. . .. . Then I have a cuda.cu and cuda.h files in order to call gpu blas sum in the code above on the device .. . .. . cuda.h .. . .. . cuda.cu .. . .. . The line A 0 3 in cublas.cu results in a segmentation-fault . I guess then that my function gpu blas sum is considered as a host function . How can I make it execute on device so that I can dereference device pointers and take advantage of GPU speed when I use cublas functions Thanks for help Comment : You must write kernels if you want to run code on the GPU or device functors if you use something like thrust . A kernel could on a supported GPU use the CUBLAS device API . If you are trying to ask how to write a kernel I think you have come to the wrong place . Comment : Thanks Talonmies . I know how to write kernels . So if I understand you well I have to transform gpu blas sum into a kernel create a c++ function as a wrapper that launches the kernel with one block and one thread and let cublas automatically optimize by launching many threads and blocks under the hoods Comment : That would seem like a huge waste of effort and latency penalties compared with just calling the CUBLAS APIs directly from the host . I still don t understand what the problem here is . You try to access a device pointer on the host and it fails . Surely the solution is just not to try and access the device pointer on the host in the first place Comment : I see that the simplified version of my problem make my question weird . My problem is I have 10 matrices A1 .. . A10 and an input vector X and 10 functions h1 . . h10 . I want to calculate A1 X then apply h1 to the resulting vector . so X2 h1 A1 X then continue with X3 h2 A2 X2 etc.. . My matrices are created once and for all on the device and my functions h1 . . h10 are coded as kernels . So I want to execute A1 X directly on the device so that the result is on the device and I directly apply the kernel h1 on it and pass it to the next step Comment : Please update your question with what you are actually trying to do here and some code which illustrates it preferably something that might be compileable for others to experiment with .. . Answer : This is illegal : .. . .. . This is host code but A is a device pointer . Basic cuda rules are that host code is not allowed to dereference a device pointer and device code is not allowed to dereference a host pointer . If you dereference a device pointer in host code a seg fault is the likely outcome just as-if you dereferenced any other pointer that was meaningless in host code such as a NULL pointer . If you really want to do this specific operation just as you have written then a tedious but workable solution would be : .. . .. . If you want to move everything to the device I suggest you study a cuda sample code that calls cublas functions from the device such as simpleDevLibCUBLAS http : docs.nvidia.com cuda cuda-samples index.html simpledevlibcublas-gpu-device-api-library-functions--cuda-dynamic-parallelism- Comment : Thanks Robert . My current architecture does not unfortunately support DevLibCublas . Can you please confirm that the normal cublas when called from host is indeed executed on device So the gain of speed realized with DevLibCublas would be the overhead of the call . Can you please give an estimation of that time Comment : Yes the normal cublas when called from the host is indeed executed on the device .", "Question : null .. . Answer : when I successfully install tensorflow on cluster I immediately running mnist demo to check if it s going well but here I came up with a problem . I don t know what is this all about but it looks like the error is coming from CUDA Comment : In order to build or run TensorFlow with GPU support both NVIDIA s Cuda Toolkit 7.0 and cuDNN v2 need to be installed . TensorFlow GPU support requires having a GPU card with NVidia Compute Capability 3.0 . have you follow the officcial setup tensorflow.org versions r0.9 get started os setup.html https : www.tensorflow.org versions r0.9 get started os setup.html Comment : absolutely yes my cuda version is 7.5 and cudnn version is v4 Comment : ok and your graphics-card has capability greater or equal to 3.0 Comment : My graphic cards is Nvidia Tesla K20m . I just looked up and found its cuda feature is 3.5 is it the compute capability from Nvidia website Comment : Does the access to cublas library required sudo authority I remembered that I used pip3 install it without sudo prefix command", "Question : In here http : stackoverflow.com questions 12219997 is-it-possible-to-call-a-cuda-cublas-function-from-a-global-or-device-function Robert Crovella said that cublas routines can be called from device code . Although I am using dynamic parallelism and compiling with compute capability 3.5 I cannot manage to call Cublas routines from a device function . I always get the error calling a host function from a device global function is not allowed My code contains device functions which call CUBLAS routines like cublsAlloc cublasGetVector cublasSetVector and cublasDgemm .. . .. . My compilation and linking commands : .. . .. . .. . .. . nvcc -arch sm 35 -I . -I usr local cuda include -c -O3 -dc GPUutil.cu -o . build GPUutil.o .. . nvcc -arch sm 35 -I . -I usr local cuda include -c -O3 -dc DivideParalelo.cu -o . build DivideParalelo.o .. . nvcc -arch sm 35 -I . -I usr local cuda include -dlink . build io.o . build GPUutil.o . build DivideParalelo.o -lcudadevrt -o . build link.o .. . icc -Wwrite-strings . build GPUutil.o . build DivideParalelo.o . build link.o -lcudadevrt -L usr local cuda lib64 -L Intel composer xe 2015.0.090 mkl lib intel64 -L Intel composer xe 2015.0.090 mkl . . compiler lib intel64 -Wl --start-group Intel composer xe 2015.0.090 mkl lib intel64 libmkl intel lp64.a Intel composer xe 2015.0.090 mkl lib intel64 libmkl sequential.a Intel composer xe 2015.0.090 mkl lib intel64 libmkl core.a Intel composer xe 2015.0.090 mkl . . compiler lib intel64 libiomp5.a -Wl --end-group -lpthread -lm -lcublas -lcudart -o DivideParalelo Comment : Your compilation commands are not correct . You are not linking against -lcublas device and there are other issues . You might want to refer to the cuda sample codes http : docs.nvidia.com cuda cuda-samples index.html simpledevlibcublas-gpu-device-api-library-functions--cuda-dynamic-parallelism- that show how to use cublas from the device and include makefiles that you can study . This question answer http : stackoverflow.com questions 27094612 cublas-matrix-inversion-from-device gives a completely worked example including compile commands . .. . Answer : Here http : docs.nvidia.com cuda cublas device-api you can find all the details about cuBLAS device API such as : .. . .. . Starting with release 5.0 the CUDA Toolkit now provides a static cuBLAS Library cublas device.a that contains device routines with the same API as the regular cuBLAS Library . Those routines use internally the Dynamic Parallelism feature to launch kernel from within and thus is only available for device with compute capability at least equal to 3.5 . .. . In order to use those library routines from the device the user must include the header file cublas v2.h corresponding to the new cuBLAS API and link against the static cuBLAS library cublas device.a . If you still experience issues even after reading through the documentation and applying all of the steps described there then ask for additional assistance . Comment : Thanks for your quick answer . I have added included cublas v2.h in my GPUutil.cu file and -lcublas device for the link in Makefile . However cublas is not detected and I have a compilation error in any cublas call . I am using nsight with cuda 6.5 Any idea which am I doing wrong Comment : @emartel are you compiling for compute capability 3.5 I.e . sm 35 Comment : Yes I am compiling for cc 3.5 You can see CUDA FLAGS in my Makefile and it is used when I compile GPUutil.cu this file contains the calls to cublas routines .", "Question : I have a CUDA kernel that looks like the following : .. . .. . The host code : .. . .. . When this kernel runs inline kernel 1 2 built and linked within eclipse Nsight the kernel runs completely fine and out returns 0.02 as expected . If I compile the kernel into a .cubin using -G generate device debugging symbols the cublas function never runs and the out is always 0.0 .. . .. . I can put breakpoints in when the .cubin is running and I can see the data is correct going into the cublas function but it looks like the cublas function never runs at all . The cublas function also always is returning 0 CUDA SUCCESS . Importantly this ONLY happens when running this from a .cubin .. . .. . To compile to a cubin I am using with the -G : .. . .. . which returns no errors . Why would the cublas functions within the .cubin stop working if the -G option is added CUDA 7.0 linux 14.04 x64 980GTX Comment : provide an MCVE including the code you are using to load and call the kernel . Comment : have edited above to provide MCVE .. . Answer : FWIW your code does not run correctly for me with or without the -G switch . You can run your code with cuda-memcheck to help identify errors . You don t appear to be doing proper CUDA error checking http : stackoverflow.com questions 14038589 what-is-the-canonical-way-to-check-for-errors-using-the-cuda-runtime-api either in your host code or your device code . With dynamic parallelism you can use a similar methodology in device code . And the CUBLAS API calls return error codes which you don t appear to be checking . This is wrong : .. . .. . This is a thread-local variable : .. . .. . Since you are launching a kernel with 2 threads : .. . .. . One of your threads 0 is passing a valid handle to the cublasSgemv call and the other thread 1 is not . When I fix that error your code works for me . Note that you still have a situation where you are passing the exact same paramters to the cublasSgemv call for each of your two threads . Therefore each call is writing to the same output location . Since the order of thread execution behavior in this case is unspecified it s possible you could see quite variable behavior : appearing to get valid output since one thread wrote the correct value as the result-of a successful cublas call even though the other cublas call failed . It s possible I suppose that the -G switch might affect this ordering or somehow impact this behavior . Comment : I have modified my code slightly to only run the cublas in the 0th thread . running cuda-memcheck I get this : cuda-memcheck . example CUDA-MEMCHECK out : 0 ERROR SUMMARY : 0 errors So this is still not working for me. . any ideas Comment : No . Your modified code works correctly for me it displays out : 0.02 with or without cuda-memcheck with or without -G . Which CUDA version are you using Are you running on windows or linux What GPU You might want to add some code to check the return-value of the cublas calls in your kernel . Comment : I have just done that and edited the code here the codes are OK as far as i can see.. . Running ubuntu 14.04 cuda toolkit 7.0 and a 980gtx . nvidia-346 drivers . I m not using it as a my display device if that makes any difference Comment : bit of an update I replaced the cublasSgemv with a really basic cublasSdot and there doesn t seem to be an issue with it at all . Runs fine with -G and not", "Question : Currently I m just trying to implement simple Linear Regression algorithm in matrix-form based on cuBLAS with CUDA . Matrix multiplication and transposition works well with cublasSgemm function . Problems begins with matrix inversions based on cublas t getrfBatched and cublas t getriBatched functions see here http : docs.nvidia.com cuda cublas index.html cublas-lt-t-gt-getribatched . As it can be seen input parameters of these functions - arrays of pointers to matrices . Imagine that I ve already allocated memory for A T A matrix on GPU as a result-of previous calculations : .. . .. . Is it possible to run factorization inversion .. . .. . without additional HOST - GPU memory copying see working example of inverting array of matrices https : devtalk.nvidia.com default topic 767806 matrix-inversion-with-cublassgetri and allocating arrays with single element but just get GPU-reference to GPU-pointer .. . Answer : There is no way around the requirement that the array you pass being in the device address space and what you posted in your question won t work . You really only have two possibilities : .. . .. . 1 . Allocate an array of pointers on the device and do the memory transfer the solution you don t want to use . 2 . Use zero-copy or managed host memory to store the batch array .. . .. . In the latter case with managed memory something like this should work completely untested use at own risk : Comment : Thanks But I am afraid that using Managed memory may be a reason of calculation speed decreasing. .", "Question : I have a M N host memory matrix and upon copying into a device memory I need it to be transposed into a N M matrix . Is there any cuda cuBLAS.. . API doing that I am using CUDA 4 . Thanks Comment : It is right in the documentation http : docs.nvidia.com cuda cublas index.html topic 9 1 if you care to look... . Comment : Thanks But I am using CUDA4 instead of CUDA5 due to the observed cublas regression and no response after submitting a nVidia bug-report after a long time . .. . Answer : CULA has auxiliary routines to compute the transpose culaDevice geTranspose . In case of a square matrix you could also use inplace transposition culaDevise geTransposeInplace . Note : CULA has a free license available if you meet certain conditions .", "Question : The code of cublas below give us the errors : core dumped while being at cublasSnrm2 handle row dy incy de could you give some advice main.cu .. . .. . makefile is below : .. . .. . My OS is linux redhat 6.2 CUDA s version is 5.0 GPU is K20M . Comment : Only a first guess thus only a comment : IIRC the default Pointer Mode is Host - so the result parameter the last parameter of this function should be a pointer to host memory also see docs.nvidia.com cuda cublas cublassetpointermode http : docs.nvidia.com cuda cublas cublassetpointermode Comment : The program worked after appending cublasSetPointerMode handle CUBLAS POINTER MODE DEVICE . Thanks .. . Answer : The problem is here : .. . .. . By default the last parameter is a host pointer . So either pass e to the snrm2 call rather than de or do this : .. . .. . The pointer mode needs to be set to device if you want to pass a device pointer to store the result .", "Question : I d like to convert Octave to use CuBLAS for matrix-multiplication . This video seems to indicate this is as simple as typing 28 characters : .. . .. . Using CUDA Library to Accelerate Applications http : youtu.be P2Ew4Ljyi6Y t 1m59s .. . .. . In practice it s a bit more complex than this . Does anyone know what additional work must be done to make the modifications made in this video compile UPDATE .. . .. . Here s the method I m trying .. . .. . in dMatrix.cc add .. . .. . include cublas.h .. . .. . in dMatrix.cc change all occurences of preserving case .. . .. . dgemm .. . .. . to .. . .. . cublas dgemm .. . .. . in my build terminal set .. . .. . the error I receive is : Comment : Actually sorry there s more to it than this . The presenter is using the fortran bindings http : docs.nvidia.com cuda cublas index.html topic 11 Specifically we need to use the thunking wrapper version of these bindings . Apologies for the misinformation in my answer there is more to it than that . I will try to update my answer with a new set of instructions . The modifications you made to the source file are still valid but the modifications to the build sequence will be different . Comment : @RobertCrovella Thank you very much . I m really looking forward to having this . Comment : I ve made another hopefully the last edit to my answer . I tested this and it seems to work for me . .. . Answer : EDIT2 : The method described in this video http : youtu.be P2Ew4Ljyi6Y t 1m59s requires the use of the fortran thunking library bindings for cublas http : docs.nvidia.com cuda cublas index.html topic 11 . These steps worked for me : .. . .. . 1 . Download octave 3.6.3 from here ftp : ftp.gnu.org gnu octave octave-3.6.3.tar.gz : .. . .. . wget ftp : ftp.gnu.org gnu octave octave-3.6.3.tar.gz .. . .. . .. . 2 . extract all files from the archive : .. . .. . tar -xzvf octave-3.6.3.tar.gz .. . .. . .. . 3 . change into the octave directory just created : .. . .. . cd octave-3.6.3 .. . .. . .. . 4 . make a directory for your thunking cublas library .. . .. . mkdir mycublas .. . .. . .. . 5 . change into that directory .. . .. . cd mycublas .. . .. . .. . 6 . build the thunking cublas library .. . .. . g++ -c -fPIC -I usr local cuda include -I usr local cuda src -DCUBLAS GFORTRAN -o fortran thunking.o usr local cuda src fortran thunking.c .. . ar rvs libmycublas.a fortran thunking.o .. . .. . .. . 7 . switch back to the main build directory .. . .. . cd . . .. . .. . .. . 8 . run octave s configure with additional options : .. . .. . . configure --disable-docs LDFLAGS -L usr local cuda lib64 -lcublas -lcudart -L home user2 octave octave-3.6.3 mycublas -lmycublas .. . .. . .. . Note that in the above command-line you will need to change the directory for the second -L switch to that which matches the path to your mycublas directory that you created in step 4 .. . .. . 9 . Now edit octave-3.6.3 liboctave dMatrix.cc according to the instructions given in the video http : youtu.be P2Ew4Ljyi6Y t 1m59s . It should be sufficient to replace every instance of dgemm with cublas dgemm and every instance of DGEMM with CUBLAS DGEMM . In the octave 3.6.3 version I used there were 3 such instances of each lower case and upper case . 10 . Now you can build octave : .. . .. . make .. . .. . .. . make sure you are in the octave-3.6.3 directory .. . .. . At this point for me Octave built successfully . I did not pursue make install although I assume that would work . I simply ran octave using the . run-octave script in the octave-3.6.3 directory . The above steps assume a proper and standard CUDA 5.0 install . I will try to respond to CUDA-specific questions or issues but there are any number of problems that may arise with a general Octave install on your platform . I m not an octave expert and I won t be able to respond to those . I used CentOS 6.2 for this test . This method as indicated involves modification of the C source files of octave . Another method was covered in some detail in the S3527 session at the GTC 2013 GPU Tech Conference . This session was actually a hands-on laboratory exercise . Unfortunately the materials on that are not conveniently available . However the method there did not involve any modification of GNU Octave source but instead uses the LD PRELOAD capability of Linux http : www.linuxjournal.com article 7795 to intercept the BLAS library calls and re-direct the appropriate ones to the cublas library . A newer better method using the NVBLAS intercept library is discussed in this blog article https : devblogs.nvidia.com parallelforall drop-in-acceleration-gnu-octave Comment : Thank you very much . I ll give this another shot and report back . Comment : @Joshua Fleming leave your answer edits as comments rather than editing my answer please . My answer is tested and correct for the OS and gcc and Octave versions I specified . If you want to add information for another version of gcc please do it in the comments . Comment : This still works great for Octave version 4.0.0 although the file to edit is now located at octave-4.0.0 liboctave array dMatrix.cc . Distro specific notes : Gentoo puts everything cuda related into opt cuda so adjust paths accordingly . Debian 8 puts cuda headers libraries in standard usr locations so no paths necessary however fortran thunking.c is hidden in usr share doc nvidia-cuda-doc examples . Comment : 1 . Did you install CUDA in the default location i.e . is libcublas.so located at usr local cuda lib64 2 . I m not sure what you mean by other packages . cublasCsyr2k is not a package it s an entry-point to a library . If all the other packages you are referring to are actually cublas calls then they probably all point to the same problem . Did you modify any files in the Octave distribution besides dMatrix.cc jlh seems to think it works with Octave 4.0.0 Comment : For example one possible test on the linking order theory would be to change this : . configure --disable-docs LDFLAGS -L usr local cuda lib64 -lcublas -lcudart -L home user2 octave octave-3.6.3 mycublas -lmycublas to this : . configure --disable-docs LDFLAGS -L home user2 octave octave-3.6.3 mycublas -lmycublas -L usr local cuda lib64 -lcublas -lcudart in step 8 above . Make modifications to the paths specified by the -L switches if necessary ." ] }
[ "yes-answer-long", "yes-answer-short" ]
cuda
UNK_RELATION
.net-4 .0 -- version 4.0 of the @placeholder framework .
{ "confidence": [ 39.56727600097656, 39.3028450012207, 38.658050537109375, 38.658050537109375, 38.658050537109375, 38.54670333862305, 38.02749252319336, 37.29270935058594, 36.41429901123047, 36.41429901123047, 36.32094192504883, 35.91206741333008, 35.804588317871094, 35.393638610839844, 35.393638610839844, 35.393638610839844, 35.393638610839844, 35.17426681518555, 35.10676574707031, 35.00638198852539, 35.00638198852539, 34.97945022583008, 34.97945022583008, 34.70819091796875, 34.70819091796875, 34.706809997558594, 34.634490966796875, 34.37306594848633, 34.37306594848633, 34.35065460205078, 34.207237243652344, 33.82286071777344, 33.8193244934082, 33.74116134643555, 33.631778717041016, 33.61109161376953, 33.485008239746094, 33.485008239746094, 33.391319274902344, 33.36350631713867, 33.14988327026367, 33.14988327026367, 33.14988327026367, 33.14988327026367, 33.127471923828125, 32.86371612548828, 32.83905792236328, 32.79920959472656, 32.64630889892578, 32.57826614379883, 32.57455062866211, 32.51797866821289, 32.227542877197266, 32.1259880065918, 32.12247085571289, 32.05015563964844, 31.955589294433594, 31.955589294433594, 31.955589294433594, 31.778636932373047, 31.71503448486328, 31.71503448486328, 31.71503448486328, 31.611412048339844, 31.611412048339844, 31.58562660217285, 31.502138137817383, 31.49155044555664, 31.480785369873047, 31.286380767822266, 31.14253044128418, 30.996482849121094, 30.996482849121094, 30.996482849121094, 30.996482849121094, 30.996482849121094, 30.977739334106445, 30.911815643310547, 30.81142807006836, 30.81142807006836, 30.804317474365234, 30.742036819458008, 30.727188110351562, 30.65087127685547, 30.55545425415039, 30.55545425415039, 30.55545425415039, 30.55545425415039, 30.55545425415039, 30.493932723999023, 30.322668075561523, 30.08847427368164, 29.9882755279541, 29.983789443969727, 29.983789443969727, 29.97591209411621, 29.97591209411621, 29.97591209411621, 29.97591209411621, 29.93742561340332 ], "content": [ "Currently there is no SP1 version of the 4.0 framework .", "Seems the master version is targeted for the .Net framework version 4.0 .", "The problem of breaking older applications in Net Framework 4.0 .", "I run application targeted to .NET Framework 4.0 .", "I believe that the application use .NET Framework 4.0 .", "Lanuage : vb.net Framework version : 4.0", "When he tried to installed the .NET framework 4.0 version of the MSI was prompted to install framework 4.0 because of the prerequisite .", "it s strange that when I switch the target framework from .net-4.0 client to .net 4 it compiles OK .", "The server previously had .NET Framework 4.0 .", "Next I installed .NET Framework 4.0 Full on it .", "Do you mean that they are ALL .NET Framework 4.0 and none of them is .NET Framework 4.0 Client Profile", ".. . .. . .NET Framework 4 .. . .. . .. . .. . Microsoft announced the intention to ship .NET Framework 4 on 29 September 2008 .", "The problem of breaking older in this case .NET 2.0 applications resurfaces in Net Framework 4.0 at which point CLR 4.0 released .", "In .NET Framework 4.0 the GAC went through a few changes .", "I don t want to believe that .NET Framework 4.0 is not stable .", "I have a WPF application that is targeting the .NET Framework 4.0 Client Profile .", "Today we upgraded our application to .NET framework 4.0 .", "The .NET 4.0 installer doesn t include the .NET framework 3.5 .", "I tried with other examples aforge emgu etc but all of them run with Net framework 3.5 and not with Net framework 4 .", "I don t want to require .NET Framework 3.5 to be downloaded and installed if the user already has .NET Framework 4.0 installed", "Or in other words does the .Net Framework 4.0 Installer include the .Net Framework 3.5", "But unfortunately this no longer works for .NET Framework 4.0 or later .", "I m developing an application with C and .NET Framework 4.0 .", "Changed it to .NET Framework 4 and everything s OK .", "solution : Change the project to .NET framework 4 profile", "Application runs on ASP.NET MVC 4.0 Framework 4.0 .", ".. . The CLR version used for both .NET Framework 2.0 and .NET Framework 3.5 is CLR 2.0 .", "The target workstation would have the .NET 4.0 Framework installed that s not enough", "@update : Both machines have .net-4.0 framework installed .", "Profile5 Framework 4.0 and Store .", "I uninstalled the .NET 4 framework that installed with Visual Studio 2010 then I reinstalled the .NET 4 version Beta 2 .", "When I am targeting version 4 of the .Net Framework and building in VS2010 will I be using clr version 4", "Source http : www.techbubbles.com net-framework gac-in-net-framework .. . .. . Why", "As it says in the link you provided .NET is no longer supporting the policy portion of the code-access-security framework as of version 4.0 .", "Using Entity Framework version 4.0 or any other version that is compatible with .NET 4.0 I want to map this existing relational-database schema : .. . .. .", ".. . The .NET Framework 4 does not automatically use its version of the common language runtime to run applications that are built with earlier versions of the .NET Framework .", "Uninstalled .NET Framework 4 Extended Beta 2 .", "Uninstall .NET Framework 4 Extended Beta 2 .", "Do .Net components that were compiled against the .Net Framework 3.5 run on a system that has only .Net Framework 4.0 installed", "How to target 4.0 framework using .net-4.5", "The service has been built and deployed targeting .NET Framework 4.0 .", "I had major trouble uninstalling the .net framework 4.0 non-beta .", "I am using following code in .Net Framework 4.0 .", "I m using the .net-4.0 framework just in case that throws a spanner into the works... .", "There is an hotfix on the framework 4.0 for this issue .", "Your assembly compiled for .NET 4 will contain references to other .NET 4 framework libraries that are not present in .NET 2.0 .", "The project says that it is targeting .NET Framework 4 Client Profile the assemblies even point to .NET Framework 4.0 folder under Referenced Assemblies .", "How can i assembly NET Framework 4 with autocad 2010 .", "I had tried to use my application built on .NET framework 4.0 with Windows Server 2012 but it s not working and according to MSDN Server 2012 is not supported by .NET Framework 4.0 .", "This happens because The .NET framework version required by the setup-project is different than the .NET framework version targeted by the application .", "Yes for .Net Framework 4 GAC is in this location windir Microsoft.NET assembly .. . .. . See here Where is the .NET Framework Global Assembly Cache", "The only thing to keep in mind since you ve developed for .NET 4.0 is that there are two versions of this framework : the full version and the Client Profile .", "What version of the .NET framework do the client machines have installed", "The fact is that I need to target .NET 4.0 framework NOT .NET 4.0 Client Profile", "And the idea that protectTokens is not supported in .NET Framework 4 itself conflicts with the fact that protectTokens was generated and works in the on-premises environment in an app that specifically targets .NET Framework 4 .", "Enterprise library 5 - .NET framework 4 .", "Update .. . .. . To repro this install .NET Framework 4.5 and create a WPF project targeting .NET Framework 4.0 .", "On the box with .NET Framework 4.5 works like a charm try it on a machine with only .NET Framework 4.0 and it blows up.. .", "So there is defiantly different behavior between .NET Framework 4.0 and .NET Framework 4.5 .", "This update adds public Silverlight APIs to the .NET Framework 4 in the same location .", "The using are : .. . .. . In the Main method I wrote this code : .. . .. . The target framework is .NET 4.0 .", "All this suggests to me their is a problem with my .Net 4.0 framework installation .", "Will EF 6 6.0.1 precompile views when using the .NET Framework 4.0", "This .NET Framework can t be installed in such case .", "And choose target .NET Framework 3.5", "I m getting this exception : .. . .. . System.Configuration.ConfigurationErrorsException : The value for the compilerVersion attribute in the provider options must be v4.0 or later if you are compiling for version 4.0 or later of the .NET Framework .", "Please note that the solution below is specific to the .NET 4.0 framework the TargetFrameworkAttribue is new to 4.0 .", "We did a changeover from dot.net Framework 3.5 to dot.net Framework 4.0 .", "Your assembly is installed to C : WINDOWS Microsoft.NET assembly instead of C : Windows Assembly because it is a .Net 4.0 assembly and the .Net framework version 4.0 has a new separate GAC in that location .", "Version 7.1 of the Windows SDK for Windows 7 and .NET Framework 4 includes the Performance Suite and is compatible with both these versions of Windows and .Net 4 .", ".. . .. . .NET Framework 4.5 .. . .. . .. . .. . .NET Framework 4.5 was released on 15 August 2012 . a set of new or improved features were added into this version .", "Is there a standard preferred method for automatically downloading and installing the .NET 4.0 Framework from an NSIS installer if the machine doesn t already have it", "All I remember is that I installed Visual Studio 2010 and .NET framework 4.0 before I m getting that error .", "I recently had an issue after upgrading my .net framework to 4.0 from 3.5 : .. . .. . System.Net.Mail.SmtpException : Failure sending mail .", "Once .NET 4.0 framework patches are applied on a win2k3 box the application running on it fails at the bind operation to AD .", "Apparently the GAC viewer shell extension shfusion.dll has been discontinued for .NET 4.0 and no longer ships with the framework .", "When I decide to upgrade my applications from the .NET 2.0 to .NET 4.0 what would bee some alternative options for working with Oracle databases in the .NET 4.0 framework", "I change it the net framework to 3.5 and worked but is not working on net framwork 4 or 4.5", "Team .. . .. . I am trying to migrate a .NET framework 2.0 targetting solution to .NET 4.0 .", "I have a large .NET 2 web application that has been updated to target the .NET 4.0 framework .", "Is there a way to check if .NET 4 Full Framework is installed on the target system and not only the Client Framework", "If the .NET 4 Framework is not installed the application bring a message but if only the client framework is installed and the application need the Full Framework nothing happened and the application starts .", "See these articles : .. . .. . .NET 4.5 is an in-place replacement for .NET 4.0 http : www.west-wind.com weblog posts 2012 Mar 13 NET-45-is-an-inplace-replacement-for-NET-40 .. . .. . Announcing the release of .NET Framework 4.5 RTM http : blogs.msdn.com b dotnet archive 2012 08 15 announcing-the-release-of-net-framework-4-5-rtm-product-and-source-code.aspx .. . .. . Whats new on .Net framework 4.5 http : msdn.microsoft.com en-us library ms171868.aspx .. . .. . Application Compatibility in the .NET Framework 4.5 http : msdn.microsoft.com en-us library hh367887 28v VS.110 29.aspx .. . .. . What s New in .NET Framework 4.5 http : www.drdobbs.com windows whats-new-in-net-framework-45 240008327 .. . .. . Windows Server 2012 blocks Framework 4.0 http : support.microsoft.com kb 2765375 .. . .. . http : coolthingoftheday.blogspot.de 2012 03 net-45-is-what-to-net-40-replacement-or.html", "CodeProject sample http : www.codeproject.com Articles 290935 Using-MemoryCache-in-Net-4-0 Using MemoryCache in .NET 4.0", "Tick the checkbox for Microsoft .NET Framework 4 x86 and x64 above it .", "On attempting to uninstall .NET Framework 4 Client Profile Beta 2 .", "Uninstall .NET Framework 4 Client Profile Beta 2 .", "Because of the missing .NET Framework 4 GAC none of my applications run .", "@Rowland Yep I originally installed the .net framework 4 .", "default and named parameters are not a feature of .NET framework 4 but a feature of .NET 4 compiler .", "Does anyone know if it is possible to use Visual Studio 2010 RC with the beta 2 version of the .NET 4 framework", "To summarize : .. . .. . Installation .. . .. . .NET Framework 4.5 does not support Windows XP or Windows Server 2003 and therefore if you have to create applications that target these operating systems you will need to stay with .NET Framework 4.0 .", "It may be a case that your library class project targets full .Net Framework 4.0 while your wpf projects target .Net Framework 4.0 Client Profile .", "possible duplicate of Is it possible to conditionally compile to .NET Framework version", "http : stackoverflow.com questions 1449925 is-it-possible-to-conditionally-compile-to-net-framework-version", "The .NET Framework 4.5 uses Common Language Runtime 4.0 with some additional runtime features .", "How do I get nant to build projects that target the .NET 4.0 Framework", "This used to work great until we built the custom-action using Visual Studio 2010 and with target framework as .Net 4.0 .", "In other words your lesson is about .NET 3.5 and does not pertain to the 4.0 framework .", "if you have neccessary .net framework installed ." ] }
{ "confidence": [ 44.83728790283203, 42.137786865234375, 41.62709045410156, 41.237918853759766, 41.104026794433594, 41.0877685546875, 41.003204345703125, 40.932708740234375, 40.76289367675781, 40.346553802490234, 39.633460998535156, 39.25831604003906, 39.082908630371094, 39.03691101074219, 38.987098693847656, 38.94573211669922, 38.90745544433594, 38.70985412597656, 38.600345611572266, 38.425872802734375 ], "content": [ "Question : I am updating a PowerShell script that manages some .NET assemblies . The script was written for assemblies built against .NET 2 the same version of the framework that PowerShell runs with but now needs to work with .NET 4 assemblies as well as .NET 2 assemblies . Since .NET 4 supports running applications built against older versions of the framework it seems like the simplest solution is to launch PowerShell with the .NET 4 runtime when I need to run it against .NET 4 assemblies . How can I run PowerShell with the .NET 4 runtime Comment : Duplicate of stackoverflow.com questions 1940983 http : stackoverflow.com questions 1940983 loading-net-4-0-beta2-assembly-in-powershell-2-0 . Comment : These days the easiest solution would be to install the Powershell 3.0 CTP which uses CLRVersion : 4.0.30319.1 . .. . Answer : The other answers are from before 2012 and they focus on hacking PowerShell 1.0 or PowerShell 2.0 into targeting newer versions of the .NET Framework and Common Language Runtime CLR . However as has been written in many comments since 2012 when PowerShell 3.0 came a much better solution is to install the newest version of PowerShell . It will automatically target CLR v4.0.30319 . This means .NET 4.0 4.5 4.5.1 4.5.2 or 4.6 expected in 2015 since all of these versions are in-place replacements of each other . Use PSVersionTable or see the Determine installed PowerShell version thread http : stackoverflow.com questions 1825585 if you are unsure of your PowerShell version . At the time of writing the newest version of PowerShell is 4.0 and it can be downloaded with the Windows Management Framework Google search link https : www.google.com q download+Windows+Management+Framework . Comment : The system requirements for the Windows Management Framework 4.0 they are similar for 3.0 are : Windows 7 Windows Embedded Standard 7 Windows Server 2008 R2 Windows Server 2012 .", "Question : I installed the VS2010 and .NET 4.0 then I compiled an assembly and ran the gacutil using the exe available on .. . .. . ProgramFiles Microsoft SDKs Windows v7.0A Bin NETFX 4.0 Tools .. . .. . The output of the executable said the assembly was sucessfully installed on Global Assembly Cache . However when I go to WINDIR assembly folder I cannot find the assembly I installed using the .NET Framework 4.0 gacutil . I ve seen some posts saying the .NET Framework 4.0 has a separated GAC but what I haven t found was where it is located . May someone to help me to check where can I see the Global Assembly Cache of .NET Framework as it used to work on previous version WINDIR assembly .. . Answer : Yes there are two distinct GACs as from .NET 4.0 .. . .. . See here : http : stackoverflow.com questions 2660355 net-4-0-has-a-new-gac-why .. . .. . As stated below the new physical location is windir Microsoft.NET assembly you can interogate it using the dir command at a command-prompt if you re interested . It s worth noting that applications running up to the 2.0 CLR will not even be able to see assemblies in the new GAC . Comment : Thanks for answering It covered all my questions .", "Question : Do .Net components that were compiled against the .Net Framework 3.5 run on a system that has only .Net Framework 4.0 installed Or in other words does the .Net Framework 4.0 Installer include the .Net Framework 3.5 Comment : This post http : stackoverflow.com questions 2816914 about-backward-compatibility-of-net-framework-4 make be helpful to your question stackoverflow.com questions 2816914 http : stackoverflow.com questions 2816914 about-backward-compatibility-of-net-framework-4 .. . Answer : See : .NET Framework Versions and Dependencies http : msdn.microsoft.com en-us library bb822049.aspx .. . .. . This gives a clear picture what is included in each version of .Net . Also .. . .. . You do not have to install previous versions of the .NET Framework or the CLR before you install the latest version each version provides the necessary components .", "Question : Do .Net components that were compiled against the .Net Framework 3.5 run on a system that has only .Net Framework 4.0 installed Or in other words does the .Net Framework 4.0 Installer include the .Net Framework 3.5 Comment : This post http : stackoverflow.com questions 2816914 about-backward-compatibility-of-net-framework-4 make be helpful to your question stackoverflow.com questions 2816914 http : stackoverflow.com questions 2816914 about-backward-compatibility-of-net-framework-4 .. . Answer : The .NET 4.0 installer doesn t include the .NET framework 3.5 . There is some information on this topic http : msdn.microsoft.com en-us library ms171868.aspx in MSDN : .. . .. . The .NET Framework 4 is highly compatible with applications that are built with earlier .NET Framework versions except for some changes that were made to improve security standards compliance correctness reliability and performance . .. . The .NET Framework 4 does not automatically use its version of the common language runtime to run applications that are built with earlier versions of the .NET Framework . To run older applications with .NET Framework 4 you must compile your application with the target .NET Framework version specified in the properties for your project in Visual Studio or you can specify the supported runtime with the supportedRuntime Element http : msdn.microsoft.com en-us library w4atty68.aspx in an application configuration file . You can install .NET 3.5 and .NET 4.0 along side each other . Visual Studio 2010 also includes improved targetting support for .NET 3.5 . ScottGu s blog http : weblogs.asp.net scottgu archive 2009 08 27 multi-targeting-support-vs-2010-and-net-4-series.aspx talks about this in more detail .", "Question : There are some really great features in .NET 4.0 that I would like to start using but I am not comfortable making the change to VS 2010 just yet . Is there a way to use the .NET 4.0 beta in VS 2008 Comment : You happy using the .net-4.0 beta but your not happy with vs2010 . What s your reason for using one beta but not the other Personally neither should be used for live apps while they are still in beta . Comment : @Simon : Ever consider perhaps not everyone can afford the latest Visual Studio upgrade I personally think it s lame MS requires developers to upgrade to their latest dev tool to develop for the latest framework version . Comment : possible duplicate of Can I develop for .NET Framework 4 in Visual Studio 2008 http : stackoverflow.com questions 1836410 can-i-develop-for-net-framework-4-in-visual-studio-2008 .. . Answer : I don t think there is - the IDE is usually tied to a particular version of the framework and 2008 has been the first version to allow you to target a non-native so to speak version of the framework instead of just the matching version . While Microsoft might add support later I wouldn t expect them to though I would expect 2010 to be able to target different versions aside from 4.0 I haven t used it so it may do this and I don t know it . Update : According to this http : stackoverflow.com questions 960904 2010 targets 2 3 3.5 and 4 . To target 4.0 you ll have to use 2010 - at least for now and probably indefinitely . Comment : Adding .NET 4.0 support to Visual Studio 2008 is a costly operation . Besides this Microsoft wants us to buy Visual Studio 2010 . Two reasons why Microsoft will not add .NET 4.0 support to Visual Studio 2008 .", "Question : I am updating a PowerShell script that manages some .NET assemblies . The script was written for assemblies built against .NET 2 the same version of the framework that PowerShell runs with but now needs to work with .NET 4 assemblies as well as .NET 2 assemblies . Since .NET 4 supports running applications built against older versions of the framework it seems like the simplest solution is to launch PowerShell with the .NET 4 runtime when I need to run it against .NET 4 assemblies . How can I run PowerShell with the .NET 4 runtime Comment : Duplicate of stackoverflow.com questions 1940983 http : stackoverflow.com questions 1940983 loading-net-4-0-beta2-assembly-in-powershell-2-0 . Comment : These days the easiest solution would be to install the Powershell 3.0 CTP which uses CLRVersion : 4.0.30319.1 . .. . Answer : PowerShell the engine runs fine under .NET 4.0 . PowerShell the console host and the ISE https : en.wikipedia.org wiki Windows PowerShell PowerShell 2.0 do not simply because they were compiled against older versions of .NET . There s a registry setting that will-change the .NET framework loaded systemwide which will in turn allow PowerShell to use .NET 4.0 classes : .. . .. . To update just the ISE to use .NET 4.0 you can change the configuration psHome powershell ise.exe.config file to have a chunk like this : .. . .. . You can build .NET 4.0 applications that call PowerShell using the PowerShell API System.Management.Automation.PowerShell just fine but these steps will help get the in-the-box PowerShell hosts to work under .NET 4.0 . .. . .. . Remove the registry keys when you don t need them any more . These are machine-wide keys and forcibly migrate ALL applications to .NET 4.0 even applications using .net 2 and .net-3.5 .. . .. . Comment : Just to be clear powershell.exe the console host app itself is a native application - not managed . Comment : I figured out my problem from above . You have to put the config file in the 64-bit directory when running on a 64-bit OS . The 32-bit powershell executable seems to pick up the change just fine from there . Comment : Just one small advice . Remove the registry keys when you don t need them any more . I just lost a ton of time trying to find out why I couldn t build some .NET 3.5 project I am working on . Comment : The proposed registry modification solution has nasty side-effects if you re doing multi-targeting i.e . writing .NET 2.0 apps in VS2010 . Beware . Comment : Note that Microsoft warns strongly against doing this : While it is possible to force PowerShell 2.0 to run with .NET Framework 4.0 using various mechanisms such as creating a config file for PowerShell or editing the registry these mechanisms aren t supported and can have negative side effects on other PowerShell functionality such as PowerShell remoting and cmdlets with mixed-mode assemblies . connect.microsoft.com PowerShell feedback details 525435 http : connect.microsoft.com PowerShell feedback details 525435 net-4-0-assemblies-and-powershell-v2 Powershell 3.0 has native support for .NET 4.0 .", "Question : Do .Net components that were compiled against the .Net Framework 3.5 run on a system that has only .Net Framework 4.0 installed Or in other words does the .Net Framework 4.0 Installer include the .Net Framework 3.5 Comment : This post http : stackoverflow.com questions 2816914 about-backward-compatibility-of-net-framework-4 make be helpful to your question stackoverflow.com questions 2816914 http : stackoverflow.com questions 2816914 about-backward-compatibility-of-net-framework-4 .. . Answer : On XP SP2 with FW 4 installed running FW3.5 application gives a message : .. . .. . Unable to find a version of the runtime to run this application . .. . .. . So the answer is no . Comment : I think that s a little misleading as it s next to trivial to run a .NET 3.5 app on a .NET 4 runtime . See this question : stackoverflow.com questions 9959743 http : stackoverflow.com questions 9959743 running-net-3-5-apps-on-net-4-only-systems", "Question : I ve thrown together some code to tinker with the new .Net 4.0 VS 2010 pieces but I can t seem to find a build of my logging framework of choice log4net for 4.0 and I m getting reference errors with the 2.0 version . Is there a 4.0 version available somewhere I m not asking for new features just a version that s already been rebuilt against the new assemblies . Anyone know where I can find a build of 1.2.10 built for the 4.0 framework Comment : I think I remember seeing in-proc side-by-side for 2.0 4.0-compat but that doesn t appear to allow my 4.0 code to reference the 2.0 log4net library . Comment : Have you tried taking a log4net source project and running it through VS2010 s upgrade process Comment : I have pulled the source for 1.2.10 from the SVN server and run it through the upgrade process . It looks like so long as I define the NET 2 0 symbol and add attribute to get the Level1 security-enforcement rules things work . Obviously there s more work involved for the complete 4.0 update so I m hoping someone has already started on that work . .. . Answer : log4net has a known issue of referencing a System.Web component which is not part of the .NET Framework 4 Client Profile http : msdn.microsoft.com en-us library cc656912.aspx and the VS2010 by default sets project target to be the lightweighted Client Profile . The solution is to change the target to .NET Framework 4 : .. . .. . Right click project - properties - Application . Change : .. . .. . to be : .. . .. . .. . and that should work i.e . you can use log4net again.. . Comment : I should say the latest releases already added support for Client profile so no need to target the full one . Comment : Downloaded today latest release it doesn t support ClientProfile with .NET 4.0 Comment : Just downloaded latest binaries 1.2.11 and it contains a version compatible with 4.0 Client Profile in bin net-cp 4.0 release . Just tested it and works like a charm", "Question : here s what i have got two box one win 2003 server IIS6 another one win2008 server IIS 7.0 I have a standalone app named Util win app built-in .net-2.0 VS2005 trying to load .net-4.0 dll assembly VS2010 . this needed a simple setting in the app which was to create a Util.exe.config and add following setting .. . .. . This will basically make sure .net-2.0 uses the CLR 4.0 .. . .. . works like a charm with in winserver2008 box but shouts with above message within win2003 server Any ideas @update : Both machines have .net-4.0 framework installed . Comment : Are you sure that the Windows 2003 server has 4.0 installed Can you tell which runtime is being loaded Comment : Also see stackoverflow.com questions 2628078 http : stackoverflow.com questions 2628078 loading-executing-clr-2-0-assemblies-in-clr-4-0 Comment : @Jim : how to find out which CLR is loaded on production machine .. . Answer : look at the bottom of the yellow-screen-of-death . it ll tell you which runtime version created the error . Are we talking about a web app if we are you need to change the app pool . The above setting will have no affect on what version of the framework a web app uses . Simon Comment : nope its a win app", "Question : My app has a Target .NET Framework of 3.0 . I have a PC with a fresh install of Windows XP SP3 . Next I installed .NET Framework 4.0 Full on it . When I try to run my ClickOnce-deployed app I get the Failed to load the runtime-error : .. . .. . It is my understanding that apps Targeting .NET 3.0 should work on machines that have .NET 4.0 installed . What is causing this error Must I install .NET Framework 3.5 SP1 on Windows XP Machines Comment : I think I may write a custom Prerequisite and A Check if user has .NET Framework 3.0 installed http : stackoverflow.com questions 199080 how-to-detect-what-net-framework-versions-and-service-packs-are-installed . fresh XP won t have it fresh Vista will have it fresh Win 7 will have it B If .NET 3 is not installed install 3.5 . Comment : OK that worked . Why the app doesn t just run properly on XP SP3 with .NET 4.0 doesn t make sense to me . .. . Answer : yes I would install the .NET Framework 3.5 and try again if it does not work I would install the 3.0 Microsoft .NET Framework 3.0 Redistributable Package http : www.microsoft.com download en details.aspx id 31 . .NET 3.5 SP1 and .NET 4 are both present in the machines we deploy our applications to . Edit : .. . .. . also check these questions : .. . .. . What .NET Framework version should I ship with 2 3 3.5 http : stackoverflow.com questions 57234 what-net-framework-version-should-i-ship-with-2-3-3-5 .. . .. . Is .net framework 2.0 required if 3.5 is installed http : stackoverflow.com questions 5690658 is-net-framework-2-0-required-if-3-5-is-installed Comment : Yuck . This is a commercial application to be downloaded by anyone on the web . I don t want to require .NET Framework 3.5 to be downloaded and installed if the user already has .NET Framework 4.0 installed Might I have to write a custom bootstrapper that checks if user is on XP and if so require 3.5 Comment : Are you in control of this application Is that yours Can you target .NET 3.5 or .NET 4 Comment : Sure I could - but I don t want Vista users to have to download .NET 3.5 or 4.0 for no reason . .NET 3.0 ships with Vista which is why we re targeting 3.0 to minimize download and install time Comment : as you said in the other comment since it works when .NET 3.5 is installed I would include .NET 3.5 as prerequisite in the setup so who does not have it will download it . if you do not target framework 4 you will need the 3.5 also in machines which have .NET 4 . this most likely happens only on old machines Vista and windows-7 with their service packs already have 3.5 and 4.0 I think . Comment : got what you mean . Read this article : blogs.msdn.com b tims archive 2008 03 19 http : blogs.msdn.com b tims archive 2008 03 19 what-does-windows-vista-sp1-mean-for-developers.aspx they explain that Vista SP1 has .NET 3.0 SP1 which executes also .NET 3.5 so if users have Vista SP1 you can absolutely just target .NET 3.5 in your code .", "Question : Anybody manage to get .NET 4.0 applications compiling on a CI server without installing Visual Studio 2010 on a CI server No SDK exists for .NET 4.0 . Have installed .NET 4.0 on CI Server . Msbuild.exe works for simple projects and give the following warning : .. . .. . GetReferenceAssemblyPaths target - C : Windows Microsoft.NET Framework v4.0.30319 Microsoft.Common.targets 847 9 : warning MSB3644 : The reference assemblies for framework .NETFramework Version v4.0 were not found . To resolve this install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed . Note that assemblies will be resolved from the Global Assembly Cache GAC and will be used in-place of reference assemblies . Therefore your assembly may not be correctly targeted for the framework you intend . Comment : How can I make this a fatal-error rather than a warning It s hidden in our build log and instead it fails further down with some cryptic message about mscorlib.dll .. . Answer : other alternative : without installing Net 4.0 SDK or vs 2010 .. . .. . Copy the reference assemblies folder from your dev machine to build-server 190MB . use msbuild -p : FrameworkPathOverride option to point to reference assemblies folder .. . .. . the reference assemblies location : .. . .. . C : Program Files x86 Reference Assemblies Microsoft Framework .NETFramework v4.0 or C : Program Files Reference Assemblies Microsoft Framework .NETFramework v4.0 .. . .. . found this from : .. . .. . .NET 4.0 build-server reference assemblies warnings MSB3644 http : stackoverflow.com questions 5876946 net-4-0-build-server-reference-assemblies-warnings-msb3644 .. . .. . If you get this error : Microsoft.WebApplication.targets was not found - just copy the target from dev machine http : stackoverflow.com a 5344246 423356 .. . .. . if mvc3 is not installed in build-server add deployable assemblies to the mvc project http : haacked.com archive 2011 05 25 bin-deploying-asp-net-mvc-3.aspx .. . .. . If you have error building the MSTest project without the sdk or visual-studio installed There are several blog post about this to bad the solution is too complex for me . I use NUnit instead of MSTest Comment : Since my 2012 server would not let me install .Net 4 because the installer said there is a higher version . I did what @kite said and copied from a PC I had were VS 2012 was installed . This resolved my issues .", "Question : I am updating a PowerShell script that manages some .NET assemblies . The script was written for assemblies built against .NET 2 the same version of the framework that PowerShell runs with but now needs to work with .NET 4 assemblies as well as .NET 2 assemblies . Since .NET 4 supports running applications built against older versions of the framework it seems like the simplest solution is to launch PowerShell with the .NET 4 runtime when I need to run it against .NET 4 assemblies . How can I run PowerShell with the .NET 4 runtime Comment : Duplicate of stackoverflow.com questions 1940983 http : stackoverflow.com questions 1940983 loading-net-4-0-beta2-assembly-in-powershell-2-0 . Comment : These days the easiest solution would be to install the Powershell 3.0 CTP which uses CLRVersion : 4.0.30319.1 . .. . Answer : Please be VERY careful with using the registry key approach . These are machine-wide keys and forcibily migrate ALL applications to .NET http : en.wikipedia.org wiki .NET Framework 4.0 . Many products do not work if forcibily migrated and this is a testing aid and not a production quality mechanism . Visual Studio 2008 and 2010 MSBuild http : en.wikipedia.org wiki MSBuild turbotax and a host of websites SharePoint http : en.wikipedia.org wiki Microsoft SharePoint and so on should not be automigrated . If you need to use PowerShell with 4.0 this should be done on a per-application basis with a configuration file you should check with the PowerShell team on the precise recommendation . This is likely to break some existing PowerShell commands . Comment : Very good point about using the registry key . Happily the launcher application with config file is working just fine . Our scripts primarily use file system commands and direct .NET calls and we have not noticed any problems with broken commands . Since .NET 4 is largely backward compatible with .NET 2.0 I would not think it likely that there would be many broken commands though it never hurts to be cautions : .", "Question : There are some really great features in .NET 4.0 that I would like to start using but I am not comfortable making the change to VS 2010 just yet . Is there a way to use the .NET 4.0 beta in VS 2008 Comment : You happy using the .net-4.0 beta but your not happy with vs2010 . What s your reason for using one beta but not the other Personally neither should be used for live apps while they are still in beta . Comment : @Simon : Ever consider perhaps not everyone can afford the latest Visual Studio upgrade I personally think it s lame MS requires developers to upgrade to their latest dev tool to develop for the latest framework version . Comment : possible duplicate of Can I develop for .NET Framework 4 in Visual Studio 2008 http : stackoverflow.com questions 1836410 can-i-develop-for-net-framework-4-in-visual-studio-2008 .. . Answer : no this is not possible .NET 4.0 requires VS 2010 to be able to target build .", "Question : I have a standard situation - my software requires .NET 4.0 . I created dotNetInstaller package and put Microsoft .NET Framework 4 Web Installer http : www.microsoft.com en-us download details.aspx id 17851 inside . But problem is when user has another version of Windows than english i.e . Russian . This .NET Framework can t be installed in such case . How to solve this problem Of course I can create dotnetinstaller with 2 languages and propose to select version but : 1 . User can have Russian version of Windows but selects English 2 . User can have another version of Windows i.e . Spanish and he should have ability to install .NET Framework from dotnetinstaller . How to solve this problem .. . Answer : Have you tried setting the multilingual support You can install different components based on the operating-system language . Regards Stenio", "Question : There are some really great features in .NET 4.0 that I would like to start using but I am not comfortable making the change to VS 2010 just yet . Is there a way to use the .NET 4.0 beta in VS 2008 Comment : You happy using the .net-4.0 beta but your not happy with vs2010 . What s your reason for using one beta but not the other Personally neither should be used for live apps while they are still in beta . Comment : @Simon : Ever consider perhaps not everyone can afford the latest Visual Studio upgrade I personally think it s lame MS requires developers to upgrade to their latest dev tool to develop for the latest framework version . Comment : possible duplicate of Can I develop for .NET Framework 4 in Visual Studio 2008 http : stackoverflow.com questions 1836410 can-i-develop-for-net-framework-4-in-visual-studio-2008 .. . Answer : AS the people here already said no . But if you want to check out some of .net 4 features you could download the already aging Parallel Exetnsions CTP http : www.microsoft.com downloads details.aspx FamilyId 348F73FD-593D-4B3C-B055-694C50D2B0F3 displaylang en and try it out with Visual Studio 2008 . It not much.. .", "Question : I have VS2010 and VS2012 installed on my computer and had the .NET Framework 4.0 which I then upgraded to .NET Framework 4.5 . However I am still developing apps that need to work on .NET Framework 4.0 . The project says that it is targeting .NET Framework 4 Client Profile the assemblies even point to .NET Framework 4.0 folder under Referenced Assemblies . The problem comes when I move this application to a machine that only has 4.0 it won t start and come up with errors the immediate problem being an exception resulting from WindowState Binding WindowState which you can t do in 4.0 but you can in 4.5 . I need this to throw the exception on my development box why doesn t it My assumption is that despite my best efforts is that it uses the 4.5 dlls if they exist . How can I make it really use 4.0 without uninstall 4.5 Update .. . .. . To repro this install .NET Framework 4.5 and create a WPF project targeting .NET Framework 4.0 . Bind the WindowState to a property in a VM or code-behind make this property have a public get and private set . .NET Framework 4.5 handles this just fine even when Mode TwoWay must ignore the set .NET Framework 4 doesn t and throws an exception : A TwoWay or OneWayToSource binding cannot work on the read-only property State of type.. . . On the box with .NET Framework 4.5 works like a charm try it on a machine with only .NET Framework 4.0 and it blows up.. . So any ideas on how to really target 4.0 when 4.5 is installed Bug report to MS here : https : connect.microsoft.com VisualStudio feedback details 774694 targeting-net-framework-4-0-when-4-5-doesnt-seem-to-work Comment : If you re targeting .NET 4.0 then why do you have code that uses something that only works in .NET 4.5 Comment : Assuming that s accurate I doubt it it doesn t throw an exception on your dev box because you no longer have .NET 4.0 installed . .NET 4.5 replaced it . Comment : @John : He didn t know it only worked in 4.5 . He wants the exception to occur even when the user happens to have .NET 4.5 installed . Comment : So under Project Properties- Application- Target Framework it says .Net Framework 4 Client Profile Comment : @HansPassant That is the point .NET 4.5 replaces .NET 4.0 but I want to develop for .NET 4.0 so how do I do that without uninstalling 4.5 because I have apps that I want to target 4.5 .. . Answer : .Net 4.5 replaces .net-4.0 with new same-named libraries that actually have some fixes . That s short answer . Unlike earlier versions updating .net 4 to 4.5 replaces files instead of adding sided by side files . Even if you have folder like this Windows Microsoft.Net Framework v40 After update there is a change in this folder . Files are changed some errors were handled in .net without developer s concern . How to target 4.0 framework using .net-4.5 I still don t know but I m still digging .. . .. . Suggested read on this topic : .. . .. . Scott Hanselman : http : www.hanselman.com blog NETVersioningAndMultiTargetingNET45IsAnInplaceUpgradeToNET40.aspx .. . .. . Rick Strahl : http : weblog.west-wind.com posts 2012 Mar 13 NET-45-is-an-inplace-replacement-for-NET-40 .. . .. . And similar problem created by me : Errors on .NET 4.0 don t appear on .NET 4.5 http : stackoverflow.com questions 26483168 errors-on-net-4-0-dont-appear-on-net-4-5", "Question : There are some really great features in .NET 4.0 that I would like to start using but I am not comfortable making the change to VS 2010 just yet . Is there a way to use the .NET 4.0 beta in VS 2008 Comment : You happy using the .net-4.0 beta but your not happy with vs2010 . What s your reason for using one beta but not the other Personally neither should be used for live apps while they are still in beta . Comment : @Simon : Ever consider perhaps not everyone can afford the latest Visual Studio upgrade I personally think it s lame MS requires developers to upgrade to their latest dev tool to develop for the latest framework version . Comment : possible duplicate of Can I develop for .NET Framework 4 in Visual Studio 2008 http : stackoverflow.com questions 1836410 can-i-develop-for-net-framework-4-in-visual-studio-2008 .. . Answer : No VS 2008 Multi Targeting option only support .NetFramework 3.5 3.0 2.0 .. . .. . so it has a Backward Compatability So You have to Use VS 2010 for .netFramework 4.0", "Question : windir Microsoft.NET assembly is the new GAC http : en.wikipedia.org wiki Global Assembly Cache . Does it mean now we have to manage two GACs one for .NET 2.0-3.5 applications and the other for .NET 4.0 applications The question is why Comment : thanks for asking the question..i am also very confused when i did not find gac in its original location : Comment : Good question.. . Many thanks . Comment : +1 for your question . I began development under NET 4.0 and was confused by the dual GAC issue . Comment : It took em a few iterations but Microsoft finally brought DLL Hell to .NET . Yay .. . Answer : Yes since there are 2 distinct Global Assembly Cache GAC you will have to manage each of them individually . In .NET Framework 4.0 the GAC went through a few changes . The GAC was split into two one for each CLR . .. . The CLR version used for both .NET Framework 2.0 and .NET Framework 3.5 is CLR 2.0 . There was no need in the previous two framework releases to split GAC . The problem of breaking older applications in Net Framework 4.0 . .. . To avoid issues between CLR 2.0 and CLR 4.0 the GAC is now split into private GAC s for each runtime.The main change is that CLR v2.0 applications now cannot see CLR v4.0 assemblies in the GAC . Source http : www.techbubbles.com net-framework gac-in-net-framework .. . .. . Why .. . .. . It seems to be because there was a CLR change in .NET 4.0 but not in 2.0 to 3.5 . The same thing happened with 1.1 to 2.0 CLR . It seems that the GAC has the ability to store different versions of assemblies as long as they are from the same CLR . They do not want to break old applications . See the following information in MSDN about the GAC changes in 4.0 http : msdn.microsoft.com en-us magazine dd727509.aspx . For example if both .NET 1.1 and .NET 2.0 shared the same GAC then a .NET 1.1 application loading an assembly from this shared GAC could get .NET 2.0 assemblies thereby breaking the .NET 1.1 application .. . .. . The CLR version used for both .NET Framework 2.0 and .NET Framework 3.5 is CLR 2.0 . As a result-of this there was no need in the previous two framework releases to split the GAC . The problem of breaking older in this case .NET 2.0 applications resurfaces in Net Framework 4.0 at which point CLR 4.0 released . Hence to avoid interference issues between CLR 2.0 and CLR 4.0 the GAC is now split into private GACs for each runtime . As the CLR is updated in future versions you can expect the same thing . If only the language changes then you can use the same GAC . Comment : That blog post merely restates the OP s discovery it doesn t explain why the GAC needed to be split . It isn t obvious the original GAC would have been quite capable of keeping the 4.0 assemblies separate . They have a new AssemblyVersion Comment : @Hans : Maybe not the exact reason but it does say : To avoid issues between CLR 2.0 and CLR 4.0 also the question had 2 questions inside of it . The second question being : does it mean now we have to manage two GACs one for .NET 2.0-3.5 apps and the other for .NET 4.0 apps Comment : deleting my post as it is also linked to the same article Comment : @Hans Passant : I added some more info . Comment : You should quote this from one of your links : For example if both .NET 1.1 and .NET 2.0 shared the same GAC then a .NET 1.1 application loading an assembly from this shared GAC could get .NET 2.0 assemblies thereby breaking the .NET 1.1 application .", "Question : How do I get nant to build projects that target the .NET 4.0 Framework .. . Answer : 2010 April 15 .. . Update to above correct answer from Eugene after .net 4 and vs2010 was released . I downloaded vs2010 and .net 4 runtime . The production version seems to be v4.30319 ie C : WINDOWS Microsoft.NET Framework v4.0.30319 .. . .. . After reviewing http : paigecsharp.blogspot.com 2009 08 nant-net-framework-40-configuration.html .. . I pasted in the text and changed all text from v4.0.20506 to v4.30319 an added text to NAnt.exe.config . I then updated my nant script to .. . .. . this so my project nant script uses the .net 4 compiler .. . .. . And this got me a nant build with .net 4 binary ... . .. . .. . Update 2010-06-14 : The above was answered with nant-0.85 I upgraded to nant-0.90 and had to add vendor Microsoft to framework attribute that is added to nants config . Also it looks like nant0.9 finds the .net libraries differently as I had to add something like this to my nant build.xml .. . .. . .. . and Comment : Updating the version of NAnt to the latest available version currently 0.91 Alpha 2 was necessary for me to get this to work in addition to the build and config changes . btw did not need the last include .", "Question : I am a .NET student and currently we are learning about Application Domains . We were given the following example code for .NET 3.5 . As expected it throws a SecurityException . Note : TestApp.exe is added as a reference in the project . .. . .. . When trying to run this in VS2010 under .NET 4.0 I run into a problem . First it shows a warning .. . .. . Public Sub New hostEvidence As Object assemblyEvidence As Object is obsolete : This constructor is obsolete . Please use the constructor which takes arrays of EvidenceBase instead . . I change the type of hostEvidence to EvidenceBase and the warning is gone . However when trying to run the application it gives an error . This method implicitly uses CAS policy which has been obsoleted by the .NET Framework . In order to enable CAS policy for compatibility reasons please use the NetFx40 LegacySecurityPolicy configuration switch . Please see http : go.microsoft.com fwlink LinkID 155570 for more information . I have viewed the page followed the link-to How to : Run Partially Trusted Code in a Sandbox and read http : blogs.msdn.com shawnfa archive 2009 05 27 coding-with-security-policy-in-net-4-0-implicit-uses-of-cas-policy.aspx but I m having trouble understanding all of this . The code example on MSDN is quite big compared to what I currently have so any help with changing my code so it works without adding other stuff will be very appreciated . .. . Answer : As it says in the link you provided .NET is no longer supporting the policy portion of the code-access-security framework as of version 4.0 . In other words your lesson is about .NET 3.5 and does not pertain to the 4.0 framework . The solution is to revert to your original code and configure your project to target the 3.5 framework http : msdn.microsoft.com en-us library bb398202.aspx you can still use Visual Studio 2010 . . Comment : I realise that the lessen is about 3.5 but the MSDN page on migration uses SecurityZone.Internet in the code . I just have the impression that it does more than I want and I don t have the experience to take out the parts I need . Comment : Your lesson may also be applicable to .NET 4.0 but you haven t provided enough information in your question to say . And probably can t . If you continue to try to make it work with 4.0 while you re learning the material you risk running into more nasty surprises as you run into language and framework changes . You can still use Visual Studio 2010 you just shouldn t target the 4.0 framework . Comment : Fair point . Thank you for your time ." ] }
[ "yes-answer-long", "yes-answer-short" ]
.net
UNK_RELATION
cbperipheral@cbcentralmanager@136
cbperipheral -- the cbperipheral class represents remote peripheral devices that your app by means of a central manager an instance of @placeholder has discovered advertising or is currently connected to .
{ "confidence": [ 49.48290252685547, 48.99999237060547, 45.33723831176758, 41.75991439819336, 40.86113357543945, 40.29937744140625, 38.349815368652344, 37.95640563964844, 37.697200775146484, 37.69675827026367, 37.373077392578125, 37.27568435668945, 36.98517608642578, 36.98517608642578, 35.89128875732422, 35.89128875732422, 35.89128875732422, 35.65341567993164, 35.271400451660156, 35.02104187011719, 34.58023452758789, 34.44657516479492, 34.41423034667969, 34.15244674682617, 33.79853439331055, 33.69964599609375, 33.674259185791016, 33.58888244628906, 33.51212692260742, 33.04230880737305, 32.58304214477539, 32.5820426940918, 32.43749237060547, 32.31691360473633, 31.92864990234375, 31.343605041503906, 31.343605041503906, 31.343605041503906, 31.343605041503906, 31.343605041503906, 31.343605041503906, 31.343605041503906, 31.288379669189453, 31.27098846435547, 31.132740020751953, 30.29498291015625, 30.26835060119629, 30.189125061035156, 30.032550811767578, 29.826257705688477, 29.57477378845215, 29.387601852416992, 29.37618637084961, 29.335140228271484, 29.30506134033203, 28.724580764770508, 28.699207305908203, 28.659067153930664, 28.659067153930664, 28.659067153930664, 28.567607879638672, 28.540464401245117, 28.4946231842041, 28.4946231842041, 28.352191925048828, 28.23739242553711, 27.81527328491211, 27.575748443603516, 27.427715301513672, 27.075145721435547, 26.97124481201172, 26.90262794494629, 26.801979064941406, 26.765390396118164, 26.62751007080078, 26.451879501342773, 26.178775787353516, 26.16025161743164, 26.151386260986328, 26.151386260986328, 26.077863693237305, 26.073402404785156, 25.99172019958496, 25.882158279418945, 25.83167266845703, 25.607406616210938, 25.300128936767578, 25.282316207885742, 25.231182098388672, 25.231182098388672, 25.140825271606445, 25.126174926757812, 25.03192901611328, 24.983732223510742, 24.735198974609375, 24.46449089050293, 24.169389724731445, 24.156566619873047, 24.135387420654297 ], "content": [ "I record all peripheral found into an array of CBPeripheral like this : Peripherals.append peripheral .", "Yes it was deprecated for CBPeripheral class .", "According to the apple docs : .. . .. . If the state moves below CBCentralManagerStatePoweredOff all CBPeripheral objects obtained from this central manager become invalid and must be retrieved or discovered again .", "but after that didConnectPeripheral and other CBPeripheral are not called .", "To connect to a peripheral will trigger void centralManager : CBCentralManager central didConnectPeripheral : CBPeripheral peripheral so if the BLE device has the pairing enabled you will get the prompt asking for pairing .", "Rediscover reconnect to the device via my app with an existing CBPeripheral object .", "I am looking at some iOS client code and using the CBPeripheral to detect a BLE peripheral using the CoreBluetooth library .", "Setting up CBPeripheral events : .. . .. . Writes to rx .", "Now whenever centralManager discovers a CBPeripheral it can check its local database of UUIDs and determine which device is related to this CBPeripheral without a doubt .", "I am having some trouble with a CBPeripheral that has it s services updated : my physical device has a button that updates the advertising services but my app still reads the old services in the delegate method didDiscoverServices .", "If it s already connected the only thing I m aware of that can wake it up is if the peripheral notifies or indicates or disconnects in which case if you ve restored your peripheral correctly by setting the delegate the callback you re looking for is .. . - void peripheral : CBPeripheral peripheral didUpdateValueForCharacteristic : CBCharacteristic error : NSError .. . or .. . - void centralManager : CBCentralManager didDisconnectPeripheral : CBPeripheral error : NSError .. . so I d suggest you check the peripheral.connected state and only call connectPeripheral if peripheral.connected CBPeripheralStateConnected or peripheral.connected CBPeripheralStateConnecting", "I have the following scenario : iOS app peripheral X OSX app central .. . .. . I instantiate my peripheral manager with CBPeripheralManagerOptionRestoreIdentifierKey .", "Add you CBPeripheral items in array not name and then pass that object to connect .", "Everytime I m using this I get CBPeripheral instances back with state CBPeripheralStateDisconnected .", "I still have saved in a var my CBPeripheral and I try to connect to it .", "You need to add a category to CBPeripheral that restores the isConnected method .", "2 . centralManager discovers a CBPeripheral connects and then reads the value for a specific characteristic .. . 3 .", "My app functions as both a central and a peripheral .", "But regardless if I cancelled the request entered an invalid pin or simply do nothing .. . .. . - void centralManager : CBCentralManager central didConnectPeripheral : CBPeripheral peripheral .. . .. . delegate always gets called .", "Therefore even if the device is nearby the address of the device may have changed since the last time it was discovered by the system in which case the CBPeripheral object you are trying to connect to doesn t correspond to the actual peripheral device .", "In foreground the beacon will be detected region entry but the callbacks for the CBPeripheral don t fire .", "It is no secret that CoreBluetooth is a little buggy and this has seemed to help me avoid invalid CBPeripheral warnings in the past .", "I am not sure you can transfer a CBPeripheral instance acquired from one CBCentralManager to another .", "Your question is a bit vague : do you want to discover a new peripheral or reconnect to a previously connected peripheral or to discover a specific service on a discovered peripheral", "That means if you have connected paired bonded the peripheral using another app or via the bluetooth system settings it will still show as disconnected within your app .", "I can connect the devices and also send data from the peripheral to the central .", "We are doing the connection using CBCentralManager for the CBPeripheral object of Bluetooth Framework in iOS app .", "However I would suggest invalidating releasing all of your CBPeripheral objects if the state moves below CBCentralManagerStatePoweredOn .", "In fact even the CBPeripheral can change out from under you CoreBluetooth has an internal behavior where the device UDID will-change every few minutes if the CBPeripheral is another iOS device .", "But unfortunately CBPeripheral CBService and CBCharacteristic do not have adopted NSCopying .", "If I do not turn off BT and then turn on May I call first call method .. . .. . then call .. . .. . void connectPeripheral : CBPeripheral peripheral options : nullable NSDictionary NSString id options .. . .. . is it will be make sense", "I am advertising my peripheral service as follows .", "Write implementation .. . .. . Now CBPeripheral s didWriteValueForCharacteristic method is getting called with nil NSError .", "If all apps that are advertising are in the background the frequency at which your peripheral device sends advertising packets may decrease .", "I ve tried to save a CBPeripheral in the NSUserDefaults Class but unfortunately only property values can be stored .", "But new identifier property was added to CBPeer superclass from which CBCentral and CBPeripheral inherit .", "In my opinion directly holding onto the CBPeripheral objects in an NSArray or NSDictionary is the easiest way .", "Connect and disconnect as many times as you would like without scanning each time to a CBPeripheral once it is retained .", "CBPeripheral device responds to the request with its non-bluetooth-related UUID from step 1 .", "I ve been storing the UUID with userDefaults but a CBPeripheral object is not a property-list object so it can t be stored that way .", "What I am finding is that when I connect to a CBPeripheral device it seems to be caching the old device name .", "By disconnecting from the CBPeripheral device twice I find that I can retrieve the new name .", "If you refer to the documentation you will see .. . .. . CBMutableCharacteristic objects represent the characteristics of a local peripheral s service local peripheral devices are represented by CBPeripheralManager objects .. . .. . and .. . .. . CBCharacteristic objects in particular represent the characteristics of a remote peripheral s service remote peripheral devices are represented by CBPeripheral objects .. . .. . You state in a comment that you are unable to discover the services and characteristics of your device - in this case I suggest you examine your discovery code or add it to your question .", "Is it possible to set the GAP name on a peripheral advertising iPhone", "Peripheral is sending data to some central .", "have you tried this When you call the scanForPeripheralsWithServices : options : method of the CBCentralManager class to discover remote peripheral s that are advertising services your central device uses its radio to listen for advertising devices until you explicitly tell it to stop .. . .. . Ref : Best Practices for Interacting with a Remote Peripheral Device https : developer.apple.com library ios documentation NetworkingInternetWeb Conceptual CoreBluetooth concepts BestPracticesForInteractingWithARemotePeripheralDevice BestPracticesForInteractingWithARemotePeripheralDevice.html", "I have developed a Bluetooth Low Energy peripheral app that successfully connects with a second BLE central app .", "Essentially if you know the UUID of the device you want to reconnect to which is the identifier property of the CBPeripheral object then you can use the retrievePeripheralsWithIdentifiers : method of the CBCentralManager to obtain the CBPeripheral object and then attempt a connection - .. . .. . This may not work and you may have to scan for your peripheral as the identifier of some peripherals iOS devices in particular periodically change their UUID .", "You need to retain the CBPeripheral object that you are trying to connect to otherwise it is released once the delegate method didDiscoverPeripheral returns .", "You can also use background modes to automatically re-launch your app and connected to a peripheral .", "For other peripheral devices such as fitness monitors HID devices etc the address will never change unless the peripheral manufacturer has also decided to introduce address randomisation and it is safe to store the UUID string and attempt to scan and reconnection directly when the appropriate UUID is seen - note that you can t necessarily use the CBPeripheral but you can store the UUID object from it .", "Can an app using CoreBluetooth in central manager mode connect to multiple CBPeripherals", "For example i have tried with one iphone as peripheral and other as central .", "An example : .. . .. . If the central manager is powered off then the best solution is to drop the whole peripheral delegate .", "You have 2 devices working as central role who wants to connect to one BLE peripheral .", "Using the CoreBluetooth framework is it possible to change the peripheral name of an iPhone that is advertising in peripheral mode", "However I am unable to get the central app to subscribe to notifications for one of the characteristics of the service offered by the peripheral .", "It doesn t work - Simultaneously advertising the peripheral and the beacon seems to cause a strange conflict .", "A peripheral should be sufficient particularly if you are advertising and connecting in the background", "As mentioned the issues appears to be simultaneous advertising of beacon and peripheral in the foreground .", "If the phone is already connected to the peripheral when the app is terminated it won t call the centralManager : didConnectPeripheral callback because it s already connected and Core Bluetooth has held that connection for you and has stored the details .", "In the didDiscoverPeripheral : peripheral delegate method you add the discovered peripheral to an array .", "I ve also tried making the three CBPeripheral variables global but I ran into a ton of issues with that .", "Does anyone know how to store a CBPeripheral object so that I can access it and initialize it in other view controllers", "I referred Sample app provided by Apple for CoreBluetooth and I succeeded in sending Data from Peripheral to Central Now I need to write Data from Central to Peripheral .", "ok i have not tried this but i think self.peripheral discoverServices : nil will be updated for a connected peripheral not a discovered peripheral .i have not tested it on ios but advertisement data changes can only be view in advertisement packets .", "I successfully discover a Peripheral and retrieve its local name : .. . .. . But if the Peripheral stops and restarts advertising with a different local name the Client doesn t recognise the change .", "If you have connected some peripherals within your app they will show as connected .", "So all the peripheral and manager stuff is tested .", "If the state changes to anything except CBCentralManagerStatePoweredOn then you need to get rid of all of your retained CBPeripheral objects and do another scan once the state turns back on .", "Sure - I have the central peripheral working in foreground and background .", "If you develop a non iOS peripheral then you should be able to start acting as ATT client once the iOS central connected to you .", "Edit : -------------------- .. . .. . Read example : aPeripheral readValueForCharacteristic : aChar .. . .. . Notify example : aPeripheral setNotifyValue : YES forCharacteristic : aChar .. . .. . Both of these calls will result in the - void peripheral : CBPeripheral aPeripheral didUpdateValueForCharacteristic : CBCharacteristic characteristic error : NSError error - function to get called when the BLE device returns a value .", "This how I cleanup Central after connection : .. . .. . This is how I reinitialise bluetooth s central and peripheral :", "Here is a similar issue : CoreBluetooth : Refreshing local name of an already discovered Peripheral http : stackoverflow.com questions 13180134 corebluetooth-refreshing-local-name-of-an-already-discovered-peripheral", "If I already have a peripheral object it doesn t seem there is any way to get the advertising data from it .", "Either use a single CBCentralManager instance throughout your app perhaps in a Bluetooth manager class or use retrievePeripheralWithIdentifier on your second CBcentralManager .", "The advertising code is as follows : .. . .. . Which produces this : .. . .. . If I remove either the peripheral or the beacon advertisement item from the dictionary before calling startAdvertising the app behaves normally .", "I am doubtful about the recovery when central or peripheral deletes pairing data .", "What will be the case-when user deletes pairing from from peripheral without deleting from central", "An app can issue a connect to a peripheral and it won t timeout .", "I did not set a custom queue however using nil on the Central Manager .", "You should just have your iOS device act as the peripheral and the Mac as the central .", "Currently iOS does not support the combination GAP Central role and ATT Server role as well as the combination GAP Peripheral role and ATT Client role .", "How to force iPhone to pair to unpaired peripheral when peripheral has the pairing information .", "I call method .. . .. . void connectPeripheral : CBPeripheral peripheral options : nullable NSDictionary NSString id options .. . .. . to connect my device my device is in range but my app still can t connect my device success when I turn off system BT and then turn on BT my app will connect my device success I don t know why", "For instance the device may not be in the vicinity of the central .", "However if the device is already connected when the app is terminated due to memory-management I cannot seem to reestablish functioning ownership of the peripheral .", "You can t initiate your scan until after you are in the powered-on state - use code in your scanning app similar to that which is in your advertising app", "You can t initiate your scan until after you are in the powered-on state - use code in your scanning app similar to that which is in your advertising app .", "I m simultaneously advertising a BLE peripheral and a beacon combined in one NSDictionary and advertised by the same CBPeripheralManager .", "Write to read from or get notified by characteristics .. . .. . Subsequently you don t have to search for and discover devices as previously discovered devices can be retrieved from cache and connected to directly .", "It is a bit counterintuitive I have to admit but the peripheral state is always related to your app .", "What is your peripheral", "To test my central code I decided to setup an iPhone as peripheral the role the chip will have once I got it and an iPad as Central .", "Add a property to the class where you are doing all that : .. . .. . And then assign the peripheral to this property when the device is discovered before you return from didDiscoverPeripheral :", "At this point your peripheral will appear with the new name .", "I wonder though shouldn t I get at least a connected-state for devices that I have connected to within my app or is it possible that the state is even isolated per CBCentralManager i.e .", "If you would like to identify a specific CBPeripheral after the app is reset or the device is shut down or even a network settings reset cache reset then you will need to have a custom implementation that uniquely identifies another device not based on anything CoreBluetooth offers you for free ." ] }
{ "confidence": [ 78.40337371826172, 78.17506408691406, 72.54087829589844, 72.43862915039062, 64.27408599853516, 62.93684387207031, 61.438228607177734, 61.36735534667969, 59.91677474975586, 59.90024185180664, 58.87871170043945, 57.370948791503906, 56.16975021362305, 52.74250030517578, 52.53114318847656, 52.1060791015625, 51.55287170410156, 51.24517059326172, 48.38542175292969, 47.970130920410156 ], "content": [ "Question : I am having some trouble with a CBPeripheral that has it s services updated : my physical device has a button that updates the advertising services but my app still reads the old services in the delegate method didDiscoverServices . Although when I discover the peripheral in didDiscoverPeripheral I can see the services are up-to-date there . If I run the app again the old services are still there It seems the only way to get my app to discover the new services is turning the Bluetooth off and on again . Even uninstalling reinstalling my app is not enough . Does iOS cache the services forever Is there a way to reset erase the cache .. . Answer : have you tried this When you call the scanForPeripheralsWithServices : options : method of the CBCentralManager class to discover remote peripheral s that are advertising services your central device uses its radio to listen for advertising devices until you explicitly tell it to stop .. . .. . Ref : Best Practices for Interacting with a Remote Peripheral Device https : developer.apple.com library ios documentation NetworkingInternetWeb Conceptual CoreBluetooth concepts BestPracticesForInteractingWithARemotePeripheralDevice BestPracticesForInteractingWithARemotePeripheralDevice.html Comment : Sure thing . That is what I do passing the services I am looking for and the didDiscoverPeripheral has those services in advertisementData CBAdvertisementDataServiceUUIDsKey . But when I explicitly call self.peripheral discoverServices : nil that service is not there anymore Comment : ok i have not tried this but i think self.peripheral discoverServices : nil will be updated for a connected peripheral not a discovered peripheral .i have not tested it on ios but advertisement data changes can only be view in advertisement packets . correct me if i am wrong", "Question : For BLE 4.0 it provides API to discover peripherals with array of service UUID . I just want to find the specific one . How to achieve this If need assign the identifier to the specific device how to do it I think my question need some context of core-bluetooth of iOS . Comment : did you find out the answer I have the same situation . If you could share what you found that would be nice . Comment : Your question is a bit vague : do you want to discover a new peripheral or reconnect to a previously connected peripheral or to discover a specific service on a discovered peripheral It seems like Paulw11 has the best answer for your question . .. . Answer : The process for reconnecting to known peripherals is described in the Core Bluetooth Programming Guide https : developer.apple.com library ios documentation NetworkingInternetWeb Conceptual CoreBluetooth concepts BestPracticesForInteractingWithARemotePeripheralDevice BestPracticesForInteractingWithARemotePeripheralDevice.html apple ref doc uid TP40013257-CH6-SW9 . Essentially if you know the UUID of the device you want to reconnect to which is the identifier property of the CBPeripheral object then you can use the retrievePeripheralsWithIdentifiers : method of the CBCentralManager to obtain the CBPeripheral object and then attempt a connection - .. . .. . This may not work and you may have to scan for your peripheral as the identifier of some peripherals iOS devices in particular periodically change their UUID . The programming guide notes - .. . .. . Note : A peripheral device may not be available to be connected to for a few reasons . For instance the device may not be in the vicinity of the central . In addition some Bluetooth low energy devices use a random device address that changes periodically . Therefore even if the device is nearby the address of the device may have changed since the last time it was discovered by the system in which case the CBPeripheral object you are trying to connect to doesn t correspond to the actual peripheral device . If you cannot reconnect to the peripheral because its address has changed you must rediscover it using the scanForPeripheralsWithServices : options : method . You will also have to scan the first time you encounter a peripheral .", "Question : This question already has an answer here : .. . .. . CoreBluetooth : What is the lifetime of unique UUIDs questions 17575949 corebluetooth-what-is-the-lifetime-of-unique-uuids 1 answer .. . .. . I ve been playing with Corebluetooth and I ve learnt that besides going through the tedious process of scanning for a peripheral every time I want to connect I can also store the peripheral s UUID and use it with retrievePeripheralsWithIdentifiers and connectPeripheral for further reconnections . Turns out that it only works for a certain amount of time apparently the peripheral has its UUID updated therefore the stored one can be considered expired . I haven t been able to find any consistent documentation on this so I m not sure how long it lasts for . Is there any way around this in order to allow later reconnections faster than scanning for peripherals all over again .. . Answer : In my opinion directly holding onto the CBPeripheral objects in an NSArray or NSDictionary is the easiest way . Connect and disconnect as many times as you would like without scanning each time to a CBPeripheral once it is retained . The only thing you have to be mindful of is the CBCentralManager s state . You will receive state changes by implementing the CBCentralManagerDelegate centralManagerDidUpdateState : method . If the state changes to anything except CBCentralManagerStatePoweredOn then you need to get rid of all of your retained CBPeripheral objects and do another scan once the state turns back on . According to the apple docs : .. . .. . If the state moves below CBCentralManagerStatePoweredOff all CBPeripheral objects obtained from this central manager become invalid and must be retrieved or discovered again . However I would suggest invalidating releasing all of your CBPeripheral objects if the state moves below CBCentralManagerStatePoweredOn . It is no secret that CoreBluetooth is a little buggy and this has seemed to help me avoid invalid CBPeripheral warnings in the past . If you would like to identify a specific CBPeripheral after the app is reset or the device is shut down or even a network settings reset cache reset then you will need to have a custom implementation that uniquely identifies another device not based on anything CoreBluetooth offers you for free . Here is how I do it in one of my apps : .. . .. . 1 . Alloc Init a NSUUID object the first time the app is launched and save it in NSUserDefaults as a NSString . Think of this UUID as a pseudo-MAC address for your app . This UUID will remain constant for the lifetime of the app . 2 . centralManager discovers a CBPeripheral connects and then reads the value for a specific characteristic .. . 3 . CBPeripheral device responds to the request with its non-bluetooth-related UUID from step 1 . I also include a whole bunch of user provided information in this step along with the UUID . 4 . centralManager saves this UUID and any other information you include using Core Data or NSUserDefaults if it hasn t already . 5 . Repeat steps 2-4 for all newly discovered CBPeripherals . Now whenever centralManager discovers a CBPeripheral it can check its local database of UUIDs and determine which device is related to this CBPeripheral without a doubt . See Paulw11 s answer for how reconnect while in the background . Note that if your app has been quit by the user swipe the app s preview up after pressing the home button twice any long term connects will be cancelled even if the app is restarted . Comment : Thank you very much for the reply I supposed I should ve been clearer in my question . The ideia is to perform reconnections across different cycles of the application . I ve been storing the UUID with userDefaults but a CBPeripheral object is not a property-list object so it can t be stored that way . Any suggestions The Peripheral is indeed an iOS device just to clarify . Thanks . Comment : We tried all the things but we are facing an issue stackoverflow.com questions 25139916 http : stackoverflow.com questions 25139916 corebluetooth-setting-notifications-on-characteristic-results-in-invalid-handle", "Question : I am new to Core Bluetooth programming in iOS . Recently I encountered this problem that when connecting to a peripheral Bluetooth Pairing Request alert will pop-up on screen . But regardless if I cancelled the request entered an invalid pin or simply do nothing .. . .. . - void centralManager : CBCentralManager central didConnectPeripheral : CBPeripheral peripheral .. . .. . delegate always gets called . That means connection always succeeds . Anyone who can explain why this happens Thanks . .. . Answer : To connect to a peripheral will trigger void centralManager : CBCentralManager central didConnectPeripheral : CBPeripheral peripheral so if the BLE device has the pairing enabled you will get the prompt asking for pairing . In case the pairing is unsuccessful if the device doesn t have a command to disconnect after unsuccessful pairing it will remain connected BUT if you try to discover its services and characteristics you ll probably get none depending how the firmware side of the BLE device has been configured .", "Question : I am currently creating a simple iOS bluetooth app . I currently have a device with the ability to modify the name . What I am finding is that when I connect to a CBPeripheral device it seems to be caching the old device name . 1 . Connect to the device via my app . 2 . Disconnect from device via my app . 3 . Change the name of the device . 4 . Rediscover reconnect to the device via my app with an existing CBPeripheral object . By following the procedure above I was expecting my iOS app to discover the new device name . However I am finding that it has a tendency of retaining the old name instead . By disconnecting from the CBPeripheral device twice I find that I can retrieve the new name . So my question is is there a way to update or clear CBPeripheral s existing discovered characteristics or rediscovering new characteristics each time in order to get the latest device name Here is a similar issue : CoreBluetooth : Refreshing local name of an already discovered Peripheral http : stackoverflow.com questions 13180134 corebluetooth-refreshing-local-name-of-an-already-discovered-peripheral .. . Answer : I had a similar issue moreover it wasn t a problem only with the device s name but some characterstics changed in specific modes like firmware upgrade on a device . Got the following answer from apple : .. . The answer is that the accessory needs to support the GATT Service Changed characteristic - please read the specification https : www.bluetooth.org DocMan handlers DownloadDoc.ashx doc id 282159 specifically Vol 3 Part G 2.5.2 and Vol 3 Part G 7.1 . .. . .. . The name issue has been solved by having the device name advertised as a property in the advertisement data . This however might need specific firmware as it doesn t always have that property in the adv package .. . .. . Otherwise to reset the core-bluetooth cache : you will need to re-start the iOS bluetooth adapter which I couldn t manage to do programatically on iOS .", "Question : We are working on iOS application and in which we need to pass the RGB signal to the BLE device and based on RGB code the device LED will glow . We are doing the connection using CBCentralManager for the CBPeripheral object of Bluetooth Framework in iOS app . We are setting the characteristic and descriptor UUID but still we are not able to send the signal on the BLE device . Here is the code we are using to pass RGB data in hex bytes format . Are we doing it the right way Is there any issue in sending the data or creating the CBMutableCharacteristic object Comment : We tried this code but not helpful . github.com RedBearLab iOS tree master Examples BLE 20RGB https : github.com RedBearLab iOS tree master Examples BLE 20RGB BLE 20RGB Comment : How have you set self.peripheral This needs to be the peripheral that was passed to the delegate method . Also you would normally call discoverServices and discoverCharacteristicsForService to get the CBCharacteristic rather than just creating a CBMutableCharacteristic Comment : We have done the same way you are saying but just provided the final method code data so that we can find the correct solution here . Anything wrong we are doing in this method Comment : Yes you cannot simply create a CBMutableCharacteristic - you must discover the CBCharacteristic or retrieve it from the peripheral s characteristics property . Refer to the documentation - a CBMutableCharacteristic represents a local characteristic not a remote characteristic Comment : You need to look at your discovery code - you must retrieve the characteristics from the peripheral . .. . Answer : You cannot simply create a CBMutableCharacteristic - you must discover the CBCharacteristic or retrieve it from the peripheral s characteristics property . If you refer to the documentation you will see .. . .. . CBMutableCharacteristic objects represent the characteristics of a local peripheral s service local peripheral devices are represented by CBPeripheralManager objects .. . .. . and .. . .. . CBCharacteristic objects in particular represent the characteristics of a remote peripheral s service remote peripheral devices are represented by CBPeripheral objects .. . .. . You state in a comment that you are unable to discover the services and characteristics of your device - in this case I suggest you examine your discovery code or add it to your question .", "Question : So basically I am keeping a pool of peripherals during a scan for devices . When I discover a peripheral I want to first check whether that peripheral is already in my pool . If it is already in the pool then I just want to update the handle I already have of that peripheral . If it is not already in the pool I want to add it to the pool . The problem is that CoreBluetooth no longer allows accessing UUID s for peripherals . Both of the methods that used to access device UUID s were deprecated in iOS 7.1 . So what is the correct way to test the equality of peripherals in CoreBluetooth .. . Answer : Yes it was deprecated for CBPeripheral class . But new identifier property was added to CBPeer superclass from which CBCentral and CBPeripheral inherit . So now you should use : .. . .. . You can check changes in AP here : https : developer.apple.com library ios releasenotes General iOS80APIDiffs frameworks CoreBluetooth.html", "Question : I m implementing Core Bluetooth background mode and have gotten to the willRestoreState method successfully . The system properly handles scanning and waking up my app on service advertisement and incoming data . However if the device is already connected when the app is terminated due to memory-management I cannot seem to reestablish functioning ownership of the peripheral . No delegate methods are called . Here is my willRestoreState method : .. . .. . The Apple docs https : developer.apple.com library ios documentation NetworkingInternetWeb Conceptual CoreBluetooth concepts CoreBluetoothBackgroundProcessingForIOSApps PerformingTasksWhileYourAppIsInTheBackground.html state that the app has to connect locally to the device but peripheral.state reads connected whether -connectPeripheral is called or not . Neither -centralManager : didConnectPeripheral nor -centralManager : didFailToConnectPeripheral : is called . Similarly peripheral readRSSI does not result in -peripheral : didReadRSSI delegate method being called . I can t seem to find full sample code for this functionality . If anyone has anything I can parse through to help troubleshoot I d appreciate that as well . Thank you SO .. . Answer : If the phone is already connected to the peripheral when the app is terminated it won t call the centralManager : didConnectPeripheral callback because it s already connected and Core Bluetooth has held that connection for you and has stored the details . It is up to you to restore the details of the connection in willRestoreState as you correctly have done . If it s already connected the only thing I m aware of that can wake it up is if the peripheral notifies or indicates or disconnects in which case if you ve restored your peripheral correctly by setting the delegate the callback you re looking for is .. . - void peripheral : CBPeripheral peripheral didUpdateValueForCharacteristic : CBCharacteristic error : NSError .. . or .. . - void centralManager : CBCentralManager didDisconnectPeripheral : CBPeripheral error : NSError .. . so I d suggest you check the peripheral.connected state and only call connectPeripheral if peripheral.connected CBPeripheralStateConnected or peripheral.connected CBPeripheralStateConnecting", "Question : null .. . Answer : I call method .. . .. . void connectPeripheral : CBPeripheral peripheral options : nullable NSDictionary NSString id options .. . .. . to connect my device my device is in range but my app still can t connect my device success when I turn off system BT and then turn on BT my app will connect my device success I don t know why If I do not turn off BT and then turn on May I call first call method .. . .. . then call .. . .. . void connectPeripheral : CBPeripheral peripheral options : nullable NSDictionary NSString id options .. . .. . is it will be make sense Comment : Better call : - connectPeripheral : options : - cancelPeripheralConnection : Comment : thanks I thinks so", "Question : I m developing an app which connects and disconnects several times to different bluetooth low energy peripherals . After a lot of research on the internet I didn t have found a way to store already discovered services and characteristics so that I can reconnect faster . At the moment I m discovering the required services and characteristics after each reconnection which costs me between 1.5 and 2 seconds . Does someone have experience or a solution to store cache a CBService or a CBCharacteristic or does someone know a way to reconnect faster Thanks for any help Comment : Are you asking how to cache something in your application Comment : That would be a solution to cache services and characteristics but I have already tried to make a copy of a services . But unfortunately CBPeripheral CBService and CBCharacteristic do not have adopted NSCopying . Is there another way to store them Comment : You can put the Pripheral in an array . This array you can save-as user defaults with the NSUserDefaults Class Comment : Thank you @Areal-17 for your input . I ve tried to save a CBPeripheral in the NSUserDefaults Class but unfortunately only property values can be stored . Here s the error output : NSUserDefaults setObject : forKey : : Attempt to insert non-property value peripheral CBConcretePeripheral : 0x1d56a660 UUID CFUUID 0x1d5dd300 A8BB2F03-A42D-CC4E-9206-B936AA2AB663 Name LightControl Device IsConnected NO of class NSArrayM . Note that dictionaries and arrays in property lists must also contain only property values . Comment : In the didDiscoverPeripheral : peripheral delegate method you add the discovered peripheral to an array . for example : id peripheralUUID id peripheral.UUID if self.discoveredPeripherals containsObject : peripheralUUID self.discoveredPeripherals addObject : peripheralUUID self.discoveredPeripherals is a NSMutableArray property . The next step is setting the userDefault with setObjectForKey : . Important is to cast the CBUUID object into id . .. . Answer : I ve tried caching peripheral service and characteristic objects in memory and manual caching does not work . Once you have disconnected from the peripheral the service and characteristic objects are no longer valid for use . In fact even the CBPeripheral can change out from under you CoreBluetooth has an internal behavior where the device UDID will-change every few minutes if the CBPeripheral is another iOS device . However if you are running developing for iOS 6 there is a way to speed things up . If you watch http : developer.apple.com videos wwdc 2012 the Advanced Bluetooth talk at WWDC 2012 you ll see a slide towards the end about caching services and characteristics . Essentially the OS can cache them all for you but only for paired devices . To pair you need to respond to a write request with an insufficient authentication error . For example for an iOS peripheral you would write something like : .. . .. . That will pop-up a pairing dialog on the iOS peripheral after which point you will be paired . Other than that you don t have to change your code just call discoverServices etc as normal and they will respond more quickly ie instantly . I have also tested this behavior on 10.8.3 and it does not appear to work . So I don t know of a way to speed things up on OS X other than staying connected to the peripheral . Comment : thank you for your answer . I ve already filled out a bug report and Apple told me that they are caching the services and characteristics . But I have tested that with my peripheral and I saw the same slow connection interval . Is this caching only available with 2 iOS Devices or also with an 3rd party peripheral Comment : It should work with a 3rd party peripheral if you establish an encrypted link with it . Have not tested this myself . Comment : has it to be an encrypted connection Because at the moment I connect to my peripheral without any encryption at all Comment : Right . Only encrypted connections get the caching behavior . Comment : I believe the pairing process establishes an encrypted link . When you try to connect iOS will pop-up an alert asking the user to pair or cancel . On the manager side you don t need to do anything for pairing . I don t know how it works on the peripheral side .", "Question : I wonder about the semantics of CBManager s retrieveConnectedPeripheralsWithServices . Everytime I m using this I get CBPeripheral instances back with state CBPeripheralStateDisconnected . It s not a problem to connect again but isn t this method supposed to return connected peripherals Comment : The list of connected peripherals can include those that are connected by other apps and that will need to be connected locally using the connectPeripheral : options : method before they can be used . . Do you have more than one CBCentralManager instance in your app Comment : No just one that said let me check whether there s no leak . It even happens right after successfully connecting to the device . .. . Answer : Unfortunately this is intended behaviour . It is a bit counterintuitive I have to admit but the peripheral state is always related to your app . That means if you have connected paired bonded the peripheral using another app or via the bluetooth system settings it will still show as disconnected within your app . If you have connected some peripherals within your app they will show as connected . Comment : I can understand that the status in general is per-app due to the sandbox concept . I wonder though shouldn t I get at least a connected-state for devices that I have connected to within my app or is it possible that the state is even isolated per CBCentralManager i.e . for every new CBCentralManager I always get disconnected no matter what Comment : Yes that can happen as well . Peripherals from one CBCentralManager cannot be used in another CBCentralManager . I suggest using just one CBCentralManager otherwise you might run into trouble . There is a good read on the Apple Developer Forum https : forums.developer.apple.com thread 20810 on this topic .", "Question : I m simultaneously advertising a BLE peripheral and a beacon combined in one NSDictionary and advertised by the same CBPeripheralManager . In the same app I m scanning for BLE peripherals and monitoring the beacon . It doesn t work - Simultaneously advertising the peripheral and the beacon seems to cause a strange conflict . In foreground the beacon will be detected region entry but the callbacks for the CBPeripheral don t fire . When device A backgrounds the app the peripheral callbacks get triggered on the app running on device B and service and characteristic query runs as expected . The behaviour suggests that the advert for the beacon blocks the advert for the peripheral when in foreground but the peripheral advert is effective when the app is in the background . The advertising code is as follows : .. . .. . Which produces this : .. . .. . If I remove either the peripheral or the beacon advertisement item from the dictionary before calling startAdvertising the app behaves normally . My CBCentralManager scan is called as follows : .. . .. . And my region monitoring is standard : .. . .. . I ve been trying to get this to work for longer than I care to admit.. . Have I misunderstood something simple Does Apple restrict some functionality in this area Comment : An iOS app can t act as a beacon in the background which is possibly why you are seeing the peripheral act correctly in the background . Why do you want to be a beacon and a peripheral A peripheral should be sufficient particularly if you are advertising and connecting in the background Comment : I would like to exploit the iOS beacon functionality that allows the app to get a callback even it s not running just installed when entering a region . In this case the region would be the proximity to a copy of the app running on another device in foreground . Comment : If you know the UUID of the service you are looking for which you will since it is your service then you can scan for those peripherals in the background . And more importantly your app can advertise that service in the background . Using a beacon the advertising app will need to be in the foreground with the phone unlocked . Comment : Sure - I have the central peripheral working in foreground and background . I just wanted to extend the functionally a bit so that I could take some action on a device that is not even running the app when it is in close proximity to a device which has it in the foreground . As mentioned the issues appears to be simultaneous advertising of beacon and peripheral in the foreground . Comment : But if you use Bluetooth state-restoration you can get notified of peripheral discovery when the app isn t running .. . Answer : Unfortunately it appears from your description that you cannot advertise an iBeacon and another peripheral service simultaneously iOS . This is not super surprising . Beacons advertise at 10 Hz and while most Bluetooth chips allow more frequent transmission they typically do not support interleaving at a chip level . This means that if iOS wanted to support broadcasting both advertisement types at the same time on all chips all iPhone and iPad models it would have to include special code to make the chip do so . It sounds like me it does not . To be clear I have no special information on the internal implementation of broadcasting multiple advertising types simultaneously on iOS . But I do know from experience that doing what you want requires jumping through special hoops at a low-level so it is very likely that iOS simply does not allow it .", "Question : I am not new to iOS coding but very new to BLE in iOS . I have successfully written code in my Main View Controller to access and write to a BLE device . So all the peripheral and manager stuff is tested . My app will get a list of BLE devices connect to them for the serial-number disconnect from them and then put them in a tableView . When the user selects one I need to go to a different view and reconnect . I want to write another class as a utility to connect to the peripheral which I am successfully passing to the utility and read and write to it in the utility . The peripheral.state is connected . Every time I try to write to the peripheral my code crashes . However the peripheral reports that the data was written . So to figure out what was wrong I started to just try and read the peripheral with the same results Crash . I m starting a new manager in the utility and centralManagerDidUpdateState is not getting called there . I also tried it without the manager thinking that if I knew of the peripheral it would just work . So how do I get centralManager to work in the new class Do you have to somehow stop the manager in the main class This is the line works in the main controller but not in my Utility . Thanks Comment : Update : I tried the Utility in a new View Controller and centralManager works just fine . So the issue is with the manager not starting in an NSObject class . Does that help Comment : What is the crash I am not sure you can transfer a CBPeripheral instance acquired from one CBCentralManager to another . Either use a single CBCentralManager instance throughout your app perhaps in a Bluetooth manager class or use retrievePeripheralWithIdentifier on your second CBcentralManager . Comment : The crash is the dreaded Red Bad Thread with no reference in Main.m . I did try the retrievePeripheralWithIdentifier but the delegate did not get called . I think the main issue is that when I pass a peripheral to a View Controller CBPeripheralManager works fine . It s when I try to pass it to a plain NSObject . Do you have a reference to your suggestion of using a single instance of the manager BTW thanks for responding Comment : There is no specific reason that a viewcontroller subclass would work while a nsobject subclass won t unless there are other issues for example the nsobject instance being released while it is still the active delegate while a view controller Simon screen so it doesn t get released . You can use a Bluetooth manager object which is either a singleton or held by your AppDelegate or even just stored on a property of each VC and set on the next VC in prepareForSegue . Even doing this with a single CBCentralManager would be better than having multiple . Comment : Thanks Paul . I was also thinking that the nsobject wouldn t matter other than it is a delegate of the VC that calls it . I agree with the efficiency of having a single manager it s just that I ve not done that yet . Do you have a reference I m going to search for that now . Thanks again .. . Answer : I am not sure passing a peripheral to other viewcontroller is a good idea unless you don t need further update on the peripheral . If you want a fresh peripheral in multiple view controller i recommend to use singleton design thus you can handle all delegates at once and reduce redundant codes . sample code I found . https : github.com kickingvegas YmsCoreBluetooth", "Question : null .. . Answer : My app functions as both a central and a peripheral . I have the one device searching for another broadcasting my service UUID . This works fine until I connect to the peripheral . Then a Bluetooth Pairing Request appears on both devices asking to confirm the 6-digit code and pair with the other device . I do not want this notification to appear and I do not want devices to start appearing in the Settings - Bluetooth . In CBCentralManager.connectPeripheral CBPeripheral options : nil I thought there might be an option that can be specified in the options dictionary to prevent the alert but there are only three https : developer.apple.com library prerelease ios documentation CoreBluetooth Reference CBCentralManager Class index.html apple ref doc constant group Peripheral Connection Options and none of them do what I want . Is it possible to read a peripheral s RSSI and characteristics without connecting Or is it possible to connect to the peripheral without displaying a pair notification to the user Thanks . UPDATE : .. . .. . I have used a TSI to get this resolved . He directed me to an Apple sample project called BTLE Transfer https : developer.apple.com library ios samplecode BTLE Transfer Introduction Intro.html . He says that the pairing should not happen and that it doesn t happen in the sample project . I built the project and ran it and it does present the same exact pair request that my app does . I don t know if anyone else cares or is also struggling with this but I will update my question with new information and I will answer it if I find a solution . UPDATE 2 : .. . .. . I believe this is a bug in iOS 8.4 . I have submitted a bug report to Apple outlining the details of the bug . Comment : I m having the exact same problem . It used to work fine a couple of months ago . However now you suddenly get a pairing popup and when you choose yes it all breaks . Choose no and you re good . And it s not just iOS OSX El Capitan suffers the same problem . Comment : Yes Finally someone else has encountered this . One difference though is with mine nothing breaks no matter which button you press . The bug doesn t happen when devices running iOS 8.4 are not involved . Interesting to know that it happens on OS X too .", "Question : This question already has an answer here : .. . .. . CoreBluetooth : What is the lifetime of unique UUIDs questions 17575949 corebluetooth-what-is-the-lifetime-of-unique-uuids 1 answer .. . .. . I ve been playing with Corebluetooth and I ve learnt that besides going through the tedious process of scanning for a peripheral every time I want to connect I can also store the peripheral s UUID and use it with retrievePeripheralsWithIdentifiers and connectPeripheral for further reconnections . Turns out that it only works for a certain amount of time apparently the peripheral has its UUID updated therefore the stored one can be considered expired . I haven t been able to find any consistent documentation on this so I m not sure how long it lasts for . Is there any way around this in order to allow later reconnections faster than scanning for peripherals all over again .. . Answer : It depends on the type of peripheral and the addressing scheme that it implements . An iOS device operating as a peripheral using Core Bluetooth will-change its address fairly frequently - in a matter of minutes . For other peripheral devices such as fitness monitors HID devices etc the address will never change unless the peripheral manufacturer has also decided to introduce address randomisation and it is safe to store the UUID string and attempt to scan and reconnection directly when the appropriate UUID is seen - note that you can t necessarily use the CBPeripheral but you can store the UUID object from it . You can also use background modes to automatically re-launch your app and connected to a peripheral . This scenario is described in the lock example of the Core Bluetooth programming guide https : developer.apple.com library ios documentation NetworkingInternetWeb Conceptual CoreBluetooth concepts CoreBluetoothBackgroundProcessingForIOSApps PerformingTasksWhileYourAppIsInTheBackground.html apple ref doc uid TP40013257-CH7-SW5 . An app can issue a connect to a peripheral and it won t timeout . In summary you can t really store UUIDs for iOS based peripherals but for other peripheral types you probably can . Comment : Thanks a lot I haven t seen the example you pointed to yet but I m assuming these fast reconnections are only supposed to be used when disconnections occur then Comment : Well I guess you need to scan the first time otherwise you won t know the UUID outside of a trivial example where you know your peripheral and can hard-code it s id Comment : So if scan once and connect when the app starts I should be able to hold this object in memory and use it connectPeripheral whenever I want until I shut the app assuming CBCentralManagerStatePoweredOn remains true Comment : Yes . And if you use state-restoration as per my link then you can do it across app executions Comment : Great I ll try it tomorrow and come back to give feedback . Thanks .", "Question : I m developing an app which connects and disconnects several times to different bluetooth low energy peripherals . After a lot of research on the internet I didn t have found a way to store already discovered services and characteristics so that I can reconnect faster . At the moment I m discovering the required services and characteristics after each reconnection which costs me between 1.5 and 2 seconds . Does someone have experience or a solution to store cache a CBService or a CBCharacteristic or does someone know a way to reconnect faster Thanks for any help Comment : Are you asking how to cache something in your application Comment : That would be a solution to cache services and characteristics but I have already tried to make a copy of a services . But unfortunately CBPeripheral CBService and CBCharacteristic do not have adopted NSCopying . Is there another way to store them Comment : You can put the Pripheral in an array . This array you can save-as user defaults with the NSUserDefaults Class Comment : Thank you @Areal-17 for your input . I ve tried to save a CBPeripheral in the NSUserDefaults Class but unfortunately only property values can be stored . Here s the error output : NSUserDefaults setObject : forKey : : Attempt to insert non-property value peripheral CBConcretePeripheral : 0x1d56a660 UUID CFUUID 0x1d5dd300 A8BB2F03-A42D-CC4E-9206-B936AA2AB663 Name LightControl Device IsConnected NO of class NSArrayM . Note that dictionaries and arrays in property lists must also contain only property values . Comment : In the didDiscoverPeripheral : peripheral delegate method you add the discovered peripheral to an array . for example : id peripheralUUID id peripheral.UUID if self.discoveredPeripherals containsObject : peripheralUUID self.discoveredPeripherals addObject : peripheralUUID self.discoveredPeripherals is a NSMutableArray property . The next step is setting the userDefault with setObjectForKey : . Important is to cast the CBUUID object into id . .. . Answer : iOS 7 adds additional caching iOS 7 : What s New in Bluetooth LE http : www.doubleencore.com 2013 09 whats-new-in-bluetooth-le-ios-7 . I m seeing times less than 100ms 80ms average total to reconnect to a peripheral discover services discover characteristics and read the value of a single characteristic . My test configuration was an iPad Air connecting to an iPad 3 . Comment : Darrinm can you specify exactly where the caching explanation is in the article I could be daft I just can t seem to find it . Comment : @Max There isn t much of an explanation only The peripheral data-caching .. . is enhanced with even more data from each characteristic and service including the last-known value of each characteristic . So I timed the whole connect discover services discover characteristics read value process to see how much of an improvement the new caching made .", "Question : null .. . Answer : I m developing an app for OS X 10.10 and iOS 8 to exchange some messages with a BLE peripheral . I want my app to find and connect to the peripheral to send the message to it and lastly to disconnect so that the peripheral is free to be accessed from some other device . Everything works fine except for the following particular but still important situation : I scan for BLE devices and I find my device but still I don t connect to it because I have no messages to send . Then I walk away out of range or simply I turn the peripheral off . I still have saved in a var my CBPeripheral and I try to connect to it . Nothing happens while I would like the method centralManager : didFailToConnectPeripheral : error : to be called so that I can start to scan again . centralManager : didConnectPeripheral working properly . The documentation tells that bluetooth connection requests don t time out so I was wondering what other kinds of problems could lead to a connection failure", "Question : I am trying to use Bluetooth I have something like this : .. . .. . My service function : .. . .. . my Service is found and I got in console : .. . .. . Why my services for my peripheral is still empty after discovering but got no error Any ideas thanks Comment : Have you saved your peripheral in a property perhaps in didDiscover which isn t shown here Comment : I record all peripheral found into an array of CBPeripheral like this : Peripherals.append peripheral . But i am not using them yet . .. . Answer : Well I restarted my iPhone and all work very good now.. . Thanks guys", "Question : I have written some CoreBluetooth code I can discover the devices but I seem to be unable to discover the characteristics for peripherals that I discover . Does anyone have a good sample code that I can use to verify my code This is what I wrote : Comment : You need to discover services and then discover characteristics.. . Comment : would you be able to share some sample code Comment : github.com paulw11 BTBackground https : github.com paulw11 BTBackground .. . Answer : Have a look here : Sample Code https : developer.apple.com library ios samplecode TemperatureSensor Introduction Intro.html .. . .. . Basically the process is : .. . .. . 1 . Scan for devices .. . 2 . Discover device .. . 3 . Connect to device .. . 4 . Ask device for services .. . 5 . Ask services for characteristics .. . 6 . Write to read from or get notified by characteristics .. . .. . Subsequently you don t have to search for and discover devices as previously discovered devices can be retrieved from cache and connected to directly . Edit : -------------------- .. . .. . Read example : aPeripheral readValueForCharacteristic : aChar .. . .. . Notify example : aPeripheral setNotifyValue : YES forCharacteristic : aChar .. . .. . Both of these calls will result in the - void peripheral : CBPeripheral aPeripheral didUpdateValueForCharacteristic : CBCharacteristic characteristic error : NSError error - function to get called when the BLE device returns a value . When using notify this callback get called automatically every time the device updates its value for that characteristic . Comment : Hello thank you very much . How do I get notified by characteristics I managed to do all until step 5 the sample code from @Paulw11 comment worked better for me than the official apple one : github.com paulw11 BTBackground https : github.com paulw11 BTBackground", "Question : For BLE 4.0 it provides API to discover peripherals with array of service UUID . I just want to find the specific one . How to achieve this If need assign the identifier to the specific device how to do it I think my question need some context of core-bluetooth of iOS . Comment : did you find out the answer I have the same situation . If you could share what you found that would be nice . Comment : Your question is a bit vague : do you want to discover a new peripheral or reconnect to a previously connected peripheral or to discover a specific service on a discovered peripheral It seems like Paulw11 has the best answer for your question . .. . Answer : Tell me if I m wrong . You have 2 devices working as central role who wants to connect to one BLE peripheral . What it is important is the UUID of the services in the BLE peripheral . From your devices in central role you should search peripherals with a wanted UUID Service . Thats all . To develop with iOS please follow Core Bluetooth Programming Guide https : developer.apple.com library ios documentation NetworkingInternetWeb Conceptual CoreBluetooth concepts PerformingCommonCentralRoleTasks PerformingCommonCentralRoleTasks.html . You have a good tutorial there . As an example of the Apple documentation : .. . .. . In this line of code you can add an Array of UUID objects CBUUID instead of nil for scanForPeripheralsWithServices :" ] }
[ "yes-answer-long", "yes-answer-short" ]
cbcentralmanager
UNK_RELATION
ledbat@algorithm@105
ledbat -- low extra delay background transport ledbat is an experimental delay-based congestion control @placeholder that seeks to utilize the available bandwidth on an end-to-end path while limiting the consequent increase in queueing delay on that path .
{ "confidence": [], "content": [] }
{ "confidence": [], "content": [] }
[ "yes-answer-long", "yes-answer-short" ]
algorithm
UNK_RELATION
vaadin-valo-theme@vaadin@58
vaadin-valo-theme -- vaadin-valo-theme is a new theme in @placeholder 7.3 java web-framework .
{ "confidence": [ 108.58056640625, 108.37340545654297, 102.18816375732422, 93.49561309814453, 92.7781982421875, 90.63066864013672, 88.03612518310547, 87.93464660644531, 87.30545806884766, 87.27760314941406, 85.52339172363281, 84.27251434326172, 83.8553695678711, 83.25022888183594, 82.44914245605469, 80.67082977294922, 80.67082977294922, 80.58454895019531, 80.30750274658203, 79.04813385009766, 78.15991973876953, 76.05943298339844, 76.04303741455078, 75.69114685058594, 73.82902526855469, 73.71165466308594, 73.53641510009766, 72.86581420898438, 72.86581420898438, 72.86581420898438, 72.86581420898438, 72.10179138183594, 68.23196411132812, 67.62137603759766, 64.22036743164062, 64.22036743164062, 64.22036743164062, 64.22036743164062, 64.22036743164062, 64.00566864013672, 62.530853271484375, 61.935035705566406, 61.59136962890625, 61.59136962890625, 61.59136962890625, 61.551483154296875, 59.815433502197266, 59.60174560546875, 58.929168701171875, 58.929168701171875, 57.9189453125, 57.89043426513672, 56.810340881347656, 55.870628356933594, 55.56128692626953, 54.09244155883789, 53.208656311035156, 53.208656311035156, 53.002830505371094, 52.97730255126953, 52.840087890625, 52.840087890625, 52.840087890625, 52.592620849609375, 51.789306640625, 51.414764404296875, 51.25856018066406, 51.12022399902344, 50.35004425048828, 49.29248046875, 47.82776641845703, 47.82776641845703, 47.19686508178711, 46.23331069946289, 45.81981658935547, 45.81981658935547, 45.621158599853516, 45.140907287597656, 45.140907287597656, 45.140907287597656, 45.140907287597656, 44.01673126220703, 44.01673126220703, 43.740699768066406, 43.59518051147461, 42.30708312988281, 42.30708312988281, 42.21813201904297, 42.21813201904297, 42.21813201904297, 39.58912658691406, 39.58912658691406, 38.698944091796875, 38.43342971801758, 37.008399963378906, 30.85708999633789, 29.745447158813477, 29.745447158813477, 29.745447158813477, 29.745447158813477 ], "content": [ "I m creating a new Vaadin theme based on the native Valo theme .", "I m working on a Vaadin theme based on Valo .", "The new Valo theme https : vaadin.com valo is now the default in Vaadin 7.3 apps .", "In new Vaadin 7.3 apps created with the Vaadin Plugin for NetBeans http : plugins.netbeans.org plugin 50531 vaadin-plug-in-for-netbeans the default theme is the new Valo theme https : vaadin.com book - page themes.valo.html .", "I m trying to make sense of the internals of the Vaadin Valo theme .", "I am trying to replicate the Vaadin Valo theme demo http : demo.vaadin.com valo-theme layout - menu on the left content on the right .", "Preferred way is to edit Valo theme Sass http : sass-lang.com variables its easy and detailed info can be found in this Vaadin wiki article https : vaadin.com wiki - wiki Main Valo+theme+-+Getting+started .", "Basically you make your custom theme which inherits from vaadin Valo theme and override only variables you are interested in .", "for the act of actually changing : github.com vaadin valo-demo blob master src main java com https : github.com vaadin valo-demo blob master src main java com vaadin tests themes valo ValoThemeUI.java L390 and for the theme itself : github.com vaadin valo-demo tree master src main webapp VAADIN https : github.com vaadin valo-demo tree master src main webapp VAADIN themes tests-valo-metro", "Is there a built-in way to make Vaadin apply approprate Valo theme that is the most similar to an operating-system used by the client e.g .", "I m playing w this Valo theme http : demo.vaadin.com valo-theme common sample .", "I find the Vaadin s Valo theme so beautiful that I would like to use it without Vaadin .", ".. . Change your theme import and include from Reindeer to Valo : .. . .. . .. . @import . . valo valo .. . .my-theme .. . @include valo .. . .. . .. . .. . To modify the theme outlook define any of the global Sass variables before the import statement : .. . .. . .. . v-background-color : 777 .. . @import . . valo valo .. . .. . .. . .. . Specific variables that might interest you are from Book of Vaadin https : vaadin.com book vaadin7 - page themes.valo.html themes.valo.variables : .. . .. . v-focus-color .. . The color of the focus outline border for focusable elements in the application .", "@kukis the valo theme demo nowadays even provides an example for this github.com vaadin valo-demo blob https : github.com vaadin valo-demo blob 69a1bcc1d709f9abdd759a419944f4c1ac6a6fb9 src main webapp VAADIN themes tests-valo-reindeer variables.scss", "To create your own variation of the Valo theme start by creating a new custom theme for your project .", "I would like to create something like Vaadin Demo http : demo.vaadin.com valo-theme buttons-and-links : .. . .. .", "We use the Vaadin valo-theme and component icons like the arrow of the combobox or the icon of the datefield are missing .", "In my Vaadin app I m using my theme based on Vaadin Base theme .", "How can I use Valo font Open Sans if I don t use Valo theme", "I already have the theme as described see the question : the theme I m working on is based on Valo .", "The deprecation notice displays on page github.com vaadin valo-demo https : github.com vaadin valo-demo .", "GIT links for that exact Vaadin Demo implementation : .. . .. . ValoThemeUI.java https : github.com vaadin valo-demo blob master src main java com vaadin tests themes valo ValoThemeUI.java - layouting valo-menu on page .. . .. . ValoMenuLayout.java https : github.com vaadin valo-demo blob master src main java com vaadin tests themes valo ValoMenuLayout.java - layouting components inside valo-menu", "The easiest way is to modify styles via CSS in your theme that imports the Valo theme .", "But longer term the Vaadin team is betting big on Valo .", "After the upgrade to Vaadin 7.3 Valo done by someone else the page content won t scroll anymore .", "In the short term I will continue to override the default to use Reindeer as described on this StackOverflow.com Question Change from Valo theme to Reindeer in new Vaadin 7.3 app http : stackoverflow.com q 26519650 642706 .", "Digging on the Valo Demo Source code find that setting a number of values you can change the Scheme or theme for Valo you can check how they manage there style for Metro on : https : github.com vaadin valo-demo blob master src main webapp VAADIN themes tests-valo-metro variables.scss if needed thet also have the other themes : https : github.com vaadin valo-demo tree master src main webapp VAADIN themes .. . .. . This are the variables that they use to change the scheme to Metro : .. . .. . Just import or include this on your theme file .", "Has any one experimented with altering Valo to be sized similar to the Reindeer theme", "The name of my custom theme which imports Valo is simply touchkit .", "I m trying to change Valo theme from Default to Metro .", "Yea thanks they use a set of variables just to change the look of the Valo theme .", "Inspecting styles of the Valo theme demo with Firefox I identified the following CSS for the responsive enlargement of the icon : .. . .. . More information on responsiveness can be found in Vaadin docs https : vaadin.com docs - part framework themes themes-responsive.html .", "In the demo page http : demo.vaadin.com valo-theme you can select from different themes for Valo see top-right corner .", "enter image description here http : i.stack.imgur.com U0IoQ.png .. . .. . I m using the new Valo Theme .", "It s a more comprehensive example of styling components and implements the same logic as the Valo Theme Demo .", "For that exact design you do not need no CSS coding all the styles are provided with compiled Valo theme .", "I m looking simply for the easiest and safest way to get the Valo widgets size to parallel the visual size of their counterparts in Reindeer theme .", "See this wiki tutorial https : vaadin.com wiki - wiki Main Valo+theme+-+Getting+started .", "Thanks but I m trying to change it using just the Valo theme on the SCSS as it have different schemes .", "For example : .. . If the client uses : .. . .. . Windows apply Valo Default .. . Linux apply Valo Dark .. . OSX apply Valo Light .. . Android Valo Facebook .. . .. . Appologies if this is not a place for such question and thank you for any reply in advance .", "Assuming the license of Vaadin s Valo theme is the same as the main project e.g Apache 2.0 the answer is yes as along as you comply with the license terms that are rather simple .", "If you need help to create your own theme Vaadin doc https : vaadin.com docs - part framework themes themes-overview.html is a good starting point .", "As for the vote to close because question is too broad - Perhaps the downvoter is not familiar with Vaadin theming in general and Valo specifically .", "I m having a problem using Vaadin in Eclipse and its associated styling engine Valo and the TouchKit package .", "Also other Vaadin projects on my localhost server have their stylesheets loaded correctly though they do not use Valo .", "i d start with github.com vaadin valo-demo blob master src main webapp VAADIN https : github.com vaadin valo-demo blob master src main webapp VAADIN themes tests-valo-facebook variables.scss change the colors to something greyish and adjust font font-size and you are not that far off from reindeer .", "Valo adds a border around focused elements by default .", "However I m new at Superuser and couldn t create tags for Vaadin or Valo so I m asking here where there might be a better chance of getting an answer .", "The Valo theme is built to be customized with various parameters for changing colors fonts roundedness of corners puffiness or flatness animations opacity borders and more .", "We tryed to replace all our theme recources with those from the valo demo from the git reposatory and it still doesn t work .", "Regarding the theme : Of course you can add the styles to your existing theme .", "Like Zigac mentioned Vaadin has some styles already written for some components such as our menu here but you d wanna apply more eventually.. . .. . .. . check out the new Dashboard demo http : dashboard.demo.vaadin.com with the Valo theme and responsiveness", "At the moment no additional styles are in use only the native Valo .", "https : github.com vaadin vaadin blob 731fec8cc81c4ff6ca53d404b68a2c1538fd3885 LICENSE", "Look at this question http : stackoverflow.com questions 16141247 change-themes-in-vaadin-7-via-code in Stackoverflow or directly in the Vaadin Wiki https : vaadin.com wiki - wiki Main Changing+theme+on+the+fly", "But I find I always need a bit of CSS tweaking in my Vaadin apps so I must use a custom theme .", "Valo is hip-looking and very important technology for the future .", "On the downside Valo is huge in its default sizing .", "Until I learn how to downsize the Valo widgets I need to switch my app back to the professional-looking business-app-oriented Reindeer theme http : demo.vaadin.com ReindeerTheme .", "In that file : .. . .. . Comment out the line @import . . valo valo.scss and replace with @import . . reindeer reindeer.scss .. . Comment out the line @include valo and replace with @include reindeer .. . .. . So in an automatically configured Vaadin 7 app the mytheme.scss file changes from this : .. . .. . to this : .. . .. . Save CSS .. . .. . Save the changes to the mytheme.scss file .", "What s the easiest preferred way to disable this behaviour in my theme", "See the Creating a theme using Sass tutorial to get that done .", "In result styles.ccs @font-face rule has to be outside own theme .", "You could just change the UI annotation @theme mytheme which is created as default to @theme reindeer if you don t have any customisations to the theme .", "I ve used the source code https : github.com vaadin valo-demo tree master src main java com vaadin tests themes valo for this demo as a starting point pruning out except the UI class ValoThemeUI ValoMenuLayout and the Tables layout and everything looks as expected however my version doesn t dynamically resize hide the right hand side menu when I resize my browser window like the official demo does .", "Compiling the theme in Eclipse yields no errors .", "Or try another web browser to verify your Reindeer theme settings .", "Does the Vaadin license allows this scenario", "Your new theme should be in effect except for the caveat described next .", "If the Valo look persists use a search-engine to learn how to clear your particular web browser s cache .", "Also this answer s approach would be a handy way to debug a potential custom theme declare Reindeer with the annotation to instantly abandon the custom theme and verify the issue .", "This theme renders visually with widgets buttons fields and so on that are dramatically larger wider and taller than in the previous default Reindeer http : demo.vaadin.com ReindeerTheme theme .", "here is what i did just as example : .v-ui.valo-menu-responsive width-range 801px-1100px .valo-menu-part .valo-menu-item class caption display : block background : red This snippet just made a background of menu title red .", "I m need to change the theme for some Liferay portlets we are building on Eclipse .", "That is I want to grab only the theme files .scss and use them in an app written in Emberjs .", "One more problem is that i support w some project theme and can t create another one", "How can I create a VerticalMenu or Sidebar in Vaadin", "So when your run your project do not despair if you still see the Valo look .", "add below to your gwt.xml and touchkit is not valo aware see https : vaadin.com forum thread 8264224 8264223", "I wold like to have Valo based on Metro styles but cant find any function or variable to change it .", "Ok so I ve answered my own question by trawling through the valo source code .", "You can view the source code here https : github.com vaadin dashboard-demo tree master src main java com vaadin demo dashboard .. . .. . Basically what it does is create a menu https : github.com vaadin dashboard-demo blob master src main java com vaadin demo dashboard view DashboardMenu.java as a CustomComponent and a content area as a CssLayout .", "Whenever a component is clicked in the menu it will call the corresponding view in the content area of the MainView https : github.com vaadin dashboard-demo blob master src main java com vaadin demo dashboard view MainView.java .. . .. . For example one of the views is the DashboardView https : github.com vaadin dashboard-demo blob master src main java com vaadin demo dashboard view dashboard DashboardView.java which is the first view the user sees .", "Edit CSS .. . .. . In the NetBeans Projects panel navigate to Web Pages VAADIN themes mytheme mytheme.scss .", "Eventually it boils down to this logic : .. . .. . background-color v-selection-color v-focus-color valo-focus-color .. . .. . And this is the body of the valo-focus-color function : .. . .. . And here is the default-value for v-app-background-color : .. . .. . Which means that the final color is calculated in the else part of the above code .", "But for business-oriented desktop-style apps the Valo size is too large taking up too much scarce screen real estate .", "I did open Ticket 14 909 http : dev.vaadin.com ticket 14909 to suggest providing a switch to make Valo automatically downsize to Reindeer scheme .", "How to change my code and project settings to use Reindeer theme throughout my app", "After editing this file I recompile the theme and see the appropriate changes in the generated file styles.css .", "Just find the solution by setting different variable values in a way they give the Theme a different style .", "Your Vaadin project is already configured to rebuild the Sass into CSS as part of a clean-and-build .", "I wanted to tweak some of the CSS so I edited the appropriate file WebContent VAADIN themes touchkit touchkit.scss .", "You should take a look to my post : stackoverflow.com questions 31028870 http : stackoverflow.com questions 31028870 how-can-i-make-a-verticallayout-scrollable-using-vaadin", "You can view the styling techniques in Sass for the different views here https : github.com vaadin dashboard-demo tree master src main webapp VAADIN themes dashboard views .. . .. . Here are some code sinppets : .. . .. . MainView.java .. . .. . DashboardMenu.java .. . .. . DashboardView.java .. . .. . and here is the styleName dashboard-view in the style sheet .. . .. . dashboardview.scss", "Before attempting my own I m asking if anyone has already started building a set of customization code to approximate the size and perhaps look of the previous Reindeer theme .", "EDIT according to the comment : New line of caption is done by the display style .", "So you can override only variable for font colors and sizes and leave everything else unchanged etc .", "Computed by default .", "Can be any CSS color value .", ".. . v-focus-style .. . The style of the focus outline for focusable elements in the application ." ] }
{ "confidence": [ 131.38946533203125, 128.81201171875, 127.87528228759766, 126.59632873535156, 126.46327209472656, 126.01933288574219, 125.92506408691406, 122.40585327148438, 120.89098358154297, 120.25846862792969, 119.42941284179688, 115.73698425292969, 113.8385009765625, 110.5782241821289, 103.27911376953125, 100.97525024414062, 97.8745346069336, 95.32318878173828, 84.54261779785156, 83.03042602539062 ], "content": [ "Question : null .. . Answer : The new Valo theme https : vaadin.com valo is now the default in Vaadin 7.3 apps . This theme renders visually with widgets buttons fields and so on that are dramatically larger wider and taller than in the previous default Reindeer http : demo.vaadin.com ReindeerTheme theme . This kind of look is now hip with all the kids using Android and iOS 7 8 . But for business-oriented desktop-style apps the Valo size is too large taking up too much scarce screen real estate . Valo s claim to fame is that it is built to be adjustable and easy to morph just a few lines of Java and or CSS code . Has any one experimented with altering Valo to be sized similar to the Reindeer theme Any source code or instructions to share To be clear my goal is simply reduce the visual height width and their font-size . I m not asking about alerting the design I would be grateful just to get back some pixel space . I m looking simply for the easiest and safest way to get the Valo widgets size to parallel the visual size of their counterparts in Reindeer theme . In the short term I will continue to override the default to use Reindeer as described on this StackOverflow.com Question Change from Valo theme to Reindeer in new Vaadin 7.3 app http : stackoverflow.com q 26519650 642706 . But longer term the Vaadin team is betting big on Valo . Eventually Reindeer will fall out of favor so I would like to learn how to transition . I did open Ticket 14 909 http : dev.vaadin.com ticket 14909 to suggest providing a switch to make Valo automatically downsize to Reindeer scheme . Some people have misread this post : we are not talking about storage size on disk . We are talking about pixels here not bits . Visual size not file size . Graphical layout not widgetset optimization . This Question was inexplicably closed as too broad . Yet it continues to receive up-votes . I ask you up-voters to vote to re-open . Comment : As for the vote to close because question is too broad - Perhaps the downvoter is not familiar with Vaadin theming in general and Valo specifically . The Valo theme is built to be customized with various parameters for changing colors fonts roundedness of corners puffiness or flatness animations opacity borders and more . See this wiki tutorial https : vaadin.com wiki - wiki Main Valo+theme+-+Getting+started . Before attempting my own I m asking if anyone has already started building a set of customization code to approximate the size and perhaps look of the previous Reindeer theme . Comment : v-font-size is your starting point and next v-unit-size . They both should bring you far . You could also remove all the rants in your question and make clear if you are concerned about the visual size or the filesystem size of the generated code and i bet this question could be reopened . Comment : i d start with github.com vaadin valo-demo blob master src main webapp VAADIN https : github.com vaadin valo-demo blob master src main webapp VAADIN themes tests-valo-facebook variables.scss change the colors to something greyish and adjust font font-size and you are not that far off from reindeer . after all one has to go with the tides of time.. . Comment : I upvoted it and reported it too moderators . There is an fairly easy solution which I just implemented in our app posted here in @cfrick comment . Why someone would want to close this question Comment : @kukis the valo theme demo nowadays even provides an example for this github.com vaadin valo-demo blob https : github.com vaadin valo-demo blob 69a1bcc1d709f9abdd759a419944f4c1ac6a6fb9 src main webapp VAADIN themes tests-valo-reindeer variables.scss", "Question : I m trying to change Valo theme from Default to Metro . In the demo page http : demo.vaadin.com valo-theme you can select from different themes for Valo see top-right corner . I wold like to have Valo based on Metro styles but cant find any function or variable to change it . I m need to change the theme for some Liferay portlets we are building on Eclipse . Comment : why not have a look at the source how they do it for the act of actually changing : github.com vaadin valo-demo blob master src main java com https : github.com vaadin valo-demo blob master src main java com vaadin tests themes valo ValoThemeUI.java L390 and for the theme itself : github.com vaadin valo-demo tree master src main webapp VAADIN https : github.com vaadin valo-demo tree master src main webapp VAADIN themes tests-valo-metro Comment : Yea thanks they use a set of variables just to change the look of the Valo theme . I test it today and worked fine . Will post an answers just in case . .. . Answer : Digging on the Valo Demo Source code find that setting a number of values you can change the Scheme or theme for Valo you can check how they manage there style for Metro on : https : github.com vaadin valo-demo blob master src main webapp VAADIN themes tests-valo-metro variables.scss if needed thet also have the other themes : https : github.com vaadin valo-demo tree master src main webapp VAADIN themes .. . .. . This are the variables that they use to change the scheme to Metro : .. . .. . Just import or include this on your theme file .", "Question : I m trying to change Valo theme from Default to Metro . In the demo page http : demo.vaadin.com valo-theme you can select from different themes for Valo see top-right corner . I wold like to have Valo based on Metro styles but cant find any function or variable to change it . I m need to change the theme for some Liferay portlets we are building on Eclipse . Comment : why not have a look at the source how they do it for the act of actually changing : github.com vaadin valo-demo blob master src main java com https : github.com vaadin valo-demo blob master src main java com vaadin tests themes valo ValoThemeUI.java L390 and for the theme itself : github.com vaadin valo-demo tree master src main webapp VAADIN https : github.com vaadin valo-demo tree master src main webapp VAADIN themes tests-valo-metro Comment : Yea thanks they use a set of variables just to change the look of the Valo theme . I test it today and worked fine . Will post an answers just in case . .. . Answer : Changing themes can be done from the java code . Look at this question http : stackoverflow.com questions 16141247 change-themes-in-vaadin-7-via-code in Stackoverflow or directly in the Vaadin Wiki https : vaadin.com wiki - wiki Main Changing+theme+on+the+fly Comment : Thanks but I m trying to change it using just the Valo theme on the SCSS as it have different schemes . Just find the solution by setting different variable values in a way they give the Theme a different style .", "Question : I m working on a Vaadin theme based on Valo . Valo adds a border around focused elements by default . What s the easiest preferred way to disable this behaviour in my theme .. . Answer : Preferred way is to edit Valo theme Sass http : sass-lang.com variables its easy and detailed info can be found in this Vaadin wiki article https : vaadin.com wiki - wiki Main Valo+theme+-+Getting+started . Basically you make your custom theme which inherits from vaadin Valo theme and override only variables you are interested in . So you can override only variable for font colors and sizes and leave everything else unchanged etc . To create your own variation of the Valo theme start by creating a new custom theme for your project . See the Creating a theme using Sass tutorial to get that done . .. . Change your theme import and include from Reindeer to Valo : .. . .. . .. . @import . . valo valo .. . .my-theme .. . @include valo .. . .. . .. . .. . To modify the theme outlook define any of the global Sass variables before the import statement : .. . .. . .. . v-background-color : 777 .. . @import . . valo valo .. . .. . .. . .. . Specific variables that might interest you are from Book of Vaadin https : vaadin.com book vaadin7 - page themes.valo.html themes.valo.variables : .. . .. . v-focus-color .. . The color of the focus outline border for focusable elements in the application . Computed by default . Can be any CSS color value . .. . v-focus-style .. . The style of the focus outline for focusable elements in the application . The syntax is the same as for CSS box-shadow e.g . v-focus-style : 0 0 0 2px orange You can also specify it to just a color value in which case only the border-color of the components is affected and no other outline is drawn . E.g . v-focus-style : orange .. . .. . Edit : the actual working code .. . .. . Adding .. . .. . before the import statement worked for me . Comment : I already have the theme as described see the question : the theme I m working on is based on Valo . I did know about v-focus-color but somehow I missed v-focus-style . I ll try using v-focus-style : none to see if that removes the border . Comment : @herman it won t . it must be a color or a list . so your best bet would be to set it to the same color the border already is . Comment : @cfrick it did work accepting . Comment : @herman it did not for me . care to add the actual working code to the answer then Comment : @cfrick I just did . Since you said it must be a color maybe you were using v-focus-color instead of v-focus-style", "Question : How can I create a VerticalMenu or Sidebar in Vaadin Is there any specific component or Have I do programatically and using CSS I would like to create something like Vaadin Demo http : demo.vaadin.com valo-theme buttons-and-links : .. . .. . enter image description here http : i.stack.imgur.com U0IoQ.png .. . .. . I m using the new Valo Theme . .. . Answer : For that exact design you do not need no CSS coding all the styles are provided with compiled Valo theme . You just have to use appropriate styles on your components and layouts . GIT links for that exact Vaadin Demo implementation : .. . .. . ValoThemeUI.java https : github.com vaadin valo-demo blob master src main java com vaadin tests themes valo ValoThemeUI.java - layouting valo-menu on page .. . .. . ValoMenuLayout.java https : github.com vaadin valo-demo blob master src main java com vaadin tests themes valo ValoMenuLayout.java - layouting components inside valo-menu", "Question : null .. . Answer : I m creating a new Vaadin theme based on the native Valo theme . After the upgrade to Vaadin 7.3 Valo done by someone else the page content won t scroll anymore . All of the other elements on the page where overflow property is applied work fine except the whole page itself . I know I could apply this .. . .. . which would be an ok solution . But it s not what would normally be seen after an upgrade . What could be causing such behavior At the moment no additional styles are in use only the native Valo . Comment : It works for me either in 7.4.8 or in the latest build 7.5.0 . Comment : You should take a look to my post : stackoverflow.com questions 31028870 http : stackoverflow.com questions 31028870 how-can-i-make-a-verticallayout-scrollable-using-vaadin", "Question : In new Vaadin 7.3 apps created with the Vaadin Plugin for NetBeans http : plugins.netbeans.org plugin 50531 vaadin-plug-in-for-netbeans the default theme is the new Valo theme https : vaadin.com book - page themes.valo.html . Valo is hip-looking and very important technology for the future . On the downside Valo is huge in its default sizing . Until I learn how to downsize the Valo widgets I need to switch my app back to the professional-looking business-app-oriented Reindeer theme http : demo.vaadin.com ReindeerTheme . How to change my code and project settings to use Reindeer theme throughout my app .. . Answer : You need to edit your project s CSS save and do a clean-and-build . Edit CSS .. . .. . In the NetBeans Projects panel navigate to Web Pages VAADIN themes mytheme mytheme.scss . In that file : .. . .. . Comment out the line @import . . valo valo.scss and replace with @import . . reindeer reindeer.scss .. . Comment out the line @include valo and replace with @include reindeer .. . .. . So in an automatically configured Vaadin 7 app the mytheme.scss file changes from this : .. . .. . to this : .. . .. . Save CSS .. . .. . Save the changes to the mytheme.scss file . NetBeans may offer to turn on a feature for compiling Sass files on Save . Decline the offer . Your Vaadin project is already configured to rebuild the Sass into CSS as part of a clean-and-build . Clean-And-Build .. . .. . Then click the Clean and Build button on NetBeans toolbar the hammer and broom icon . Be patient as this may take a few minutes . Watch the Output pane to see when the build has completed . That is all you need to change your project . Your new theme should be in effect except for the caveat described next . Browser Reload .. . .. . Some web browsers are overly aggressive in their caching looking at you Safari . So Valo s CSS and such may still be stuck in your web browser . So when your run your project do not despair if you still see the Valo look . Click the web browser s reload button to force the browser to dump its cache load fresh info from the server and restart your app with the other theme s look . In the old days some browsers Firefox required you to hold down the Shift key while clicking that reload button but that may no longer be necessary . If the Valo look persists use a search-engine to learn how to clear your particular web browser s cache . Or try another web browser to verify your Reindeer theme settings .", "Question : I find the Vaadin s Valo theme so beautiful that I would like to use it without Vaadin . That is I want to grab only the theme files .scss and use them in an app written in Emberjs . Does the Vaadin license allows this scenario .. . Answer : Assuming the license of Vaadin s Valo theme is the same as the main project e.g Apache 2.0 the answer is yes as along as you comply with the license terms that are rather simple . https : github.com vaadin vaadin blob 731fec8cc81c4ff6ca53d404b68a2c1538fd3885 LICENSE", "Question : In new Vaadin 7.3 apps created with the Vaadin Plugin for NetBeans http : plugins.netbeans.org plugin 50531 vaadin-plug-in-for-netbeans the default theme is the new Valo theme https : vaadin.com book - page themes.valo.html . Valo is hip-looking and very important technology for the future . On the downside Valo is huge in its default sizing . Until I learn how to downsize the Valo widgets I need to switch my app back to the professional-looking business-app-oriented Reindeer theme http : demo.vaadin.com ReindeerTheme . How to change my code and project settings to use Reindeer theme throughout my app .. . Answer : You could just change the UI annotation @theme mytheme which is created as default to @theme reindeer if you don t have any customisations to the theme . This works since the JAR has the SCSS file for reindeer also included the same one you can import in mytheme.scss if you indeed would have some custom styling . Comment : Good answer . But I find I always need a bit of CSS tweaking in my Vaadin apps so I must use a custom theme . Comment : Also this answer s approach would be a handy way to debug a potential custom theme declare Reindeer with the annotation to instantly abandon the custom theme and verify the issue . Comment : Tip : That string reindeer must be lowercase as correctly shown in the Answer . The string Reindeer fails because of the uppercase R .", "Question : In my Vaadin app I m using my theme based on Vaadin Base theme . How can I use Valo font Open Sans if I don t use Valo theme My styles.scss .. . .. . But it don t work . Hope it s clear enough can you point me in the right direction Comment : Have you looked with the inspector what css rules are finally present .. . Answer : I found solution . In result styles.ccs @font-face rule has to be outside own theme . So my styles.scss :", "Question : How can I create a VerticalMenu or Sidebar in Vaadin Is there any specific component or Have I do programatically and using CSS I would like to create something like Vaadin Demo http : demo.vaadin.com valo-theme buttons-and-links : .. . .. . enter image description here http : i.stack.imgur.com U0IoQ.png .. . .. . I m using the new Valo Theme . .. . Answer : well to be able to create a responsive behaviour for your application you d have to use CSS . Like Zigac mentioned Vaadin has some styles already written for some components such as our menu here but you d wanna apply more eventually.. . .. . .. . check out the new Dashboard demo http : dashboard.demo.vaadin.com with the Valo theme and responsiveness It s a more comprehensive example of styling components and implements the same logic as the Valo Theme Demo . You can view the source code here https : github.com vaadin dashboard-demo tree master src main java com vaadin demo dashboard .. . .. . Basically what it does is create a menu https : github.com vaadin dashboard-demo blob master src main java com vaadin demo dashboard view DashboardMenu.java as a CustomComponent and a content area as a CssLayout . Whenever a component is clicked in the menu it will call the corresponding view in the content area of the MainView https : github.com vaadin dashboard-demo blob master src main java com vaadin demo dashboard view MainView.java .. . .. . For example one of the views is the DashboardView https : github.com vaadin dashboard-demo blob master src main java com vaadin demo dashboard view dashboard DashboardView.java which is the first view the user sees . It s a responsive VerticalLayout with responsive compnents on it . You can view the styling techniques in Sass for the different views here https : github.com vaadin dashboard-demo tree master src main webapp VAADIN themes dashboard views .. . .. . Here are some code sinppets : .. . .. . MainView.java .. . .. . DashboardMenu.java .. . .. . DashboardView.java .. . .. . and here is the styleName dashboard-view in the style sheet .. . .. . dashboardview.scss", "Question : null .. . Answer : Is there a built-in way to make Vaadin apply approprate Valo theme that is the most similar to an operating-system used by the client e.g . based on user-agent header entry or using JavaScript Request.Browser.Platform For example : .. . If the client uses : .. . .. . Windows apply Valo Default .. . Linux apply Valo Dark .. . OSX apply Valo Light .. . Android Valo Facebook .. . .. . Appologies if this is not a place for such question and thank you for any reply in advance .", "Question : I m playing w this Valo theme http : demo.vaadin.com valo-theme common sample . In it when browser screen is widely open i see the menu items as small icon following w some text in a singel line . Ok . When i make the browser screen more narrow the menu item look is changing . Now i see larger icon w the line of text below it . How can i see such look from the origin it seems such behavior is related to so called responsive-design . it is a really cool thing but in this particular case i would like to handle it more precisely . Thanks in advance . .. . Answer : The easiest way is to modify styles via CSS in your theme that imports the Valo theme . The menu item icons are font icons so you can just increase the font-size via CSS . Inspecting styles of the Valo theme demo with Firefox I identified the following CSS for the responsive enlargement of the icon : .. . .. . More information on responsiveness can be found in Vaadin docs https : vaadin.com docs - part framework themes themes-responsive.html . EDIT according to the comment : New line of caption is done by the display style . Comment : Hi Steffen Thanks a lot for your answer but it seems this is not the point your update only increased the font-size but didn t make the label to position itself under the icon i understand that i have to override the CSS somehow to get the look i need . Now i have to find out how to do it. . Comment : I updated the answer . If you need help to create your own theme Vaadin doc https : vaadin.com docs - part framework themes themes-overview.html is a good starting point . Comment : Unfortunately this didn t help . here is what i did just as example : .v-ui.valo-menu-responsive width-range 801px-1100px .valo-menu-part .valo-menu-item class caption display : block background : red This snippet just made a background of menu title red . When browser is open wide - default menu behavior is the same . One more problem is that i support w some project theme and can t create another one Comment : The width-range 801px-1100px means that the style is applied when the browser view port width is in that range . Remove that CSS selector to get the desired effect . You should really read the documentation to get a basic understanding . Regarding the theme : Of course you can add the styles to your existing theme . Comment : Hi Steffen it seems i could resolve this issue Below i added description how.. . Thanks for assist", "Question : I am trying to replicate the Vaadin Valo theme demo http : demo.vaadin.com valo-theme layout - menu on the left content on the right . I ve used the source code https : github.com vaadin valo-demo tree master src main java com vaadin tests themes valo for this demo as a starting point pruning out except the UI class ValoThemeUI ValoMenuLayout and the Tables layout and everything looks as expected however my version doesn t dynamically resize hide the right hand side menu when I resize my browser window like the official demo does . I figure I m missing something but looking at the demo source code I can t see what . There has to be some scss code somewhere that defines the menu width resize behaviour - but I can t find it . One thing I did have to add do differently was add the following code to ValoThemeUI as otherwise the app doesn t run . The demo must be doing this and maybe other key things elsewhere but I can t figure out where . .. . Answer : Ok so I ve answered my own question by trawling through the valo source code . The source code for the demo as linked doesn t do the menu hiding resizing shown in the live demo also linked but getting it to work is fairly simple once you know how . You just need to add .. . .. . after .. . .. . in the init method of ValoThemeUI . Comment : Yeah the source link is the deprecated repo . I wondered why it even exists yet . The deprecation notice displays on page github.com vaadin valo-demo https : github.com vaadin valo-demo .", "Question : I m having a problem using Vaadin in Eclipse and its associated styling engine Valo and the TouchKit package . I mention all of these because I m not sure which if any is causing the problem . The name of my custom theme which imports Valo is simply touchkit . I have the project running on a Tomcat server on localhost and accessible in my browser . I wanted to tweak some of the CSS so I edited the appropriate file WebContent VAADIN themes touchkit touchkit.scss . After editing this file I recompile the theme and see the appropriate changes in the generated file styles.css . Then I go to load up the application in my browser and things get weird . I can load the page and using Chrome s developer tools see that the page requests styles.css for download as expected . It gets a 200 OK response from the server but when I view styles.css it contains just a single n . This is also true in Safari . Even using cURL to download styles.css yields the same result . In the Eclipse editor and when I inspect it in the terminal styles.css is 12 000 lines long . Why can t my browser or cURL get that data I can view similar project demos on Vaadin s own site and the stylesheet which should be almost identical to mine is loaded correctly . Also other Vaadin projects on my localhost server have their stylesheets loaded correctly though they do not use Valo . Compiling the theme in Eclipse yields no errors . Because the issue presents itself across a variety of graphical and non-graphical clients I m starting to think the issue is with Tomcat . But I can get to the directory from which Tomcat serves files and styles.css is correct in that folder too . There s no apparent reason that Tomcat would be serving a blank file . You may have guessed from the description but I m working on a Mac . Any help is appreciated PS Mods - I also asked this question over at Superuser since it wasn t 100 a programming question . However I m new at Superuser and couldn t create tags for Vaadin or Valo so I m asking here where there might be a better chance of getting an answer . Comment : your logging is sane and you don t eat up somewhere an exception is your app running in production mode a flag for the servlet does chrome curl -i show odd things in the headers .. . Answer : add below to your gwt.xml and touchkit is not valo aware see https : vaadin.com forum thread 8264224 8264223", "Question : I m having a problem using Vaadin in Eclipse and its associated styling engine Valo and the TouchKit package . I mention all of these because I m not sure which if any is causing the problem . The name of my custom theme which imports Valo is simply touchkit . I have the project running on a Tomcat server on localhost and accessible in my browser . I wanted to tweak some of the CSS so I edited the appropriate file WebContent VAADIN themes touchkit touchkit.scss . After editing this file I recompile the theme and see the appropriate changes in the generated file styles.css . Then I go to load up the application in my browser and things get weird . I can load the page and using Chrome s developer tools see that the page requests styles.css for download as expected . It gets a 200 OK response from the server but when I view styles.css it contains just a single n . This is also true in Safari . Even using cURL to download styles.css yields the same result . In the Eclipse editor and when I inspect it in the terminal styles.css is 12 000 lines long . Why can t my browser or cURL get that data I can view similar project demos on Vaadin s own site and the stylesheet which should be almost identical to mine is loaded correctly . Also other Vaadin projects on my localhost server have their stylesheets loaded correctly though they do not use Valo . Compiling the theme in Eclipse yields no errors . Because the issue presents itself across a variety of graphical and non-graphical clients I m starting to think the issue is with Tomcat . But I can get to the directory from which Tomcat serves files and styles.css is correct in that folder too . There s no apparent reason that Tomcat would be serving a blank file . You may have guessed from the description but I m working on a Mac . Any help is appreciated PS Mods - I also asked this question over at Superuser since it wasn t 100 a programming question . However I m new at Superuser and couldn t create tags for Vaadin or Valo so I m asking here where there might be a better chance of getting an answer . Comment : your logging is sane and you don t eat up somewhere an exception is your app running in production mode a flag for the servlet does chrome curl -i show odd things in the headers .. . Answer : Hard to say since your are doing everything fine . My best bet would be the tomcat implementation you are using maybe there s something weird there . Try upgrading to latest if it s not or to a previous version . FYI I m using Tomcat 7.0.55 . PS : your attempts are in run debug from eclipse or have you made a .war form the project and deployed it with the Tomcat-Manager Regards", "Question : null .. . Answer : I m trying to make sense of the internals of the Vaadin Valo theme . I m studying the button widget as an example . More precisely I m trying to understand how the background-color for the v-button-primary style is calculated . Eventually it boils down to this logic : .. . .. . background-color v-selection-color v-focus-color valo-focus-color .. . .. . And this is the body of the valo-focus-color function : .. . .. . And here is the default-value for v-app-background-color : .. . .. . Which means that the final color is calculated in the else part of the above code . I tried to reproduce this logic in SASSMeister like this.. . .. . .. . .. . which outputs this result : .. . .. . How come it gives me this reddish not blueish color I m definitely looking in the wrong place .", "Question : We use the Vaadin valo-theme and component icons like the arrow of the combobox or the icon of the datefield are missing . We tried to put font-awesome manually but the icons are still missing . We can t explain why . Can somebody help My log output is full with stuff like this : .. . .. . I m not sure if its related to our problem . Instead of the icons there are just this signs Instead of the icons there are just this signs http : i.stack.imgur.com uK57J.png Comment : Does the server log shows some files not found 404 errors What does the webbrowser has for image URL s when you reference them Comment : I edited my post . Comment : The OpenSans-Light font has nothing to do with the icons . But the error suggest that you have a general problem with the css and resources . Did you deploy it correctly including all required elements Comment : We tryed to replace all our theme recources with those from the valo demo from the git reposatory and it still doesn t work . Do you know an other example we could try .. . Answer : We changed the Java version of the project form 1.7 to 1.6 . That solved the problem .", "Question : I m playing w this Valo theme http : demo.vaadin.com valo-theme common sample . In it when browser screen is widely open i see the menu items as small icon following w some text in a singel line . Ok . When i make the browser screen more narrow the menu item look is changing . Now i see larger icon w the line of text below it . How can i see such look from the origin it seems such behavior is related to so called responsive-design . it is a really cool thing but in this particular case i would like to handle it more precisely . Thanks in advance . .. . Answer : It seems i could find out how to implement what i need . Actually this was a play w css-selectors . In my case i had to make the following :", "Question : We use the Vaadin valo-theme and component icons like the arrow of the combobox or the icon of the datefield are missing . We tried to put font-awesome manually but the icons are still missing . We can t explain why . Can somebody help My log output is full with stuff like this : .. . .. . I m not sure if its related to our problem . Instead of the icons there are just this signs Instead of the icons there are just this signs http : i.stack.imgur.com uK57J.png Comment : Does the server log shows some files not found 404 errors What does the webbrowser has for image URL s when you reference them Comment : I edited my post . Comment : The OpenSans-Light font has nothing to do with the icons . But the error suggest that you have a general problem with the css and resources . Did you deploy it correctly including all required elements Comment : We tryed to replace all our theme recources with those from the valo demo from the git reposatory and it still doesn t work . Do you know an other example we could try .. . Answer : I just had exactly the same problem . We are using Wildfly 8.2 to deploy the application . The problem occured by enabling GZip compression for the server following this blog post : How to enable GZIP compression in Wildfly 8.2 http : dimaki.blogspot.de 2014 12 how-to-enable-gzip-compression-in.html . Disabling it made everything work again . Currently I am still investigating why this is a problem ." ] }
[ "yes-answer-long", "yes-answer-short" ]
vaadin
UNK_RELATION
procmon@real-time@86
procmon -- process monitor is a free advanced monitoring tool for windows that shows @placeholder file system registry and process thread activity .
{ "confidence": [ 47.1524772644043, 40.982418060302734, 39.71862030029297, 37.898414611816406, 36.72500991821289, 35.89918518066406, 34.17817306518555, 33.58070373535156, 31.975170135498047, 31.896251678466797, 31.832345962524414, 31.468486785888672, 31.433473587036133, 31.18416976928711, 30.319171905517578, 30.12529754638672, 30.12529754638672, 29.80545425415039, 29.477920532226562, 29.372621536254883, 28.798145294189453, 27.588409423828125, 27.548871994018555, 27.40262222290039, 27.101531982421875, 26.971084594726562, 26.971084594726562, 26.971084594726562, 25.980037689208984, 25.919517517089844, 25.882551193237305, 25.806983947753906, 25.706031799316406, 25.276723861694336, 25.168636322021484, 24.94103240966797, 24.44851303100586, 24.119428634643555, 23.798446655273438, 23.661285400390625, 23.661285400390625, 23.455699920654297, 23.43912124633789, 22.878475189208984, 22.658193588256836, 22.582782745361328, 22.450698852539062, 22.4468936920166, 22.339305877685547, 21.72542953491211, 21.63089370727539, 21.46832847595215, 20.88500213623047, 20.622085571289062, 20.532346725463867, 20.420305252075195, 20.420305252075195, 20.075454711914062, 19.964759826660156, 19.936161041259766, 19.778671264648438, 19.676105499267578, 19.46002197265625, 19.191679000854492, 19.064706802368164, 18.80438232421875, 18.710430145263672, 18.18917465209961, 18.111352920532227, 17.960575103759766, 17.960575103759766, 17.960575103759766, 17.906253814697266, 17.88275909423828, 17.804370880126953, 17.72748565673828, 17.267383575439453, 17.161500930786133, 17.14801025390625, 17.116931915283203, 16.915546417236328, 16.761747360229492, 16.73204803466797, 16.73204803466797, 16.73204803466797, 16.73204803466797, 16.57939338684082, 16.53559684753418, 16.53559684753418, 16.53559684753418, 16.53559684753418, 16.53559684753418, 16.445201873779297, 16.355390548706055, 16.271400451660156, 16.18228530883789, 16.167320251464844, 16.057952880859375, 16.057952880859375, 15.97956371307373 ], "content": [ "We use Process Monitor ProcMon to monitor the w3wc.exe process on a Windows Server 2008 running IIS7 .", "I am using Procmon to monitor activities on a system for some specific processes .", "I was told this function is only callable in kernel-mode drivers and SysInternals Process Monitor uses a kernel-mode driver to monitor detailed Registry activity .", "How does the Process Monitor from Sysinternals monitor file IO activity like it does", "Is there a way to achieve this through Process Monitor tool", "I m using the latest version of Procmon to monitor some application .", "I want to use RegistryCallback to monitor registry changes on windows machine .", "It is my understanding that Procmon now uses a minifilter driver for File IO monitoring and ETW for networking monitoring .", "Perhaps your answer is with this SO post http : stackoverflow.com questions 864839 monitoring-certain-system-calls-done-by-a-process", "ProcMon shows event LoadImage on foo.pyd with result SUCCESS .", "If that s the case try monitoring all FileSys activity of the process if it s not to much and add filters based on the results .", "When I try to kill this process the system says it s done successfully but the process stays in memory and .exe file is locked .", "I m using FileStream to write to a file and watching the underlying system calls using Process Monitor http : live.sysinternals.com procmon.exe .", "i m using Sysinternals Procmon to monitor the system s processes .", "However I am no clear on how it monitors registry access and process image thread events", "I m sure process monitor used to show the impersonated account in previous versions", "Hmm Process Monitor used to show impersonated accounts yes .", "I ve launch Process monitor from sysinternals then .", "After running the above command the procmon UI shows filtered events but the saved file - output.csv contains all the events .", "I am using Process Monitor tool to see when and which files are read .", "The process starts then its first thread .", "The worker process account only has read access required so that ASP.NET can monitor for file changes to trigger recompiles of the site in the shadow-copy folders .", "There are bunch of callbacks for monitoring support in kernel since xp : .. . .. . registry - http : msdn.microsoft.com en-us library windows hardware ff545879 v vs.85 .aspx .. . .. . process image thread notify - PsSetCreateProcessNotifyRoutineEx PsSetLoadImageNotifyRoutine PsSetCreateThreadNotifyRoutine - http : msdn.microsoft.com en-us library windows hardware ff559917 v vs.85 .aspx .. . .. . object manager callbacks for handles monitoring - http : msdn.microsoft.com en-us library windows hardware ff558692 v vs.85 .aspx .. . .. . on xp was some limitation but since vista they fully functional .", "http : localhost id 123 ImageVaultHandler.aspx will return an image as expected but when you analyze the request in ProcMon the w3wc.exe process looks to have unsuccessfully searched for a physical file with the same path in my web directory .", "After walking through most of the code in the Sulley environment I found that the restart target method in the sessions.py module calls for a restart on the virtual-machine if vmcontrol is available first and then tries to restart the process via the procmon if its available .", "When I run Process Monitor I never see the impersonated anonymous account accessing files .", "It is my understanding that a kernel-mode driver is used required to do what Process Monitor does .", "Process Monitor needs no install so I d be surprised if it actually installs a filter driver or something .", "Only restarting the machine helps to kill the process and unlock the file .", "The only filter I m using in ProcMon is to monitor access where the path contains d : websites mysite www which is the root of my site .", "I want to determine when process in the system wasn t open by the user but by another process .", "No need to patch any internal tables for any monitoring activity .", "Ok here is the answer : .. . .. . The windows diagnostics depends procmon etc were showing the DLL or pyd loading fine .", "I tried to use ProcMon http : en.wikipedia.org wiki Process Monitor for analizing but I could see very few events and the process stops before loading its image Load Image operation does not happen .", "I am using procmon command-line .", "I tried reinstalling procmon and launching with administrator privilege but at double click or run by command-line it pop-up nothing and no log or error message are provided .", "can it be determine using Procmon", "And some time after gvimportable.exe exits I can see in Procmon that 7zFM.exe does a SetDispositionInformationFile Details : Delete : True that deletes the temporary file and when gvim tries to open it the file has been deleted .", "I ve used Google and the Sysinternals procmon to find a registry key that seems relevant : when I set English to Left Alt+Shift+1 Windows writes the following : .. . .. . I interpret this as follows : .. . .. . 00000100 is for English 00000101 would be Slovak 00000102 Spanish .. . the Virtual Key or 31 corresponds to 1 indeed 0x31 is 1 in ASCII .. . the Key Modifiers correspond to Left Alt+Shift .. . .. . Unfortunately this only works one way : modifying the system settings writes to the registry but updating the registry does not update the system settings .", "I am trying to analyze a basic read operation using ifstream with Procmon .", "Did an import foo on foo.pyd in the python command window with ProcMon watching .", "But when I download procMon I didn t see any driver installed all I did is download the .exe and launch it .", "to know if a process of Internet Explorer was opened by a user or by another process", "Either the account you are impersonating or NETWORK SERVICE doing the requests.. . Make sure you also ask in the very active Sysinternals Forums : forum.sysinternals.com http : forum.sysinternals.com forum topics.asp FID 19 title process-monitor", "When I ask a program to open another process it looks a lot like when that process decides to open another process on its own .", "Following is calls to : .. . QueryNameInformationFile of my exe file SUCCESS .. . Load Image of my exe file SUCCESS .. . Load Image of ntdll.dll SUCCESS .. . QueryNameInformationFile if my exe file SUCCESS .. . CreateFile Try to create it un C : WINDOWS Prefetch blahbla.pf NAME NOT FOUND .. . then the thread and the process exits .", "Is there a way to get stat C runtime functions caught in ProcMon", "If this is running on a virtual-machine and a test case causes the process and target machine to become unresponsive vmcontrol would then revert to an earlier snapshot .", "Machines run Windows XP .NET version is 4.0.30319.1008 .. . .. . As I can see in Task Manager http : en.wikipedia.org wiki Windows Task Manager the process is started but it uses only 40 KB of memory sometimes more for example 404 KB but ordinary running process needs much more .", "So if ProcMon has access to your executable symbols and you know which file to watch you might see stat in the call stack of that file s access .", "We have noticed that requests to perfectly legal urls still results in a PATH NOT FOUND entry in ProcMon .", "Since i upgraded to windows-10 i can t run It .", "The process the dump file was collected against must have been running on .NET 4.5 or higher .", "I only ever see the worker process account accessing files in the web folders .", "I want a detailed filtering in the pml file generated .", "ProcMon intercepts calls at the Window levels specifically NTxxxx and ZWxxxx calls I think .", "I understand older Procmon and its predecessors filemon regmon etc used virtual drivers to hook the kernel .", "I would rather like to see a single file read event instead .", "You might want to look at the linux proc file system : there you will find mostly all information about the system and running processes .", "@Strawberry Do you mean to say that this tool is not common enough to qualify", "I wasn t aware that the virus scanner could inject itself in my process .", "Would like to know myself but so far I ve looked at this book : amazon.com Windows-System-Internals-Classic-Reprints dp http : www.amazon.com Windows-System-Internals-Classic-Reprints dp 0976717514 ref sr 1 1 ie UTF8 qid 1297344046 sr 8-1 that may shed some light", "For example when a file is read once several times in chunks of 65535 bytes it generates 1 event for each chunk read .", "The error message is not more explicit indicating that the failure is down in the Windows dll loading system where python cannot tell where the load failure occurred .", "Sometimes users ask one process to start another process sometimes they do so only indirectly and sometimes processes are started without any basis in user actions .", "It works perfectly when editing a file that is not inside an archive or compressed file but it miserably fails when editing a file inside an archive or compressed file .", "And Dependency Walker also shows it linked to Python26.dll", "Even if you increase the size of the internal buffer that ifstream uses internaly that is still no guarantee that the file system will honor a larger read size .", "Mostly all tool output might will-change over time .", "One possibility is that you have a virus scanner installed that injects itself into each running process", "Any process with sufficient permissions can inject code into another process s address space and execute it .", "Particularly i m interested to know if process of an web browser Internet Explorer wasn t opened by the user .", "I compared the procmon of both and saw that before I get the Thread Exit Operation it tries to Load Image - and the succuss machine - just keep starting.. . .. . .. . Do you have an idea how to work it from here", "Although I usually notice it with Windows Picture Viewer meaning that I don t see the image .", "try telling it where to find the rc file i.e .", "This sample code : .. . .. . Causes the following systems calls : .. . .. . The first three IO calls are expected create write close but the the process goes on to read the file a dozen more times and repeatedly open and close it .", "Thanks @Mark shouldn t I see any errors in procmon on those use cases", "An introduction somewhat old but a good introduction you can find under http : www.linuxjournal.com article 8381 .. . .. . Additional note : the proc file system is somewhat documented and stable .", "Edit : I add procmon details about the error : .. . .. . 18 : 13 : 40 4305346 xxx.exe 3172 CreateFile C : WINDOWS Prefetch XXX.EXE-1FA9609A.pf NAME NOT FOUND Desired Access : Generic Read Disposition : Open Options : Synchronous IO Non-Alert Attributes : n a ShareMode : None AllocationSize : n a", "Part of the code used for read operation where i was trying to read data of 16kb size from a file : .. . .. . In Procmon there were 4 ReadFile operation with the following details : .. . .. . Offset : 0 Length : 4 096 Priority : Normal .. . Offset : 4 096 Length : 4 096 .. . Offset : 8 192 Length : 4 096 .. . Offset : 12 288 Length : 4 096 .. . .. . So does it mean that there were 4 operations of each 4kb size", "I m running ASP.NET 2.0 on Windows 2003 32-bit standard edition .", "Is there a way to load .pmf file instead of entire .pmc file", "What happens is that 7-zip portable stores the file to a temporary place launches gvimportable.exe which forks and opens gvim.exe .", "When gvim started as you say by default it forks and exits so 7z thinks that the edit has finished and deletes the file .", "Put your .vimrc file at base App vim gvimrc not in base Data setting .", "7zip will delete temp file after it thinks the external app terminated I think the gVimPortable gives 7zip wrong indication on this .", "If you enable the advanced information you can see that calls that were previously shown as CreateFile are now shown as IRP MJ CREATE which suggests that it hooks some rather low-level stuff .", "But the pml logs generated are very lenghty .", "Is such detailed filtering possible in procmon s pml files", "Else the events generated are very huge in number .", "I am able to get network activities for firefox when I am capturing only network activities no other filters .", "I am not getting any network activities for firefox when all event classes are being traced .", "I want to analyze when files are read directly from the disk vs the system file IO cache .", "So use gVimPortable you need luck to see the content as it must fast enough to open the file before 7zip delete it sometime works sometimes not .", "The output shows that the .pyd loaded properly and it s dependencies which without the .pyd would not be needed by the program were also picked up and loaded properly .", "So my thought was that crashed native image of the assembly is cached somewhere so replacing the .exe initiates the system to rebuild it .", "Also since I was using existing log file there is no need to use Drop Filtered Events while saving the configuration file .", "I found that the windows tools were referring to a different Python26.dll hiding in my C : Window SysWOW64 folder .", "So when loading via windows diagnostics the SysWOW64 dll was found and the .pyd loaded properly .", "I m trying to debug a file permission problem ." ] }
{ "confidence": [ 62.71281433105469, 59.64131546020508, 53.98505783081055, 46.39701843261719, 42.69606399536133, 42.575164794921875, 41.06640625, 39.90141296386719, 39.29129409790039, 39.15483093261719, 37.764530181884766, 35.79152297973633, 34.14720916748047, 33.64643859863281, 31.31527328491211, 31.189096450805664, 30.74508285522461, 29.95111656188965, 29.356243133544922, 26.9915771484375 ], "content": [ "Question : I understand older Procmon and its predecessors filemon regmon etc used virtual drivers to hook the kernel . However Patchguard prevents SSDT hooking etc on 64-bit Vista+ . It is my understanding that Procmon now uses a minifilter driver for File IO monitoring and ETW for networking monitoring . However I am no clear on how it monitors registry access and process image thread events Does it also use ETW for these .. . Answer : There are bunch of callbacks for monitoring support in kernel since xp : .. . .. . registry - http : msdn.microsoft.com en-us library windows hardware ff545879 v vs.85 .aspx .. . .. . process image thread notify - PsSetCreateProcessNotifyRoutineEx PsSetLoadImageNotifyRoutine PsSetCreateThreadNotifyRoutine - http : msdn.microsoft.com en-us library windows hardware ff559917 v vs.85 .aspx .. . .. . object manager callbacks for handles monitoring - http : msdn.microsoft.com en-us library windows hardware ff558692 v vs.85 .aspx .. . .. . on xp was some limitation but since vista they fully functional . No need to patch any internal tables for any monitoring activity .", "Question : null .. . Answer : I want to use RegistryCallback to monitor registry changes on windows machine . I was told this function is only callable in kernel-mode drivers and SysInternals Process Monitor uses a kernel-mode driver to monitor detailed Registry activity . But when I download procMon I didn t see any driver installed all I did is download the .exe and launch it . Would anyone tell me how did the driver installed and what s it s name", "Question : How does the Process Monitor from Sysinternals monitor file IO activity like it does If you enable the advanced information you can see that calls that were previously shown as CreateFile are now shown as IRP MJ CREATE which suggests that it hooks some rather low-level stuff . Does anyone know exactly what it hooks how it works Comment : It is my understanding that a kernel-mode driver is used required to do what Process Monitor does . Comment : Where could I learn how to write one Comment : Process Monitor needs no install so I d be surprised if it actually installs a filter driver or something . As to your question where you can learn this . Would like to know myself but so far I ve looked at this book : amazon.com Windows-System-Internals-Classic-Reprints dp http : www.amazon.com Windows-System-Internals-Classic-Reprints dp 0976717514 ref sr 1 1 ie UTF8 qid 1297344046 sr 8-1 that may shed some light .. . Answer : Perhaps your answer is with this SO post http : stackoverflow.com questions 864839 monitoring-certain-system-calls-done-by-a-process", "Question : We use Process Monitor ProcMon to monitor the w3wc.exe process on a Windows Server 2008 running IIS7 . We have noticed that requests to perfectly legal urls still results in a PATH NOT FOUND entry in ProcMon . For example we have configured a handler in web.config like : .. . .. . Requests to this handler eg . http : localhost id 123 ImageVaultHandler.aspx will return an image as expected but when you analyze the request in ProcMon the w3wc.exe process looks to have unsuccessfully searched for a physical file with the same path in my web directory . Is this behaviour by design Or have we missed something the application-pool used is configured to run in Integrated Mode . .. . Answer : This sounds reasonable to me - what IIS is probably doing is checking to see whether or not the file-exists in order to determine what handler to use when processing that request : .. . .. . Screenshot of the request restrictions dialog http : i.stack.imgur.com TzYKs.png .. . .. . It looks like the logic in IIS doesn t bother to check first whether there is an applicable handler that can be used even when the file doesn t exist . Comment : Thanks Justin Do you mind explaining a bit further where you found the dialog above and if the settings could alter the behaviour . Comment : Did you ever figure this out @EmilLundin", "Question : null .. . Answer : I m using the latest version of Procmon to monitor some application . Since i upgraded to windows-10 i can t run It . I tried reinstalling procmon and launching with administrator privilege but at double click or run by command-line it pop-up nothing and no log or error message are provided .", "Question : null .. . Answer : I m trying to debug a file permission problem . I m running ASP.NET 2.0 on Windows 2003 32-bit standard edition . ASP.NET 2.0 is configured to impersonate my web sites anonymous accounts . In my machine.config file in C : WINDOWS Microsoft.NET Framework v2.0.50727 CONFIG I have : .. . .. . I know that ASP.NET requests are being impersonated because I have a test page that does this : .. . .. . This page correctly displays the site s IIS anonymous identity MACHINENAME I testsite . Additionally the site is locked down using NTFS permissions so that only the anonymous account can create write files Modify permission which works fine using a simple test script I m debugging an issue for a customer with Cute-Editor where I think it s misconfigured . The worker process account only has read access required so that ASP.NET can monitor for file changes to trigger recompiles of the site in the shadow-copy folders . When I run Process Monitor I never see the impersonated anonymous account accessing files . I only ever see the worker process account accessing files in the web folders . The only filter I m using in ProcMon is to monitor access where the path contains d : websites mysite www which is the root of my site . Why is this I m sure process monitor used to show the impersonated account in previous versions Comment : Hmm Process Monitor used to show impersonated accounts yes . Either the account you are impersonating or NETWORK SERVICE doing the requests.. . Make sure you also ask in the very active Sysinternals Forums : forum.sysinternals.com http : forum.sysinternals.com forum topics.asp FID 19 title process-monitor Comment : @moontear - yep I asked in there as well....belt and braces and all that .", "Question : null .. . Answer : I am using Procmon to monitor activities on a system for some specific processes . But the pml logs generated are very lenghty . I want a detailed filtering in the pml file generated . For example when a file is read once several times in chunks of 65535 bytes it generates 1 event for each chunk read . I would rather like to see a single file read event instead . Is such detailed filtering possible in procmon s pml files Else the events generated are very huge in number .", "Question : null .. . Answer : I want to determine when process in the system wasn t open by the user but by another process . i m using Sysinternals Procmon to monitor the system s processes . Particularly i m interested to know if process of an web browser Internet Explorer wasn t opened by the user . i m tried to use the Parent PID but it is not enough to distinguish . can someone please give me a direction Comment : When I ask a program to open another process it looks a lot like when that process decides to open another process on its own . Comment : how can i measure that time in c to know if a process of Internet Explorer was opened by a user or by another process Comment : Processes can only be started by other processes . Sometimes users ask one process to start another process sometimes they do so only indirectly and sometimes processes are started without any basis in user actions . Comment : So according to you i want to know when processes are started without any basis in user actions . how that can be done can it be determine using Procmon", "Question : Is there a way to get stat C runtime functions caught in ProcMon .. . Answer : Not directly because as @Preet Sangha explained it works below the CRT level . However it does show you a call stack and stat does access a file . So if ProcMon has access to your executable symbols and you know which file to watch you might see stat in the call stack of that file s access . If that is not enough further describe your scenario . Note that there are tools for hooking at the code level - see How can I hook Windows functions in C C++ http : stackoverflow.com questions 873658 how-can-i-hook-windows-functions-in-c-c Comment : thank you I m using stat to test if directory is present . I presume I may filter directory name access Comment : @Chesnokov sure . On the filter window Path contains the dir name Comment : + 1 Nice answer Comment : it does not show the events if Path contains dir name Comment : @Chesnokov it works for me . Does the filter s list have a row that looks like Path contains dir name include Note that dir name can be just the last subdir and not the complete path . Also try to access that dir using say the browser which is what I just did . If you see nothing the filter s not set correctly . If you do see the access the code might not be accessing that dir after all . If that s the case try monitoring all FileSys activity of the process if it s not to much and add filters based on the results .", "Question : I compile my application on a windows XP SP3 machine . When it compiles I try to lauch it and windows replies me back with : .. . .. . Unable to start program xx . This application has failed to start because the application configuration is incorrect . Reviex the manifest file for possible errors . Reinstalling the application may fix this problem . For more details please see the application event log . Trying to copy DLL files didn t help see my previous question http : stackoverflow.com questions 1322758 unable-to-start-program-in-debug-mode-debug-dll-installation-issue if you want . I ve launch Process monitor from sysinternals then . I try here to summarise the report while it is not very long . The process starts then its first thread . Following is calls to : .. . QueryNameInformationFile of my exe file SUCCESS .. . Load Image of my exe file SUCCESS .. . Load Image of ntdll.dll SUCCESS .. . QueryNameInformationFile if my exe file SUCCESS .. . CreateFile Try to create it un C : WINDOWS Prefetch blahbla.pf NAME NOT FOUND .. . then the thread and the process exits . I ve add my users with full control on that folder C : WINDOWS prefetch but did not help . How to make it work I feel if I go through this step my application will work as expected . Edit : I add procmon details about the error : .. . .. . 18 : 13 : 40 4305346 xxx.exe 3172 CreateFile C : WINDOWS Prefetch XXX.EXE-1FA9609A.pf NAME NOT FOUND Desired Access : Generic Read Disposition : Open Options : Synchronous IO Non-Alert Attributes : n a ShareMode : None AllocationSize : n a .. . Answer : Is Task Scheduler running on the PC A way to repair Prefetch is detailed here if that is causing the problem : .. . .. . http : members.rushmore.com jsky id14.html Comment : Yep task schrduler is running . I don t think I need to repair my prefetch folder . I believe I need to tune my application s rights or something like that . But I ll look at your advise in last case . Thanks .", "Question : null .. . Answer : I am debugging an application which reads a lot of files . Its performance depends on whether it reads file contents from disk or the file IO cache . I want to analyze when files are read directly from the disk vs the system file IO cache . I am using Process Monitor tool to see when and which files are read . But I m not able to figure out from the logs if the files are read from disk or cache . Is there a way to achieve this through Process Monitor tool Or should I use some other tool to figure this out", "Question : null .. . Answer : The issue appears sometimes on several machines in our domain : The user starts my .NET 4.0 application but nothing happens . Machines run Windows XP .NET version is 4.0.30319.1008 .. . .. . As I can see in Task Manager http : en.wikipedia.org wiki Windows Task Manager the process is started but it uses only 40 KB of memory sometimes more for example 404 KB but ordinary running process needs much more . When I try to kill this process the system says it s done successfully but the process stays in memory and .exe file is locked . Only restarting the machine helps to kill the process and unlock the file . I tried to use ProcMon http : en.wikipedia.org wiki Process Monitor for analizing but I could see very few events and the process stops before loading its image Load Image operation does not happen . So the cause is not inside my application . As a workaround I tried some things : .. . .. . 1 . Rebuild the application and replace the .exe in its location - it helps But the difference between two EXE files is only the changed MVID GUID and some other compile information included in the .exe .. . .. . 2 . So my thought was that crashed native image of the assembly is cached somewhere so replacing the .exe initiates the system to rebuild it . I am not strong in this but I tried ngen update instruction - sometimes it helps sometimes not . After some time the problem repeats on some machines . How can I find what is causing the problem Comment : The problem continues . Once helped login as administrator . Once didn t . Comment : Nowtimes I suspect that Symantec Endpoint Protection s Insight feature causes the problem . Disabling Insight Download Insight and restarting machine hepls .", "Question : I am trying to load a .pyd with Python but I receive the well known Import Error : DLL load failed : the specified procedure can not be found . error . I have already done the following : .. . .. . 1 . Investigated the .pyd with Dependency Walker . GPSVC.DLL and IESHIMS.DLL came up as missing but delay loaded IEFRAME.DLL aslo came up as missing an export but was also delay-loaded . It s my understanding that these are not used and are delay load anyway so they should not be the problem . 2 . Did an import foo on foo.pyd in the python command window with ProcMon watching . ProcMon shows event LoadImage on foo.pyd with result SUCCESS . This seems to imply that the .pyd file loaded correctly . So what am I missing . My windows diagnostics are telling me all is well but python is telling me the thing cannot be loaded usually due to a missing dll or symbol . Ideas Thanks Comment : UPDATE : I built a small program to do a LoadLibrary on the .pyd in question . The output shows that the .pyd loaded properly and it s dependencies which without the .pyd would not be needed by the program were also picked up and loaded properly . .. . Answer : Ok here is the answer : .. . .. . The windows diagnostics depends procmon etc were showing the DLL or pyd loading fine . Python was showing that it was not loading fine . I found that the windows tools were referring to a different Python26.dll hiding in my C : Window SysWOW64 folder . This second Python26.dll found in SysWOW64 has a symbol that is missing in the primary python26.dll installed by the windows python installer found in C : Python26 . This symbol PyByteArray empty string was apparently needed by my .pyd file . So when loading via windows diagnostics the SysWOW64 dll was found and the .pyd loaded properly . When loading from python the dll in C : Python26 was found the symbol was missing and load failed . So that is WHY the problem manifested . The question now is : Why are there two versions of Python26.dll floating around one with PyByteArray empty string and one without I m using Python 2.6.6 . Perhaps this symbol is removed in 2.6.6 but present in some older 2.6.x release", "Question : I am trying to load a .pyd with Python but I receive the well known Import Error : DLL load failed : the specified procedure can not be found . error . I have already done the following : .. . .. . 1 . Investigated the .pyd with Dependency Walker . GPSVC.DLL and IESHIMS.DLL came up as missing but delay loaded IEFRAME.DLL aslo came up as missing an export but was also delay-loaded . It s my understanding that these are not used and are delay load anyway so they should not be the problem . 2 . Did an import foo on foo.pyd in the python command window with ProcMon watching . ProcMon shows event LoadImage on foo.pyd with result SUCCESS . This seems to imply that the .pyd file loaded correctly . So what am I missing . My windows diagnostics are telling me all is well but python is telling me the thing cannot be loaded usually due to a missing dll or symbol . Ideas Thanks Comment : UPDATE : I built a small program to do a LoadLibrary on the .pyd in question . The output shows that the .pyd loaded properly and it s dependencies which without the .pyd would not be needed by the program were also picked up and loaded properly . .. . Answer : If you have a file foo.pyd for import foo to succeed there must be an externally accessible function named initfoo . Dependency Walker will show this typically the ONLY function if it exists . initfoo needs to be called by Python to initialise the foo module . Note : I would expect a more explicit error message if this were the problem : .. . .. . You say that you are trying to load a .pyd file . Is that just a strange way of describing import foo or is it something else Did you create the pyd If not who did Have you asked them Is this pyd available on the web so that others could try to load import it Comment : Another possibility is that one of the missing delay-load DLLs actually is needed by the init function . Comment : Thank you for your input . The .pyd does define initfoo properly this is the ONLY function in the .pyd as you describe . The error message is not more explicit indicating that the failure is down in the Windows dll loading system where python cannot tell where the load failure occurred .", "Question : null .. . Answer : On my Windows 7 workstation I use three input languages English Slovak Spanish . I have also set up hot keys to switch between them : .. . .. . hot key settings http : i.stack.imgur.com l7hLW.png .. . .. . Unfortunately these three hot-key settings get unset every time there s a company-wide system patching involves reboot all change from Left Alt+Shift+ NUMBER to None . Question 1 : Why would this happen Could it be something like a group policy being applied Any hunch will help me in flagging this with our IT who own the patching . Question 2 : Can I set these keyboard-shortcuts programmatically to work around the problem I could then set a scheduled task which would run at system start-up i.e . after the patching to restore these shortcuts . I ve used Google and the Sysinternals procmon to find a registry key that seems relevant : when I set English to Left Alt+Shift+1 Windows writes the following : .. . .. . I interpret this as follows : .. . .. . 00000100 is for English 00000101 would be Slovak 00000102 Spanish .. . the Virtual Key or 31 corresponds to 1 indeed 0x31 is 1 in ASCII .. . the Key Modifiers correspond to Left Alt+Shift .. . .. . Unfortunately this only works one way : modifying the system settings writes to the registry but updating the registry does not update the system settings . Am I missing something", "Question : I am trying to load a .pyd with Python but I receive the well known Import Error : DLL load failed : the specified procedure can not be found . error . I have already done the following : .. . .. . 1 . Investigated the .pyd with Dependency Walker . GPSVC.DLL and IESHIMS.DLL came up as missing but delay loaded IEFRAME.DLL aslo came up as missing an export but was also delay-loaded . It s my understanding that these are not used and are delay load anyway so they should not be the problem . 2 . Did an import foo on foo.pyd in the python command window with ProcMon watching . ProcMon shows event LoadImage on foo.pyd with result SUCCESS . This seems to imply that the .pyd file loaded correctly . So what am I missing . My windows diagnostics are telling me all is well but python is telling me the thing cannot be loaded usually due to a missing dll or symbol . Ideas Thanks Comment : UPDATE : I built a small program to do a LoadLibrary on the .pyd in question . The output shows that the .pyd loaded properly and it s dependencies which without the .pyd would not be needed by the program were also picked up and loaded properly . .. . Answer : Is the .pyd file for the same version of Python you re using Loading a .pyd file for the wrong Python version can produce that error message . Dependency Walker can show you which pythonNN.dll it links to . Comment : It seems to be the same version . All documentation states it works with Python 2.6 which is what I am using . And Dependency Walker also shows it linked to Python26.dll Comment : Different versions of python26.dll . That was the issue .", "Question : From my understanding the process monitor stores crashbin information locally . If this is running on a virtual-machine and a test case causes the process and target machine to become unresponsive vmcontrol would then revert to an earlier snapshot . How is the crashbin information displayed to the web interface or accessed at this point if it was lost on the revert to an earlier snapshot Comment : I m voting to close this question as off-topic because it appears to be beyond the scope of SO Comment : Okay thanks anyways Comment : @Strawberry Why does it seem off-topic This seems to me to fall under the category of software tools commonly used by programmers . stackoverflow.com help on-topic http : stackoverflow.com help on-topic Comment : @JoshP I would suggest that a combined total of 88 questions and 20 followers rather proves my point - but mine is just one solitary vote Comment : @Strawberry Do you mean to say that this tool is not common enough to qualify .. . Answer : After walking through most of the code in the Sulley environment I found that the restart target method in the sessions.py module calls for a restart on the virtual-machine if vmcontrol is available first and then tries to restart the process via the procmon if its available . By switching the order of these I can solve the problem of losing the log information from the crashbin unless the entire target machine becomes unresponsive . Comment : Nice Please consider making a pull request to the Github site and also to my fork github.com jtpereyda sulley https : github.com jtpereyda sulley", "Question : I am using procmon command-line . After running the above command the procmon UI shows filtered events but the saved file - output.csv contains all the events . Is there an option to save the filtered output via cmd If not is there a way to copy the output to cmd Comment : Did you enable Drop filtered events in the saved config file Comment : @LievenKeersmaekers I figured out the solution . I have 1 more query . Is there a way to load .pmf file instead of entire .pmc file Comment : I honestly have no idea . From the two of us I m the one that s learning the most from this . .. . Answer : I figured it out . I was missing the SaveApplyFilter option . It s strange I did not find a quick reference on forums either . So adding .. . .. . achieved the desired result . Also since I was using existing log file there is no need to use Drop Filtered Events while saving the configuration file . In case you are capturing logs and want to save them with filters applied you could enable Drop Filtered Events to capture only the required events .", "Question : I m using FileStream to write to a file and watching the underlying system calls using Process Monitor http : live.sysinternals.com procmon.exe . I m having trouble with some file locking issues in a production deployment so I m looking at the details closely . This sample code : .. . .. . Causes the following systems calls : .. . .. . The first three IO calls are expected create write close but the the process goes on to read the file a dozen more times and repeatedly open and close it . I ve now observed this behavior on Win XP SP2 and Win 2003 x64 . However my Windows Vista machine at home behaves as expected just the first three lines . Any clues on why this is happening on non-Vista runtimes .. . Answer : One possibility is that you have a virus scanner installed that injects itself into each running process Comment : While I can t confirm this it makes perfect sense . I suspected that early on but eliminated it due to the access showing that it was coming from my EXE and not a virus scanner . I wasn t aware that the virus scanner could inject itself in my process . Comment : also note thats a POS virus scanner if it needs to read the file 11 times . Comment : How does the virus scanner s read originate from ConsoleApplication1.vshost.exe though Comment : Any process with sufficient permissions can inject code into another process s address space and execute it . Look up CreateRemoteThread in MSDN for a good example of one way this can be done . Comment : It performed 11 read operations on the file. . This doesn t say it read the file 11 times . It could be the first 11 bytes one after another", "Question : I am trying to analyze a basic read operation using ifstream with Procmon . Part of the code used for read operation where i was trying to read data of 16kb size from a file : .. . .. . In Procmon there were 4 ReadFile operation with the following details : .. . .. . Offset : 0 Length : 4 096 Priority : Normal .. . Offset : 4 096 Length : 4 096 .. . Offset : 8 192 Length : 4 096 .. . Offset : 12 288 Length : 4 096 .. . .. . So does it mean that there were 4 operations of each 4kb size and if so why did that happen instead of just having a single ReadFile operation of 16 kb size . .. . Answer : So does it mean that there were 4 operations of each 4kb size That is exactly what it is saying . and if so why did that happen instead of just having a single ReadFile operation of 16 kb size . Just because you asked for 16000 bytes does not mean ifstream can actually read 16000 bytes in a single operation . File systems do not usually allow for such large reads there is usually a cap . Even if you increase the size of the internal buffer that ifstream uses internaly that is still no guarantee that the file system will honor a larger read size . The contract of read is that it returns the requested number of bytes unless an EOF error is encountered . HOW it accomplishes that reading internally is an implementation detail . In this case ifstream had to read four 4KB blocks in order to return 16000 bytes . Comment : I don t think that at this level the filesystem implementation matters in any other way than suggesting the designers of the CRT to use 4096 as default block size . ReadFile per se is quite a high-level API you can ask to it any size and pass any kind of file handle and it will happily oblige blocking until it fetches all the requested data the filesystem drivers limitations are way below it ." ] }
[ "yes-answer-long", "yes-answer-short" ]
real-time
UNK_RELATION
acceptverbs@http@73
acceptverbs -- acceptverbs represents an attribute that specifies which @placeholder verbs an action method will respond to .
{ "confidence": [ 54.02778625488281, 49.40230941772461, 44.070945739746094, 41.713722229003906, 37.83578872680664, 37.6995964050293, 35.75453567504883, 35.62701416015625, 35.489173889160156, 35.025413513183594, 34.31513214111328, 34.036376953125, 26.809173583984375, 25.426069259643555, 24.848251342773438, 24.81404685974121, 24.44243621826172, 23.49214744567871, 23.49214744567871, 22.18026351928711, 21.665483474731445, 21.405105590820312, 21.316373825073242, 20.90211296081543, 20.056663513183594, 19.507930755615234, 18.6229190826416, 18.50507354736328, 18.404094696044922, 18.404094696044922, 17.76763153076172, 17.7241268157959, 17.714801788330078, 17.34027671813965, 16.638202667236328, 16.638202667236328, 16.619192123413086, 16.619192123413086, 15.839093208312988, 15.77031135559082, 15.088330268859863, 15.058067321777344, 15.058067321777344, 14.456063270568848, 14.350887298583984, 14.30738353729248, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 12.985485076904297, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379, 11.673600196838379 ], "content": [ "The invoker then invokes the correct method by looking at the AcceptVerbs attribute .", "Using the AcceptVerbs attribute does not affect routing .", "If I just change AcceptVerbs HttpVerbs.Get to AcceptVerbs HttpVerbs.Get HttpVerbs.Head will MVC know to drop the body of the request", "If I create a controller action and do not decorate it with AcceptVerbs HttpPost or HttpGet .", "do I have to register the HttpVerb constraint in my route definition when i m registering routes if i have decorated my action method with the AcceptVerbs . . attribute already", "@Phil : i understand the first part about how the controller s invoker picks the best method based on AcceptVerbs .", "Source https : msdn.microsoft.com en-us library system.web.mvc.httpverbs v vs.118 .aspx .. . .. . Also you can use AcceptVerbs to accept other verbs that are not part of the HttpVerbs enum - eg .", "AcceptVerbs Trace .. . .. . Update : actually attributes are examples of AOP https : en.wikipedia.org wiki Aspect-oriented programming used within the .NET framework .", "My guess is that you are including a constraint on the action method such that it will only respond to HTTP GET verbs .", "You omitted the link-to the MSDN AcceptVerbs documentation https : msdn.microsoft.com en-us library system.web.mvc.httpverbs v vs.118 .aspx which pretty much covers it .", "I followed your example and replaced all instances of HttpGet with AcceptVerbs new GET HEAD right throughout my site .", "Hi I tried that too as shown below but still it doesnt wrk... . ActionName index AcceptVerbs HttpVerbs.Get public ActionResult Index ... . ActionName onchange AcceptVerbs HttpVerbs.Post public ActionResult OnChange int i m NumberOfVisibleItems i return RedirectToAction index", "What it allows you to do is have 2 action methods on a controller with the same name that each respond to a different HTTP Method .", "This means I have a single route that needs to handle 3 verbs POST PUT DELETE - would it be smarter to use a constraint at the routing level and simply have 3 separate actions wired in the routes.. . or better to build an attribute in the MVC framework that captures multiple verbs and passes them as an argument to the action", "I think there are 7 Accept verbs in mvc : .. . .. . 1 .", "What is the best way to unit test the controller action HttpAcceptAttribute verbs", "Could you show the Index action method code", "While referring asp.net-mvc I got stuck on Accept verbs .", "I know Accept verbs are used for polymorphism in mvc but how do they work", "How do I take care of resources verbs and HEATOS .", "These are Enumerations for HTTP Protocol verbs http : www.w3.org Protocols rfc2616 rfc2616-sec9.html .", "@Haacked - to correct myself and be more specific GET PUT DELETE all share the same route signature objName id and I m trying to have one Controller Action that handles accepts all three verbs -or- 3 actions one for each verb but the same name and same method-signature not possible with just attribs", "Try to test it with an action method distinct from Get or Post or GetById because in these cases if there is no Accepted verb attribute the http method will be resolved automatically from the name .", "Nope -- Create will only respond to POST requests .", "So when a POST request comes in for home create neither action method will be called because that route will not match the request .", ".. . Options : Represents a request for information about the communication options available on the request response chain identified by the Request-URI .", "You re correct - it s an actual redirect and as a result the action Index should be called from scratch.. . so regardless of how you get there the Index action should be called .", "It s actually something used by the action invoker .", "Does the action allow any access method or does it default to GET", "I ve tested with Dummy action method and it s only accepting POST .", "I created a simple action method in an ASP.Net MVC 2 project : .. . .. . Then I launched Fiddler and built up an HTTP GET request to hit this URL : .. . .. . http : localhost .", "do i need to add this to the route that refers to this action as a constraint", "Are you saying that if u use the HttpMethodConstraint it wouldn t know which Create method to use", "@SirwanAfifi thz for your answer but yet i dont understand the core concept about how this attributes help for polymorphism by putting the attributes in front of the action in controller", "You can have other implementations of Create with different AcceptVerb attributes or one with no attribute that will catch all other requests .", "What s the difference between the AcceptVerb attribute vs the HttpVerb constraint defined in the route definition", "Also are you sure you have an Index action in that controller and that you don t have an ActionName on it that looks like this : .. . .. . The way a lot of the stuff in MVC works is through reflection - and I believe capitalization might be an issue with that .", "So those attributes are some built-in implementations that handles HTTP stuff for you so you don t have to put those code in all of your controller action methods .", "Which is really annoying .", "The difference between the two is the following : Let s assume the Create method in question is on the HomeController .", "In Web API 2.1 : .. . .. . it depends on the name of the action .", "If you want the exact same method to handle them use 3 attributes on it : HttpPost HttpGet HttpDelete public ActionResult MyMethod", "If that was your only Create method any GET or other non-POST request would result in a 404 .", "Presumably the the two MVC projects will be hosted in their own web-applications so the EmployeeMVC application can just post a form to an action on a controller in the TimesheetMVC application .", "It s quite strange because I have just received : The requested resource does not support http method GET for an action without attributes tested in WebApi 2.2 .", "If the action starts with Get then it will default to only accept GET requests .", "Here the RedirectToAction doesn t call the ActionResult Index .", "Do I need to register a route for this", "public ActionResult Index .... . return View s Model", "Depending on what release of MVC you re using you don t need the ActionName any longer .", "if you re running the RC of MVC you don t need to have the ActionName decorator anymore .", "Try getting rid of them .", "Also try just returning the view : return View Index and the model here", "I m not 100 sure but doesn t RedirectToAction send a 302 redirect to the client", "So it wouldn t directly call Index only in the next request from the browser .", "Without more information it might even be IIS with some sort of redirect setting issue", "HttpVerbs.Get .. . 2 .", "HttpVerbs.Post .. . 3 .", "HttpVerbs.Put .. . 4 .", "HttpVerbs.Delete .. . 5 .", "HttpVerbs.Head .. . 6 .", "HttpVerbs.Patch .. . 7 .", "HttpVerbs.Options .. . .. . what do they mean and how do they help to make polymorphism in asp.net-mvc please help and what are their short hands example : httppost and httpget i knows", "Delete : Requests that a specified URI be deleted .", ".. . Get : Retrieves the information or entity that is identified by the URI of the request .", ".. . Head : Retrieves the message headers for the information or entity that is identified by the URI of the request .", ".. . Patch : Requests that a set of changes described in the request entity be applied to the resource identified by the Request- URI .", ".. . Post : Posts a new entity as an addition to a URI .", ".. . Put : Replaces an entity that is identified by a URI .", "Aspect-oriented Programming and Code Contracts in ASP.NET MVC https : www.simple-talk.com dotnet asp.net aspect-oriented-programming-and-code-contracts-in-asp.net-mvc .. . .. . Aspect Oriented Programming in ASP.NET MVC http : stackoverflow.com questions 23244400 aspect-oriented-programming-in-asp-net-mvc", "Why people don t look at the documentation before coming here is beyond me .", "@NightOwl888 Thanks I ve added the source .", "@Aakashp maybe you could post that as a question and we could all learn - if you do feel free to mention me in comment with link", "eg .", "i have this .", "So when a request for home create comes in the route will match and hand off the request to the controller s invoker .", "Using the HttpMethodConstraint in routing will make it such that the route itself will not match the request .", "It s possible that another route will match that request though .", "Part of the reason for the overlap here is that Routing is a feature of ASP.NET 3.5 SP1 and isn t specific to MVC .", "MVC uses Routing but Routing is also used by Dynamic Data and we plan to integrate routing with ASP.NET Web Forms .", "I don t understand the second part .", "No i m saying that using a constraint means that the route itself doesn t match .", "If no route matches then the request is not handed off to MVC in the first place .", "@Haacked - This post is ages old but I have a question regarding both these techniques .", "I m using MVC3 and trying to build a JSON api for my app in a RESTful manner .", "I assume under the hood this is all being done by the routing engine anyways .", "edit : nope see Haacked s post", "Yep - i understand all that but that s not the question .", "Nothing .. . just whatever way floats your boat", "First decorate like this : .. . .. . then you need to add route like this :", "I d like to correctly support the HTTP HEAD request when bots hit my ASP.NET MVC site using HEAD .", "It was brought to my attention that all HTTP HEAD requests to the site were returning 404s particularly from http : downforeveryoneorjustme.com .", "Wish they would switch to GET like all the other good bots out there .", "What have you done to support HTTP HEAD requests", "Code sample would be great", "The MVC framework gives no special treatment to HEAD whatsoever .", ": 51149 Home TestMe .. . .. . The expected full page content was returned .", "Then I changed the request to use an HTTP HEAD instead of an HTTP GET .", "I received just the expected head info and no body info in the raw output .", "If you do something like this it will work for both GET and HEAD or you can omit the constraint entirely if it provides no value ." ] }
{ "confidence": [ 71.1385498046875, 60.738033294677734, 59.72456741333008, 56.11941146850586, 52.811161041259766, 49.0405387878418, 44.75682067871094, 44.573062896728516, 43.27931594848633, 25.368640899658203, 24.382877349853516, 24.17205047607422, 24.17205047607422, 21.00804901123047, 19.204437255859375, 13.87933349609375 ], "content": [ "Question : do I have to register the HttpVerb constraint in my route definition when i m registering routes if i have decorated my action method with the AcceptVerbs . . attribute already eg . i have this . do i need to add this to the route that refers to this action as a constraint .. . Answer : The difference between the two is the following : Let s assume the Create method in question is on the HomeController . Using the AcceptVerbs attribute does not affect routing . It s actually something used by the action invoker . What it allows you to do is have 2 action methods on a controller with the same name that each respond to a different HTTP Method . So when a request for home create comes in the route will match and hand off the request to the controller s invoker . The invoker then invokes the correct method by looking at the AcceptVerbs attribute . Using the HttpMethodConstraint in routing will make it such that the route itself will not match the request . So when a POST request comes in for home create neither action method will be called because that route will not match the request . It s possible that another route will match that request though . Part of the reason for the overlap here is that Routing is a feature of ASP.NET 3.5 SP1 and isn t specific to MVC . MVC uses Routing but Routing is also used by Dynamic Data and we plan to integrate routing with ASP.NET Web Forms . Comment : @Phil : i understand the first part about how the controller s invoker picks the best method based on AcceptVerbs . I don t understand the second part . Are you saying that if u use the HttpMethodConstraint it wouldn t know which Create method to use Comment : No i m saying that using a constraint means that the route itself doesn t match . If no route matches then the request is not handed off to MVC in the first place . Comment : @Haacked - This post is ages old but I have a question regarding both these techniques . I m using MVC3 and trying to build a JSON api for my app in a RESTful manner . This means I have a single route that needs to handle 3 verbs POST PUT DELETE - would it be smarter to use a constraint at the routing level and simply have 3 separate actions wired in the routes.. . or better to build an attribute in the MVC framework that captures multiple verbs and passes them as an argument to the action Comment : @Haacked - to correct myself and be more specific GET PUT DELETE all share the same route signature objName id and I m trying to have one Controller Action that handles accepts all three verbs -or- 3 actions one for each verb but the same name and same method-signature not possible with just attribs Comment : If you want the exact same method to handle them use 3 attributes on it : HttpPost HttpGet HttpDelete public ActionResult MyMethod", "Question : While referring asp.net-mvc I got stuck on Accept verbs . I know Accept verbs are used for polymorphism in mvc but how do they work I think there are 7 Accept verbs in mvc : .. . .. . 1 . HttpVerbs.Get .. . 2 . HttpVerbs.Post .. . 3 . HttpVerbs.Put .. . 4 . HttpVerbs.Delete .. . 5 . HttpVerbs.Head .. . 6 . HttpVerbs.Patch .. . 7 . HttpVerbs.Options .. . .. . what do they mean and how do they help to make polymorphism in asp.net-mvc please help and what are their short hands example : httppost and httpget i knows Comment : These are Enumerations for HTTP Protocol verbs http : www.w3.org Protocols rfc2616 rfc2616-sec9.html . .. . Answer : Delete : Requests that a specified URI be deleted . .. . Get : Retrieves the information or entity that is identified by the URI of the request . .. . Head : Retrieves the message headers for the information or entity that is identified by the URI of the request . .. . Options : Represents a request for information about the communication options available on the request response chain identified by the Request-URI . .. . Patch : Requests that a set of changes described in the request entity be applied to the resource identified by the Request- URI . .. . Post : Posts a new entity as an addition to a URI . .. . Put : Replaces an entity that is identified by a URI . Source https : msdn.microsoft.com en-us library system.web.mvc.httpverbs v vs.118 .aspx .. . .. . Also you can use AcceptVerbs to accept other verbs that are not part of the HttpVerbs enum - eg . AcceptVerbs Trace .. . .. . Update : actually attributes are examples of AOP https : en.wikipedia.org wiki Aspect-oriented programming used within the .NET framework . So those attributes are some built-in implementations that handles HTTP stuff for you so you don t have to put those code in all of your controller action methods . Aspect-oriented Programming and Code Contracts in ASP.NET MVC https : www.simple-talk.com dotnet asp.net aspect-oriented-programming-and-code-contracts-in-asp.net-mvc .. . .. . Aspect Oriented Programming in ASP.NET MVC http : stackoverflow.com questions 23244400 aspect-oriented-programming-in-asp-net-mvc Comment : You omitted the link-to the MSDN AcceptVerbs documentation https : msdn.microsoft.com en-us library system.web.mvc.httpverbs v vs.118 .aspx which pretty much covers it . Why people don t look at the documentation before coming here is beyond me . Comment : @NightOwl888 Thanks I ve added the source . Comment : @SirwanAfifi thz for your answer but yet i dont understand the core concept about how this attributes help for polymorphism by putting the attributes in front of the action in controller Comment : @Aakashp maybe you could post that as a question and we could all learn - if you do feel free to mention me in comment with link", "Question : I d like to correctly support the HTTP HEAD request when bots hit my ASP.NET MVC site using HEAD . It was brought to my attention that all HTTP HEAD requests to the site were returning 404s particularly from http : downforeveryoneorjustme.com . Which is really annoying . Wish they would switch to GET like all the other good bots out there . If I just change AcceptVerbs HttpVerbs.Get to AcceptVerbs HttpVerbs.Get HttpVerbs.Head will MVC know to drop the body of the request What have you done to support HTTP HEAD requests Code sample would be great Comment : The MVC framework gives no special treatment to HEAD whatsoever . .. . Answer : I created a simple action method in an ASP.Net MVC 2 project : .. . .. . Then I launched Fiddler and built up an HTTP GET request to hit this URL : .. . .. . http : localhost . : 51149 Home TestMe .. . .. . The expected full page content was returned . Then I changed the request to use an HTTP HEAD instead of an HTTP GET . I received just the expected head info and no body info in the raw output . My guess is that you are including a constraint on the action method such that it will only respond to HTTP GET verbs . If you do something like this it will work for both GET and HEAD or you can omit the constraint entirely if it provides no value . Comment : Thanks for this great answer . I followed your example and replaced all instances of HttpGet with AcceptVerbs new GET HEAD right throughout my site . Now twitter and other similar bots can call a HEAD on any of my content and receive the correct response rather than the errors I was throwing them. . Cheers", "Question : do I have to register the HttpVerb constraint in my route definition when i m registering routes if i have decorated my action method with the AcceptVerbs . . attribute already eg . i have this . do i need to add this to the route that refers to this action as a constraint .. . Answer : Nope -- Create will only respond to POST requests . You can have other implementations of Create with different AcceptVerb attributes or one with no attribute that will catch all other requests . If that was your only Create method any GET or other non-POST request would result in a 404 . I assume under the hood this is all being done by the routing engine anyways . edit : nope see Haacked s post Comment : Yep - i understand all that but that s not the question . What s the difference between the AcceptVerb attribute vs the HttpVerb constraint defined in the route definition Nothing .. . just whatever way floats your boat", "Question : do I have to register the HttpVerb constraint in my route definition when i m registering routes if i have decorated my action method with the AcceptVerbs . . attribute already eg . i have this . do i need to add this to the route that refers to this action as a constraint .. . Answer : First decorate like this : .. . .. . then you need to add route like this :", "Question : Here the RedirectToAction doesn t call the ActionResult Index . Do I need to register a route for this Comment : Could you show the Index action method code Comment : public ActionResult Index .... . return View s Model .. . Answer : Depending on what release of MVC you re using you don t need the ActionName any longer . Also are you sure you have an Index action in that controller and that you don t have an ActionName on it that looks like this : .. . .. . The way a lot of the stuff in MVC works is through reflection - and I believe capitalization might be an issue with that . Comment : Hi I tried that too as shown below but still it doesnt wrk... . ActionName index AcceptVerbs HttpVerbs.Get public ActionResult Index ... . ActionName onchange AcceptVerbs HttpVerbs.Post public ActionResult OnChange int i m NumberOfVisibleItems i return RedirectToAction index Comment : if you re running the RC of MVC you don t need to have the ActionName decorator anymore . Try getting rid of them . Also try just returning the view : return View Index and the model here", "Question : If I create a controller action and do not decorate it with AcceptVerbs HttpPost or HttpGet . What is the default behaviour Does the action allow any access method or does it default to GET .. . Answer : It s accessible via any verb . Comment : @marcind tested it and it works like you answered . It would be great to have some links to official documentation that states this .", "Question : I d like to correctly support the HTTP HEAD request when bots hit my ASP.NET MVC site using HEAD . It was brought to my attention that all HTTP HEAD requests to the site were returning 404s particularly from http : downforeveryoneorjustme.com . Which is really annoying . Wish they would switch to GET like all the other good bots out there . If I just change AcceptVerbs HttpVerbs.Get to AcceptVerbs HttpVerbs.Get HttpVerbs.Head will MVC know to drop the body of the request What have you done to support HTTP HEAD requests Code sample would be great Comment : The MVC framework gives no special treatment to HEAD whatsoever . .. . Answer : You can achive the result by simply doing following", "Question : If I create a controller action and do not decorate it with AcceptVerbs HttpPost or HttpGet . What is the default behaviour Does the action allow any access method or does it default to GET .. . Answer : In Web API 2.1 : .. . .. . it depends on the name of the action . If the action starts with Get then it will default to only accept GET requests . If it starts with Put then it will default to only accept PUT requests . Same with POST . If it doesn t start with any known verb then it will default to only accept POST . Here are the results of my testing : Comment : It s quite strange because I have just received : The requested resource does not support http method GET for an action without attributes tested in WebApi 2.2 . Comment : Try to test it with an action method distinct from Get or Post or GetById because in these cases if there is no Accepted verb attribute the http method will be resolved automatically from the name . Comment : Contrary to my answer AFAICT if the method name starts with Get then it will default to only accept GET requests . Otherwise it defaults to accept any verb . Comment : I ve tested with Dummy action method and it s only accepting POST . Have you tried it Comment : I ve reached the same conclusion . It would be nice to have an offical documentation with this info .", "Question : What is the best way to unit test the controller action HttpAcceptAttribute verbs So far I have the following but it s so ugly even a mother couldn t love it and not very flexible . Is there a better way Thanks Mac .. . Answer : No reflection and magic strings easy to rename controller and method without breaking the unit test : Comment : Interesting very clean approach many thanks", "Question : What is the best way to unit test the controller action HttpAcceptAttribute verbs So far I have the following but it s so ugly even a mother couldn t love it and not very flexible . Is there a better way Thanks Mac .. . Answer : Using Comment : That looks good . Thanks Refining the idea even further though do you think there is a way to make it even more generic to allow an array of HttpVerbs to be passed in and have the method Assert only the HttpVerbs are an exact match or is that overkill and seperate methods for post get delete put or combinations of them is enough Ideally I d like to be able to call it something like this MvcAssert.HasHttpVerbs controller actionName paramTypes HttpVerbs", "Question : What is the best way to unit test the controller action HttpAcceptAttribute verbs So far I have the following but it s so ugly even a mother couldn t love it and not very flexible . Is there a better way Thanks Mac .. . Answer : Comment : Superb thanks Mehdi", "Question : What is the best way to unit test the controller action HttpAcceptAttribute verbs So far I have the following but it s so ugly even a mother couldn t love it and not very flexible . Is there a better way Thanks Mac .. . Answer : A bit modified version Darin s solution .", "Question : Here the RedirectToAction doesn t call the ActionResult Index . Do I need to register a route for this Comment : Could you show the Index action method code Comment : public ActionResult Index .... . return View s Model .. . Answer : I m not 100 sure but doesn t RedirectToAction send a 302 redirect to the client So it wouldn t directly call Index only in the next request from the browser . Comment : You re correct - it s an actual redirect and as a result the action Index should be called from scratch.. . so regardless of how you get there the Index action should be called . Without more information it might even be IIS with some sort of redirect setting issue", "Question : I want to create a REST based chat application in Java using Eclipse but I have no idea how to start . How do I take care of resources verbs and HEATOS . .. . Answer : Check out this link http : jersey.java.net or this link http : restlet.org or this link http : www.jboss.org resteasy . I would personally recommend Jersey . restelt is very powerful but might be quite complicated . RESTeasy has more features than jersey but it can also be a pain to configure outside JBoss and their community is not as active . I would recommend Jersey their startup tutorial is very easy to follow . You can also look at this book http : shop.oreilly.com product 9780596521134.do and this book http : shop.oreilly.com product 9780596158057.do . Sorry I can t provide any hard answers as I have no knowledge your level of expertise on the subject . Hope this helps . Comment : Hay greenkode I wanna use Atmosphere . Can u please help me with that", "Question : I have Three projects in one solution two are asp.net MVC type and last one is class type call it EmployeeMVC Proj and TimeSheetMVC Proj To manage the views and Third one EntityLib proj . Now from EmployeeMVC Proj I would like to pup-up a page from TimeSheetMVC Proj and perform some operations . Let s say from EmployeeMVC Proj Post Time-Sheet Data in JSon format to TimeSheetMVC Proj and get back the result . How can we achieve this Many thanks Jigar .. . Answer : Presumably the the two MVC projects will be hosted in their own web-applications so the EmployeeMVC application can just post a form to an action on a controller in the TimesheetMVC application ." ] }
[ "yes-answer-long", "yes-answer-short" ]
http
UNK_RELATION
code-formatting@tabs@102
code-formatting -- code-formatting is the way to format the source code of programs using spaces and @placeholder improving legibility of source code .
{ "confidence": [ 52.87385177612305, 52.424983978271484, 52.104522705078125, 46.771358489990234, 46.25604248046875, 44.55143356323242, 44.424896240234375, 44.328495025634766, 43.141231536865234, 42.95713806152344, 42.769859313964844, 42.645145416259766, 42.41554641723633, 42.27391052246094, 41.567787170410156, 41.477264404296875, 41.23075485229492, 41.18800354003906, 41.10411071777344, 41.08911895751953, 40.64215850830078, 39.768001556396484, 39.66911697387695, 39.635887145996094, 39.56970977783203, 39.33823013305664, 39.33823013305664, 38.997772216796875, 38.78196716308594, 38.78196716308594, 38.78196716308594, 38.78196716308594, 38.78196716308594, 38.78196716308594, 38.62394714355469, 38.32427978515625, 38.32427978515625, 38.003387451171875, 37.83074188232422, 37.59717559814453, 37.59717559814453, 37.59717559814453, 37.59717559814453, 37.5777702331543, 37.55540466308594, 37.13953399658203, 37.09325408935547, 37.08018493652344, 36.53071212768555, 36.482059478759766, 36.480567932128906, 36.257179260253906, 36.17716979980469, 36.17716979980469, 36.17716979980469, 36.17716979980469, 36.17716979980469, 35.808414459228516, 35.76121520996094, 35.668678283691406, 35.366031646728516, 35.366031646728516, 35.26103591918945, 35.260643005371094, 34.93494415283203, 34.86287307739258, 34.70770263671875, 34.53788757324219, 34.511436462402344, 34.48701095581055, 34.47539138793945, 34.42822265625, 34.41312789916992, 34.078330993652344, 34.078330993652344, 34.05375289916992, 34.00495910644531, 33.92591857910156, 33.92591857910156, 33.92591857910156, 33.830833435058594, 33.69530487060547, 33.57749938964844, 33.55119323730469, 33.44995880126953, 33.35309600830078, 33.35309600830078, 33.35309600830078, 33.24036407470703, 33.1070671081543, 32.93181610107422, 32.91004180908203, 32.89353942871094, 32.89353942871094, 32.89353942871094, 32.89353942871094, 32.89353942871094, 32.89353942871094, 32.809661865234375 ], "content": [ "Formatting is part of source code quality .", "There are lots of source code-formatting tools out there .", "In Eclipse 3.4 for Windows the Source - Format option for formatting Java code was extended to format HTML code .", "This barely counts as code-formatting .", "applying code to formatted code will break the formatting .", "eclipse itself has good source code-formatting capabilities .", "Select the Run Format option under Select a code-formatting action", "You can also access the formatting option from Commands Apply Source Formatting or only apply it to a select block of code by selecting the Apply Source Formatting to Selection option .", "Commands Apply Source Formatting .", "Webstorm code-formatting is very nice to see javascript code .", "I want to know the automatic way formatting a c source code to contain only one statement for each line .", "When I do automatic code-formatting with visual-studio format or resharper format it uses 2 spaces for indentation .", "Is there a way to save two different sets of code-formatting in Visual Studio", "But it seems strange that the code-formatting options were removed .", "This page shows all the supported languages : en.support.wordpress.com code posting-source-code http : en.support.wordpress.com code posting-source-code", "Possible duplicate of Xcode source automatic formatting http : stackoverflow.com questions 1573968 xcode-source-automatic-formatting", "Sad : What is common way to share code-formatting across the team", "AStyle http : astyle.sourceforge.net can be customized in great detail for C++ and Java and others too .. . .. . This is a source code-formatting tool .", "possible duplicate of Code formatting shortcut in Android studio http : stackoverflow.com questions 16580171 code-formatting-shortcut-in-android-studio", "What about options for formatting JavaScript code", "What is surprising is that the Spaces subtab is formatting the code the right way but it s is the only place where it works .", "Thank you for comments but my purpose is formatting all possible C source code .", "However formatting unfolds all folded code blocks .", "I ve been using Dreamweaver Apply Source Formatting or CRTL + K + D in Visual Studio and format my pages .", "And for JavaScript source format you can use Dreamweaver JavaScript source formatting extension .", "The code should at any time be robust against a Format Source on all projects .", "Check the Perform the selected actions on save and check the Format source code box .", "The source code will already be tabbed .", "On Windows code-formatting is available in VSCode through the shortcut Shift + Alt + F .", "I like to formatting my code to align right side of equal operands .", "Would be really nice if I could provide framework specific code-formatting .", "I updated to the new Xamarin 6 and the code-formatting is strange .", "http : i.stack.imgur.com ThhQw.png Here is Xamarin 6 s code-formatting", "There is a vim-plugin that enables formatting on your code from within vim .", "Source code of this extension is also available .", "So you are telling that you can do it manually but formatting code makes it appears as code-snippet-1 .", "You want to know how to make code-formatting appears as code-snippet-2", "You can tweak the settings of the code-formatting .", "Well this question is really old but as it was mentioned here : .. . .. . How to preserve code-folding when formatting source http : stackoverflow.com questions 29566156 how-to-preserve-code-folding-when-formatting-source 29591220 29591220 .. . .. . and there is no answer I thought I could answer both here is the answer I posted there : .. . .. . What you can do is create regions and disable code-folding format code and then reenable the code-folding .", "Formatting code in Visual Studio Team Services http : i.stack.imgur.com UYzqh.png", "A pet peeve - why doesn t SSMS have code-formatting by now", "I m interested in formatting the code preferably without needing to run an editor .", "Update your IDE with the latest PDT version for better code-formatting .", "And what kind of source code it is", "Coding toolbar Edit Toolbars Coding and select Code Format Settings to set your preferred formatting .", "A formatter accepts source code as input applies styling rules and produces styled source code that is semantically equivalent to the original source code .", "I write my programs with high degree of formatting .", "You can export the settings for code-formatting but I m not sure of a way to load them via keyboard shortcut .", "I got some source code and this is a mess .", "It s called vim-autoformat and you can download it here : .. . .. . https : github.com Chiel92 vim-autoformat .. . .. . It integrates external code-formatting programs into vim .", "Windows - Preferences - Java - Editor - save actions - Format source code - Format Edited lines or format all lines .", "Is there a way to instruct Eclipse to ignore certain lines of source with respect to formatting", "It is also possible to automatically apply such formatting when code is committed .", "I have used Uncrustify http : uncrustify.sourceforge.net for formatting code .", "As you know Delphi 2010 has built-in code-formatting .", "See : http : clang.llvm.org docs ClangFormatStyleOptions.html disabling-formatting-on-a-piece-of-code", "Clutter your code with comments to make the automatic formatting work .", "Does anyone know a free tool to format Java source code using Sun s conventions", "Here are the shortcuts to format the code in Xcode .. . .. . 1.Format entire code entire class controller .. . .. . select the entire code and press + on mac to format your code .", "Is there a way to automatically format the code when you save", "What is the equivalent of Ctrl + K + F and Ctrl + K + D on Windows in Visual Studio for formatting or beautifying code in the Visual Studio Code editor", "When I copy code from another file the formatting is messed up like this : .. . .. . How can I autoformat this code in vim", "Usually what this means is a that group can t agree on a format and so formatting doesn t happen and you end up with well badly formatted code .", "everytime i format the code using the command .. . .. . Code : .. . .. . Intellij Settings : .. . .. .", "Is there any way of changing the standard by which NetBeans automatically formats the code when doing Source- Format", "Format entire code entire class controller .. . .. . Select the entire code and press control+I on mac to format your code .", "I was wondering if there is a good way to write your XTemplates so that they are visually indented by the HTML code they contain and maintain that indentation even after using automatic code-formatting in your IDE in my case Netbeans .", "But especially kRON for linking to the format customizations http : stackoverflow.com questions 351298 best-source-code-formatter-for-javascript 351310 page .", "All project members share the same code-formatting settings .", "That will also format C code .", "Is there any way to disable ReSharper Web Form MVC .aspx Code Formatting on Brace Completion", "I want to have code formatted like the following .. . .. . but IntelliJ always gives me code like this when formatting .. . .. . So basically I d like to instruct the code formatter to leave my chained method calls like they are .", "Try this : .. . .. . 1 . ReSharper Options Code Editing C Formatting Style Blank Lines Preserve existing formatting Keep max blank lines in declaration Select 0 2 . ReSharper Options Code Editing C Formatting Style Blank Lines Blank lines Around field Uncheck", "My company is picky about formatting too and has different ideas about code aesthetics .", "http : i.stack.imgur.com IH018.png Here are Xamarin 6 s code-formatting options", "I m a code purist preferring my own style of code-formatting as opposed to Visual Studio s default settings .", "A set of source code-formatting tools installed and in your path .. . .. . Between uncrustify http : uncrustify.sourceforge.net and greatcode http : sourceforge.net projects gcgreatcode you should be able to completely replicate the style you want .", "I m not sure if you need source code .", "@Mk12 That s not source code...it s hieroglyphics : -", "There is lots of TODOs TODO in comments in the source code .", "I think what he s saying is that he feels that poorly written poorly formatted code should be kept as-is rather than formatting it in the hope of improving it .", "The source code is available https : github.com beautify-web js-beautify .", "For Delphi : .. . .. . DelForExp a freeware Pascal source code formatter for Delphi http : www.aew.wur.nl UK Delforexp .. . JEDI Code Format http : jedicodeformat.sourceforge.net .. . GExperts http : www.gexperts.org is a IDE plugin which also contains a code formatter .", "After I m done writing some code or when someone else has pushed code to the repository I like to quickly run NetBeans code-formatting over the code .", "You can download the TinyMCE source code http : tinymce.moxiecode.com download.php as it s open-source .", "What I m confused about is how to format source code as part of my document .", "For Java there exists Open source IDE IntelliJ idea that can easily format code .", "Another option is to go to Window- Preferences- Java- Editor- SaveActions and check the Format source code option .", "does not format code it re-indents it .", "This doesn t do formatting beautifying .", "I actually found this while looking for a way to format javascript code .", ".. . .. . Now some project members use the Eclipse editor and the semantic formatting is often destroyed when they format an entire source file .", "The JetBrains Resharper http : www.jetbrains.com resharper Visual Studio addin does a lot of stuff including code-formatting .", "I ve used Uncrustify http : uncrustify.sourceforge.net with UniversalIndentGui http : universalindent.sourceforge.net for formatting C++ code .", "If the link doesn t work in your browser please copy n paste this url : http : dbestudio.wiki.sourceforge.net Code+Formatting+with+Checkstyle", "Auto formatting can be done by .. . .. . Select View Code View Options .. . Click the View Options button", "See more information here : http : jedicodeformat.sourceforge.net .. . .. . The formatting engine of DelForExp has been integrated into the code base of GExperts .", "I ve seen a lot of code-formatting standards and I m a bit confused what I should do .", "So in short is there any way to directly edit my views within SSMS and have the views retain the formatting in my code" ] }
{ "confidence": [ 47.14530563354492, 46.94833755493164, 46.231407165527344, 45.2966194152832, 44.824485778808594, 44.281803131103516, 43.81404495239258, 43.60395812988281, 43.46713638305664, 43.359527587890625, 43.152503967285156, 43.08201217651367, 42.919212341308594, 42.91828918457031, 42.754608154296875, 42.738243103027344, 42.69841766357422, 42.61811065673828, 42.561397552490234, 42.27997970581055 ], "content": [ "Question : I am rather new to VIM . I got some source code and this is a mess . At a first sight I would like at least to get a clear and organised view of the code so I like to get it rightly formatted I mean indented depending on the depth of the functions and so . I wonder if it can be done with VIM and otherwise which other commandline tools for that can you recommend . Thanks .. . Answer : There is a vim-plugin that enables formatting on your code from within vim . It s called vim-autoformat and you can download it here : .. . .. . https : github.com Chiel92 vim-autoformat .. . .. . It integrates external code-formatting programs into vim . For example if you want to format C C++ C or Java code you need to install the program astyle and vim sets it as the format program automatically .", "Question : Is it possible to auto-format your code in Dreamweaver like in Visual Studio ctrl+k+d .. . Answer : Coding toolbar Edit Toolbars Coding and select Code Format Settings to set your preferred formatting . You can also access the formatting option from Commands Apply Source Formatting or only apply it to a select block of code by selecting the Apply Source Formatting to Selection option . http : www.hongkiat.com blog 10-useful-dreamweaver-tips-for-beginners", "Question : Is there anyway to format the code in Xcode like you can do in Eclipse or Netbenas . I have not found any option in menu is there any hot key for this or its simply not in Xcode Comment : I should say that Xcode should a better job now Its really not competing with Eclipse Netbeans or Visual Studio Comment : Duplicate of XCode 4 How to format code http : stackoverflow.com q 6543026 3425536 Comment : Possible duplicate of Xcode source automatic formatting http : stackoverflow.com questions 1573968 xcode-source-automatic-formatting .. . Answer : Select some text and then : Edit- Format- Re-Indent .. . .. . You can bind this to a hotkey in the preferences . Comment : This barely counts as code-formatting . Comment : Fair enough but AFAIK it s the closest thing Xcode has . Comment : Not really . See the post that s been upvoted . Comment : This is the closest thing Xcode has to built-in formatting support .", "Question : Is there anyway to format the code in Xcode like you can do in Eclipse or Netbenas . I have not found any option in menu is there any hot key for this or its simply not in Xcode Comment : I should say that Xcode should a better job now Its really not competing with Eclipse Netbeans or Visual Studio Comment : Duplicate of XCode 4 How to format code http : stackoverflow.com q 6543026 3425536 Comment : Possible duplicate of Xcode source automatic formatting http : stackoverflow.com questions 1573968 xcode-source-automatic-formatting .. . Answer : Not saying this is best approach but for completeness if you cut and then paste the code back in Xcode will automatically format it for you .", "Question : Is there anyway to format the code in Xcode like you can do in Eclipse or Netbenas . I have not found any option in menu is there any hot key for this or its simply not in Xcode Comment : I should say that Xcode should a better job now Its really not competing with Eclipse Netbeans or Visual Studio Comment : Duplicate of XCode 4 How to format code http : stackoverflow.com q 6543026 3425536 Comment : Possible duplicate of Xcode source automatic formatting http : stackoverflow.com questions 1573968 xcode-source-automatic-formatting .. . Answer : You can also highlight the code you want to re indent and use the re-indent command", "Question : There are lots of source code-formatting tools out there . Which ones work best for C++ I m interested in command-line tools or other things that can be automatically run when checking code in out preferably without needing to launch an editor or IDE . If you see the one you like already listed as an answer vote it up . If it s not there add it . .. . Answer : AStyle http : astyle.sourceforge.net can be customized in great detail for C++ and Java and others too .. . .. . This is a source code-formatting tool . .. . .. . clang-format http : clang.llvm.org docs ClangFormat.html is a powerful command-line tool bundled with the clang compiler which handles even the most obscure language constructs in a coherent way . It can be integrated with Visual Studio Emacs Vim and others and can format just the selected lines or with git-svn to format some diff . It can be configured with a variety of options listed here http : clang.llvm.org docs ClangFormatStyleOptions.html . When using config files named .clang-format styles can be per directory - the closest such file in parent directories shall be used for a particular file . Styles can be inherited from a preset say LLVM or Google and can later override different options .. . .. . It is used by Google and others and is production ready . .. . .. . Also look at the project UniversalIndentGUI http : universalindent.sourceforge.net . You can experiment with several indenters using it : AStyle Uncrustify GreatCode .. . and select the best for you . Any of them can be run later from a command-line . .. . .. . Uncrustify http : uncrustify.sourceforge.net has a lot of configurable options . You ll probably need Universal Indent GUI in Konstantin s reply as well to configure it . Comment : neat tool . added to favorites collection . Comment : I m interested in formatting the code preferably without needing to run an editor . AStyle is the kind of thing I m looking for . Comment : We have some messy source files full of complicated macros making it hard to understand how to modify the code or set breakpoints . We de-macroed it with gcc -E resulting in very long lines of nested for loops if statements etc . Astyle fixed that to be readable saving us a lot of trouble . Astyle has a permanent place on my software toolshelf Comment : Vim tip : if you want to beautify the code in a file you re current editing use : astyle Comment : Tried it . It s very easy to get a quick result doc is good . It s a shame there are not so many options though Some programmers are very creative with the way they pad their code with spaces and AStyle does not handle all of that creativity .", "Question : Is there anyway to format the code in Xcode like you can do in Eclipse or Netbenas . I have not found any option in menu is there any hot key for this or its simply not in Xcode Comment : I should say that Xcode should a better job now Its really not competing with Eclipse Netbeans or Visual Studio Comment : Duplicate of XCode 4 How to format code http : stackoverflow.com q 6543026 3425536 Comment : Possible duplicate of Xcode source automatic formatting http : stackoverflow.com questions 1573968 xcode-source-automatic-formatting .. . Answer : Here are the shortcuts to format the code in Xcode .. . .. . 1.Format entire code entire class controller .. . .. . select the entire code and press + on mac to format your code . 2.Format particular block of code .. . .. . select the code and press .. . .. . + for right move and + for left move .. . .. . Note : as per @JavierGiovannini sugesstion you can do using Editor Menu option .. . .. . 3.Select code -- Go to Editor -- Structure -- Re-Indent", "Question : Is there any way of changing the standard by which NetBeans automatically formats the code when doing Source- Format I seem to remember seeing this option somewhere but I can t find anything about it . .. . Answer : The formatting preferences are at two levels in NetBeans 6.9 Beta http : download.netbeans.org netbeans-6.9 beta and NetBeans 6.8 . There is a global setting which is available via the Options item of the Tools menu Preferences item of the NetBeans menu on Mac OS X . This opens a Options dialog . Select the Formatting tab of the Editor category and then change the language to PHP . alt text http : www.freeimagehosting.net uploads 587cd38396.png .. . .. . You can also specify formatting on a per-project basis . To do that select your PHP project in the Project explorer and the select the Project Properties item from the File menu . When the Properties dialog opens select the Formatting category from the navigation list on the left side of the dialog . alt text http : www.freeimagehosting.net uploads 47904df6e4.png .. . .. . Note : In 6.8 there are only two formatting categories that you can change : Tabs and Indents Braces . It looks like the preview area is not rendered correctly . NetBeans 6.9 Beta extends the number of formatting categories Tabs and Indents Alignment Braces Blank Lines Spaces Wrapping . The issues with the preview area appear to be resolved too .", "Question : Is there anyway to format the code in Xcode like you can do in Eclipse or Netbenas . I have not found any option in menu is there any hot key for this or its simply not in Xcode Comment : I should say that Xcode should a better job now Its really not competing with Eclipse Netbeans or Visual Studio Comment : Duplicate of XCode 4 How to format code http : stackoverflow.com q 6543026 3425536 Comment : Possible duplicate of Xcode source automatic formatting http : stackoverflow.com questions 1573968 xcode-source-automatic-formatting .. . Answer : In v.4 you can make some adjustments through xCode preferences.. . .. . .. . fix code indentation in xcode http : stackoverflow.com questions 3558709 fix-code-indentation-in-xcode 7609419 7609419", "Question : I want to know the automatic way formatting a c source code to contain only one statement for each line . Do we have any tool for this From this I want to measure precise statement coverage using gcov . For example .. . .. . from this .. . .. . to this : .. . .. . Any useful comments would be appreciated . Thank you . Note : Please read carefully what I want only one statement per a line . I have already tried Astyle and other beautifiers but those tools do not provide the function what I want . Also I have searched it Google but no results have found . Comment : Well I am not sure But you can have a look at GNU indent gnu.org software indent manual indent.html http : www.gnu.org software indent manual indent.html . Comment : You could make a little script that format your files . You just have to define when to add n after or for example Comment : Thank you for comments but my purpose is formatting all possible C source code . Some target programs consist of more than 10 000 lines-of-code .. . Answer : GNU indent http : www.gnu.org software indent should help you achieve the desired result . The default style is --gnu-style . For an input : .. . .. . indent with default options would transform it into :", "Question : Is there anyway to format the code in Xcode like you can do in Eclipse or Netbenas . I have not found any option in menu is there any hot key for this or its simply not in Xcode Comment : I should say that Xcode should a better job now Its really not competing with Eclipse Netbeans or Visual Studio Comment : Duplicate of XCode 4 How to format code http : stackoverflow.com q 6543026 3425536 Comment : Possible duplicate of Xcode source automatic formatting http : stackoverflow.com questions 1573968 xcode-source-automatic-formatting .. . Answer : My personal favorite code formatter is Uncrustify http : uncrustify.sourceforge.net . It has-many many options so I also suggest you download UniversalIndentGUI http : universalindent.sourceforge.net a GUI to help set Uncrustify s behavior to your liking .", "Question : I ve got some Java code with SQL statements written as Java strings please no OR M flamewars the embedded SQL is what it is - not my decision . I ve broken the SQL statements semantically into several concatenated strings over several lines-of-code for ease of maintenance . So instead of something like : .. . .. . I have something like : .. . .. . This style makes the SQL much easier to read and maintain IMHO especially for larger queries . For example I can put my editor into overwrite mode and modify the text in-place fairly easily . Note that this issue generalizes beyond the particular example of SQL . Any code that is written with any vertical formatting particularly tabular constructs is susceptible to destruction by a pretty printer . .. . .. . Now some project members use the Eclipse editor and the semantic formatting is often destroyed when they format an entire source file . Is there a way to instruct Eclipse to ignore certain lines of source with respect to formatting .. . .. . I m looking for something like a special comment that toggles the Eclipse formatter . Ideally such a comment could be configurable to be whatever we choose and other formatters could be programmed to respect it as well : .. . .. . Obviously one solution is to have our team members standardize on some external formatter like Jalopy http : www.triemax.com products jalopy or JIndent http : www.jindent.com but that s not what this question is about also not my decision on this project : I m specifically looking for a way to avoid the Eclipse formatter on an ad-hoc basis . Ideally a solution will allow me to insert instructions for the Eclipse formatter without requiring team members using Eclipse to do any IDE reconfiguration other than possibly choosing a formatter agnostic command comment : STOP-ECLIPSE-FORMATTING STOP-FORMATTING . Comment : We ve had this problem . Eclipse should have an option to always break a line in a String constructor where a + is regardless of whether the next bit of string would fit on the line . But it doesn t . : - Comment : Apparently this feature was added in Eclipse 3.6M6 : bugs.eclipse.org bugs show bug.cgi id 27079 https : bugs.eclipse.org bugs show bug.cgi id 27079 Comment : Note : If you simply want to prevent eclipse from messing up your comments then you can use in front of each line . To comment out a block highlight and press Ctrl+ . .. . Answer : This hack works : .. . .. . I would suggest not to use the formatter . Bad code should look bad not artificially good . Good code takes time . You cannot cheat on quality . Formatting is part of source code quality . Comment : Not using the formatter is just a bad idea the formatter helps to catch errors and keeps the code in a consistent state . Comment : An interesting suggestion but I don t see how formatting tells us whether code is good or not . Comment : I think what he s saying is that he feels that poorly written poorly formatted code should be kept as-is rather than formatting it in the hope of improving it . Poorly written poorly formatted code should stick out somehow so that it can be easily identified . Not quite sure that I totally agree but I think that s the idea . Comment : @Francis - Bugs : How can auto-formatted code finding bugs Consistency : Consistency is a nice argument but overall code quality is more important . You can define a nice consistent process for hamburger flipping but it will never work for haute cuisine . Cooking a can be a reasonably complicated activity or trivial if you ignore enough facts . If you think that software development is like hamburger flipping tools enforcing consistency are for you . This is not an argument against formatting guide lines but if the developers don t care about these guidelines the won t care about other essentials . Comment : My argument here : I write good code and I stick to the formatting guide lines . But I am LAZY . Why should I have to insert the correct amount of spaces and line-breaks when I can write my five lines of sloppy code press the format-button and be happy AFTER I have formatted the code using my tool that makes sure the result is always perfect I am as nazi as anyone about the formatting . There is NO argument against sticking to the guide lines other that that they may be particularly bad if the formatting is just a kestroke away . All project members share the same code-formatting settings .", "Question : In Eclipse 3.4 for Windows the Source - Format option for formatting Java code was extended to format HTML code . However for OS X this option is disabled . Additionally there are no formatting options in the Preferences . I ve downloaded all the Web Tools for Eclipse and the option is still unavailable . Which plugin feature allows for HTML formatting on Eclipse OS X if there is one Otherwise what is a good Web-based alternative Thanks Adam .. . Answer : I did not see any Mac OSX-related formatting improvement in the upcoming Galileo releases as described in their News And Noteworthy http : download.eclipse.org eclipse downloads drops S-3.5M5-200902021535 eclipse-news-M5.html pages .. . .. . May be some external plugin like this Flex formatter http : mac.softpedia.com get Developer-Tools Flex-Formatter.shtml also there as a Sourceforge project http : sourceforge.net projects flexformatter would bring as a side effect better HTML formatting Disclaimer : I have not tested it", "Question : Is there a keyboard shortcut to format code within Notepad++ I m mainly working with HTML CSS and Python code . For example : .. . .. . To : .. . .. . I remember Visual Studio doing it with CRTL+K+D and Netbeans having the feature too but can t find it within Notepad++ if it can even do it . Comment : However I think Notepad++ should add shortcut for this We developer will never go every time follow the sequence of clicks to format the Code Really bad Comment : I ve been using Dreamweaver Apply Source Formatting or CRTL + K + D in Visual Studio and format my pages . I ve also used VIM but I just never got it right with Notepadd++ because it doesn t like my django tags . .. . Answer : If you go to TextFX menu and go to TextFX Edit you will see a menu item Reindent C++ Code . That will also format C code . Comment : It even formats Powershell code Comment : That s exactly what I want It can format many languages . Comment : It doesn t indent correctly in PHP . Sometimes it makes 2 or 3 tab spaces instead of one and in some situations it makes none when it should .", "Question : What is the equivalent of Ctrl + K + F and Ctrl + K + D on Windows in Visual Studio for formatting or beautifying code in the Visual Studio Code editor Comment : For all those desperately trying to format XML which seems not possible out of the box currently you can achieve this by installing an extension . I have found XML Tools https : marketplace.visualstudio.com items itemName DotJoshJohnson.xml review-details to get the job done just fine . Disclaimer : I am not the author nor related to this project.. . .. . Answer : Also note that as of today formatting is available for these languages : .. . .. . xml .. . html .. . json .. . javascript .. . typescript .. . c Comment : refer to the source https : code.visualstudio.com Docs languages overview for updates Comment : Where did you find this information As per the first comment XML is meant to be a supported syntax however the command palette doesn t show format code when the file-type is set to xml . I can change it to json or c and the format code option becomes available . It looks to me that XML isn t supported for formatting . Comment : This no longer seems to work for me for XML . Comment : Yep . Not working with XML at all Comment : @DanRevell Just encountered the same issue - no formatting available for XML . So I have installed XML Tools https : marketplace.visualstudio.com items itemName DotJoshJohnson.xml review-details extension and it works just fine .", "Question : When I copy code from another file the formatting is messed up like this : .. . .. . How can I autoformat this code in vim Comment : For anyone looking to format and not just indent the code the second answer mine addresses that . If you just want to fix indenting the accepted answer is the simplest way . .. . Answer : The plugin vim-autoformat lets you format your buffer with only one button press : https : github.com Chiel92 vim-autoformat . It uses external format programs for that with a fallback to vim s indentation functionality .", "Question : Is there a keyboard shortcut to format code within Notepad++ I m mainly working with HTML CSS and Python code . For example : .. . .. . To : .. . .. . I remember Visual Studio doing it with CRTL+K+D and Netbeans having the feature too but can t find it within Notepad++ if it can even do it . Comment : However I think Notepad++ should add shortcut for this We developer will never go every time follow the sequence of clicks to format the Code Really bad Comment : I ve been using Dreamweaver Apply Source Formatting or CRTL + K + D in Visual Studio and format my pages . I ve also used VIM but I just never got it right with Notepadd++ because it doesn t like my django tags . .. . Answer : For JavaScript Formatting I use Notepad ++ JSMin Plugin.Quite Handy", "Question : Is there anyway to format the code in Xcode like you can do in Eclipse or Netbenas . I have not found any option in menu is there any hot key for this or its simply not in Xcode Comment : I should say that Xcode should a better job now Its really not competing with Eclipse Netbeans or Visual Studio Comment : Duplicate of XCode 4 How to format code http : stackoverflow.com q 6543026 3425536 Comment : Possible duplicate of Xcode source automatic formatting http : stackoverflow.com questions 1573968 xcode-source-automatic-formatting .. . Answer : In Xcode 4 it s been moved to Editor Structure Re-Indent command and has a default shortcut of CTRL+I . Comment : Xcode 7 as well .", "Question : Is there anyway to format the code in Xcode like you can do in Eclipse or Netbenas . I have not found any option in menu is there any hot key for this or its simply not in Xcode Comment : I should say that Xcode should a better job now Its really not competing with Eclipse Netbeans or Visual Studio Comment : Duplicate of XCode 4 How to format code http : stackoverflow.com q 6543026 3425536 Comment : Possible duplicate of Xcode source automatic formatting http : stackoverflow.com questions 1573968 xcode-source-automatic-formatting .. . Answer : Other than re-indentation Edit Format Re-Indent not really . However Xcode does have support for scripts the menu to the right of the Window menu so you could conceivably write a script that formats your code how you like it . Edit : here are some links that touch on this subject : .. . .. . http : hackertoys.com 2008 09 18 adding-a-code-beautifier-script-to-xcode .. . strike http : 8020world.com jcmendez 2006 11 geeky-stuff software adding-a-script-menu-to-xcode-to-reformat-code-using-astyle strike dead link", "Question : Is it possible to auto-format your code in Dreamweaver like in Visual Studio ctrl+k+d .. . Answer : And for JavaScript source format you can use Dreamweaver JavaScript source formatting extension . available on adobe Comment : Please also provide link-to the resource you are forwarding at" ] }
[ "yes-answer-long" ]
tabs
UNK_RELATION
spookyjs -- spookyjs makes it possible to drive casperjs suites from @placeholder .
{ "confidence": [ 50.9476203918457, 50.290061950683594, 49.182857513427734, 48.10614013671875, 48.012107849121094, 48.012107849121094, 47.30364227294922, 46.64665222167969, 46.61207580566406, 45.86100387573242, 45.855804443359375, 45.441322326660156, 45.272560119628906, 45.07829284667969, 44.78110885620117, 44.719974517822266, 44.68505096435547, 44.68505096435547, 43.28187561035156, 42.86122131347656, 42.86122131347656, 42.64678955078125, 42.64678955078125, 42.44643783569336, 41.75641632080078, 41.690467834472656, 41.690467834472656, 41.458030700683594, 41.458030700683594, 41.458030700683594, 41.458030700683594, 40.986663818359375, 40.68084716796875, 40.287288665771484, 40.17426300048828, 40.07286071777344, 40.07286071777344, 39.76961898803711, 38.884098052978516, 38.699161529541016, 38.64657974243164, 38.04346466064453, 38.04346466064453, 38.04346466064453, 38.04346466064453, 38.04346466064453, 38.00485610961914, 37.81977462768555, 37.157196044921875, 36.872711181640625, 36.23728561401367, 36.23728561401367, 35.93376541137695, 35.87556838989258, 35.87556838989258, 35.46953582763672, 35.46953582763672, 33.444068908691406, 33.444068908691406, 33.444068908691406, 33.444068908691406, 33.444068908691406, 33.444068908691406, 33.444068908691406, 32.982452392578125, 32.453365325927734, 32.2733154296875, 32.2733154296875, 32.2733154296875, 32.2733154296875, 32.2733154296875, 31.908645629882812, 31.908645629882812, 31.59226417541504, 31.59226417541504, 30.629138946533203, 30.629138946533203, 30.629138946533203, 30.629138946533203, 30.629138946533203, 30.21857452392578, 29.45838737487793, 29.45838737487793, 29.45838737487793, 29.45838737487793, 26.521286010742188, 26.318010330200195, 25.930442810058594, 25.7735595703125, 24.75652313232422, 24.62448501586914, 24.492671966552734, 24.165681838989258, 24.165681838989258, 24.165681838989258, 24.165681838989258, 24.053302764892578, 23.097179412841797, 22.994930267333984, 22.994930267333984 ], "content": [ "I have installed SpookyJS to execute CasperJs commands in Node.js .", "As explained on https : github.com SpookyJS SpookyJS wiki Introduction :", "In CasperJS I can use mouse : .. . .. . How can I do it with SpookyJS", "I am using spookyjs https : github.com SpookyJS SpookyJS to test my application .", "I m new to SpookyJS CasperJS and I m trying to figure out the execution flow .", "I needed to understand global-variables in CasperJS first and so the differences in SpookyJs .", "Posted that question to the github https : github.com SpookyJS SpookyJS issues 187 .", "Is it possible to chain missions to spookyjs after initialization", "I m driving casperjs through spookyjs and I want to use slimerjs rather than phantomjs as the engine for casperjs .", "So how does spookyjs detect this change of value", "How to use mouse in SpookyJS", "This is very similar to your previous question ok spookyjs versus casperjs.. . BTW why is this question tagged casperJS", ".. . .. . In contrast to casperjs spookyjs has three possible contexts : spooky context casper context and page context .", "On SpookyJs that drives CasperJS from node.js I tried to set the same parameter on the casper initialization as seen bellow : .. . .. . But it is not working .", "There is any way to use remote debugger from SpookyJS", "When using casperjs you set the engine when calling casperjs from the command-line like this : .. . .. . I thought it may be possible to set the engine when configuring casperjs when using spookyjs like this : .. . .. . But that doesn t work .", "I m new to SpookyJS .", "This implementation of SpookyJS is really spooky .", "Can this be done with SpookyJS", "Opened this issue https : github.com WaterfallEngineering SpookyJS issues 97 on the SpookyJS GitHub page .", "I need to open a page in spookyjs then run sum code outside spookyjs context and then open another page .", "I have a nodeJS command-line script which interacts with a website using phantomJS via casperJS spookyJS .", "So how do you use slimerjs as the engine when driving casperjs through spookyjs", "How do I get the value in spookyjs for an asynchronous call", "I m getting a Can t set headers after they are sent error when trying to run a SpookyJS https : github.com WaterfallEngineering SpookyJS a driver for CasperJS script after posted to a URL .", "right : github.com WaterfallEngineering SpookyJS issues 99 https : github.com WaterfallEngineering SpookyJS issues 99 .", "I have been following the Quickstart steps on SpookyJS s github page https : github.com SpookyJS SpookyJS .", "Question .. . .. . Is there anyway to enforce the spookyJs to start at particular step", "How to force start at particular step spookyJs", "I m on the latest SpookyJS 0.2.5 and CapserJS 1.1-beta3 .", "I m trying to send the parametter countryCode to spookyjs function .", "UPDATE : .. . .. . Tried using a function tuple from the SpookyJS documentation with no luck :", "I m controlling CasperJS from a node module via SpookyJS - so using the advice of Artjom B . I was able to determine that I just needed to add an event-listener to the CasperJS options JSON passed into SpookyJS when building the object .", "See https : github.com SpookyJS SpookyJS wiki Introduction for a detailed introduction on how it works .", "I am trying to scrape data from site by spookyjs and store in mongoDB .I am able to get data from the website.But not able to save scraped data from spookyjs environment to mongoDB.To save scraped data I passed my database model instance to spookyjs .I refered below link for it .", "Just to be clear I am using SpookyJS which is a library that allows for a headless CasperJS .", "I threw together a small Lambda function together to crawl a website using the SpookyJS CasperJS and PhantomJS toolchain for headless browsing .", "When I run the hello example from SpookyJS https : github.com WaterfallEngineering SpookyJS it fails with the following error : .. . .. . In fact all examples that I tried result in this error .", "But now I cannot overcome the htaccess protection with SpookyJS .", "Judging by issue 81 https : github.com WaterfallEngineering SpookyJS issues 81 you can do this in SpookyJS : .. . .. . You may also want to update PhantomJS .", "I am using CasperJS and SpookyJS to navigate to a page parse the page HTML and then take some action depending on the HTML of the parsed page .", "SpookyJS hangs if there are any international characters inside spooky.then function .", "reported this issue here https : github.com WaterfallEngineering SpookyJS issues 110", "I would like to have a module that export a spookyjs instance .", "all .. . .. . I can run spookyjs program without a problem .", "It could be other environment issue as spookyjs log seems fine .", "This spookyjs issue https : github.com WaterfallEngineering SpookyJS issues 27 is describes how you can pass values from spooky to casper via then in array notation and back via spooky.emit and spooky.on .", "I m struggling to get node s util functions to output anything from within a spookyJS callback : .. . .. . Is it possible to access the util functions within a callback like this", "I only have spookyjs installed in the node-modules folder of my project but I am only able to successfully execute my scripts or the example one included when casperjs is installed with the global -g flag not when I have it in the same nodes modules as spookyjs .", "For anyone using SpookyJS that code would look roughly like the following :", "I m building a web scraper using spookyjs : https : github.com WaterfallEngineering SpookyJS .. . .. . I created a new spooky object and I m trying to evaluate a function that returns the contents of a certain html tag .", "https : github.com SpookyJS SpookyJS wiki Introduction .. . .. . Below is my code where I extracted data in prod link info variable and pass its values into mongoDB .. . .. . Below is the code of database-schema and model used in above code .", "You probably wanted to create a new function : function Captcha this.phrase function ask .. . and call it later but this will probably not work because you cannot pass functions through contexts from spookyjs context to casperjs context", "I want to store the data extracted from spookyjs to mongoDB.Please suggest where am I doing wrong .", "I git-clone a spookyjs from github to my shell then npm-install and run node examples hello.js .", "They are 3 levels of context using SpookyJS : node spooky casper and the webpage itself .", "I have a strange problem during screen-scraping with spookyjs capserjs .", "However I wasn t able to send back the elements I retrieved using spookyjs .", "I am trying to inject punycode https : github.com bestiejs punycode.js script in my SpookyJS program .", "I don t want to re-initialize spookyjs for the mission but use an existing process of phantomjs .", "because spookyJS is node and node is asynchronous i don t think it will work in the way it is described in your posted article .", "I want to send a post request with JSON body to a particular server using Spookyjs .", "I want to use node global variable in Spooky.js.so how I access a global variable into SpookyJS .", "The main developer of SpookyJS lawnsea answered me : .. . .. . Sounds like that package webpage is conflicting with the native PhantomJS module webpage .", "Since CasperJS supports XPath expressions for almost all of its functions you can translate the CSS selector to an XPath expression : .. . .. . You can then use it like this : .. . .. . The problem is that SpookyJS doesn t expose the XPath utility so you need to do a little workaround that is described in GitHub isse 109 https : github.com SpookyJS SpookyJS issues 109 issuecomment-69525601 .", "package.json : .. . .. . node -v v6.3.0 .. . .. . casperjs --version 1.1.2 .. . .. . phantomjs -v 2.1.1 .. . .. . Problem : spookyjs not work : .. . .. . cd var lib openshift . . app-root runtime repo node-modules spooky examples node hello.js .. . .. . Solution : .. . .. . change transport from http to stdio in your spooky file", "Edit : At the time of writing this SpookyJS didn t support the additional syntax of passing objects by value into waitFor callbacks .", "Thanks you Updating PhantomJS helped me.Where can i find more SpookyJS examples", "EDIT : I m using this construction with spookyjs and it seems there is an issue with objects containing very long strings .", "I am getting the following error in windows while running spookyjs but code is working in linux .", "While using Gulp to run Mocha + SpookyJS tests I am unable to see most console log output .", "Please have another look at what the Introduction wiki page says about JavaScript Environments https : github.com WaterfallEngineering SpookyJS wiki Introduction javascript-environments and the fact that they are isolated https : github.com WaterfallEngineering SpookyJS wiki Introduction javascript-environments-are-isolated .", "When you pass hash of variables to spooky it is converted to a string using JSON.stringify and then gets converted back to an object using JSON.parse in casper environment please refer docs https : github.com SpookyJS SpookyJS wiki Introduction function-tuples so it is impossible to pass mongoose model to casper environment moreover there is no actual reason for that .", "Also when I try to check if the selector exists the answer seems to be yes because I also get the error with nonexistent selector : .. . .. . Code : .. . .. . Error : .. . .. . Because of SpookyJS I use PhantomJS 1.9.7 and CasperJS 1.1.0-beta3 .", "SpookyJS doesn t seem to provide the equivalent function to CasperJS setHttpAuth but you can still pass the username and password during creation through the pageSettings http : docs.casperjs.org en latest modules casper.html pagesettings property :", "There is also a way to specify the direct path to the binary by specifying it in the child.command config option https : github.com WaterfallEngineering SpookyJS blob master lib spooky.js L26", "one way would be to globally save the number of passed steps and recall the spookyjs funktion and passing the number of tests which have been done .", "Why don t you describe your use-case and what you want to achieve instead of showing some arbitrary limitation of spookyjs .", "Hi someone235 why don t to the page calls within one spookyJS session- As Artjom mentioned the thenOpen method will help you .", "But now it failed with weird logs : .. . .. . My question is why does adding some dependencies to SpookyJS lead to such an error and how can this error be avoided", "Example .. . .. . SpookyJs will run step by step Suppose some connection error happened at particular step and server got stopped Now how can I continue the test from particular step instead of running from beginning .", "https : github.com WaterfallEngineering SpookyJS issues 27 .. . .. . So adapting this to your code you should have : .. . .. . I don t know for sure if spooky.waitFor supports this syntax .", "We have a function in SpookyJS that returns a JSON object that contains just one huge array of strings when a GET method is called on it in nodeJS .", "I tried to verify that spookyjs and phantomjs are installed correctly in my app but that isn t as easy as it sounds for someone who uses them for the first time.. .", "Finally I succeed to do what I needed by using PhantomJS-node https : github.com sgentle phantomjs-node instead of SpookyJS .", "Solution : npm-install -g casperjs .. . .. . I assumed that it is enough to call npm-install locally but casperjs must be in the path .", "Both phantomjs casperjs are in the PATH and work from cmd.exe .", "Do you have CasperJS installed and added to path", "I try to call an external function in SpookyJS by doing the same thing than in the wiki : https : github.com WaterfallEngineering SpookyJS wiki Introduction .. . .. . But when I try the following code I have this error : .. . .. . ReferenceError : Can t find variable : test .. . .. . These two following logs work : .. . .. . But the third one is responsible for the error message : .. . .. . Any suggestion", "To access any Casper prototypes in its module including other CasperJS modules you have to do it inside the CasperJS scope .", "Python .. . 3 . casperjs - Installed globally using npm-install -g casperjs .. . .. . In the command-prompt casperjs is working .. . .. . What I have tried : .. . .. . 1 .", "After I installed casperjs globally the example worked fine .", "I m trying to connect to SoundCloud using CasperJS .", "CasperJS is not a node module that you can require .", "You don t need npm to install CasperJS .", "When CasperJS hangs in the debug log there is no error .", "After a lot of hard work my SpookyJS script works as I should and I got my spoils of war an array of values I want to use to query my Collection in my Meteor app but I have a huge problem .", "why don t you use the repeat function from casperjs", "Did you install CasperJS and is Spooky able to find it", "I copied the function string and then regenerated it in the casperjs scope ." ] }
{ "confidence": [ 72.20299530029297, 71.08639526367188, 67.45097351074219, 66.38480377197266, 65.49520111083984, 63.625038146972656, 62.714752197265625, 61.742366790771484, 60.392616271972656, 59.97075271606445, 56.71879577636719, 55.63136291503906, 55.44621276855469, 55.1722412109375, 54.551780700683594, 54.539886474609375, 54.31226348876953, 54.00525665283203, 52.823707580566406, 52.32146453857422 ], "content": [ "Question : I m driving casperjs through spookyjs and I want to use slimerjs rather than phantomjs as the engine for casperjs . When using casperjs you set the engine when calling casperjs from the command-line like this : .. . .. . I thought it may be possible to set the engine when configuring casperjs when using spookyjs like this : .. . .. . But that doesn t work . So how do you use slimerjs as the engine when driving casperjs through spookyjs Comment : Opened this issue https : github.com WaterfallEngineering SpookyJS issues 97 on the SpookyJS GitHub page . .. . Answer : try like this :", "Question : I m driving casperjs through spookyjs and I want to use slimerjs rather than phantomjs as the engine for casperjs . When using casperjs you set the engine when calling casperjs from the command-line like this : .. . .. . I thought it may be possible to set the engine when configuring casperjs when using spookyjs like this : .. . .. . But that doesn t work . So how do you use slimerjs as the engine when driving casperjs through spookyjs Comment : Opened this issue https : github.com WaterfallEngineering SpookyJS issues 97 on the SpookyJS GitHub page . .. . Answer : May be this workaround helps . As casperjs is a a python script that sets variables and starts slimmer phantom you can just modify the script to make slimmer it s default . Just edit usr local bin casperjs and set the engine around line 86 : .. . .. . ENGINE phantomjs ---replace by-- ENGINE slimerjs .. . .. . Good luck .", "Question : How to use mouse in SpookyJS In CasperJS I can use mouse : .. . .. . How can I do it with SpookyJS Comment : this.mouse inside the casper context maybe .. . Answer : To access any Casper prototypes in its module including other CasperJS modules you have to do it inside the CasperJS scope . As explained on https : github.com SpookyJS SpookyJS wiki Introduction :", "Question : I m new to SpookyJS CasperJS and I m trying to figure out the execution flow . This is what I m trying to achieve : .. . .. . load a page .. . .. . store an image of the page .. . .. . pass this image to a function and execute it this process is quite long : 15 seconds .. . .. . wait for the function to return the result .. . .. . use the returned value to fill a field in the form in the loaded page .. . .. . submit the form .. . .. . this is a code snippet which tries to explain the solution I came up with : .. . .. . When I run the application I receive the following error : .. . .. . ReferenceError : Can t find variable : globProcessedImage .. . .. . How do I make globProcessedImage visible in SpookyJS Is this the correct approach to deal with external functions during Web automation Thanks in advance . Comment : This is very similar to your previous question ok spookyjs versus casperjs.. . BTW why is this question tagged casperJS I will remove it Comment : Yes sorry . I needed to understand global-variables in CasperJS first and so the differences in SpookyJs . I just wanted to avoid confusion . .. . Answer : Edit : At the time of writing this SpookyJS didn t support the additional syntax of passing objects by value into waitFor callbacks . So this code doesn t work . .. . .. . In contrast to casperjs spookyjs has three possible contexts : spooky context casper context and page context . What you try is accessing a variable that is defined in the spooky context from the casper context . You can pass variables between the contexts as described in this issue : How to make global-variables available to functions inside casper https : github.com WaterfallEngineering SpookyJS issues 27 .. . .. . So adapting this to your code you should have : .. . .. . I don t know for sure if spooky.waitFor supports this syntax . Comment : Looks like spooky.waitFor is still not able to find spookyGlobProcessedImage : ReferenceError : Can t find variable : spookyGlobProcessedImage Comment : @lerio Then I guess waitFor doesn t work like spooky.then does . You could open an issue in the github project describing your feature request bug . Comment : right : github.com WaterfallEngineering SpookyJS issues 99 https : github.com WaterfallEngineering SpookyJS issues 99 . Thanks", "Question : null .. . Answer : When calling CasperJS from comand line with --remote-debugger-port I can remotelly debug my code using the WebKit inspector as see on this article : https : drupalize.me blog 201410 using-remote-debugger-casperjs-and-phantomjs . On SpookyJs that drives CasperJS from node.js I tried to set the same parameter on the casper initialization as seen bellow : .. . .. . But it is not working . There is any way to use remote debugger from SpookyJS Comment : because spookyJS is node and node is asynchronous i don t think it will work in the way it is described in your posted article .", "Question : When I run the hello example from SpookyJS https : github.com WaterfallEngineering SpookyJS it fails with the following error : .. . .. . In fact all examples that I tried result in this error . I m stuck as I cannot interpret the error message even when looking into the source code . Do you have any ideas I m using Ubuntu with phantomjs 1.9.7 .. . Answer : Solution : npm-install -g casperjs .. . .. . I assumed that it is enough to call npm-install locally but casperjs must be in the path . After I installed casperjs globally the example worked fine .", "Question : I only have spookyjs installed in the node-modules folder of my project but I am only able to successfully execute my scripts or the example one included when casperjs is installed with the global -g flag not when I have it in the same nodes modules as spookyjs . Is there any configuration or step that I may be overlooking here Thank you .. . Answer : CasperJS is not a node module that you can require . It is installed globally -g so that spooky can find the executable in the PATH . You don t need npm to install CasperJS . Just put it somewhere and add its directory to the PATH . As said in the comments http : stackoverflow.com questions 28311061 can C2 B4t-load-casperjs-module-placed-at-the-same-parent-node-modules-directory-as-s 28315939 comment45003629 28315939 it is also possible to put a path to the CasperJS executable shell script as an option during creation : Comment : You are right that is why I wasn t finding it . There is also a way to specify the direct path to the binary by specifying it in the child.command config option https : github.com WaterfallEngineering SpookyJS blob master lib spooky.js L26 Comment : You re right . I added it to my answer but this suggests that you know beforehand where it is installed which is not comfortable everytime .", "Question : I m new to SpookyJS . In the hello.js example which has been provided i tried changing the url .. . .. . http : en.wikipedia.org wiki Spooky the Tuff Little Ghost .. . .. . to .. . .. . https : www.twitter.com .. . .. . or .. . .. . www.facebook.com with https .. . .. . none of these seem to be opening . PhantomJS version is 1.9.0 .. . Answer : This may be very well related the POODLE problem of PhantomJS . Reference http : stackoverflow.com a 26419531 1816580 It is usually fixed by passing --ssl-protocol tlsv1 and possibly --ignore-ssl-errors true on the commandline . Judging by issue 81 https : github.com WaterfallEngineering SpookyJS issues 81 you can do this in SpookyJS : .. . .. . You may also want to update PhantomJS . This is fixed in 1.9.8 and later but CasperJS doesn t currently 1.1-beta3 support PhantomJS 2 . Either use the master branch of CasperJS which does support PhantomJS 2 or stick to 1.9.8 . Comment : Thanks you Updating PhantomJS helped me.Where can i find more SpookyJS examples", "Question : I have a site that is behaving differently when I interact with it in a traditional browser versus spooky casper phantom . I would like to debug by printing out the entire http header requests and responses to the console or a file to see what is different between my browser and the phantom browser similar to how I would using developer tools on the browser . How can I get all http-request response including headers in a spooky event handler .. . Answer : I m controlling CasperJS from a node module via SpookyJS - so using the advice of Artjom B . I was able to determine that I just needed to add an event-listener to the CasperJS options JSON passed into SpookyJS when building the object . For anyone using SpookyJS that code would look roughly like the following :", "Question : I need to periodically login and scrape some data from a particular site . I wrote a CasperJS script to run on Heroku in order to take care of it . Here is what I want to be able to do : .. . .. . Then at the final step of the spooky script : .. . .. . Unfortunately it doesn t seem to be possible for some reason as the function passed to scrapeStuff doesn t make it inside the .then . can t find variable : callback Instead I have to use this.emit and monitor it with spooky.on - you can see an example of how this is done here https : github.com leesei heroku-casper-node blob master web.js . The problem with using emit is that I want to receive the HTML of the scraped page upon request . So I want to access scrape then wait 10 seconds while it s working and receive the page not call it assume it succeeded and request another URL to finally get the HTML . Can this be done with SpookyJS Maybe there is a better way using CasperJS directly . .. . Answer : They are 3 levels of context using SpookyJS : node spooky casper and the webpage itself . You can pass data between the 3 contexts but it will be serialized and unserialized so you are limited to pure JSON object . See https : github.com SpookyJS SpookyJS wiki Introduction for a detailed introduction on how it works .", "Question : null .. . Answer : all .. . .. . I can run spookyjs program without a problem . However if it runs over long period of time e.g . 24 hours or 48 hours continuously the program stops with this message . Anyone got a clue for this error It could be other environment issue as spookyjs log seems fine . Error : Child terminated with non-zero exit code 3221225477 details : code : 3221225477 signal : null .. . .. . Setting : .. . .. . .. . .. . .. . My working environments : .. . .. . 1 . node : v0.12.4 .. . 2 . casperjs : 1.1.0-beta5 .. . 3 . phantomjs : 1.9.7 .. . 4 . npm : 2.10.1 .. . 5 . os : windows-10", "Question : null .. . Answer : I have installed SpookyJS to execute CasperJs commands in Node.js . I Installed it with this command : npm-install spooky I m using a Centos machine . the error : .. . .. . Thanks in advance Comment : The example is working . Do you have CasperJS installed and added to path Comment : I have installed CasperJs but not added to the path I have added and now works Thanks very much Comment : Future visitors can also read the procedure described at the following QA : stackoverflow.com questions 27688804 http : stackoverflow.com questions 27688804 how-to-debug-any-node-js-child-process-error-spawn-enoent", "Question : I have a strange problem during screen-scraping with spookyjs capserjs . I want to catch information from the following website : https : www.rwe-smarthome.de is-bin INTERSHOP.enfinity WFS RWEEffizienz-SmartHome-Site de DE - EUR ViewApplication-DisplayWelcomePage . Because the site contains more than one page of products I want to open the other sites too . Normally one could use .. . .. . to achieve this . For some strange reasons this is not working here . Please have a look at the following code : .. . .. . I receive an error .. . .. . Which is strange because if the selector DOM object does not exists it should fail at waitUntilVisible . Also when I try to check if the selector exists the answer seems to be yes because I also get the error with nonexistent selector : .. . .. . Code : .. . .. . Error : .. . .. . Because of SpookyJS I use PhantomJS 1.9.7 and CasperJS 1.1.0-beta3 . Does anyone have an idea about this .. . Answer : This is very likely related to a bug in PhantomJS 1.x which doesn t correctly find elements based on CSS selectors that use : nth-child . See this question http : stackoverflow.com questions 27835506 waitforselector-passes-but-assertexists-fails-for-the-same-selector for more information . Since CasperJS supports XPath expressions for almost all of its functions you can translate the CSS selector to an XPath expression : .. . .. . You can then use it like this : .. . .. . The problem is that SpookyJS doesn t expose the XPath utility so you need to do a little workaround that is described in GitHub isse 109 https : github.com SpookyJS SpookyJS issues 109 issuecomment-69525601 . Comment : Great thank you so much For anyone who struggle with Webstorm and this solution the selectXPath has to be put into one row otherwise there will be an error .", "Question : null .. . Answer : I am using CasperJS and SpookyJS to navigate to a page parse the page HTML and then take some action depending on the HTML of the parsed page . However pulling HTML from the page blocks all further spookyInstance.then calls from executing . However when I replace the HTML fetching code with any other code subsequent .then calls execute without issue . Current Code : .. . .. . Replacement code that works : .. . .. . Is there something I m missing here Is there something about interacting with the page HTML itself that prevents further execution I m on the latest SpookyJS 0.2.5 and CapserJS 1.1-beta3 . All help would be appreciated . Comment : A comment from @KevinGagnon http : stackoverflow.com users 4962411 kevin-gagnon who can t post a comment so posted an answer instead : Can we see the event code .", "Question : null .. . Answer : I am using spookyjs https : github.com SpookyJS SpookyJS to test my application . Question .. . .. . Is there anyway to enforce the spookyJs to start at particular step How to force start at particular step spookyJs Example .. . .. . SpookyJs will run step by step Suppose some connection error happened at particular step and server got stopped Now how can I continue the test from particular step instead of running from beginning . Any suggestion will be grateful Comment : one way would be to globally save the number of passed steps and recall the spookyjs funktion and passing the number of tests which have been done .", "Question : null .. . Answer : i created a node latest app in openshift . package.json : .. . .. . node -v v6.3.0 .. . .. . casperjs --version 1.1.2 .. . .. . phantomjs -v 2.1.1 .. . .. . Problem : spookyjs not work : .. . .. . cd var lib openshift . . app-root runtime repo node-modules spooky examples node hello.js .. . .. . Solution : .. . .. . change transport from http to stdio in your spooky file Comment : after spending a lot of time i found solution : cd OPENSHIFT REPO DIR node-modules spooky examples npm-install tiny-jsonrpc --save", "Question : I wrote a little bit code to go to my Wordpress page with CasperJS with a htaccess protection . The script should login an then later update the plugins . At this time I can login and create a screenshot from the plugins who should updated . also the CasperJS works fine .. . .. . Now I want that this snippet work on a server . So I use .. . .. . express spooky node .. . .. . And I found this spooky http : stackoverflow.com questions 23768800 communication-between-node-express-and-spooky-casper-js snippet and tried to insert my CasperJS code into it . But now I cannot overcome the htaccess protection with SpookyJS . Any idea Also this code below should work on a nodejs server with spooky . .. . Answer : SpookyJS doesn t seem to provide the equivalent function to CasperJS setHttpAuth but you can still pass the username and password during creation through the pageSettings http : docs.casperjs.org en latest modules casper.html pagesettings property : Comment : Thx this works but you have a small mistake userName instead of username : Comment : Thanks fixed it .", "Question : null .. . Answer : Is it possible to chain missions to spookyjs after initialization Something like this : .. . .. . But when I do this I get this error : Comment : You can put the thenOpen call directly behind the start call but I guess you re asking something else . Why don t you describe your use-case and what you want to achieve instead of showing some arbitrary limitation of spookyjs . Comment : I need to open a page in spookyjs then run sum code outside spookyjs context and then open another page . I don t want to re-initialize spookyjs for the mission but use an existing process of phantomjs . Comment : Hi someone235 why don t to the page calls within one spookyJS session- As Artjom mentioned the thenOpen method will help you .", "Question : null .. . Answer : How do I get the value in spookyjs for an asynchronous call for example : I have a variable x whose value gets modified by an asynchronous function . So how does spookyjs detect this change of value", "Question : I have an weird error and can t find the cause of it for the last few hours.. . I have a meteor app that scrapes some webpages for information and everything works fine as long as I use reuqest and cheerio for static pages but now I have a dynamic site and I wanted to use phantomjs casperjs and spookyjs for this one but here I get some bug.. . My code is as follows I import the npm modules at the start : .. . .. . And sometime later I want to use spooky to scrape some webpage : .. . .. . But as soon as I call the method I get the following error message : .. . .. . I am doing something completly wrong and I have no clue why it isn t working.. . I tried to verify that spookyjs and phantomjs are installed correctly in my app but that isn t as easy as it sounds for someone who uses them for the first time.. . Comment : Did you install CasperJS and is Spooky able to find it Comment : Yeah I checked that . The problem was that I had to create a new spooky as follows : var Spooky Meteor.npmRequire spooky var spooky new Spooky Now it works like a charm.. . mostly.. . Comment : You can provide the answer yourself if you solved it . .. . Answer : Like normally with spooky you have to create a new Spooky Object before you can start and run it.. ." ] }
[ "yes-answer-long", "yes-answer-short" ]
node.js
UNK_RELATION
google-closure-library@open-source@132
google-closure-library -- closure library is a javascript-framework used by google and one of three components to closure tools an @placeholder toolset to aid with developing front-end web-applications .
{ "confidence": [ 72.1456069946289, 71.36715698242188, 66.55355072021484, 65.85269165039062, 65.54733276367188, 65.1982421875, 65.1982421875, 63.397274017333984, 63.249267578125, 62.03675842285156, 61.977935791015625, 61.86665344238281, 61.48905944824219, 60.77372741699219, 60.37107467651367, 60.12936782836914, 59.74057388305664, 59.74057388305664, 58.79552459716797, 58.61412048339844, 57.300113677978516, 57.05540466308594, 57.04703903198242, 57.04703903198242, 56.82209777832031, 56.427886962890625, 56.32833480834961, 56.13091278076172, 56.03420639038086, 55.939781188964844, 55.82085037231445, 55.349571228027344, 55.20049285888672, 55.20049285888672, 55.20049285888672, 55.09309768676758, 54.98987579345703, 54.96573257446289, 54.91253662109375, 54.855873107910156, 54.78855895996094, 54.78855895996094, 53.127315521240234, 53.031700134277344, 53.020896911621094, 53.00294494628906, 52.88710021972656, 52.7546501159668, 52.5069580078125, 52.5069580078125, 52.5069580078125, 52.5069580078125, 52.29634094238281, 51.91889190673828, 51.91889190673828, 51.91889190673828, 51.727760314941406, 51.727760314941406, 51.68646240234375, 51.663848876953125, 51.59375762939453, 51.4919319152832, 51.469905853271484, 51.30753707885742, 51.18476104736328, 51.1422119140625, 51.1409912109375, 51.13754653930664, 51.08710479736328, 50.915802001953125, 50.64384841918945, 50.5765380859375, 50.5765380859375, 50.5765380859375, 50.5765380859375, 50.5765380859375, 50.5765380859375, 50.5765380859375, 50.5765380859375, 50.490867614746094, 50.356353759765625, 50.34932327270508, 50.015106201171875, 50.0080451965332, 49.724021911621094, 49.629600524902344, 49.473472595214844, 49.473472595214844, 49.45051574707031, 49.32912063598633, 49.32912063598633, 49.28445053100586, 49.2689208984375, 49.22535705566406, 49.08870315551758, 49.03422546386719, 48.85690689086914, 48.79092025756836, 48.79092025756836 ], "content": [ "Use the GitHub version : github.com google closure-library https : github.com google closure-library .", "See github.com google closure-library blob master closure goog https : github.com google closure-library blob master closure goog base.js L1282", "Google Closure Stylesheet renaming is designed for use with the Google Closure Library .", "I m using a third-party library Google Closure Library http : code.google.com closure library with many .CSS files .", "I am using the Google Closure Library btw .", "The Google Closure Library allows you to compile and optimize your JavaScript .", "I am trying to teach myself the Google Closure javascript library .", "Hi has any one used google s Closure Library https : developers.google.com closure in building Phonegap applications on Android .", "I came across the goog.math.isFiniteNumber function in the Google Closure Library http : closure-library.googlecode.com svn svn bc 4 trunk closure goog docs closure goog math math.js.html .", "I have a quite unusual problem with google-closure-library .", "Google Closure Templates and Google Closure Library are different pieces of software that do not share any dependency .", "See the discussion on support for table grid components in the Closure Library https : groups.google.com forum fromgroups searchin closure-library-discuss table 2420grid closure-library-discuss x1afFp9Y1Ho 31xhS792UT0J .", "The biggest advantage of Closure Library is that is is designed for Closure Compiler .", "https : github.com google closure-library blob master closure goog demos tree demo.html", "The Closure Compiler can work without the Closure Library the Closure Library can work without the Closure Compiler .", "However the Closure Library https : developers.google.com closure library follows the convention that each namespace is provided in only one file .", "I m trying to create a custom event dispatcher in google-closure js library .", "I received an answer to this in the google-closure-library discussion group .", "I m trying to use Closure Compiler and Closure Library .", "I ve just started google-closure .", "Closure Library and Closure Templates do not depend on one another so you can certainly use Closure Templates with jQuery without pulling in the Closure Library or the Closure Compiler .", "How can I test if an JavaScript object is an implementation of an interface using the Google Closure inheritance mechanism https : developers.google.com closure library docs introduction", "Have you taken a look at the goog.net.iframeIo class in the Google Closure Library", "I am trying to use Google Closure but called through a php library .", "I ve recently created a JavaScript library using Google s Closure Compiler : https : github.com bvaughn task-runner .. . .. . I intend for this library to be used by applications that also require the full Closure Library and so I want the built version of my library Task Runner not to include a subset of Closure Library .", "This editing surface is not included in Closure Library .", "Is it possible to use YUI3 Uploader http : yuilibrary.com yui docs uploader with Google Closure Library http : code.google.com p closure-library", "I have this jquery library that needs to initialize like so but I d like to call it through Google Closure in the code instead .", "In this snippet of Google Closure javascript code involving a constructor why is goog.base this necessary", "I tried to create deps.js file using closure-library closure bin build depswriter.py in Windows 7 .", "Unfortunately this excludes a lot of great frameworks such as dojo http : dojotoolkit.org Google Closure http : code.google.com closure library and jQuery http : jquery.com .", "Closure Library provides the function goog.dom.safeHtmlToNode html https : github.com google closure-library blob fab924fd90b343996a7a2dbd0ebc1394e63e38a9 closure goog dom dom.js L907 to create a document fragment Node from a goog.html.SafeHtml object which can be created using goog.html.sanitizer.HtmlSanitizer as shown below .", "in my project I m using google-closure .", "Or is it possible to use ClojureScript w o Google Closure", "I recently switched to Google closure for a new project .", "I am currently experimenting https : github.com highsource javascript-module-loaders-comparison with different JavaScript module formats and loader and also wanted to try out Google Closure https : developers.google.com closure library .", "More : developers.google.com closure library docs gettingstarted https : developers.google.com closure library docs gettingstarted", "Google Closures also comes with its own library that is similar to jQuery and that provides functions and utilities to write your own code : code.google.com closure library docs tutorial.html http : code.google.com closure library docs tutorial.html", "The difference between using Closure-compiler with Closure-library as compared to more traditional JavaScript libraries is that ONLY the parts of the code determined to be called and used are included in the output .", "Can anyone recommend a library or pure JavaScript approach to two-way data-binding in Closure Library", "Is there a geolocation API part of google-closure ultimately for use in ClojureScript", "What s the equivalent of using Google Closure to JQuery document .foo please", "Calling goog.provide tutorial.notepad does not tell the Closure Compiler about the class tutorial.notepad.Note .. . .. . Google Closure code is extremely verbose in its raw library form .", "Others who utilize your library with Closure-compiler or Closure-library will need to use an externs file and include your library AFTER compilation .", "If Closure-library is used in both projects it will only be included once in the build-process .", "As of May 2012 the Closure Library does not provide a table grid-layout component .", "Google Closure doesn t run in JSP .", "Closure Linter is designed to enforce the Google JavaScript Style Guide http : google-styleguide.googlecode.com svn-trunk javascriptguide.xml .", "How to handle multiple file uploads with Google Closure", "I m compiling my code with the Google Closure compiler .", "It s important to remember that Google Closure is a collection of tools .", "However this is not JQuery vs Google closure in any manner .", "Closure library https : developers.google.com closure library like jQuery and jQuery ui but can be compiled along with your code .. . 5 .", "like jQuery google-closure allows traversing dom structure with the string-based queries using a dedicated component of the library .", "Long story short Google Closure is a tool while jQuery is a library similar to Prototype .", "I am using google-closure-library at the client don t ask why company MO .", "Take a look at this thread http : groups.google.com group closure-library-discuss browse thread thread fad6c47c76941a44 on closure discussion group .", "There is a rather small list of primitive functions defined in Closure-library that are completely removed replaced when compiled with Closure-compiler .", "If Task Runner includes a subset of Closure Library and another application includes the full Closure Library a race-condition will exist between which loads Closure last last in wins .", "See the wiki page https : github.com google closure-compiler wiki Manage-Closure-Dependencies to know about the options flags Closure Compiler provides for that .", "My original idea was to data-bind to a JavaScript object but have yet to find a good way of data-binding in closure library .", "Dossier https : github.com jleyba js-dossier is currently 2016 being used to build the Closure Library documentation http : google.github.io closure-library api index.html .", "There are much better build tools in the closure library repository that break up what calcdeps used to do .", "Reading https : github.com google closure-library issues 382 depswriter.py is no longer used within Google but it looks like the script is still maintained .", "Nothing is in Closure for this right now .", "The Closure compiler http : code.google.com closure compiler will .", "FWIW the Plovr experimental-exclude-closure-library http : plovr.com options.html experimental-exclude-closure-library option seems to somewhat describe the functionality I m looking for .", "I was reading through the code segment of closure library https : github.com google closure-library blob master closure goog dom dom.js I saw this code fragment there : .. . .. . Why we have wrapped the document reference in the getter method", "Helpful reference article : https : developers.google.com closure library docs tutorial", "More https : groups.google.com forum searchin closure-library-discuss dispatchEvent closure-library-discuss 6q6xPNriZt4 z47UEB nFK0J discussions https : groups.google.com forum topic closure-library-discuss cEtEsx M42o .", "The Closure Library unlike any other library will compile your javascript to raw heavily minified code with semantic features .", "Does anyone have experience with Google Closure Editor WYSIWYG", "I m thinking of moving from CKEDITOR to Google Closure Editor WYSIWYG .", "The Google Closure editor is a wrapper around the built-in browser editing capabilities .", "Is there in google-closure any calendar component that allows selecting range of dates", "But to be able to use Google Closure i need to include goog base.js file .", "I m trying to build my project using google-closure-compiler .", "Google Closure has no control over what the browser calls the document variable .", "We have an application that uses both the google-closure and dojo libraries .", "Not using closure-library mainly angular jquery", "possible duplicate of How to make Jquery work with google-closure-compiler http : stackoverflow.com questions 16461915 how-to-make-jquery-work-with-google-closure-compiler", "A Google Closure library team member asserts http : groups.google.com group closure-library-discuss browse thread thread 1beecbb5d6afcb41 075c536259653946 that waiting for DOMContentReady event is a bad practice .", "I am trying to implement a custom component using closure tools .", "goog.inherits childConstructor parentConstructor https : github.com google closure-library blob master closure goog base.js L2181 .. . .. . goog.inherits establishes the prototype chain from the child constructor to the parent constructor .", "Presumably Google Closure developers could have hard-coded this into the Closure Compiler but by being explicit they avoid adding special cases to the Closure Compiler for properties that exist on the global object .", "I m intending my library TR to be used by another application that ALSO uses the full Closure Library CL .", "Outputing the HTML required use of Google Closure-templates .", "You must really like Google closure P", "I m cleaning up my code with the gjslint tool from Google Closure Tools .", "...Closure rulez", "not private-by-closure .", "The following options may be used to prevent the Closure Compiler from renaming symbols : .. . .. . @export https : developers.google.com closure compiler docs js-for-compiler also see : goog.exportSymbol https : code.google.com p closure-library source browse closure goog base.js spec svn60ec04c13f5c3f9b471fb1c3eb6b5588670aeb99 r 60ec04c13f5c3f9b471fb1c3eb6b5588670aeb99 1447 or goog.exportProperty https : code.google.com p closure-library source browse closure goog base.js spec svn60ec04c13f5c3f9b471fb1c3eb6b5588670aeb99 r 60ec04c13f5c3f9b471fb1c3eb6b5588670aeb99 1476 .. . Export symbols by storing them on the global object referenced by a string .", "But I suspect this is a Closure mistake .", "It s actually fairly easy to write a Google Closure Library component that uses SWFUpload for multiple file uploading .", "@gonvaled Have a look at developers.google.com closure compiler https : developers.google.com closure compiler That is the homepage to the closure-compiler .", "So how can I use emscripten in conjunction with the closure library and closure compiler", "Google Closure would help you make your own javascript code minimized to allow for a speedier delivery over the Internet .", "There is no hybrid approach where you compile your code but exclude Closure-library .", "More info and examples here : https : developers.google.com closure library docs tutorial" ] }
{ "confidence": [ 78.61125946044922, 75.99044799804688, 72.87181091308594, 72.51724243164062, 69.97329711914062, 69.56382751464844, 69.33500671386719, 68.04779815673828, 67.68513488769531, 67.2558364868164, 66.91371154785156, 66.87322998046875, 66.7131576538086, 66.28176879882812, 66.2638931274414, 66.17256927490234, 66.04397583007812, 65.8946762084961, 65.74472045898438, 65.23799133300781 ], "content": [ "Question : Considering .. . .. . business background .. . community support .. . available extensions .. . default set of features .. . simplicity of use .. . and reliability .. . .. . why do you prefer one over the another Comment : I think it will be hard to say why one is preferred over the other until people get to experiment with applications and see what the limits of closure is . Comment : Some syntax comparisons here : derekslager.com blog posts 2010 06 http : derekslager.com blog posts 2010 06 google-closure-introduction.ashx Comment : This article http : sayspy.blogspot.com 2010 10 lessons-learned-porting-from-jquery-to.html may also help with the decision . Key lesson : Closure is an ecosystem . It is not like jQuery where you just use it here and there to make accessing or manipulating the DOM easier . If you want to truly use Closure you have to make a commitment to truly use it . .. . Answer : I ll try to add my piece of information . More than another JS lib .. . .. . As I understand it Google Closure is not only another JS library but it is also a set of tools that will allow you to optimize your JS code . Working with jQuery gives you good tools and a lightweight library but it does not minify your own code . The Closure compiler http : code.google.com closure compiler will . The closure inspector http : code.google.com closure compiler docs inspector.html may also be useful as sometimes minified code has a different behavior than the original one and is a pain to debug . It integrates with Firebug http : getfirebug.com and support unit tests which are both developers best friends nowadays . Documentation .. . .. . I guess that as any new library VS a well established one it will lack the availability of tons of extensions and tutorial that jQuery has . However being pushed by Google should ensure that support and reliability will be both pretty good . The current documentation http : closure-library.googlecode.com svn docs index.html and tutorial http : code.google.com closure library docs tutorial.html both seem really good too . Features .. . .. . The features of Closure look decent though and its modular architecture is promising too . I guess Google has been using it internally for a long time which means that you could expect all basic features and more to be implemented and probably in a very optimized and scalable way . They are trying to present it as the STL of JavaScript so they should have polished it . After looking at the features more closely it seems that this may be a step forward for web-applications development compared to existing libraries as jQuery . It guess it benefits internal developments at Google but things like detecting the online state see goog.events.OnlineHandler http : closure-library.googlecode.com svn docs class goog events OnlineHandler.html easy integration of AJAX requests and JS actions in the browser-history see goog.History http : closure-library.googlecode.com svn docs class goog History.html or the legions of great widgets they provide see goog.ui package http : closure-library.googlecode.com svn docs namespace goog ui.html may help all of us building even more awesome webapps It comes with templates features http : code.google.com closure templates that integrates with Java who said GWT http : code.google.com webtoolkit so this may also be another plus for Closure . Ease of use .. . .. . Finally it looks pretty simple to use . The syntax may be a bit more verbose than the short jQuery function but with IDEs and auto-completion it s not a real problem . Moreover I d say we can expect a good integration in IDEs like Eclipse coming from Google . EDIT : as requested let me say a few words about the GWT reference . Google Web Toolkit is a Java library that allows to create AJAX-enabled web interfaces and that generates and optimizes the required JavaScript code . As Google Closure allows to create Templates that can be used both client- and server-side using JavaScript and Java my guess is that it will soon be possible to use them jointly if it s not already the case . Comment : Detailed and meaningful answer thank you . Could you please explain what that reference to GWT means I m afraid I didn t get that . Comment : I think you should also mention the template library Soy in your More than section . The same template file can be used in both server Java side and client-side . Really nice implementation IMO . Means we can just send down JSON in AJAX queries rather than sending down HTML - saves bandwidth . Comment : I just discovered a critique against Closure but perhaps it s just FUD : sitepoint.com blogs 2009 11 12 http : www.sitepoint.com blogs 2009 11 12 google-closure-how-not-to-write-javascript Comment : The critique isn t FUD and thanks for the link . The critique is focused on how the javascript code isn t optimal everywhere . This may be valid but it misses the larger point . As I understand it Closure targets really complex JS applications on the scale of GMail and that has some consequences - such as not every line being optimal since everything isn t written by a single brilliant coder . But conversely it might scale further as a software-engineering framework . Comment : @nalpy As suggested by the comments this article didn t mention that thelibrary gots a COMPILER not a minifier which might optimize these coding issues .", "Question : Can anyone help me in creating a table grid-layout using closure Libray Is there any widget available for it I searched but din t find any Please Help .. . Answer : As of May 2012 the Closure Library does not provide a table grid-layout component . There is a table sorter see demo http : closure-library.googlecode.com svn-trunk closure goog demos tablesorter.html but it only decorates traditional HTML tables . You might also want to take a look at the Visualization Table https : developers.google.com chart interactive docs gallery table which is part of Google Chart Tools . See the discussion on support for table grid components in the Closure Library https : groups.google.com forum fromgroups searchin closure-library-discuss table 2420grid closure-library-discuss x1afFp9Y1Ho 31xhS792UT0J .", "Question : We are starting to create an application using JavaScript and HTML5 which will use rest API to access server resources taking the advantage of jQuery awesomeness and easiness which our dev team is already comfortable with . This application is going to be made multilingual . We had decided later that we will write our DOM using JavaScript which will allow us the flexibility to use our UI bits for integration with our other applications and will create our own widgets using jQuery UI widgets . Then by just adding a script-tag referencing JavaScript file in a relevant page of our other application we will have most of our integration for that particular feature done . Because it takes lot of amount of coding for creating DOM using JavaScript we started looking in search of tools which will help us easily convert HTML to JavaScript for creation of UI and hence Google Closure Templates came in . At this time what I thought of was using Google closure for writing the UI DOM bit as it can quickly give me JavaScript for my DOM and then for other JavaScript i.e . for server-side communication and for other UI logic like changing of UI once got response from the server and x should change to y on click of z kind of things which needs to be handwritten I should use jQuery which is easy to write . But after looking at this question http : stackoverflow.com q 1690197 148271 I see that both are compared against each other and it left me wondering on few things . 1 . If I go by what I ve thought of doing then will I be able to call the functions generated by Google Closure in my jQuery widgets to render the UI 2 . If I leave jQuery and just use Google Closure will it be enough for my requirements 3 . As I started reading Google Closure documentation I found that it has a whole new world of it s own and learning curve is involved . How much it is If it is not much then our team of 5 devs will be ready to learn it . On 2 and 3 it would be great if anyone who has already used it can provide some insight . Note : - Just in case if it has any relevance we are working on Microsoft .NET stack for server-side . Comment : Have you considered jquery-templates The Goog library is an entire framework in it s own right and is more complex then jQuery . Comment : What do you want to do Google Closure Templates and Google Closure Library are different pieces of software that do not share any dependency . Comment : @marc so does that mean I will be able to call the functions generated by Google Closure Templates in my jQuery widgets to render the UI Comment : imho yes because it has nothing to do with the library Comment : Yes I think this is a way to go that wont cause problems . .. . Answer : Closure Library and Closure Templates do not depend on one another so you can certainly use Closure Templates with jQuery without pulling in the Closure Library or the Closure Compiler . To use Templates with jQuery you translate your Closure Template files aka Soy files using SoyToJsSrcCompiler.jar as described in the documentation http : code.google.com closure templates docs javascript usage.html . Then you will have one JavaScript file for each Soy file where each JavaScript file contains one function per template defined in the corresponding Soy file . To use the generated JavaScript functions you must also include soyutils.js http : code.google.com p closure-templates source browse trunk javascript soyutils.js which is a set of utilities required by the generated functions . Therefore your production system should include the following JavaScript files concatenated minified in this order : .. . .. . soyutils.js .. . JavaScript generated from Soy .. . jQuery library .. . Your application code which presumably depends on both jQuery and your template functions . Getting up to speed on Closure Templates is considerably easier than learning the Library or the Compiler so I m sure that your dev team can pick it up quickly . I believe the online documentation http : code.google.com closure templates docs overview.html is thorough without being overwhelming so the syntax and usage should not take long to learn . Note that if you decide to use the Closure Library instead of jQuery at some point you should include soyutils usegoog.js http : code.google.com p closure-templates source browse trunk javascript soyutils usegoog.js instead of soyutils.js http : code.google.com p closure-templates source browse trunk javascript soyutils.js . Though if you decide to rewrite your application logic to depend on Closure Library instead of jQuery after you have a substantial amount of code this small change will likely be the least of your concerns That is I m sure you could ultimately write your entire application using Google Closure but migrating from one JavaScript library to another for a large application will likely require so many code changes that you may be too intimidated to take on the migration . Comment : Thanks very much for your help : - Comment : I will be grateful if you would also be able to help me with multilingual capabilities of Closure Templates http : stackoverflow.com q 7008419 148271 .", "Question : Considering .. . .. . business background .. . community support .. . available extensions .. . default set of features .. . simplicity of use .. . and reliability .. . .. . why do you prefer one over the another Comment : I think it will be hard to say why one is preferred over the other until people get to experiment with applications and see what the limits of closure is . Comment : Some syntax comparisons here : derekslager.com blog posts 2010 06 http : derekslager.com blog posts 2010 06 google-closure-introduction.ashx Comment : This article http : sayspy.blogspot.com 2010 10 lessons-learned-porting-from-jquery-to.html may also help with the decision . Key lesson : Closure is an ecosystem . It is not like jQuery where you just use it here and there to make accessing or manipulating the DOM easier . If you want to truly use Closure you have to make a commitment to truly use it . .. . Answer : The Google Closure Library allows you to compile and optimize your JavaScript . It s not a library like jQuery is . jQuery is something that provides you with functions that allow you to write your own javascript faster . Google Closure would help you make your own javascript code minimized to allow for a speedier delivery over the Internet . Long story short Google Closure is a tool while jQuery is a library similar to Prototype . Comment : That is not exactly true . Google Closures also comes with its own library that is similar to jQuery and that provides functions and utilities to write your own code : code.google.com closure library docs tutorial.html http : code.google.com closure library docs tutorial.html Comment : Ah ok Thanks for correcting me Comment : +1 For trying to be helpful : Comment : you deserve -1 not -3 :", "Question : Is there a geolocation API part of google-closure ultimately for use in ClojureScript I ve been looking for it but all I can find is something that looks like an old shim https : code.google.com p closure-compiler source browse externs w3c geolocation.js r 7e3ff71630c12fd69bb63e3809f0a2b02e5d283b . If there is none is it because Google doesn t use that feature of web browsers they find our location using other means or because the browser API doesn t require that already unified and what would be the best alternative in ClojureScript Comment : Nothing is in Closure for this right now . Generally Closure only wraps these native APIs when there are cross-browser compatibility issues is potential for a polyfill or potential for improvement . I m not personally too familiar with these APIs but my guess is it s not in Closure because it s pretty standardized across the browsers that implement it . Is there something specific you re concerned about Comment : @joeltine that makes sense . I am concerned because 1 caniuse.com feat geolocation http : caniuse.com feat geolocation - look at known issues and 2 because of the link I provided to an interface without implementation why . Comment : The shim link you provided is what s called an externs file . It s used in conjunction with the Closure Compiler to avoid renaming certain properties . See this resource https : developers.google.com closure compiler docs api-tutorial3 hl en for more info . Comment : On a side note you should definitely avoid the Google code repository for Closure it s obsolete . Use the GitHub version : github.com google closure-library https : github.com google closure-library . Comment : @joeltine thanks that makes sense now . I did not find it on github though . .. . Answer : Nothing is in Closure for this right now . Generally Closure only wraps these native APIs when there are cross-browser compatibility issues is potential for a polyfill or potential for improvement . I m not personally too familiar with these APIs but my guess is it s not in Closure because it s pretty standardized across the browsers that implement it . The shim link you provided is what s called an externs file . It s used in conjunction with the Closure Compiler to avoid renaming certain properties . See this resource https : developers.google.com closure compiler docs api-tutorial3 hl en for more info .", "Question : Considering .. . .. . business background .. . community support .. . available extensions .. . default set of features .. . simplicity of use .. . and reliability .. . .. . why do you prefer one over the another Comment : I think it will be hard to say why one is preferred over the other until people get to experiment with applications and see what the limits of closure is . Comment : Some syntax comparisons here : derekslager.com blog posts 2010 06 http : derekslager.com blog posts 2010 06 google-closure-introduction.ashx Comment : This article http : sayspy.blogspot.com 2010 10 lessons-learned-porting-from-jquery-to.html may also help with the decision . Key lesson : Closure is an ecosystem . It is not like jQuery where you just use it here and there to make accessing or manipulating the DOM easier . If you want to truly use Closure you have to make a commitment to truly use it . .. . Answer : In my brief look at the API I find the differences between jQuery and Closure to be striking . jQuery is basically just a simplified way to do many frequent operations in a cross-browser way . Closure is a framework that is very new in that they provide a cross-browser way to use the canvas tag for example and they have added new events . So this is adding onto what we typically do with javascript they are taking many operations that people want to do and putting them into the API . For example they have an event to tell if the online state has changed . So you can tell if the system is online . They have javascript functions that use tools such as Google Gears which continues with the fact that they have extended what can be done with Javascript . It will take me a couple of days to digest all the changes but I can see that this could have a big impact on web-applications that can be developed .", "Question : Considering .. . .. . business background .. . community support .. . available extensions .. . default set of features .. . simplicity of use .. . and reliability .. . .. . why do you prefer one over the another Comment : I think it will be hard to say why one is preferred over the other until people get to experiment with applications and see what the limits of closure is . Comment : Some syntax comparisons here : derekslager.com blog posts 2010 06 http : derekslager.com blog posts 2010 06 google-closure-introduction.ashx Comment : This article http : sayspy.blogspot.com 2010 10 lessons-learned-porting-from-jquery-to.html may also help with the decision . Key lesson : Closure is an ecosystem . It is not like jQuery where you just use it here and there to make accessing or manipulating the DOM easier . If you want to truly use Closure you have to make a commitment to truly use it . .. . Answer : The biggest advantage of Closure Library is that is is designed for Closure Compiler . This opens completely new possibilities for JavaScript development.. . The compiler has several cool features : .. . .. . It compiles readable JavaScript into compressed machine-readable JavaScript - it has the best compression ratio in ADVANCED mode . Documentation of the code with JSDoc Tags is important : the compiler reads it and you get warnings during compilation for typos in documentation wrong use of a @constructor wrong type of a variable misuse of a field annotated with @private and @protected etc . If you write a reusable JavaScript library such as OpenLayers or Google Maps you formally export your public API - and the compiler optimizes your internal code . The end applications can be compiled together with the library - and then the unused parts of the library are removed from the produced code . Dependencies are solved automatically by the compiler . Compiler accepts constants to remove unwanted functionality - this allows compilation only for particular browser such as Mobile WebKit for only one of Quirks mode or Strict mode compilation without support of IE6 etc . Debugging with FireBug is possible even for the compiled version of the source code . Compiler supports generation of dynamically loadable modules which can significantly speed up loading of the end application because the code for advanced functionality can be loaded only when it is required . For details have a look at : http : blog.klokantech.com 2010 12 closure-compiler-for-openlayers-3x.html", "Question : I m trying to migrate from the closurebuilder.py script to the Closure compiler https : developers.google.com closure compiler because of this message : .. . .. . is prefererred over using this script for performing JavaScript compilation .. . .. . Since I m using Google Closure Library https : github.com google closure-library and the OpenLayers 3 https : github.com openlayers ol3 how do I have to call the compiler compiler.jar to .. . .. . Build an myapp-deps.js dependency file .. . Build an minified version myapp.js that includes only used OL3 and CL classes .. . Build both with the usage of pre-calculated dependency files of OL3 and CL e.g . ol3-deps.js .. . .. . Let s further say everything is located in the following structure . This almost equals to my own project but it is to big and complex to be posted here directly . I m thankful for every hint . .. . Answer : Closure Compile can now manage Closure dependencies that is dependencies defined with goog.provide and goog.require in the JavaScript code . So you do not need to use the closurebuilder.py script anymore . And this is why it s deprecated . See the wiki page https : github.com google closure-compiler wiki Manage-Closure-Dependencies to know about the options flags Closure Compiler provides for that . Regarding the generation of deps files which may be necessary for loading js files one by one for debugging development purposes you will still need Closure Library s depswriter.py script . Closure Compiler has no tool or flag for that . Reading https : github.com google closure-library issues 382 depswriter.py is no longer used within Google but it looks like the script is still maintained .", "Question : Considering .. . .. . business background .. . community support .. . available extensions .. . default set of features .. . simplicity of use .. . and reliability .. . .. . why do you prefer one over the another Comment : I think it will be hard to say why one is preferred over the other until people get to experiment with applications and see what the limits of closure is . Comment : Some syntax comparisons here : derekslager.com blog posts 2010 06 http : derekslager.com blog posts 2010 06 google-closure-introduction.ashx Comment : This article http : sayspy.blogspot.com 2010 10 lessons-learned-porting-from-jquery-to.html may also help with the decision . Key lesson : Closure is an ecosystem . It is not like jQuery where you just use it here and there to make accessing or manipulating the DOM easier . If you want to truly use Closure you have to make a commitment to truly use it . .. . Answer : Edit : take a look at this youtube video http : www.youtube.com watch v M3uWx-fhjUc feature related it may answer some questions about Google Closure better . Probably the best sources of information on google-closure are project discussion group http : groups.google.com group closure-library-discuss wiki doc pages demos and a yet unfinished book by Michael Bolin http : my.safaribooksonline.com 9781449381882 that is now available from safari books site . one thing I can tell right away - there is a steeper learning curve for closure vs jQuery but it may be well worth it due to the library s vastness clear organization and the benefit of using it together with the compiler and the templating tool . closure library in that respect is more like dojo than jQuery and some concepts were borrowed from dojo according to Michael Bolin . google-closure-compiler uses JSDoc documentation system which simultaneously if created by the programmer correctly provides documentation and enables catching many errors at compile-time . while function names are more verbose than jQuery s the compiler shrinks the code using various optimization tactics and the type checking will save a considerable time debugging the code so time typing in the longer names is probably not an issue . At the same time longer names add readability . library supports browsers running in the quirks-mode so that scripts could be embedded by other sites using quirky html .. . .. . library works with but does not depend upon a javascript templating system called soy that simplifies filling documents with content . like jQuery google-closure allows traversing dom structure with the string-based queries using a dedicated component of the library . closure library relies on dot-delimited namespaces more like Java - a very strong organizational feature . using such namespaces will incur overhead in uncompiled code but in the compiled code those things are replace with short variable names . Comment : I was looking for something else and ended up here but good to know like jQuery google-closure allows traversing dom structure with the string-based queries using a dedicated component of the library . Can you please link me to some documentation related to it Comment : @iSid : I believe he talks about goog.dom.DomHelper but I personally don t see a query function equivalent to jQuery . @Evgeny : Can you give us more details Comment : @iSid : That functionality is provided by goog.dom.query http : closure-library.googlecode.com svn docs closure third party closure goog dojo dom query.js.html which is not documented as well as the rest of the goog.dom namespace .", "Question : I m looking into Google s stylesheet renaming feature and I m not sure how to rewrite my jquery-selectors . I didn t find the doc http : code.google.com p closure-stylesheets Renaming very clear on that . If I have some code that looks like this : .. . .. . How must the HTML and javascript be written so that CSS renaming will work Thanks for your suggestions . Comment : Google Closure Stylesheet renaming is designed for use with the Google Closure Library . Specifically you need goog.getCssName support . While it might be possible to make this work without Closure Library there really isn t much information on that possibility yet . Comment : Yes I saw that goog.getCssName is mentioned . How does it work specifically in conjunction with jquery Is it used just within the compiler or does it also need to be included in the page s output Comment : That was my point . I don t know that it does will work with jQuery . .. . Answer : For Closure-stylesheets to work in combination with an external library like jQuery you will need to use the Closure-library as well to add support for goog.getCssName . However because Closure-Library is written to make maximum use of the dead-code elimination of Closure-compiler only a very small amount of the library code will be included in the final output about 1KB in this example . Step 1 - Setup your project .. . .. . You ll need the following tools : .. . .. . Closure Library http : code.google.com p closure-stylesheets downloads list .. . Closure Compiler http : code.google.com p closure-compiler downloads detail name compiler-latest.zip .. . Closure Templates http : code.google.com p closure-templates downloads detail name closure-templates-for-javascript-latest.zip .. . Closure Stylesheets http : code.google.com p closure-stylesheets downloads list .. . .. . Step 2 - Setup Your Source Files .. . .. . Stylesheet Source sample.gss .. . .. . Closure Template Source sample.soy .. . .. . Javascript Source sample.js http : people.missouristate.edu chadkillingsworth ClosureSamples jQueryStylesheets sample.js .. . .. . HTML Source development.htm http : people.missouristate.edu chadkillingsworth ClosureSamples jQueryStylesheets development.htm .. . .. . Step 3 - Compile your Stylesheet and Templates .. . .. . Using the tools downloaded from the templates and stylesheet projects you ll need to compile the sample.gss and sample.soy files . Here s the commands used for this sample : .. . .. . With these files you can test the renaming during development . See the example http : people.missouristate.edu chadkillingsworth ClosureSamples jQueryStylesheets development.htm . Step 4 - Compile the Project for Production .. . .. . First recompile your stylesheets to produce a renaming map using the CLOSURE COMPILED option : .. . .. . Then you will need to calculate the Closure-library dependency files and compile all of the source javascript files into a single-source . Note : since jQuery is not compatible with ADVANCED OPTIMIZATIONS of Closure-compiler it will not be included as input . Instead reference the appropriate jQuery extern file http : closure-compiler.googlecode.com svn-trunk contrib externs jquery-1.7.js found in the Closure-compiler contrib externs http : code.google.com p closure-compiler source browse svn 2Ftrunk 2Fcontrib 2Fexterns folder . .. . .. . The calcdeps.py script in the Closure-library project can be used to also call the Closure-compiler on the input files it determines . See the final result : compiled version http : people.missouristate.edu chadkillingsworth ClosureSamples jQueryStylesheets compiled.htm . Final Notes .. . .. . As you can see using Google Closure Stylesheets requires not only pieces of the entire Closure-tools suite but is quite involved . Outputing the HTML required use of Google Closure-templates . In this contrived example I used a document.write call to output the HTML with the properly renamed class however there are more elegant and maintainable techniques for production code . Closure-stylesheets does not rename ID selectors therefore the code for an ID is not affected . For ease of viewing the compiled example references the jQuery library off of the Google CDN . However it would be equally valid to concatenate the jQuery library and the compiled source into a single-source JS file . Comment : Wow I m up-voting this purely on effort You must really like Google closure P Comment : I m a regular contributor to the Closure-compiler project and it was a very interesting question . The original question author was correct documentation for such uses is very sparse . Comment : Thank you SOOOOO much The doc is written with a what-is perspective but people need docs written from a how-to perspective like you did Step 1 : do this step 2 : do that step n : you re done . I do want to ask a follow-up question . I m writing a single-page app where most of the HTML is generated at run-time with data coming in the form of ajaxed json strings . The only HTML that comes out of the server is the initial skeleton HTML . If I put this initial HTML in a string and use .html in the doc.ready function will that avoid using Closure Template and the soy file Thanks Comment : Yes - instead of using SoyTemplates you could do something like : jQuery id .html div class + goog.getCssName MyClass + div Comment : Ok thank you very much for your answer and your work on Google Closure . And please spread the word : we don t want what-is documentations we need how-to documentations", "Question : null .. . Answer : What s the equivalent of using Google Closure to JQuery document .foo please I have this jquery library that needs to initialize like so but I d like to call it through Google Closure in the code instead .", "Question : Hi has any one used google s Closure Library https : developers.google.com closure in building Phonegap applications on Android . I have read that Closure has good support for internationalization of applications . So if anyone could provide material they referred or sample snippets to get an idea of how to implement it . Comment : Your question is fairly vague . Any more details On a side note using Google s Closure library in a mobile app sounds like a good idea in fact a project I am helping with is planning on using the Closure Library and Compiler to develop a mobile app for Android and iOS though we re planning on just using a web view and not using Phonegap . Comment : I am planning to use Closure library for internationalization of my phonegap application . Currently im using it in my application but i am getting few errors . So I want to find out if anyone has worked on similar stuff here . Also In your project you will be using Closure for the phone browser correct me if im wrong . Comment : Essentially PhoneGap just displays your code using a WebView but it adds some extra APIs available through to the JavaScript . I ve done things with WebViews where I added functions that JavaScript could call to play audio . PhoneGap essentially does the same thing . Comment : Ok So have you started using closure into your application . Comment : Not yet we re still in the planning stages but I have been using Closure not on mobile . .. . Answer : There is no difference as to how you use PhoneGap . Framing a web view inside a native app background doesn t change . The Closure Library unlike any other library will compile your javascript to raw heavily minified code with semantic features . otherwise yes use it as you please PhoneGap included . When you build something with Closure you can render the DOM in JavaScript . It is super fast and much much better than the conventional way . so you create your pages with goog.dom.createDom . Below you will find an example . Do the above wherever translations are needed . Then simply set the current language on load with something very easy like . and then call the boot method inside the index.php or whatever on window.load and echo a JSON string with the boot parameters from the server . Beware everything that comes from the server must be encapsulated within quotes when referenced . Otherwise the compiler will flatten the property name in ADVANCED OPTIMIZATIONS mode . Comment : Yes i do agree wat you said but i wanna know how to do localization of strings using closure.js . Comment : If you want to do localization using the google way you need to compile a seperate js file for every locale - actually by default the compiler assumes en US locale for any of its libraries that you may use that has locale support . I do not know if it is possible to select locale at runtime for those libraries if you use them but I doubt it .", "Question : I ve recently created a JavaScript library using Google s Closure Compiler : https : github.com bvaughn task-runner .. . .. . I intend for this library to be used by applications that also require the full Closure Library and so I want the built version of my library Task Runner not to include a subset of Closure Library . If Task Runner includes a subset of Closure Library and another application includes the full Closure Library a race-condition will exist between which loads Closure last last in wins . It also bloats the size of the Task Runner file . However I m having trouble . If I don t require any of the Closure library classes Task Runner builds fine obviously . However if I require something goog.dom for instance then my compiled JavaScript file also includes a portion of the Closure library . Is there a way to tell the Closure Compiler to leave certain JavaScript files modules whatever out of the built result FWIW the Plovr experimental-exclude-closure-library http : plovr.com options.html experimental-exclude-closure-library option seems to somewhat describe the functionality I m looking for . Comment : Uh if you put a in front of a filename or wildcard it will not include it when you compile . Or you could just not have them in the dir you are grabbing files from . Comment : True but then the compiler will error . I want to be able to reference Closure Library classes and have the compiler verify things like type-safety etc . but I don t want any of the Closure Library to be included in the built version of my library . It seems to be an either or thing . If I use the to exclude the classes the project won t build . Comment : developers.google.com closure compiler docs api-tutorial3 https : developers.google.com closure compiler docs api-tutorial3 Comment : Yeah.. . I mean I obviously read through the documentation before posting this but thanks.. . Comment : I m a little confused . Your code depends on some goog.dom function but you don t want the output to include that function How will the code actually work then .. . Answer : On the surface what you are asking makes no sense . You want to depend on use code from Closure-library but not include it in your output . This isn t really possible nor how the library and compiler function together . There is a rather small list of primitive functions defined in Closure-library that are completely removed replaced when compiled with Closure-compiler . goog.require and goog.provide are the two most prominent of those . For the vast majority of the Closure-Library if you use or depend on a class-method or object that specific code will appear in the compiled output . And because that library code itself may depend on other parts of the library even more code may be included in the compiled result . The difference between using Closure-compiler with Closure-library as compared to more traditional JavaScript libraries is that ONLY the parts of the code determined to be called and used are included in the output . This is much more granular than a simple file inclusion - prototypes variables constants etc will all be excluded because the compiler can determine that they are never used . Distributing a Library .. . .. . If you are building a library which depends on Closure-library you have two options . 1 . Distribute a compiled built version .. . You would compile your library using Closure-library exporting any public API methods and properties . Others who utilize your library with Closure-compiler or Closure-library will need to use an externs file and include your library AFTER compilation . 2 . Distribute your library as source .. . You would simply distribute your library source code . Others would goog.require your library as part of their source and build-process . If Closure-library is used in both projects it will only be included once in the build-process . There is no hybrid approach where you compile your code but exclude Closure-library . This violates the principle that all of the source code will be compiled simultaneously . You can peruse my Geolocation-marker library https : github.com ChadKillingsworth geolocation-marker to see an example . I provide a compiled standalone version of the code for use but the uncompiled source can also be included in other projects which use Closure-library . Comment : Thank you for your detailed answer . I believe I did a poor job explaining my question . I m intending my library TR to be used by another application that ALSO uses the full Closure Library CL . If my library includes a subset of CL then things break . So I d like TR to have a runtime dependency on CL- but not to actually include any of CL . Does this make any more sense Comment : @brianvaughn I ve updated the answer to reflect your clarification . Comment : Thanks for updating . That s an approach I hadn t considered but it seems reasonable . I m used to working with JavaScript libraries that have been concat ed and minified prior to distribution .", "Question : In the tutorial mentioned here https : developers.google.com closure library docs tutorial creating-a-namespace-with-googprovide the namespace provided by the module is : .. . .. . goog.provide tutorial.notepad.Note .. . .. . But I am wondering why not this : .. . .. . goog.provide tutorial.notepad .. . .. . Since according to the rule mentioned below : .. . .. . If we just provided : .. . .. . goog.provide tutorial.notepad then we would already have : .. . .. . to which we could have added property Note .. . .. . Hence my question is : .. . .. . Why not just declare goog.provide tutorial.notepad and then use that to include top level Classes instead its recommended to use goog.provide tutorial.notepad.Note for each Class which feels redundant to me . .. . Answer : A couple things at play here : .. . .. . 1 . You can only evoke goog.provide once per namespace . .. . .. . You may currently have your class defined in a single file say Note.js with goog.provide tutorial.notepad right now . However if you add another file say Tab.js that has the class tutorial.notepad.Tab in it you re going to run into this error https : github.com google closure-library blob 580627b88e776a81c18cabbb6115bc6c2dd9f292 closure goog base.js L276 when Tab.js also calls goog.provide tutorial.nodepad . 2 . Calling goog.provide tutorial.notepad does not tell the Closure Compiler about the class tutorial.notepad.Note .. . .. . Google Closure code is extremely verbose in its raw library form . The real reason to use it is to run your Google Closure code through the javascript-to-javascript Closure Compiler that removes dead unused code while minimizing and obfuscating the pieces you do use . While your example works in debug mode since it does not leverage the Closure Compiler once the Closure Compiler is ran and tries to build a dependency map it will fail to find the tutorial.notepad.Note class when something tries to reference it via goog.requires tutorial.notepad.Note . If you want to learn more about how this dependency map works owler s answer is a very good starting place . As an aside note that I use class in quotes and quite intentionally . While Google Closure gives the look-and-feel of object oriented programming in many ways with its @constructor annotation and a rough analog of package import via goog.provide goog.require syntax it is still JavaScript at the end of the day .", "Question : I m trying to find a tool that generates HTML documentation for my Javascript source code . Does anyone know if the tool that Google uses to generate the interface at the following URLs is open-source Would I be able to generate similar output http : closure-library.googlecode.com svn docs class goog proto2 Serializer.html .. . .. . http : closure-library.googlecode.com svn docs namespace goog date.html .. . .. . http : closure-library.googlecode.com svn docs namespace goog events.html .. . .. . http : closure-library.googlecode.com svn docs class goog gears Database.html .. . .. . http : closure-library.googlecode.com svn docs class goog ui DatePicker.html .. . .. . I m aware of http : code.google.com p jsdoc-toolkit .. . .. . But I d like to know if the specific generator that Google uses is available for me to use for my own source which is going to be open-source if that matters . Thanks in advance.. . Comment : Found this quote google-closure-compiler uses JSDoc documentation system which simultaneously if created by the programmer correctly provides documentation and enables catching many errors at compile-time . from stackoverflow.com questions 1690197 http : stackoverflow.com questions 1690197 what-does-google-closure-library-offer-over-jquery 2339186 2339186 Would like to know more on that.. . .. . Answer : Google Closure + JSDoc .. . .. . As you mentioned yourself in your comment they build on JSDoc Toolkit http : code.google.com p jsdoc-toolkit to add special annotations used by the Closure Compiler for type-checking and other things but this means you can also just use JSDoc on top of closure code to generate your documentation . Generating an output with the desired look-and-feel is then only a matter of writing your own template and stylesheet . The Google Closure Tools are all open-source except for some bits that aren t disclosed at the moment . In any case you can have a look at the documentation and source code and see what they use to generate Javadocs . ExtJS + Ext-Doc .. . .. . Another one you could possibly have a look at for inspiration and to see how they do it is the online doc for ExtJS http : dev.sencha.com deploy dev docs . I find it a bit confusing to navigate at first but you get used to it fairly quickly . An open-source project Ext-Doc http : code.google.com p ext-doc generates documentation with a similar style though it is now a bit outdated . YUI Doc .. . .. . As mentioned by Matthew Manela http : stackoverflow.com questions 3818875 is-there-a-way-to-generate-javascript-api-documentation-like-the-google-closure-l 3818884 3818884 YUI Doc produces pretty good online documentation as well . My advice would be to go for JSDoc as it is the de-facto standard for many tools and it reflects Java practices but it s really up to what you want . Comment : The documentation annotation of JSDoc toolkit is different from Google Closure why is that Even more important is it possible to generate documentation using some part of Google Closure Their online API reference looks amazing . Comment : @Betamos : sorry never noticed your follow-up question . The reason why Closure s documentation format is not entirely identical to JSDoc is that they add their own set of parameters as far I know . Comment : @Betamos : Also it s most probably possible to generate the documentation the same way they do . However it will probably take a lot of hacking as their tool generates the doc for their library . Maybe youc an try to make it generate another doc but I cannot make any assumptions on the difficulty to do this . Comment : Ext-Doc has been renamed to JSDuck github.com senchalabs jsduck https : github.com senchalabs jsduck", "Question : Considering .. . .. . business background .. . community support .. . available extensions .. . default set of features .. . simplicity of use .. . and reliability .. . .. . why do you prefer one over the another Comment : I think it will be hard to say why one is preferred over the other until people get to experiment with applications and see what the limits of closure is . Comment : Some syntax comparisons here : derekslager.com blog posts 2010 06 http : derekslager.com blog posts 2010 06 google-closure-introduction.ashx Comment : This article http : sayspy.blogspot.com 2010 10 lessons-learned-porting-from-jquery-to.html may also help with the decision . Key lesson : Closure is an ecosystem . It is not like jQuery where you just use it here and there to make accessing or manipulating the DOM easier . If you want to truly use Closure you have to make a commitment to truly use it . .. . Answer : I just posted a pretty exhaustive article about Google Closure which answer this question on insideRIA http : www.developria.com 2009 11 google-closure-a-new-way-of-de.html . ...Closure rulez Comment : Nice to-the-point comparison to jQuery : .. . jQuery work really well and make possible great things with no effort and fast so the promise of Closure is not to offer better algorithms but rather a really better organized and maintainable way of deploying JavaScript applications .. . Coding in Closure means thinking with object oriented principles in mind create several js files each representing a single class organize the application architecture into packages and finally deploying it using the tools provided obtaining a single compressed and safe JavaScript file .. . Comment : While this link may answer the question it is better to include the essential parts of the answer here and provide the link for reference . Link-only answers can become invalid if the linked page changes . - From Review review low-quality-posts 10300820", "Question : I have an html text like : .. . .. . div class a span 1 span div 2 div div .. . .. . Is there a function in closure library to get such a string as input and return a DOM tree to insert in a document .. . Answer : Closure Library provides the function goog.dom.safeHtmlToNode html https : github.com google closure-library blob fab924fd90b343996a7a2dbd0ebc1394e63e38a9 closure goog dom dom.js L907 to create a document fragment Node from a goog.html.SafeHtml object which can be created using goog.html.sanitizer.HtmlSanitizer as shown below . Example Comment : goog.dom.htmlToDocumentFragment htmlString is deleted now . Are there any new way for this Comment : @red led Example updated to use goog.dom.safeHtmlToNode html in-place of the deleted goog.dom.htmlToDocumentFragment .", "Question : How to handle multiple file uploads with Google Closure Is it possible to use YUI3 Uploader http : yuilibrary.com yui docs uploader with Google Closure Library http : code.google.com p closure-library Is there an externs file available for YUI3 Would it be possible to put the YUI3 Uploader in an iframe and access a variable returned by the upload handler in the parent frame of the iframe With an iframe maybe I could create an isolated environment for the YUI uploader . Does anyone have experience with SWFUpload http : code.google.com p swfupload Plupload http : www.plupload.com or another alternative using Google Closure Library As an alternative I could use Google Picker https : developers.google.com picker to upload files to Google Drive and then use the Google Drive SDK to download these files to my web host . The drawback is that I can t change the style of Google Picker to match with the style of my web site . .. . Answer : It s actually fairly easy to write a Google Closure Library component that uses SWFUpload for multiple file uploading . I created an externs file for advanced compilation with the Closure Compiler :", "Question : I run the very basic file : .. . .. . but I get .. . .. . on compiling with .. . .. . how does it know to look for the goog libraries Edit : .. . .. . I also tried using the online one at : http : closure-compiler.appspot.com home and still get : Comment : this works fine when I use the closurebuilder i will use that for now .. . Answer : It s important to remember that Google Closure is a collection of tools . Though the tools are synergistic Google has maintained a fair degree of independence between these tools . The Closure Compiler can work without the Closure Library the Closure Library can work without the Closure Compiler . Both can work without Closure Templates etc . The closurebuilder Python scripts were made and included with to provide some things the Closure Compiler lacked . Nowadays however you should rarely have to use them . The Closure Compiler fairly recently allowed wildcard expressions to solve this particular problem . Every file in compiler closure-library is examined to see whether it provides the necessary namespaces . Anything other files will not be included only closure dependencies . Comment : I ve been struggling with this same issue over the weekend . What you describe makes sense but I m not sure how you got it from reading the documentation . That being said running the sample command you provided above errors for me : When only closure dependencies is on you must specify at least one closure entry-point Comment : @brianvaughn yeah Closure isn t what I would describe as beginner friendly like some other JS tools . And yeah you need to add --closure entry-point test where test is the top level symbol . Comment : I ve made a little progress since leaving my last comment . Closure definitely feels more like a Java library than a JS one in terms of its toolchain and documentation . Thanks for sharing your thoughts though it helped me past one sticking point . :", "Question : Considering .. . .. . business background .. . community support .. . available extensions .. . default set of features .. . simplicity of use .. . and reliability .. . .. . why do you prefer one over the another Comment : I think it will be hard to say why one is preferred over the other until people get to experiment with applications and see what the limits of closure is . Comment : Some syntax comparisons here : derekslager.com blog posts 2010 06 http : derekslager.com blog posts 2010 06 google-closure-introduction.ashx Comment : This article http : sayspy.blogspot.com 2010 10 lessons-learned-porting-from-jquery-to.html may also help with the decision . Key lesson : Closure is an ecosystem . It is not like jQuery where you just use it here and there to make accessing or manipulating the DOM easier . If you want to truly use Closure you have to make a commitment to truly use it . .. . Answer : Maybe I m not getting jQuery but I haven t seen a real UI widgets collection there there are plugins yes but you never know how well-tested they are and often there is no clear winner and or the plugin lacks documentation . Closure has among other things a widgets collection http : closure-library.googlecode.com svn-trunk closure goog docs index.html see the demos tab including say imageless buttons http : stackoverflow.com questions 520640 googles-imageless-buttons used in gmail . More generally it has more functionality implemented as part of the release . It may not be a big thing but I get annoyed with the sea of jQuery plugins when I m looking for something as simple as a ajax history module or autocomplete . Overall it s a huge library + set of tools and I ll be getting acquainted with it just to know what s available . Comment : jqueryui.com is the official ui widgets collection Comment : yeah well judging from the site it has 6 widgets : Accordion Datepicker Dialog Progressbar Slider Tabs Comment : I ve used jQueryUI and I thought it was very weak . It hardly even seems to be in development . When was the last time a new widget was added . It may be the official widgets collection but anyone looking for a widget to use with jQuery is better off just googling for third-party jQuery widgets . Comment : jQueryUI isn t just a set of javascript widgets it has a great css framework as well . Its been a great tool for me in styling CRUD admin pages . Plus many of those Closure Widgets are 1-2 liners in jQuery not even worth writing a plugin for . Comment : The appeal of JQuery is not pre-made widgets . It s making your own custom widgets in record time . I rarely touch the plug-ins including UI ." ] }
[ "yes-answer-long", "yes-answer-short" ]
open-source
UNK_RELATION
linq-to-json@json@37
linq-to-json -- an api to work with @placeholder objects .
{ "confidence": [ 33.836063385009766, 31.31470489501953, 27.18260955810547, 26.873228073120117, 25.095630645751953, 25.095630645751953, 23.652313232421875, 23.64053726196289, 23.64053726196289, 23.279083251953125, 23.01137924194336, 22.701213836669922, 22.033458709716797, 21.86724853515625, 21.557249069213867, 21.557249069213867, 21.088520050048828, 20.88568878173828, 20.598712921142578, 20.311641693115234, 19.133440017700195, 19.133440017700195, 19.046226501464844, 19.046226501464844, 18.92477798461914, 18.92477798461914, 18.720741271972656, 18.523033142089844, 18.512920379638672, 18.05509376525879, 18.05509376525879, 18.031103134155273, 17.98947525024414, 17.98947525024414, 17.98947525024414, 17.820812225341797, 17.775596618652344, 17.694557189941406, 17.62645721435547, 17.62645721435547, 17.479244232177734, 17.479244232177734, 17.479244232177734, 17.479244232177734, 17.479244232177734, 17.28554916381836, 17.28554916381836, 17.28554916381836, 17.227367401123047, 16.911128997802734, 16.911128997802734, 16.911128997802734, 16.911128997802734, 16.85749053955078, 16.53118896484375, 16.24897575378418, 16.24897575378418, 16.24897575378418, 16.24897575378418, 16.24897575378418, 16.148637771606445, 16.141584396362305, 16.141584396362305, 16.141584396362305, 16.141584396362305, 16.108171463012695, 16.01378631591797, 15.614571571350098, 15.540056228637695, 15.540056228637695, 15.540056228637695, 15.540056228637695, 15.26055908203125, 15.26055908203125, 15.182140350341797, 15.105010986328125, 15.105010986328125, 15.105010986328125, 15.105010986328125, 15.105010986328125, 15.105010986328125, 15.105010986328125, 15.105010986328125, 15.048559188842773, 14.770511627197266, 14.770511627197266, 14.770511627197266, 14.770511627197266, 14.770511627197266, 14.770511627197266, 14.770511627197266, 14.770511627197266, 14.758970260620117, 14.470606803894043, 14.470606803894043, 14.470606803894043, 14.470606803894043 ], "content": [ "I m implementing a library that parses JSON data into various C objects using Newtonsoft s LINQ to JSON functions .", "It uses Linq-to-objects to select from a Dictionary .", "I m trying to filter json data using linq-to-json query in C .", "possible duplicate of Can I LINQ a JSON", "one more help can you provide links for linq-to-json tutorial", "http : stackoverflow.com questions 18758361 can-i-linq-a-json", "MattK - so how can I use linq-to-objects to perform a query that results in an IEnumerable Clazz that I can return from a WCF-exposed method", "Thanks for the reply.It s working how to select multiple objects", "The problem is that not all objects follow the same interface .", "No need for Linq just use dynamic using Json.Net http : json.codeplex.com .. . .. . Linq version would not be much readable .. . .. . Documentation : LINQ to JSON http : www.newtonsoft.com json help html LINQtoJSON.htm", "The following is my json string : .. . .. . When I try to do the following LINQ query : .. . .. . I get the following error : .. . .. . However the following works fine : .. . .. . Any idea why I can t use LINQ on this json string", "After that you can perform LINQ operations on this object filter them and parse back to the JSON if required .", "When using Json.NET I am trying to create a JSON structure dynamically using the JSON to LINQ http : james.newtonking.com json help index.html support .", "Study this great article http : www.dotnetperls.com linq for writing LINQ queries .", "You can t use Linq from a JObject check this link http : www.newtonsoft.com json help html QueryingLINQtoJSON.htm for more details", "I would deserialize the json into a dynamic ExpandoObject for brevity otherwise define a type then use linq .", "@name Value queries for objects in an array with a property named @name with value Value .", "But the ROW NUMBER hasn t been extended to LINQ .", "LINQ .", "a..b matches any token in the JSON hierarchy whose topmost property is named a and bottom most is named b with any number of arrays and objects inbetween - or none at all .", "First create classes as I ve suggested and then try writing LINQ by yourself .", "I was able to create a linq statement with table joins as below .", "I m new to json .", "Your JSON is invalid .", "I would not recommend LINQ .", "Where is the LINQ in your example", "I have as same as following Json data .. . .. . And How can I check widget Parent node include image children node with linq", "If that is really what you want do : .. . .. . Which results in : .. . .. . .. . .. . .. . Id : 1528 .. . CompName : ZYZ.A a Test Company .. . SEDOL : SEDOL111 .. . ADP : ADPSC1111 .. . .. . .. . Id : 1519 .. . CompName : ZVV Test .. . SEDOL : SEDOL112 .. . ADP : ADPS1133 .. . .. . .. . .. . .. . As an aside since your JSON is rather polymorphic properties are sometimes arrays of objects and sometimes just objects I don t think deserializing to a class-hierarchy or ExpandoObject will be easier .", "I have to filter json data using linq-to-json query in C .I have to retrieve multiple values from the below sample json data : .. . .. . please help me with query how to select multiple key values using where clause.I have to select name slug form factor motherboard using where clause .", "Then you will need to parse this JSON to an object of C class .", "I ve updated the json to follow the correct format .", "However when I m trying to get the 1st analyst my code only works on objects and produces nulls for the analysts that are part of an array .", "If you can allow to read the whole file its super-easy with linq .", "You re selecting from a dictionary so the result in the LINQ is the property .", "That s my dilemma and that was what I was trying to do with my LINQ code .", "But how can I query enumerate the child objects using key names e.g .", "thanks for your suggestions but what i want to know is how to write linq query to retrieve those values .", ".. . .. . I am receiving a complex JSON object from an API with a variable number type of properties .", "@Micha lHompus Why would anyone need LINQ here", "Then you can use the classic Linq to XML .", "It would help to see a sample of the JSON", "Think about what your JSON is .", "That s the json text that is given to me .", "This is the JSON string that I am working with .", "I have a polymorphic json string .", "You need to first create classes with respect to your JSON content structure .", "How can I obtain the data as in the JSON format above", "I need to select users that have a 3 in their json array .", "Thus feed.SelectTokens ..DataItem finds the values of all JSON properties named DataItem no matter where they are in the JSON hierarchy .", "I suggest to use a JSON library like Json.net .", "http : www.newtonsoft.com json help html T Newtonsoft Json JsonReader.htm", "NOTE : I understand that this json text is malformed .", "The object s hierarchy will mimic that of your json object", "When you are done take the XML deserialize it and serialize it back to JSON to JSON .", "How about for a JSON Null", "You can use SelectTokens http : www.newtonsoft.com json help html QueryJsonSelectTokenJsonPath.htm for queries of this nature .", "Thus : .. . .. . In your JSON the value of parts : .. . is an array in the query parts is a wildcard that searches through all elements of the array .", "sorry If i want to select name type from my json data how to pass in the select token", "This free online tool http : json2csharp.com can help you creating C classes from JSON data easily .", "You can use Json.NET http : www.newtonsoft.com json for all serialization and de-serialization operations .", "However it still doesn t work .", "Each grabs a json file from a different location on smartsheets .", "I m implementing simple search engine.all the data saved as a JSON in text file .", "To do that first you ll need to create a .net object equivalent of your JSON .", "I ve updated the json text above to closely match my current environment .", "Useless for JObject construction and reading JSON .", "I think part of the reason you are seeing 9 records is because the syntax you are using is the one for left outer joins in Linq https : msdn.microsoft.com en-us library bb397895.aspx .", "I want the output as below in JSON format : .. . .. . For this I created DTO : .. . .. . The CSQModel class has needed data from both CSQActivityReport and CallDistributionSummary tables .", "I would recommend a JSON library such as newtonsoft.json .", "Oh my apologizes : undefined is not valid JSON .", "dynamic JObj JObject.Parse json if JObj.widget.image null", "JSON sample below trimmed down for brevity", "github.com JamesNK Newtonsoft.Json blob master Src https : github.com JamesNK Newtonsoft.Json blob master Src Newtonsoft.Json Linq JValue.cs", "Json.NET defines a JConstructor type https : github.com JamesNK Newtonsoft.Json blob master Src Newtonsoft.Json Linq JConstructor.cs .", "In the following jObject is a JObject http : james.newtonking.com json help html T Newtonsoft Json Linq JObject.htm and JObject.Add takes string JToken http : james.newtonking.com json help html T Newtonsoft Json Linq JToken.htm .", "So stupid simple - wrong JSON properties names like FlightId instead of FlightID .", "I ve updated the json text my code to show what I m facing now .", "It handles the polymorphism you are seeing in your JSON where sometimes data is nested in an array and sometimes not .", "enter image description here http : i.stack.imgur.com ELkJT.png .. . .. . Also note your JSON is malformed .", "I used this deserializer command : var obj JsonConvert.DeserializeObject ExpandoObject json new ExpandoObjectConverter .", "JToken.SelectTokens http : www.newtonsoft.com json help html QueryJsonSelectTokenJsonPath.htm supports JSONPath query syntax http : goessner.net articles JsonPath .", "The data you are trying to get is several layers down in the JSON so your query has to account for this .", "You need to use SelectToken http : www.newtonsoft.com json help html QueryJsonSelectToken.htm to select grandchildren .", "Especially if you work inside the same app domain and don t perform marshaling .", "How do I explicitly add a JToken JValue for a JSON Undefined", "And this is probably the reason why undefined isn t supported by JSON it s completely redundant .", "This is confusing because to the best of my knowledge constructors are not part of the JSON model .", "Json.NET includes many features which are not part of JSON specification .", "In particular it allows parsing some JSON files which are officially invalid .", "Data serialized this way is invalid JSON but valid JavaScript code .", "Edit .. . .. . I made progress and found typo in JSON data example .", "Look at the parse method in this documentation http : www.newtonsoft.com json help html T Newtonsoft Json Schema JsonSchema.htm", "Update .. . .. . Given your updated JSON you can use SelectTokens http : www.newtonsoft.com json help html QueryJsonSelectToken.htm with the JSONPath recursive search operator . . http : goessner.net articles JsonPath to find the first analyst s last name where the recursive search operator handles the fact that the analysts might or might not be contained in an array :", "As I can see obj accepting data but then I got error : .. . .. . .. . Here is the code : .. . .. . And this is class structure DepartureFlightData is part of PricesViewModel class : .. . .. . Ok and JSON is here :", "This is my sample JSON array . . .. . .. . enter image description here http : i.stack.imgur.com bVSrq.png .. . .. . Test word : rock expected result : 991335 991336 991337", "Or var x string feed.SelectToken DataFeed.Issuer.name http : www.newtonsoft.com json help html QueryJsonSelectToken.htm which won t throw a null reference exception if an intermediate object is missing .", "Below is my json text : .. . .. . Here s the code that I have so far : .. . .. . The error I get is : .. . .. . Accessed JArray values with invalid key-value : sedol ." ] }
{ "confidence": [ 31.727920532226562, 28.567672729492188, 26.17700958251953, 25.599485397338867, 25.33507537841797, 24.771129608154297, 24.413387298583984, 24.356178283691406, 24.338577270507812, 24.184734344482422, 24.151077270507812, 23.591567993164062, 23.13225555419922, 23.120094299316406, 22.943740844726562, 22.534950256347656, 22.533119201660156, 22.239471435546875, 22.088279724121094, 21.482666015625 ], "content": [ "Question : I m new to json . I m trying to filter json data using linq-to-json query in C . I m trying to retrieve multiple values from json data : .. . .. . This is my C code : .. . .. . I tried with this code and it not returns any result.Please let me know where I m doing mistake or is this the proper way to write the query.Can anyone please help me to solve this . .. . Answer : You can use SelectTokens http : www.newtonsoft.com json help html QueryJsonSelectTokenJsonPath.htm for queries of this nature . It supports JSONPath http : goessner.net articles JsonPath query syntax . Thus : .. . .. . In your JSON the value of parts : .. . is an array in the query parts is a wildcard that searches through all elements of the array . Comment : Thanks for the reply.It s working how to select multiple objects Comment : @Rajesh - Your comment doesn t have enough detail for me to be sure how to answer so you might want to ask another question . The preferred format on stackoverflow is one question per question https : meta.stackexchange.com questions 39223 one-post-with-multiple-questions-or-multiple-posts . Comment : sorry If i want to select name type from my json data how to pass in the select token Comment : one more help can you provide links for linq-to-json tutorial", "Question : I m new to json . I have to filter json data using linq-to-json query in C .I have to retrieve multiple values from the below sample json data : .. . .. . please help me with query how to select multiple key values using where clause.I have to select name slug form factor motherboard using where clause . Comment : possible duplicate of Can I LINQ a JSON http : stackoverflow.com questions 18758361 can-i-linq-a-json .. . Answer : You need to first create classes with respect to your JSON content structure . This free online tool http : json2csharp.com can help you creating C classes from JSON data easily . Then you will need to parse this JSON to an object of C class . After that you can perform LINQ operations on this object filter them and parse back to the JSON if required . You can use Json.NET http : www.newtonsoft.com json for all serialization and de-serialization operations . Study this great article http : www.dotnetperls.com linq for writing LINQ queries . Comment : thanks for your suggestions but what i want to know is how to write linq query to retrieve those values . Comment : First create classes as I ve suggested and then try writing LINQ by yourself . I will help then with specific queries if any .", "Question : I m implementing a library that parses JSON data into various C objects using Newtonsoft s LINQ to JSON functions . Apart from the lazy vs . eager approach is there any impact to passing some other library s IEnumerable vs . dumping it into a List and then returning that Does this allow better garbage-collection or anything along those lines Comment : I don t think so . All assemblies are loaded into memory at this point and basically there is no difference between your library dll and json.net library dll . Especially if you work inside the same app domain and don t perform marshaling . Comment : By the way accessing Tag assigned by UpdateTags1 may cause multiple IEnumerable enumeration down to JToken.Values . So I d have ICollection string instead and force materialization using ToArray . Comment : Yeah I m aware of that issue . This is a low-level library though . The assumption is that any developer consuming it will themselves convert the IEnumerable to a List or whatever else they want . At least that s the theory...what a developer does in reality is another matter . .. . Answer : There is no difference at all with respect to whether the Values string method is in the same assembly or a different one . However it s worth noting that there is a practical difference depending on what the Values string method is actually returning . Often when an instance of IEnumerable T is returned the sequence is a result-of deferred execution . I.e . until you evaluate the sequence it doesn t actually exist . More to the point it is recreated every time you evaluate it . Depending on the evaluation this may or may not be a problem . At the very least it could be a performance issue . It is also possible that the result-of the evaluation could change between evaluations . When you aren t positively sure this would not be a problem it is often a good idea to convert to a list or array just to make sure you get a fully-evaluated sequence . You can do this as in your example or by calling e.g . the ToList or ToArray extension-methods on the result .", "Question : The following is my json string : .. . .. . When I try to do the following LINQ query : .. . .. . I get the following error : .. . .. . However the following works fine : .. . .. . Any idea why I can t use LINQ on this json string Comment : What would you expect using Select to give you You re iterating over the JObject of Issuer .. . Comment : I should get Apple . How should i be doing this Comment : Issuer is an inner JObject . You can t use Linq from a JObject check this link http : www.newtonsoft.com json help html QueryingLINQtoJSON.htm for more details Comment : To get Apple you just use string x string feed DataFeed Issuer name Comment : Or var x string feed.SelectToken DataFeed.Issuer.name http : www.newtonsoft.com json help html QueryJsonSelectToken.htm which won t throw a null reference exception if an intermediate object is missing . .. . Answer : Think about what your JSON is . You re selecting from a dictionary so the result in the LINQ is the property . You re trying to then access name on a property which doesn t make sense which gives you the error . You already have the working code : Comment : Since the man himself is here any comments about my solution or how can I improve it Also thanks for Json.net .", "Question : I m trying to get a list of SEDOL s ADP values . Below is my json text : .. . .. . Here s the code that I have so far : .. . .. . The error I get is : .. . .. . Accessed JArray values with invalid key-value : sedol . Int32 array index expected .. . .. . I think I m really close to figuring this out . What should I do to fix the code If there is an alternative to get the SEDOL and ADP value please do let me know UPDATE1 I ve started working with dynamic ExpandoObject . Here s the code that I ve used so far : .. . .. . But I m now getting the error ExpandoObject does not contain a definition for DataFeed and no extension method DataFeed accepting a first argument of type ExpandoObject could be found . NOTE : I understand that this json text is malformed . One instance has an array the other is an object . I want the code to be agile enough to handle both instances . UPDATE2 Thanks to @dbc for helping me with my code so far . I ve updated the json text above to closely match my current environment . I m now able to get the SEDOLs ADP codes . However when I m trying to get the 1st analyst my code only works on objects and produces nulls for the analysts that are part of an array . Here s my current code : .. . .. . What do I need to change to always select the 1st analyst Comment : I would deserialize the json into a dynamic ExpandoObject for brevity otherwise define a type then use linq . Comment : Could you provide some code on how I can do this with a dynamic ExpandoObject Comment : Again here you need to debug the code . Set a breakpoint inside your foreach loop and inspect expand the element variable . What values exist in side of it Is there a DataFeed element inside of that object Use your debugger observe the contents of the entire expandoobject . Comment : I m using LINQPAD as my IDE . I see element Key DataFeed Value ExpandoObject . Then it drills down to more key-value pairs . I m not sure how to post a image through this . As far as I can drill down I can see the SEDOLs ADP codes . Am I referencing the value wrong .. . Answer : If you want all SEDOL ADP values with the associated issuer Id and CompName for each you can do : .. . .. . Using the extension-methods : .. . .. . Then .. . .. . Produces : .. . .. . .. . .. . .. . Id : 1528 .. . CompName : ZYZ.A a Test Company .. . SEDOL : SEDOL111 .. . ADP : ADPSC1111 .. . .. . .. . Id : 1519 .. . CompName : ZVV Test .. . SEDOL : SEDOL112 .. . ADP : ADPS1133 .. . .. . .. . Id : 1519 .. . CompName : ZVV Test .. . SEDOL : SEDOL112 .. . ADP : ADPS1133 .. . .. . .. . .. . .. . However in the query you have written so far you seem to be trying to return only the first SEDOL ADP for each issuer . If that is really what you want do : .. . .. . Which results in : .. . .. . .. . .. . .. . Id : 1528 .. . CompName : ZYZ.A a Test Company .. . SEDOL : SEDOL111 .. . ADP : ADPSC1111 .. . .. . .. . Id : 1519 .. . CompName : ZVV Test .. . SEDOL : SEDOL112 .. . ADP : ADPS1133 .. . .. . .. . .. . .. . As an aside since your JSON is rather polymorphic properties are sometimes arrays of objects and sometimes just objects I don t think deserializing to a class-hierarchy or ExpandoObject will be easier . Update .. . .. . Given your updated JSON you can use SelectTokens http : www.newtonsoft.com json help html QueryJsonSelectToken.htm with the JSONPath recursive search operator . . http : goessner.net articles JsonPath to find the first analyst s last name where the recursive search operator handles the fact that the analysts might or might not be contained in an array : Comment : Thanks so much @dbc . That really helped . Can you help with tackling my analyst problem I ve updated the json text my code to show what I m facing now . Thank you for your direction . Comment : @inquisitive one - answer updated . Comment : Thanks . That works . Question : would you explain the significance of . . Comment : @inquisitive one - . . is the JSONPath recursive search operator . I.e . a..b matches any token in the JSON hierarchy whose topmost property is named a and bottom most is named b with any number of arrays and objects inbetween - or none at all . It handles the polymorphism you are seeing in your JSON where sometimes data is nested in an array and sometimes not . For more on JSONPath see the article linked in the answer .", "Question : This is the JSON I get from a request on .NET : .. . .. . and I d like to catch the field url using maybe LINQ . I do many request as this that differents a bit . So I won t to create a C Class and deserialize it every time . Is it a way to extract a single field Thank you .. . Answer : No need for Linq just use dynamic using Json.Net http : json.codeplex.com .. . .. . Linq version would not be much readable .. . .. . Documentation : LINQ to JSON http : www.newtonsoft.com json help html LINQtoJSON.htm Comment : First example works perfectly Thank you so much Comment : Just a side note : .Where p p.Name url .First can just be replaced by .First p p.Name url . Comment : When you use dynamic no need to use the cast in string obj.picture.data.url . You can simply write Console.WriteLine obj.picture.data.url and the correct overload will be invoked at runtime Comment : I think you meant .Value string or something like that cause your code won t work . Comment : The use of dynamic should not be recommended if you want your code to be reusable on mobile platforms : stackoverflow.com a 1668642 http : stackoverflow.com a 1668642", "Question : I need to select users that have a 3 in their json array . In the end my results should be Elon Musk Steve Jobs . This is the code that I used other variations : .. . .. . I m getting the following error : .. . .. . I changed .Values string to .Values int and still no luck . What am I doing wrong Comment : Your JSON is invalid . Upload it to jsonformatter.curiousconcept.com https : jsonformatter.curiousconcept.com to see the problem . Possibly People : id : 123 .. . should be People : id : 123 .. . with the matching also removed from the end Comment : Good eye . I ve updated the json to follow the correct format . However it still doesn t work . Any idea what I m doing wrong .. . Answer : The problem is that not all objects follow the same interface . The last item in that list has a single string value in the roleIds.int property while all others has an array . You need to normalize that property and then do the check . It ll be easiest if they were all arrays . You should be able to do this :", "Question : This is the JSON I get from a request on .NET : .. . .. . and I d like to catch the field url using maybe LINQ . I do many request as this that differents a bit . So I won t to create a C Class and deserialize it every time . Is it a way to extract a single field Thank you .. . Answer : I would not recommend LINQ . I would recommend a JSON library such as newtonsoft.json . So you can do this : .. . .. . Note : - this code has been copied from the samples present on the project site http : james.newtonking.com pages json-net.aspx Comment : Where is the LINQ in your example Comment : @Micha lHompus Why would anyone need LINQ here Comment : Well look at the title of the question :", "Question : I m trying to get a list of SEDOL s ADP values . Below is my json text : .. . .. . Here s the code that I have so far : .. . .. . The error I get is : .. . .. . Accessed JArray values with invalid key-value : sedol . Int32 array index expected .. . .. . I think I m really close to figuring this out . What should I do to fix the code If there is an alternative to get the SEDOL and ADP value please do let me know UPDATE1 I ve started working with dynamic ExpandoObject . Here s the code that I ve used so far : .. . .. . But I m now getting the error ExpandoObject does not contain a definition for DataFeed and no extension method DataFeed accepting a first argument of type ExpandoObject could be found . NOTE : I understand that this json text is malformed . One instance has an array the other is an object . I want the code to be agile enough to handle both instances . UPDATE2 Thanks to @dbc for helping me with my code so far . I ve updated the json text above to closely match my current environment . I m now able to get the SEDOLs ADP codes . However when I m trying to get the 1st analyst my code only works on objects and produces nulls for the analysts that are part of an array . Here s my current code : .. . .. . What do I need to change to always select the 1st analyst Comment : I would deserialize the json into a dynamic ExpandoObject for brevity otherwise define a type then use linq . Comment : Could you provide some code on how I can do this with a dynamic ExpandoObject Comment : Again here you need to debug the code . Set a breakpoint inside your foreach loop and inspect expand the element variable . What values exist in side of it Is there a DataFeed element inside of that object Use your debugger observe the contents of the entire expandoobject . Comment : I m using LINQPAD as my IDE . I see element Key DataFeed Value ExpandoObject . Then it drills down to more key-value pairs . I m not sure how to post a image through this . As far as I can drill down I can see the SEDOLs ADP codes . Am I referencing the value wrong .. . Answer : enter image description here http : i.stack.imgur.com ELkJT.png .. . .. . Also note your JSON is malformed . The proxy class created can t figure out the type of Security because in one instance it s an array and in another it s a simple object . Original answer : .. . .. . I used json2csharp http : json2csharp.com to help me get some classes and now I can use the types : .. . .. . Classes : Comment : That s the json text that is given to me . That s my dilemma and that was what I was trying to do with my LINQ code . If it finds a type of array then get the values from the 1st array otherwise just get the values .", "Question : This is the JSON I get from a request on .NET : .. . .. . and I d like to catch the field url using maybe LINQ . I do many request as this that differents a bit . So I won t to create a C Class and deserialize it every time . Is it a way to extract a single field Thank you .. . Answer : In a bind you could always deserialize the JSON and serialize it to XML and load the XML in a XDocument . Then you can use the classic Linq to XML . When you are done take the XML deserialize it and serialize it back to JSON to JSON . We used this technique to add JSON support to an application that was originally built for XML it allowed near-zero modifications to get up and running .", "Question : The following is my json string : .. . .. . When I try to do the following LINQ query : .. . .. . I get the following error : .. . .. . However the following works fine : .. . .. . Any idea why I can t use LINQ on this json string Comment : What would you expect using Select to give you You re iterating over the JObject of Issuer .. . Comment : I should get Apple . How should i be doing this Comment : Issuer is an inner JObject . You can t use Linq from a JObject check this link http : www.newtonsoft.com json help html QueryingLINQtoJSON.htm for more details Comment : To get Apple you just use string x string feed DataFeed Issuer name Comment : Or var x string feed.SelectToken DataFeed.Issuer.name http : www.newtonsoft.com json help html QueryJsonSelectToken.htm which won t throw a null reference exception if an intermediate object is missing . .. . Answer : You can get the value you want using two methods : .. . .. . Method 1 : .. . .. . First you need a cast from JToken to a JObject since the value of Issuer is an object : .. . .. . Then loop through all the properties to find the one with the name Name then get its value as a string : .. . .. . Method 2 : .. . .. . You can also deserialize the JSON into an object that is easier to handle . To do that first you ll need to create a .net object equivalent of your JSON . You can use Visual Studio to generate these for you from the Edit menu - Paste Special - Paste JSON as classes or use a website like JsonUtils.com http : jsonutils.com .. . .. . Then all you have to do to get the Issuer name is this :", "Question : This is the JSON string that I am working with . I m trying to get a list of values for SYMBOL NAME PRICE AGG VOLUME . Here s my code so far : .. . .. . But I m getting the following error : .. . .. . Object reference not set to an instance of an object . What am I doing wrong Comment : Lecture 1 : how to debug your code.. . Write smaller codes . var aaaa feed DataItem Then check if aaaa is null etc...... . .. . Answer : JToken.SelectTokens http : www.newtonsoft.com json help html QueryJsonSelectTokenJsonPath.htm supports JSONPath query syntax http : goessner.net articles JsonPath . You can make use of this syntax to perform the query you require : .. . .. . . . is the wildcard recursive-descent operator . Thus feed.SelectTokens ..DataItem finds the values of all JSON properties named DataItem no matter where they are in the JSON hierarchy . @ . @name Value queries for objects in an array with a property named @name with value Value . Thus the following does what you need :", "Question : When using Json.NET I am trying to create a JSON structure dynamically using the JSON to LINQ http : james.newtonking.com json help index.html support . In the following jObject is a JObject http : james.newtonking.com json help html T Newtonsoft Json Linq JObject.htm and JObject.Add takes string JToken http : james.newtonking.com json help html T Newtonsoft Json Linq JToken.htm . However I cannot find out how to add either an Undefined or a Null token - nor can I find out how to create JValues with the appropriate Null Undefined type . How do I explicitly add a JToken JValue for a JSON Undefined How about for a JSON Null .. . Answer : Comment : It looks like it is an alias for the most part : CreateUndefined : Creates a JValue null value . I wonder if there is a difference use-case for such going back my incorrect assumption that undefined values were allowed in JSON . The corresponding CreateNull method answers the other question well . Comment : there is a different JTokenType so unlikely is same thing . github.com JamesNK Newtonsoft.Json blob master Src https : github.com JamesNK Newtonsoft.Json blob master Src Newtonsoft.Json Linq JValue.cs", "Question : This really has me stumped . I have four tables in the database and unfortunately the person who designed this table didn t create referential constraints . So there is no navigation properties available . Four tables are : .. . .. . The idea is that for each PhoneReportID in CiscoPhoneReport there is one ApplicationSummary three CSQActivityReport and three CallDistributionSummary . I want the output as below in JSON format : .. . .. . For this I created DTO : .. . .. . The CSQModel class has needed data from both CSQActivityReport and CallDistributionSummary tables . I was able to create a linq statement with table joins as below . The result I m getting is a set of data with 9 rows which makes sense - as in inner-join in SQL . But this is not what I wanted . How can I obtain the data as in the JSON format above I couldn t figure it out at all . .. . Answer : I think part of the reason you are seeing 9 records is because the syntax you are using is the one for left outer joins in Linq https : msdn.microsoft.com en-us library bb397895.aspx . What might work is using subqueries to get the data you want in a format you want it . For example .. . .. . You were right that you need the CSQModels to be some sort of collection be it a List or even a basic ICollection of type CSQModel . You can write another sub query for the CallDistributionSummary as needed . Comment : Exactly what I needed . I had to tweak a couple things to fit my objective but this was spot on . I learnt a new thing today I didn t know I could create another join statement inside select . It s wonderful and simple", "Question : This really has me stumped . I have four tables in the database and unfortunately the person who designed this table didn t create referential constraints . So there is no navigation properties available . Four tables are : .. . .. . The idea is that for each PhoneReportID in CiscoPhoneReport there is one ApplicationSummary three CSQActivityReport and three CallDistributionSummary . I want the output as below in JSON format : .. . .. . For this I created DTO : .. . .. . The CSQModel class has needed data from both CSQActivityReport and CallDistributionSummary tables . I was able to create a linq statement with table joins as below . The result I m getting is a set of data with 9 rows which makes sense - as in inner-join in SQL . But this is not what I wanted . How can I obtain the data as in the JSON format above I couldn t figure it out at all . .. . Answer : You can serialize your object :", "Question : How can I query to see if a property exists and enumerate the array property found within a complex JSON object using using JSON.NET in C .. . .. . I am receiving a complex JSON object from an API with a variable number type of properties . I keep reading the JSON.Net Documentation http : www.newtonsoft.com json help html QueryJsonLinq.htm reviewing samples etc . but not gotten far and am lost in JObject JArray JToken using dynamic etc.. . I want to find the pageResponses.scriptOutput property verify it contains and .items array and then enumerate iterate the array . Edit .. . .. . I made progress and found typo in JSON data example . But how can I query enumerate the child objects using key names e.g . item.location item.timestamp JSON sample below trimmed down for brevity Comment : You can create a class-hierarchy and for any property you don t want to deserialise you can use dynamic . If you want to go through the hierarchy you will need to use a recursive function . Comment : Another important note if you are validating JSON then you can use the JSON.Net validator against a scheme that you create . Look here http : www.jsonschemavalidator.net Comment : Look at the parse method in this documentation http : www.newtonsoft.com json help html T Newtonsoft Json Schema JsonSchema.htm Comment : I would seriously look in json schema because that sounds like exactly what you re asking for : I want to find the pageResponses.scriptOutput property verify it contains .. . Answer : I do this with a couple of Extension Methods and I use JsonConvert.DeserializeObject . Code snippets below . Usage .. . .. . In the snippet above I check a property exists then I assign it to a .Net type in this case an object array . Though it can be any type so long as it s sane . Extension Methods .. . .. . Quick easy and to the point", "Question : I m trying to get a list of SEDOL s ADP values . Below is my json text : .. . .. . Here s the code that I have so far : .. . .. . The error I get is : .. . .. . Accessed JArray values with invalid key-value : sedol . Int32 array index expected .. . .. . I think I m really close to figuring this out . What should I do to fix the code If there is an alternative to get the SEDOL and ADP value please do let me know UPDATE1 I ve started working with dynamic ExpandoObject . Here s the code that I ve used so far : .. . .. . But I m now getting the error ExpandoObject does not contain a definition for DataFeed and no extension method DataFeed accepting a first argument of type ExpandoObject could be found . NOTE : I understand that this json text is malformed . One instance has an array the other is an object . I want the code to be agile enough to handle both instances . UPDATE2 Thanks to @dbc for helping me with my code so far . I ve updated the json text above to closely match my current environment . I m now able to get the SEDOLs ADP codes . However when I m trying to get the 1st analyst my code only works on objects and produces nulls for the analysts that are part of an array . Here s my current code : .. . .. . What do I need to change to always select the 1st analyst Comment : I would deserialize the json into a dynamic ExpandoObject for brevity otherwise define a type then use linq . Comment : Could you provide some code on how I can do this with a dynamic ExpandoObject Comment : Again here you need to debug the code . Set a breakpoint inside your foreach loop and inspect expand the element variable . What values exist in side of it Is there a DataFeed element inside of that object Use your debugger observe the contents of the entire expandoobject . Comment : I m using LINQPAD as my IDE . I see element Key DataFeed Value ExpandoObject . Then it drills down to more key-value pairs . I m not sure how to post a image through this . As far as I can drill down I can see the SEDOLs ADP codes . Am I referencing the value wrong .. . Answer : Using newtonsoft.json .. . .. . I dont have my ide in front of me but the value should be at : Comment : I tried that already but how would you get the SEDOL or the ADP value Comment : have you inspected the resulting object in the debugger The object s hierarchy will mimic that of your json object Comment : I used this deserializer command : var obj JsonConvert.DeserializeObject ExpandoObject json new ExpandoObjectConverter . I then get this error when trying to find sedol or even the name . ExpandoObject does not contain a definition for DataFeed and no extension method DataFeed accepting a first argument of type ExpandoObject could be found . Comment : Try dynamic instead of var Comment : foreach dynamic element in obj you are using var again . Further I ll need to see the full code maybe update your question with the example .", "Question : I have a WCF Service . It uses Linq-to-objects to select from a Dictionary . The object-type is simple : .. . .. . There is a collection of stored in a Dictionary Guid User . I want to have a WCF OperationContract method like this : .. . .. . It compiles fine but when I run it I get : .. . .. . The server encountered an error processing the request . The exception message is Cannot serialize parameter of type System.Linq.Enumerable+WhereSelectEnumerableIterator 2 Cheeso.Samples.Webservices . 2010.Jan.User System.Guid for operation GetAllUsers contract IJsonService because it is not the exact type System.Collections.Generic.IEnumerable 1 System.Guid in the method-signature and is not in the known-types collection . In order to serialize the parameter add the type to the known-types collection for the operation using ServiceKnownTypeAttribute . . See server logs for more details . How can I coerce the selection to be an IEnumerable Guid .. . .. . EDIT .. . If I modify the code to do this it works well - good interoperability . Is there a way for me to avoid the creation instantiation of the List T .. . Answer : You need to pass interoperable collections to and from your WCF methods . WCF plays best with simple types and arrays . Pass in an array from your client and then turn it into an IEnumerable in the service . Stuff like IEnumerable is not interoperable which is what WCF is trying to be . There may be a way to get around it with known-types but I always strive to make my components as flexible as possible . Comment : I guess I m not so much trying to pass out an IEnumerable Guid . What I really want to deliver out is a list of Guids . but I didn t want to have to do unnecessary casting in order to make that happen . In fact I can just change the return-type of the method to a List Guid and then create a new List Guid passing the selection into the List constructor - that works just fine and the client gets the list the way I want . Simple enough . I was hoping the explicit creation of the List Guid would be unnecessary . Comment : IEnumerable is just an interface and it is not entirely correct to say that it is not interoperable as that is dependent on the initialized type that implements IEnumerable that is returned by the method . I have utilized IEnumerable as a return from service operations without any issue but the key is that the return-value of the operation must be initialized properly . Comment : MattK - so how can I use linq-to-objects to perform a query that results in an IEnumerable Clazz that I can return from a WCF-exposed method", "Question : This really has me stumped . I have four tables in the database and unfortunately the person who designed this table didn t create referential constraints . So there is no navigation properties available . Four tables are : .. . .. . The idea is that for each PhoneReportID in CiscoPhoneReport there is one ApplicationSummary three CSQActivityReport and three CallDistributionSummary . I want the output as below in JSON format : .. . .. . For this I created DTO : .. . .. . The CSQModel class has needed data from both CSQActivityReport and CallDistributionSummary tables . I was able to create a linq statement with table joins as below . The result I m getting is a set of data with 9 rows which makes sense - as in inner-join in SQL . But this is not what I wanted . How can I obtain the data as in the JSON format above I couldn t figure it out at all . .. . Answer : For every master record you have 3 records each in 2 separate child tables . Any join you do will give you 9 records even if you go straight to T-SQL unless you add some more information . One way to do this in SQL is to join record 1 from table A to record 1 from table B you would need an indexer to do this . One option in T-SQL is to use the ROW NUMBER function on each of the child tables and use that value in the join . But the ROW NUMBER hasn t been extended to LINQ . If you can t stand getting getting duplicate records and just doing a Distinct call for each child result set . Then you could do this as two or 3 separate queries . NOTE : You can bundle this into 3 result sets in a stored proc. . You can easily get EntityFramework to deserialize each result into your POCO s. .", "Question : How can I query to see if a property exists and enumerate the array property found within a complex JSON object using using JSON.NET in C .. . .. . I am receiving a complex JSON object from an API with a variable number type of properties . I keep reading the JSON.Net Documentation http : www.newtonsoft.com json help html QueryJsonLinq.htm reviewing samples etc . but not gotten far and am lost in JObject JArray JToken using dynamic etc.. . I want to find the pageResponses.scriptOutput property verify it contains and .items array and then enumerate iterate the array . Edit .. . .. . I made progress and found typo in JSON data example . But how can I query enumerate the child objects using key names e.g . item.location item.timestamp JSON sample below trimmed down for brevity Comment : You can create a class-hierarchy and for any property you don t want to deserialise you can use dynamic . If you want to go through the hierarchy you will need to use a recursive function . Comment : Another important note if you are validating JSON then you can use the JSON.Net validator against a scheme that you create . Look here http : www.jsonschemavalidator.net Comment : Look at the parse method in this documentation http : www.newtonsoft.com json help html T Newtonsoft Json Schema JsonSchema.htm Comment : I would seriously look in json schema because that sounds like exactly what you re asking for : I want to find the pageResponses.scriptOutput property verify it contains .. . Answer : I suggest creating a proxy class I used json2csharp http : json2csharp.com : .. . .. . Then deserialize it : Comment : This helps little how to actually check for and enumerate the array Comment : I updated the answer . Is it more clear now You can use the debugger and inspect the object s structure to help you write the code that handles it . Comment : What is the namespace for RootObject I can t find it anywhere in JSON.NET or .NET docs online . Comment : Include only the types you need then . No need to add all classes properties you are not interested in . Comment : Thanks Bruno This works like a charm in only 9 lines-of-code . And sorry man I didn t see RootObject in your example had to scroll down duh . I created just the classes I need and your advice worked great . var obj JsonConvert.DeserializeObject RootObject json if obj null obj.pageResponses null foreach var pageResponse in obj.pageResponses if pageResponse.scriptOutput null continue foreach var item in pageResponse.scriptOutput.items Console.WriteLine item" ] }
[ "yes-answer-long", "yes-answer-short" ]
json
UNK_RELATION
garrys-mod@sandbox@32
garrys-mod -- garry s mod is a @placeholder game based around the idea of building .
{ "confidence": [ 42.20934295654297, 41.535247802734375, 39.43980026245117, 38.684669494628906, 38.314796447753906, 38.22646713256836, 38.22646713256836, 35.545249938964844, 35.545249938964844, 35.29684829711914, 34.895484924316406, 34.645240783691406, 33.707916259765625, 33.707916259765625, 32.77326202392578, 32.75448226928711, 32.527305603027344, 32.527305603027344, 32.527305603027344, 32.527305603027344, 32.527305603027344, 32.527305603027344, 31.381044387817383, 31.381044387817383, 30.689971923828125, 30.689971923828125, 30.680259704589844, 30.680259704589844, 30.680259704589844, 29.68248748779297, 28.611499786376953, 28.611499786376953, 28.48788070678711, 26.774166107177734, 26.370067596435547, 26.36545181274414, 26.36545181274414, 26.341373443603516, 25.97547149658203, 25.95241928100586, 25.085073471069336, 24.691940307617188, 24.57207489013672, 24.528118133544922, 24.528118133544922, 24.3521728515625, 24.3521728515625, 24.04275131225586, 23.885711669921875, 23.885711669921875, 23.885711669921875, 23.647342681884766, 23.548988342285156, 23.4205379486084, 23.151676177978516, 23.151676177978516, 22.914756774902344, 22.698041915893555, 22.697940826416016, 22.61668586730957, 22.510568618774414, 22.510568618774414, 22.279624938964844, 22.11688804626465, 22.11688804626465, 21.918701171875, 21.58320426940918, 21.436927795410156, 21.09313201904297, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.956092834472656, 20.629772186279297, 20.27955436706543, 20.003326416015625, 19.628751754760742, 18.723724365234375, 18.4310302734375, 18.186548233032227, 18.186548233032227, 18.186548233032227 ], "content": [ "This advice seems to be specific to Garry s Mod .", "In a game called Garry s mod there an add-on called wiremod .", "Edit : this is intended to be used on Garry s mod .", "Basically I am trying to use ULX in Garrys mod and have a file check if the user is VIP or staff that it will give them a weapon as soon as it notices the weapon being weapon physgun .", "@TomBlodget It s bad advice for Garry s Mod as well generally .", "I am following a tutorial on Lua specifically for making a gamemode in the game Garry s Mod .", "I m trying to create something in a game called Garry s Mod that uses Lua for addons .", "To do that I have added some code to the mainmenu.lua file of Garry s mod .", "http : wiki.garrysmod.com page file Find .. . .. . The following should work in Garry s Mod .", "I think your new question needs a new title and focuses on Garry s Mod which I m not familiar with .", "I have tasked myself with building an updating stats page on my website which updates itself with realtime stats from my Garry s Mod game server .", "Creating my loading screen on garrys-mod and seeing this useless coding and was betting that there is a way to shorten it massively however I am quite a php nooby and was wondering if there was a perhaps a way to use arrays or something to make it easier shorter", "I just Googled gary s mod client-server lua .", "@EtanReisner Wow that never occured to me that Garry s mod may not include the module .", "Anyone in the future that has this problem .. . .. . After some trawling around the scripting wiki I found that Garry s Mod has it s own file IO library .", "I wrote out this batch script to start up a dedicated source-server for Garry s Mod in test mode where all of the non-essential filesystem addons are moved to a --Disabled folder so that it does not load them into the game .", "I have a Garry s Mod script which contains this statement : .. . .. . My question is : how to retrieve my body variable out of this", "I m working on a leaderboard system for Garry s Mod and I have run into a slight problem to do with one of the statistics I m tracking .", "I am trying to create an Lua addon for Garry s Mod but I keep coming across an error in my code .", "I want to let some friends connect to my server just by clicking a simple button in the Garry s Mod menu .", "I ve recently started Coding a program that will replace sound effects from a default directory in the Source-Engine Game Garry s Mod .", "I don t know where you got that function from and I m no Gary s Mod expert .", "I m making a script for Garry s Mod and it s almost complete but for some reason when ever I type in the new Cvar i made it won t change host framerate .", "I am playing Garry s Mod and I m trying to make an e2 chip that allows me to add guns to a price list with for example name store name and then + AK47- 500 .", "How do I compile multiple .smd files with one .qc file for Garry s Mod", "I have been trying to code a whitelist add-on for my Garry s Mod server .", "See the Garry s Mod wiki http : wiki.garrysmod.com page sound PlayFile for more info and note the orange box on the page which means it s client-side .", "But the string.Explode is explained here : wiki.garrysmod.com page string Explode http : wiki.garrysmod.com page string Explode I m working mostly on garry s mod-lua libraries", "I started doing some research on the framework for Garry s Mod addons and I am very confused by the documentation presented here http : wiki.garrysmod.com page Main Page .", "I don t know enough about that mod or your code to tell if you that s the best approach but if Gary s mod lets you run Lua code on both the server and client and it doesn t automatically synchronize them through some kind of voodoo magic then it s up to you to do that .", "According to the Garry s Mod source code https : github.com garrynewman garrysmod blob master garrysmod html js menu control.Servers.js L110 you may call JoinServer in the menu state .", "I have decompiled the old Pikmin add-on for Garry s Mod because it s producing the following error : .. . .. . ERROR workshop lua sv pikmin.lua : 38 : attempt to call global ValidEntity a nil value 1 .", "Specifically this is for Garry s Mod however I don t think that matters too much in this problem .", "I don t know much about Garry s Mod besides that it exists but I would consider support for normal sockets to be far more likely than support for websockets .", "I created a script for the game Garry s Mod but once is loaded on some servers it gets the next error : .. . .. . ERROR addons ulib-master lua ulib shared hook.lua : 110 : addons applysystem lua applysystem init.lua : 13 : bad argument 1 to pairs table expected got nil fn - C : -1 unknown - addons ulib-master lua ulib shared hook.lua : 110 .. . .. . How can i fix it", "I m using file.Find from garry s mod to return the full directory of my maps in a table and I want to make sure the map doesn t start with arena wiki.garrysmod.com page file Find http : wiki.garrysmod.com page file Find", "So currently I have ulx and ulib installed they are free-to-use admin mod addons and I have a chatbox installed called atlaschat it s a custom chatbox for garrysmod now I have looked into ulib and ulx I m not really good at lua yet but I really do want to become one .", "I have a 3d game where I will create an rectangle which is working as screen and the game itself works with vectors to positions .", "Edit1 : When all players leave the game ref .", "So after taking a break and see your guyses comments i found that i had a capital S instead of a lower case s . Thanks to Tom Blodget for pointing that out .", "You can use the hook system to hook onto events that happen in the game .", "I need your help because my team and me actually work on Multi-Server in Garry s Mod I explain : We have 4 servers and we wan t to make comunicate servers so I have thinking about using Node JS Socket.io to create a server At first I m a Web Developper and all the Garry s Mod server be a client but I don t know if it s possible to connect a Gmod server to a NodeJS server So I ask you if you had an API or something else to create that .", "However when I try to run it ANYWHERE I have tried running in Ideone.com codepad.com lExecutor Garry s Mod etc I get the same error message .", "I m not familiar with Garry s Mod but if you just need to check if the player s nick is in the table you can do this : .. . .. . If you use a slightly different table to hold the players nicks then the check will become simpler Table is now used as a hash table http : www.lua.org pil 11.5.html :", "There are multiple C++ modules that lets you create regular sockets in Garry s Mod Bromsock https : facepunch.com showthread.php t 1393640 GLSock https : www.facepunch.com threads 1136961 however none of them support websockets so you will have to use the net https : nodejs.org api net.html Node.js module .", "Is there any way I can get around this", "Go to the function that is around line 25 .. . 4 .", "This code above works on ULX on Garry s Mod it uses find.File to read the directory of garrysmod maps and return in TABLE all of the files in it ending with .bsp all of the maps however I do not wan t it to include maps that begin with certain parts like arena and gm is there a way I can go about removing them and or making it keep checking until It gets a map not beginning with that .", "It is not possible to run Lua commands in the menu state when the user has launched the game .", "One of these hooks is Initialize which is called when the game first loads and Lua is initialized .", "I m new to this website and I m not sure if I m supposed to ask questions about mysql things in a game server .", "EDIT : I tried putting double quotes around all of the move arguments .", "Source Link : https : www.dropbox.com s yv2xuuh2ecqrfo8 pikmin.zip dl 0", "example : .. . .. . What I will create is an little bit hard but as idea simple .", "@Schollii it s a game and there is server-side only functions and client-side functions.. . in this case sound.PlayFile is client-side only and the autorun folder is purely server-side .", "I would like to know if its possible to run LUA commands though an addon when the user has just launched the game and if so how", "What is the purpose of the other .smd s", "You should whitelist based on SteamIDs .", "You can put an if SERVER then check around shared code to only make it run serverside .", "It tries to move advdupe2 into --Disabled but instead of actually doing that it shoves only advdupe2 s CONTENTS into --Disabled .", "It does not work with RunConsoleCommand connect mycoolgmodserverip.com too. . Do you have any idea", "is see 2 functions here and have no idea what they are doing nor what you want to restrict to the group owner", "Trying to fix an addon for Gmod : .. . .. . Pastebin http : pastebin.com MwT7Egh7 .. . .. . When I attempt to execute function DMenu.AddOption in game by right clicking on the prop and selecting Add to Exsto Restrictions and the rank I want it spits out : .. . .. . ERROR addons exsto-master lua exsto plugins shared restrictions.lua : 1019 : attempt to index field ent a nil value .. . .. . I m new to lua coding so I think it s because ent needs to be defined but I have no idea how to go about that .", "You could potentially set G.body body but I would avoid that and pass around callback functions that know how to load things once they are invoked .", "I m trying to make a 3D2D Sign that has text on it and displays a website so that i can walk around it and the website will stay in the same position .", "what the above code is supposed to do is look at the recived table and then based on whats in there update the relevent tables in the main table with the new data .", "I have an Idea for it but I don t know how to search through it .", "In your code simply call local snds file.Find sound customsteps GAME which gives you a table then you can simply choose a random one from the list using local snd snds math.random 1 snds and play it as you do in your above code - ply : EmitSound snd .", "You have Unnecessary s .", "if anyone know what the problem is your a life saver .", "Lua is a case-sensitive language http : www.lua.org manual 5.2 manual.html 3.1", "Try using an IDE that helps find this sort of non-syntax error .", "now i don t get the index global error but when i type speedhack enabled 1 it wont change the command host framerate .", "Do i need to add the i want it in the line RunConsoleCommand host framerate 5 speedhack", "In speedCvar and speedHackCvar you re defining the same cvar speedhack enabled twice .", "You also define speedhack twice both in and out of the if clause .", "Remove the local from first of each line creation of your objects to make your objects go globally across the lua .", "Your problem is that your functions are localized which means they can only be accessed from the file code block or chunk they re created in .", "Oh and also you had a mistake on your code which Is fixed From reading comments on your post .", "Could you possibly write it out for me", "im new to lua so it s kind of hard to understand where and what your telling me to do .", "For Lua in general it is not correct and goes against best practice .", "Can someone help me", "i need to fix this because it has been bugging me since yesterday .", "@BobGravity Your original question has been resolved and isn t all that useful for future visitors so I suggest deleting it .", "Perhap 111WARLOCK11 will follow you to the new question .", "This is what I have so far and I can t seem to figure out how to make the screen say what I say", "Why tag 4 different languages", "Because no one will see it otherwise do you know how to fix it", "Instead of helping why did everyone just edit the post. .", ".. . .. . If you mean something like reload function will work only after 60 change it to anything seconds try the following : - .. . .. . .. . .. . Based on your comment if you want to loop the sound till a specific time something like this should work", "Before I explain my problem I have already had a look around stack-overflow and looked through countless questions regarding this error message .", "I ve been working with a friend and we both have a problem in a Garry s Mod Server ok so we have a box saying Rules and when we go to place a website INSIDE OF THAT BOX it shows exactly this : .. . .. . http : cloud-4.steamusercontent.com ugc 37489242708029141 B4E51CC2F089F13DF25AA8F4F3E9BF7A07619427 .. . .. . As you can see it shows a box with the HTML5 coding not sure if I can place : http : www.sparkperp.com Rules index.html on that box .", "@NicoSchertler If an object s angle is 0 0 0 and I would rotate it right around a particular axis it will increase until 180 however if I rotate it left it will go from -180 to 0 back to 180 .", "ply : StripWeapons .. . ply : SetupHands .. . .. . .. . end .. . .. . function GM : PlayerSetHandsModel ply ent .. . .. . local simplemodel player manager.TranslateToPlayerModelName ply : GetModel .. . local info player manager.TranslatePlayerHands simplemodel .. . if info then .. . ent : SetModel info.model .. . ent : SetSkin info.skin .. . ent : SetBodyGroups info.body .. . end .. . .. . end .. . .. . function team red ply .. . .. . ply : SetTeam 0 .. . .. . end .. . .. . function team blue ply .. . .. . ply : SetTeam 1 .. . end .. . .. . concommand.Add team red team red .. . concommand.Add team blue team blue .. . .. . cl init.lua : .. . .. . .. . include shared.lua .. . include modules team teamMenu.lua .. . .. . shared.lua .. . .. . .. . GM.Name SpaceRP .. . GM.Author Dicknanigans .. . GM.Email N A .. . GM.Website N A .. . .. . team.SetUp 0 Red Color 255 0 0 .. . team.SetUp 1 Blue Color 0 0 255 .. . .. . teamMenu.lua .. . .. . .. . function set team .. . .. . local frame vgui.Create DFrame .. . frame : SetPos ScrW 2 ScrH 2 --Set the window in the middle of the players screen game window .. . frame : SetSize 200 210 --Set the size .. . frame : SetTitle Change Team --Set title .. . frame : SetVisible true .. . frame : SetDraggable false .. . frame : ShowCloseButton true .. . frame : MakePopup .. . .. . team red vgui.Create DButton frame .. . team red : SetPos frame : GetTall 2 5 --Place it half way on the tall and 5 units in horizontal .. . team red : SetSize 50 100 .. . team red : SetText Team Red .. . team red.DoClick function --Make the player join team 1 .. . RunConsoleCommand team red .. . end .. . .. . team blue vgui.Create DButton frame .. . team blue : SetPos frame : GetTall 2 105 --Place it next to our previous one .. . team blue : SetSize 50 100 .. . team blue : SetText Team Blue .. . team blue.DoClick function --Make the player join team 2 .. . RunConsoleCommand team blue .. . end .. . .. . end .. . concommand.Add team menu set team .. . .. . .. . teamsetup.lua .. . .. . .. . local ply FindMetaTable Player .. . .. . local teams .. . .. . .. . .. . THIS IS THE TEAM INIT AREA .. . .. . teams 0 .. . name red .. . description You are on the red team .. . color Vector 1.0 0 0 .. . weapons weapon smg1 weapon revolver weapon frag .. . model models player Group01 male 0 . . math.random 1 9 . . .mdl .. . .. . teams 1 .. . name blue .. . description You are on the blue team .. . color Vector 0 0 1.0 .. . weapons weapon smg1 weapon revolver weapon frag .. . model models player Group01 male 0 . . math.random 1 9 . . .mdl .. . .. . .. . .. . END .. . .. . .. . function GM : PlayerLoadout ply .. . .. . ply : StripWeapons .. . .. . ply : SetupTeam n .. . .. . end .. . .. . .. . function ply : SetupTeam n .. . if not teams n then return end .. . .. . self : SetTeam n .. . self : SetPlayerColor teams n .color .. . self : SetHealth 150 .. . self : SetMaxHealth 200 .. . self : SetWalkSpeed 200 .. . self : SetRunSpeed 400 .. . self : SetModel teams n .model .. . .. . self : GiveWeapons n .. . end .. . .. . function ply : GiveWeapons n .. . for k weapon in pairs teams n .weapons do .. . self : Give weapon .. . end .. . end .. . .. . What could I be doing wrong", "The method is based on a popular algorithm http : en.wikipedia.org wiki Fisher E2 80 93Yates shuffle to generate a random permutation of an array of elements .", "I finally updated the Pikmin addon to meet current Gmod coding standards and I m wondering why the addon is producing this weird shader graphical glitch : .. . .. . http : steamcommunity.com sharedfiles filedetails id 725356645 .. . .. . Does anyone have any ideas", "I have been coding a new custom gamemode for Gmod its going to be similar to DarkRP .", "However I have hit a wall ." ] }
{ "confidence": [ 50.15413284301758, 50.15413284301758, 46.098018646240234, 42.531394958496094, 41.27926254272461, 40.35242462158203, 37.90306854248047, 37.39949417114258, 37.16563415527344, 36.54453659057617, 36.03125762939453, 35.14490509033203, 34.918209075927734, 34.918209075927734, 34.904640197753906, 34.79397964477539, 34.783695220947266, 34.78022766113281, 34.45137023925781, 33.487892150878906 ], "content": [ "Question : Basically I am trying to use ULX in Garrys mod and have a file check if the user is VIP or staff that it will give them a weapon as soon as it notices the weapon being weapon physgun . This would need to check over and over so when a player joins or a player donates and gets switched to VIP it will give them the custom weapon . At this time I have no code . .. . Answer : Can t you also check ULX with ply : GetUserGroup Anyway here s how I would do it : .. . .. . If you would like to do it on the player s first spawn then do :", "Question : Basically I am trying to use ULX in Garrys mod and have a file check if the user is VIP or staff that it will give them a weapon as soon as it notices the weapon being weapon physgun . This would need to check over and over so when a player joins or a player donates and gets switched to VIP it will give them the custom weapon . At this time I have no code . .. . Answer : In ULX you must check the user s usergroup via table . Here s an example What it should be : .. . .. . This would give the player a crowbar if they are in the ULX group superadmin or admin when the function is called .", "Question : Creating my loading screen on garrys-mod and seeing this useless coding and was betting that there is a way to shorten it massively however I am quite a php nooby and was wondering if there was a perhaps a way to use arrays or something to make it easier shorter Code Here http : pastebin.com B92w4qUM Comment : I do recommend you to at least put all the cases where map in a comment for later reference . Comment : Consider a switch-statement . All the map lines can be part of the default case . .. . Answer : Comment : Thanks using 1 line per map instead of 3 3", "Question : Before I explain my problem I have already had a look around stack-overflow and looked through countless questions regarding this error message . I have tasked myself with building an updating stats page on my website which updates itself with realtime stats from my Garry s Mod game server . I have written a lua script which I will include below that in theory should pull the current map name and number of players connected to seperate text-files . Here is my program in it s current state I have not added a loop for updating just yet trying to get working in simplest form first : .. . .. . When I start up the server I get an error in my console with Line 4 : attempt to index global io a nil value .. . .. . After trying countless numbers of things and editing the code many times I am still unable to get this working when it should in theory be so simple and I have no idea what is wrong Thanks in advance for your help Comment : That looks like gmod doesn t include the io module in it . Do you know that it does Does gmod have its own io -type module instead Does it even allow things to do io -type stuff reading to and writing from disk directly Comment : @EtanReisner Wow that never occured to me that Garry s mod may not include the module . Here is a picture of the server s module folder- I can t see anything that may relate to IO unless you can tell me otherwise i.imgur.com 6Hr8EWO.png http : i.imgur.com 6Hr8EWO.png Comment : The io module is a lua built-in module but the hosting environment doesn t need to load it if they don t want to . You won t see any files related to it . You d have to check the gmod documentation . Comment : @pythagon For things like that reference the relevant documentation . Comment : It would make perfect sense for gmod to not include the io module . You don t want random scripts being able to read and write all over your hard-drive for example . .. . Answer : Anyone in the future that has this problem .. . .. . After some trawling around the scripting wiki I found that Garry s Mod has it s own file IO library . A link-to this page on the wiki can be obtained below : .. . .. . http : wiki.garrysmod.com page file Write", "Question : I m making a script for Garry s Mod and it s almost complete but for some reason when ever I type in the new Cvar i made it won t change host framerate . if anyone know what the problem is your a life saver . Comment : Lua is a case-sensitive language http : www.lua.org manual 5.2 manual.html 3.1 Comment : Try using an IDE that helps find this sort of non-syntax error . Comment : So after taking a break and see your guyses comments i found that i had a capital S instead of a lower case s . Thanks to Tom Blodget for pointing that out . now i don t get the index global error but when i type speedhack enabled 1 it wont change the command host framerate . Do i need to add the i want it in the line RunConsoleCommand host framerate 5 speedhack Comment : In speedCvar and speedHackCvar you re defining the same cvar speedhack enabled twice . You also define speedhack twice both in and out of the if clause . .. . Answer : Remove the local from first of each line creation of your objects to make your objects go globally across the lua . Your problem is that your functions are localized which means they can only be accessed from the file code block or chunk they re created in . Oh and also you had a mistake on your code which Is fixed From reading comments on your post . Comment : Could you possibly write it out for me im new to lua so it s kind of hard to understand where and what your telling me to do . Comment : This advice seems to be specific to Garry s Mod . For Lua in general it is not correct and goes against best practice . Comment : Can someone help me i need to fix this because it has been bugging me since yesterday . Comment : @BobGravity Your original question has been resolved and isn t all that useful for future visitors so I suggest deleting it . I think your new question needs a new title and focuses on Garry s Mod which I m not familiar with . Perhap 111WARLOCK11 will follow you to the new question . Comment : @TomBlodget It s bad advice for Garry s Mod as well generally .", "Question : I wrote out this batch script to start up a dedicated source-server for Garry s Mod in test mode where all of the non-essential filesystem addons are moved to a --Disabled folder so that it does not load them into the game . Here s all of the code that may be relevant to that : .. . .. . The weird thing happens on the third line of that . It tries to move advdupe2 into --Disabled but instead of actually doing that it shoves only advdupe2 s CONTENTS into --Disabled . And the advdupe2 just gets lost in the matrix or something . At first I thought I messed something up there but I didn t do anything differently from where I move sbep spacebuild and wire-extras and those 3 move perfectly . Any ideas EDIT : I tried putting double quotes around all of the move arguments . Same results . .. . Answer : Wrong order of commands .. . .. . If the target folder does not exist and in the original code it was created in the wrong place the first move command is equivalent to a rename operation then the following move commands will found that the target folder exists and then the move will be correctly done . Comment : applies head directly to desk I should ve noticed that.. . It worked when I switched them", "Question : I have been trying to code a whitelist add-on for my Garry s Mod server . I am fairly new to LUA so any help is much appreciated . I have an Idea for it but I don t know how to search through it . say I have a table .. . .. . This is as far as I have been able to understand how to do . Thankyou for you re time . Comment : Note : Nicknames can be altered . If an unauthorized user discovers the nickname of someone allowed on the server they can just change their name to that . You should whitelist based on SteamIDs . .. . Answer : I m not familiar with Garry s Mod but if you just need to check if the player s nick is in the table you can do this : .. . .. . If you use a slightly different table to hold the players nicks then the check will become simpler Table is now used as a hash table http : www.lua.org pil 11.5.html : Comment : For some reason I get this error from the console saying bad key to string index number expected got string I ve looked at what the : Nick command gives . It gives a string and the table is formatted like a string table so I have no clue where to go from here . Also I fixed the Player Conect not having PlayerConnect", "Question : null .. . Answer : How do I compile multiple .smd files with one .qc file for Garry s Mod I ve created a prop before but it only had one .smd . I created my model in Blender . Comment : What is the purpose of the other .smd s Are you using them for bodygroups LOD Animations", "Question : I want to let some friends connect to my server just by clicking a simple button in the Garry s Mod menu . To do that I have added some code to the mainmenu.lua file of Garry s mod . The Button and all other things work only the RunConsoleCommand connect mycoolgmodserverip.com fails.. . In the Console I can find the error Bad server address mycoolgmodserverip.com like when I would type connect mycoolgmodserverip.com in the console . But I have to remove the quotes.. . It does not work with RunConsoleCommand connect mycoolgmodserverip.com too. . Do you have any idea EDIT Thanks to MattJeanes JoinServer myip.com worked out Comment : What error do you get from the single-quoted version The same thing And if you run connect someserver.com on the command-line yourself you get the error with the quotes but connect someserver.com doesn t give you that error with the quotes pick some string that triggers that Bad server address error to test with Comment : connect someserver.com makes the same error and with single quotes too.. . it only works with connect someserver.com without quotes but how could I write that in my code Comment : You see whichever of single or double quotes you used on the command-line or in RunConsoleCommand in the error Or does the error always use double quotes .. . Answer : According to the Garry s Mod source code https : github.com garrynewman garrysmod blob master garrysmod html js menu control.Servers.js L110 you may call JoinServer in the menu state . Examples : .. . .. . JoinServer address JoinServer myepicserverip.com Comment : If my answer helped please mark it as the correct answer .", "Question : I am following a tutorial on Lua specifically for making a gamemode in the game Garry s Mod . I ve been looking at this for a while and I simply can t find what s wrong . Summary of code : I want to create a database.txt file at the directory above . Edit1 : When all players leave the game ref . A is reached but no file created in directory . Comment : possible duplicate of Attempt to index local self a nil value http : stackoverflow.com questions 14068944 attempt-to-index-local-self-a-nil-value .. . Answer : When you are calling the function databasePath you are not using the OOP syntax and therefore self is not implicitly passed to the function . Henceforth the error . Change the following : Comment : Thank you so much Yes this worked . The : versus . is strange for me since this is my first time encountering it . Comment : @cid : The : syntax for method calls a Lua-specific quirk . There are good reasons http : lua-users.org wiki ColonForMethodCall its like that though . Comment : it s actually similar in python", "Question : null .. . Answer : I am playing Garry s Mod and I m trying to make an e2 chip that allows me to add guns to a price list with for example name store name and then + AK47- 500 . This is what I have so far and I can t seem to figure out how to make the screen say what I say Comment : Why tag 4 different languages Comment : Because no one will see it otherwise do you know how to fix it Comment : Instead of helping why did everyone just edit the post. .", "Question : This code above works on ULX on Garry s Mod it uses find.File to read the directory of garrysmod maps and return in TABLE all of the files in it ending with .bsp all of the maps however I do not wan t it to include maps that begin with certain parts like arena and gm is there a way I can go about removing them and or making it keep checking until It gets a map not beginning with that . Any way I could do this and preferable pure Lua please . Oh and the site I m using to test it is MOAIFiddle http : moaifiddle.com Comment : The find function is a string-function and is available through the default string metatable so you can do strvar : find .. . . That function isn t available via the default table metatable there is no such metatable . What are you trying to do Test each value in the table against the pattern Comment : I m using file.Find from garry s mod to return the full directory of my maps in a table and I want to make sure the map doesn t start with arena wiki.garrysmod.com page file Find http : wiki.garrysmod.com page file Find Comment : If the table is like the one in your question hello world test do you want to check if the first string starts with hello or any string or all strings Comment : file.find and string.find are entirely different functions and I m not sure how file.find is relevant here . That snippet is using string.find and the error is because you tried to replace a string with a table in that snippet which doesn t work . What is your goal for the snippet in your question when ss1 is a table Comment : Alright I was trying to use that as an example because find.File isn t normally in lua but I ll edit it and re-explain sorry . .. . Answer : It looks like the function you meant is file.Find instead of find.File . http : wiki.garrysmod.com page file Find .. . .. . The following should work in Garry s Mod . What it does is read all maps in maps and then add all maps that do not have a certain prefix defined in ignoredPrefixes to the maps table . When it is done doing so a random map will be selected from the table .", "Question : null .. . Answer : I m trying to create something in a game called Garry s Mod that uses Lua for addons . Basically I need to check if the player s cursor has entered a specific area . So I ve basically got that I check where the player s hitpos is where he s looking and hitentity the entity he s looking at and I need to check if he s looking at draw.RoundedBox . Problem I m having is I don t know how I could check if the cursor is inside a graphical box that is displayed on an entity . This is the white box I need to check if the players hitpos has entered .. . .. . image i.stack.imgur.com xohPD.jpg Comment : Do you get the raw world coordinate or the coordinate in model space of the entity you re looking at Expand on that . Comment : What is the line where you compare hitpos to a point Vector is it how you are currently trying to determine if hitpoint is box That cant work where are you getting those numbers 33 -3 30 from", "Question : I created a script for the game Garry s Mod but once is loaded on some servers it gets the next error : .. . .. . ERROR addons ulib-master lua ulib shared hook.lua : 110 : addons applysystem lua applysystem init.lua : 13 : bad argument 1 to pairs table expected got nil fn - C : -1 unknown - addons ulib-master lua ulib shared hook.lua : 110 .. . .. . How can i fix it this is the line 13 : .. . .. . If needed theres the entire function where the error is created : Comment : It seems to me results 1 is nil instead of a table . My best guess is you re query didn t return any results Comment : results 1 .data that is . If results 1 was nil then that would be an error about attempting to index nil . Comment : Correct . commenting using a mobile phone isn t that handy . I meant results 1 .data .. . Answer : Fixed thanks guys it was because i were trying to retrieve nil values .", "Question : First sorry for my English but I m french . I need your help because my team and me actually work on Multi-Server in Garry s Mod I explain : We have 4 servers and we wan t to make comunicate servers so I have thinking about using Node JS Socket.io to create a server At first I m a Web Developper and all the Garry s Mod server be a client but I don t know if it s possible to connect a Gmod server to a NodeJS server So I ask you if you had an API or something else to create that . Thanks Before for your answers Cordially Matspyder . Comment : Websockets are kind of special . I don t know much about Garry s Mod besides that it exists but I would consider support for normal sockets to be far more likely than support for websockets . .. . Answer : There are multiple C++ modules that lets you create regular sockets in Garry s Mod Bromsock https : facepunch.com showthread.php t 1393640 GLSock https : www.facepunch.com threads 1136961 however none of them support websockets so you will have to use the net https : nodejs.org api net.html Node.js module . If you wish to have a practical example of a system running on Node.js and Bromsock you can have a look at my Steam chat bot s source code : FoxedBot https : github.com Starfox64 FoxedBot .", "Question : null .. . Answer : So currently I have ulx and ulib installed they are free-to-use admin mod addons and I have a chatbox installed called atlaschat it s a custom chatbox for garrysmod now I have looked into ulib and ulx I m not really good at lua yet but I really do want to become one . This might probaly be the noobiest question and I hope you guys out there can teach me on how to do this so in the future I can do this for myself . --Start of code .. . .. . --End of code . What I want to add is something really simple and that is that this feature can only be used by a certain ply : IsUserGroup owner Is this possible to do maybe Comment : can someone please help me out : Comment : which feature is see 2 functions here and have no idea what they are doing nor what you want to restrict to the group owner", "Question : In a game called Garry s mod there an add-on called wiremod . Inside wiremod there is expression 2 which is a conmand line basiced coding so execute commands . The command For loop I m having issues with because I can t do variable inside a variable . In CMD I could setlocal EnableLocalExtension and do Var Var The code simpler is : cap sensitive .. . .. . My problem is I can t change GoCart1 to GoCart2 GoCart3.. . Ect Tried GoCartN but gives me an error GoCartN does not exists Anyone have any ideas .. . Answer : Short answer I m going to separate the code .. . .. . If anyone know how to put GoCart in the loop please let me know", "Question : I have decompiled the old Pikmin add-on for Garry s Mod because it s producing the following error : .. . .. . ERROR workshop lua sv pikmin.lua : 38 : attempt to call global ValidEntity a nil value 1 . v - workshop lua sv pikmin.lua : 38 2 . Call - lua includes modules hook.lua : 84 3 . unknown - gamemodes sandbox entities weapons gmod tool shared.lua : 279 .. . .. . This section of code is on line 38 : .. . .. . end .. . .. . Line 38 is specifically the if-statement with the ValidEntity keyword . I would like to somehow be able to update this fantastic add-on so we can use it along with the tool-gun . I have the whole project here : https : drive.google.com file d 0Bwr6tf5HSyxyRXZ0c2VkQmEtU2M view usp sharing .. . .. . Thanks Pikmin25 . .. . Answer : ValidEntity is not a function in your scope . Therefor you cannot call it . I don t know where you got that function from and I m no Gary s Mod expert . But the reference documentation lists a function IsValid entity . Maybe you can use this instead as you are obviously trying to validate an entity . So try to replace ValidEntity tr.Entity by IsValid tr.Entity Comment : Well this is a very old plugin which has been re-uploaded several times . It doesn t surprise me that it has deprecated code . I m just trying to update it so I can use the tool-gun with it enabled .", "Question : I am trying to create an Lua addon for Garry s Mod but I keep coming across an error in my code . This is my code : .. . .. . And this is the resulting error . Any ideas Comment : This means that sound exists as an object but it does not have a member called PlayFile . I ve never used gmod so from what you show could it be that some code you run elsewhere has a sound something Or less likely because Lua is not complaining that sound doesn t exist just that it doesn t have PlayFile as field could it be that you need to activate something in the gmod UI or config to make the sound module available .. . Answer : The lua autorun file is serverside and there is a variable sound server-side Lua however only in client-side does sound.PlayFile exist . See the Garry s Mod wiki http : wiki.garrysmod.com page sound PlayFile for more info and note the orange box on the page which means it s client-side . Please remember to check what the function takes also : .. . .. . sound.PlayFile string path string flags function callback .. . .. . Example taken from the wiki .. . .. . Also more easy way of searching the docs : .. . .. . http : glua.me .. . .. . http : glua.me docs q sound.PlayFile .. . .. . How DarkRP handles this : .. . .. . https : github.com FPtje DarkRP blob master gamemode modules chatsounds.lua L275 Comment : @Schollii it s a game and there is server-side only functions and client-side functions.. . in this case sound.PlayFile is client-side only and the autorun folder is purely server-side . Comment : Also be sure to mark this as accepted if it fixed your issue Comment : I ve seen a suggestion to use surface.PlaySound . The code : BroadcastLua surface.PlaySound s2 almost works but I end up with an error of PlaySound string expected got nil If I know the exact file to play such as hello.mp3 then the code BroadcastLua surface.PlaySound misc custom hello.mp3 will play the sound whenever text is entered in the chat . The tricky part is making it dynamic for different inputs Comment : That means s2 is not a string however this should have solved the first issue.. . this isn t a support form though . It s saying s2 is nil try adding in a few things to debug like print and so on it should help.. . Comment : Ah you forgot the path to the file see how before you had misc custom ..s2. . .mp3 Yeah sorry just noticed . Edit also when I posted that comment your answer came up Ha well Robotboy is a dev of gmod so I d say he could help a lot more than I could and I suggest using a table or an array for words with a space like hi there etc .", "Question : I have been trying to code a whitelist add-on for my Garry s Mod server . I am fairly new to LUA so any help is much appreciated . I have an Idea for it but I don t know how to search through it . say I have a table .. . .. . This is as far as I have been able to understand how to do . Thankyou for you re time . Comment : Note : Nicknames can be altered . If an unauthorized user discovers the nickname of someone allowed on the server they can just change their name to that . You should whitelist based on SteamIDs . .. . Answer : Make a Table of the Whitelisted SteamIDs do NOT use Names They aren t unique .. . .. . Then write your Code it should be something like that .. . .. . Note that I didn t used the PlayerConnect Hook . I didn t used it cause we just have the players name there but we need a full Player Object . Soure : My Experience and the GMod Wiki .. . .. . Notes : Used SteamIDs in example are all my own valid accounts Code is not testest pls comment if something isn t working as expected" ] }
[ "yes-answer-long", "yes-answer-short" ]
sandbox
UNK_RELATION
emacs-faces@emacs@30
emacs-faces -- a face in gnu @placeholder is a text style .
{ "confidence": [ 39.0859260559082, 35.89250946044922, 35.089534759521484, 34.375858306884766, 33.486778259277344, 33.28386688232422, 33.264732360839844, 33.26454162597656, 33.1889762878418, 32.98564147949219, 32.610267639160156, 32.32147216796875, 31.76482391357422, 31.641937255859375, 31.587160110473633, 31.45315170288086, 31.29927635192871, 31.23477554321289, 31.208900451660156, 30.864471435546875, 30.77234649658203, 30.64710235595703, 30.349300384521484, 30.349300384521484, 30.349300384521484, 30.349300384521484, 30.318004608154297, 30.318004608154297, 30.279375076293945, 30.10807228088379, 29.60232162475586, 29.55422592163086, 29.55422592163086, 29.397920608520508, 29.200031280517578, 29.183486938476562, 29.148191452026367, 28.677806854248047, 28.646772384643555, 28.630430221557617, 28.592966079711914, 28.553281784057617, 28.526016235351562, 28.42251205444336, 28.09850311279297, 28.024986267089844, 27.993690490722656, 27.93532943725586, 27.933311462402344, 27.696109771728516, 27.696109771728516, 27.55535316467285, 27.174388885498047, 26.990205764770508, 26.927682876586914, 26.868696212768555, 26.737802505493164, 26.737802505493164, 26.737802505493164, 26.737802505493164, 26.70563507080078, 26.697307586669922, 26.68873405456543, 26.530353546142578, 26.518924713134766, 26.455524444580078, 26.455524444580078, 26.360477447509766, 26.278011322021484, 26.26170539855957, 26.26170539855957, 26.257781982421875, 26.171812057495117, 26.171812057495117, 26.125431060791016, 26.125431060791016, 25.963699340820312, 25.963699340820312, 25.921138763427734, 25.921138763427734, 25.910560607910156, 25.83480453491211, 25.83480453491211, 25.83480453491211, 25.79002571105957, 25.79002571105957, 25.79002571105957, 25.65035629272461, 25.65035629272461, 25.606891632080078, 25.511268615722656, 25.511268615722656, 25.511268615722656, 25.46802520751953, 25.41168212890625, 25.41168212890625, 25.41168212890625, 25.41168212890625, 25.41168212890625, 25.368911743164062 ], "content": [ "Defining Faces - GNU Emacs Lisp Reference Manual http : www.gnu.org software emacs manual html node elisp Defining-Faces.html Defining-Faces says that a face name should not end in -face but when I run list-faces-display there are some face names that end with that .", "Why is emacs not prompting me for that face", "How do you change the default face which Emacs uses to style text on a per-mode basis", "Is there any way to define a face in Emacs e.g .", "Looking through the Faces for emacs I see several eshell specific faces for symlinks directories prompt etc .", "the custom-set-faces is written by emacs s customize-face mechanism :", "Here is a link-to the documentation regarding remapping faces : http : www.gnu.org software emacs manual html node elisp Face-Remapping.html", "This ignores faces set as text properties .", "Thanks but when I invoke M-x customize-face it prompts me with Customize face default all faces .", "M-x customize-face RET default will allow you to set the face default face on which all other faces base on .", "The problem as I wrote is that the emacs-faces are not buffer-local so the above set-face-foreground calls will affect all windows and all mode lines .", "I defined a new face in Emacs but the coloring does not take effect .", "I m trying to do this but in Emacs 23.1.1 the auto-complete will only show the options set-face-background set-face-font set-face-inverse-video-p set-face-underline set-face-background-pixmap set-face-foreground set-face-stipple set-face-underline-p .", "But basically you can put cursor to text and execute M-x customize-face - Emacs will ask for name of face font+color+.. . and by default it substitutes the name of face for text under cursor so you can simply press enter .", "From Emacswiki http : www.emacswiki.org emacs SetFonts GNU Emacs 23 has a built-in key combination : .. . .. . C-xC-+ and C-xC-- to increase or decrease the buffer text-size", "This little snippet from http : www.emacswiki.org emacs GnusFormatting tries to work around that and also introduces separate faces for empty and non-empty topics : .. . .. . That page also notes that you have to replace my-gnus-topic-empty-face and my-gnus-topic-face with some appropriate faces or create your own .", "In Emacs 24.3 you ll need to adjust the following faces : .. . .. . This code is from the latest version of Zenburn https : github.com bbatsov zenburn-emacs .", "They do work - Emacs will process all lists - however if you then use M-x customize-face to add a new custom face similarly for a variable and save it for future sessions Emacs will combine all the lists into one .", "BTW the convention nowadays is to not use a -face suffix for faces tho such a suffix is still used of course for variables holding faces tho we haven t bothered to rename the font-lock-foo-face faces to font-lock-foo yet even though it would very much help the confusion you re seeing where a lot of font-lock rules say things like 0 font-lock-foo-face and people think it refers to the font-lock-foo-face face whereas it refers to the font-lock-foo-face variable whose value holds the font-lock-foo-face face .", "Names and line numbers speak to GNU emacs 22.3.1 .", "The key-bindings for the mouse wheel don t work I have version GNU Emacs 24.3.1 x86 64-pc-linux-gnu GTK+ Version 3.10.7", "Is it possible to define a second comment face and comment-start indicator in Emacs such that the second comment highlight appears even if called from within the first comment-face", "I think all faces does not refer to the face under the cursor in my picture above .", "M-x customize-face indicates that the content is associated with two faces : underlined and bold-italic .", "If you find you need to override faces once they re set consider FACE-REMAP-ADD-RELATIVE and friends .", "If enable hl-line-mode you will only see hl-line as the face not the other faces .", "As for having multiple custom-set-faces .. . or custom-set-variables .. . lists I have just tested this in Emacs 23.1 .", "I m trying to define some emacs font faces to do some custom highlighting .", "Here is the face and mode definition in .emacs : .. . .. . However when I use font-lock-builtin-face instead of sml-highlight-operator-face those characters are highlighted albeit with a color I don t want .", "You change your face in a hook add-hook highlight-current-line-hook lambda set-face-foreground font-lock-comment-delimiter-face NOT BLACK set-face-foreground font-lock-comment-face NOT BLACK you can read about hooks in manual gnu.org software emacs manual html node emacs Hooks.html https : www.gnu.org software emacs manual html node emacs Hooks.html", "B how can I tell emacs to use the following faces", "How can I adjust the term face in the new Emacs to get the same control that was possible with ansi-term-color-vector", "-- .. . .. . I m setting Emacs font-size by using face-font-rescale-alist like followings .", "I currently have a custom Emacs mode with the following : .. . .. . .emacs file : : set-face-attribute font-lock-comment-face nil : foreground gray70 .. . .. . custom mode.el : : set make-local-variable comment-start .. . .. . Is it possible to add : .. . .. . .emacs file : : set-face-attribute font-lock-comment-face nil : foreground gray70 set-face-attribute font-lock-comment2-face nil : foreground forestgreen .. . .. . custom mode.el : : set make-local-variable comment-start set make-local-variable comment2-start .. . .. . such that the line .. . .. . Test comment : Second test comment .. . .. . is rendered in two colors", "Instead add custom variables with customize-set-variable and custom faces with set-face-attribute : .. . .. . In order to customize face of some package one sometimes need to request the package first and after that set its face :", "Here s some code to start you off : .. . .. . I ve seen this work for most of the cases except for basic-faces that don t call set-face-attribute for instance the error face .", "Or should I move that to a different block to avoid Emacs from getting confused .. . .. . Also would Emacs get confused I have multiple custom-set-faces .. . blocks", "Or just get a recent version of emacs and use buffer-face-mode .", "When I customize a face through the M-x customize-face menu and save the changes to disk Emacs adds automatically generated code to my .emacs file that looks like this : .. . .. . where SOME CODE is something like : .. . .. . Now say that I want to manually make changes to SOME CODE and perhaps add more code to modify other faces .", "load-theme tango-dark t .. . .. . If I run what-cursor-position on the image above described here : Get font-face under cursor in Emacs http : stackoverflow.com questions 1242352 get-font-face-under-cursor-in-emacs I get : .. . .. . How can I modify this font", "One of the new features http : www.masteringemacs.org articles 2013 03 11 whats-new-emacs-24-3 in Emacs 24.3 seems to be that it revamps the mechanism to control the face of term buffers i.e .", "What s needed is the ability to do that but also let that face take a back seat to any faces that might already be given to particular parts of the prompt string .", "More precisely remove the closing parens after custom-set-faces and the region line -- after that the code works fine for me on Emacs 23.1.1", "If you are manually adding custom faces keep it in custom-set-faces .", "Library replace+.el http : www.emacswiki.org emacs-en download replace 2b.el turns off the face over the entire prompt and highlights important parts of the prompt exactly the ones you are requesting in different faces which you can of course customize .", "I have successfully followed examples in the GNU documentation to change the face of single-line regular expressions .", "I m using Aquamacs 2.1 which is based on GNU Emacs 23.2.50.1 on OS X 10.6.5 if that makes a difference .", "@Drew But there are hundreds of faces.. .", "As far as I can tell from the docs strike-through is not a face but an attribute of the text face which in this case is imposed on top of whatever face is in effect like default-face .", "I believe the point of variables that hold faces is that you can change which face is used without actually changing the face definition .", "How about something like this : .. . .. . You can then customize the variable-pitch face and the other faces in the buffer will inherit from this instead of the default face .", "I have a horrible font rendering for verbatim text in Emacs LaTeX mode : .. . .. .", "Could you try face instead of font-lock-face", "To my understanding this requires Emacs 23 can t find neither variable-pitch-mode nor buffer-face-mode in Emacs 22 .", "Nothing in term actually uses those faces directly they are just used to derive other faces .", "i hate that color http : s24.postimg.org 9d3mlv6qt image.jpg .. . .. . I v read some articles explaining how to change font faces in Emacs .", "And if so they can customize that face .", "Check the definition of face default .", "Or customize face default .", "M-x describe-face", "If I were to write a package which uses its own faces should I use the -face suffix", "Mickey from Mastering Emacs comments the following http : www.masteringemacs.org articles 2013 03 11 whats-new-emacs-24-3 : .. . .. . If like me you customized ansi-color-names-vector to change the default term colours I suggest you switch to using the faces now .", "Here is what is in my .emacs .", "See this answer http : stackoverflow.com a 5058752 261142 to a related question and also Emacs documentation http : www.gnu.org software emacs manual html node emacs Saving-Customizations.html .", "Related to this StackOverflow question http : stackoverflow.com questions 15733873 customizing-highlighting-faces-in-emacs-only-change-the-background-color I added .. . .. . below the : inherit line for hlinum and it used the same color .", "It also lets me modify the properties of these faces e.g .", "However I don t want to redefine these faces .", "gnu.org software emacs manual html node elisp http : www.gnu.org software emacs manual html node elisp Text-Properties.html here it explains how Emacs represents the additional info of the text .", "How to get the underlying faces", "I am very new to emacs and despite the great online documentation http : www.gnu.org software emacs manual html node elisp Syntactic-Font-Lock.html Syntactic-Font-Lock I can t figure out how to customize the face applied to the content between HTML header tags e.g .", "Thus if you refactor it there is a good chance that .. . .. . 1 . you break compatibility with the customization system .. . 2 . your refactored code will be overwritten by the original code next time you customize a face .. . .. . However if you find your .emacs file too cluttered you can configure Emacs to write customization code to a separate file .", "The element 0 sml-highlight-operator-face in your font-lock-keywords does not say use face sml-highlight-operator-face for sub-match 0 but use the result-of evaluating the expression sml-highlight-operator-face as the face to put on sub-match 0 .", "will print the face found at the current point .", "Trey s what face is on the right track .", "This is only part of your .emacs right", "Duh forgot it wasn t bundled with Emacs .", "In my Emacs set-face-attribute is indeed missing from M-x execute-extended-command but it is present in M- : eval-expression and C-h f describe-function .", "When I m running eshell or shell in emacs I would like to have the default face be a different font like Courrier so that eshell looks more like a normal shell .", "Personally although I too hate the effect of bold on faces on MS Windows at least I prefer to simply redefine the individual faces .", "I have also tried M-x customize-faces but it is not obvious to me which of the hundreds of faces listed is being used by realgud .", "A full list of attributes is in the manual http : www.gnu.org software emacs manual html node elisp Face-Attributes.html .", "Also how do you know that font-lock-string-face is specifically the face I have under the cursor", "In my Elisp file responsible for face customizations I have the following : .. . .. . However the hlinum face remains unchanged .", "in a hashtable keyed by face then you can later pass it to FACE-REMAP-REMOVE-RELATIVE to disable the remapping .", "More info about window fringes here https : www.gnu.org software emacs manual html node emacs Fringes.html .", "See github.com jonathanchu emacs-powerline https : github.com jonathanchu emacs-powerline for reference .", "See github.com rocky emacs-dbgr wiki Customizing-Colors https : github.com rocky emacs-dbgr wiki Customizing-Colors .", "Since the background of face default is White as shown that is also the frame parameter background-color value which should be what is shown outside the text areas .", "Another possibility I can think of is that some code you use applies a face or a display text property or overlay property to newline characters in your buffer .", "the yanked text adopts the font-face of the location where it is yanked", "I had thought the combination of delay-mode-hooks .. . run-mode-hooks would make setq buffer-face-mode-face .. . buffer-face-mode run after the new mode was set up but apparently not .", "Replacing font-lock-face with face : .. . .. . propertize buffer-file-name face : foreground white .. . .. . .. . .. . .. . .. . .. . Follow Up .. . .. . Thanks to TacticalCoder I now have exactly what I want - multiple fonts and colours in my modeline .", "There s a bug in the what-face code : the function takes pos as an argument but then doesn t use it when getting the face -- instead it uses point even though the message later claims pos in the No face at d case .", "All custom-set-.. . code is generated automatically by Emacs easy customization http : www.gnu.org software emacs manual html node emacs Easy-Customization.html Easy-Customization system .", "Is there a way to easily modify the font-face under cursor", "@user273158 It should be font-lock-string-face", "I can add a slant effect to the underlined face .", "I evaluated the variable face-font-rescale-alist .", "Then you can M-x customize-face .", "emacs is absolutely determined to have that grey background ." ] }
{ "confidence": [ 48.566219329833984, 48.563560485839844, 47.71868896484375, 45.7209358215332, 45.05498123168945, 45.01766586303711, 44.30475616455078, 44.101219177246094, 43.98723602294922, 43.858150482177734, 43.58900833129883, 43.254940032958984, 43.21672821044922, 43.07986831665039, 42.845458984375, 42.51488494873047, 42.21600341796875, 42.19487380981445, 41.81175231933594, 41.81083679199219 ], "content": [ "Question : How do you change the default face which Emacs uses to style text on a per-mode basis For example say that I am already happy with the face customizations that I have which include a default fixed-width font . However in one particular mode markdown-mode.el say I want the default font to be variable-width . It is easy to style headers links etc . uniquely for markdown-mode : simply place the cursor over the styled text and M-x describe-face then click the link-to customize it . However the default face is the face used if no other face is specified so it is not specific to markdown-mode and if modified will affect all other modes . What magic can I put in the markdown-mode-hook to set the default face for buffers using this mode Comment : If there is a some variable that controls the default faces then you can localized it for the current buffer only in a hook that getting called while opening a file w markdown . Comment : The question is asked in a general way then a specific example is made and answers revolve around this specific example . If you really need to Set Emacs defaut font-face per-mode see Using a different font for each major mode - Emacs Stack Exchange http : emacs.stackexchange.com questions 3038 using-a-different-font-for-each-major-mode 3042 3042 .. . Answer : How about something like this : .. . .. . You can then customize the variable-pitch face and the other faces in the buffer will inherit from this instead of the default face . Read the docs for buffer-face-mode for more customization details . BufFace is also used for text-scale-increase and text-scale-decrease .. . very useful . Comment : To my understanding this requires Emacs 23 can t find neither variable-pitch-mode nor buffer-face-mode in Emacs 22 . Comment : Wow people still use Emacs 22 Comment : Thanks does the trick . However when a buffer uses variable-pitch fonts scrolling becomes so paaainfully slow that it s unusable . But this is probably just a bug .", "Question : I am very new to emacs and despite the great online documentation http : www.gnu.org software emacs manual html node elisp Syntactic-Font-Lock.html Syntactic-Font-Lock I can t figure out how to customize the face applied to the content between HTML header tags e.g . h1 Content here h1 so that the content is not displayed underlined nor bold in emacs . In other words I would like such content to be displayed with no ornament at all as pure default text . In a general manner how can syntactic-based not keyword-based highlighting be customized Does anyone know how to proceed .. . Answer : it depends on which mode is used to edit html files . But basically you can put cursor to text and execute M-x customize-face - Emacs will ask for name of face font+color+.. . and by default it substitutes the name of face for text under cursor so you can simply press enter . After that Emacs will open new buffer where you can edit parameters . After that you can press Apply to set only for current session or Save to save these parameters into file with settings . Comment : M-x customize-face indicates that the content is associated with two faces : underlined and bold-italic . It also lets me modify the properties of these faces e.g . I can add a slant effect to the underlined face . However I don t want to redefine these faces . I just want not to associate these faces with the content of HTML headers h1 h2 etc . In other words what I am looking for would make M-x customize-face return default instead of underlined bold-italic the next time I run it with the cursor on such a header . Comment : which mode are you using You can find this by pressing C-h m Comment : Thanks for your help Alex . I am in HTML major mode with all the associated default minor modes . I haven t customized anything so far .", "Question : When I customize a face through the M-x customize-face menu and save the changes to disk Emacs adds automatically generated code to my .emacs file that looks like this : .. . .. . where SOME CODE is something like : .. . .. . Now say that I want to manually make changes to SOME CODE and perhaps add more code to modify other faces . Would it be smart to keep those changes under the custom-set-faces block Or should I move that to a different block to avoid Emacs from getting confused .. . .. . Also would Emacs get confused I have multiple custom-set-faces .. . blocks same question for custom-set-variables .. . .. . Answer : If you are manually adding custom faces keep it in custom-set-faces . As for having multiple custom-set-faces .. . or custom-set-variables .. . lists I have just tested this in Emacs 23.1 . They do work - Emacs will process all lists - however if you then use M-x customize-face to add a new custom face similarly for a variable and save it for future sessions Emacs will combine all the lists into one . So you should probably only keep the one .", "Question : Defining Faces - GNU Emacs Lisp Reference Manual http : www.gnu.org software emacs manual html node elisp Defining-Faces.html Defining-Faces says that a face name should not end in -face but when I run list-faces-display there are some face names that end with that . If I were to write a package which uses its own faces should I use the -face suffix What about user-variables that hold faces Should the variable names end in -face .. . Answer : If the manual says that you shouldn t do it don t do it . The ones that end with -face are old holdovers that were written before the rule came into place and haven t been rewritten yet . The variables that hold faces is something similar to a box that can hold exactly one box of the same size . Not very useful . You can get by without them I think . Comment : I believe the point of variables that hold faces is that you can change which face is used without actually changing the face definition . This can certainly be useful if a given face is utilised in multiple places and you only want to change the appearance in some of them although it s undoubtedly true that this flexibility is not needed in all cases . In response to the original question I would certainly recommend that such variables end in -face as that is clearly the normal convention . Comment : Both @abo-abo and @phils are correct . There is still a use for such variables as @phils explained . But in the past there were also some such variables that were not needed . And in the past there were also face names that had the suffix -face . Comment : Face variables are much less useful now that you can get the same result via face-remap-alist .", "Question : When I use query-replace to replace say abc by def and then call query-replace again I get a minibuffer that looks like this all in the same face : .. . .. . It would be easier to read this line if abc and def were displayed in a different face . This would be even more pronounced if either the search or replacement string contained spaces or parentheses or arrows all of which would blend with the prompt around them . I would expect a different face for the search and replacement strings to be offered by default . However I can t find anything in the documentation that even allows one to separately customize the faces used to show the search and replacement strings . Can someone provide me with some code that I could use to do this Comment : Sounds like a good thing . Why don t you suggest this as an addition to Emacs . I believe that you can use the Help - Send Bug Report menu item for this . Comment : @Alan : aren t you talking about the mini-buffer instead of the modeline Comment : The function at issue is query-replace-read-from within replace.el . And yes @TacticalCoder is correct -- the mini-buffer is at issue not the modeline . It should be possible to use font-lock for different elements of the query-replace-read-from or something like an overlay text-properties . Modifying the format of the layout is also possible . We already know it is possible to change the font for minibuffer-prompt and also set minibuffer default font with an enter exit-minibuffer-setup so it should be possible to do what you propose . .. . Answer : Use library replace+.el http : www.emacswiki.org emacs-en download replace 2b.el -- description here http : www.emacswiki.org emacs ReplacePlus . See also Emacs bug 16136 http : debbugs.gnu.org cgi bugreport.cgi bug 16136 which is a related enhancement request . The problem is that users can currently decide only whether the entire prompt is to have a face . And if so they can customize that face . What s needed is the ability to do that but also let that face take a back seat to any faces that might already be given to particular parts of the prompt string . Library replace+.el http : www.emacswiki.org emacs-en download replace 2b.el turns off the face over the entire prompt and highlights important parts of the prompt exactly the ones you are requesting in different faces which you can of course customize . If enhancement request 16136 http : debbugs.gnu.org cgi bugreport.cgi bug 16136 is implemented then the rest of the prompt can be kept in the normal prompt face minibuffer-prompt . It s a bit hard to believe that the design for this was so shortsighted in Emacs but it was . And it is implemented in C code so it is not very amenable to user improvement . Let s hope for a fix . Meanwhile you can get what you request but without minibuffer-prompt being used on the rest of the prompt by loading replace.el .", "Question : When I m running eshell or shell in emacs I would like to have the default face be a different font like Courrier so that eshell looks more like a normal shell . Looking through the Faces for emacs I see several eshell specific faces for symlinks directories prompt etc . but I don t see anything for just the basic default face . Google returns lots of results about customizing the actions of eshell but very little about customizing its look . .. . Answer : This example is adapted from : http : www.emacswiki.org emacs FacesPerBuffer Comment : Awesome This is exactly what I was looking for . Thanks", "Question : I also want to save the font-size in my .emacs file . Comment : see also : stackoverflow.com questions 2091881 http : stackoverflow.com questions 2091881 emacs-font-sizing-with-ctrl-key-and-mouse-scroll Comment : This is the simplest answer that worked for me stackoverflow.com a 6050987 215094 http : stackoverflow.com a 6050987 215094 Comment : Novice use .emacs.d init.el instead which is better cleaner and better version-control .. . Answer : M-x customize-face RET default will allow you to set the face default face on which all other faces base on . There you can set the font-size . Here is what is in my .emacs . actually color-theme will set the basics then my custom face setting will override some stuff . the custom-set-faces is written by emacs s customize-face mechanism : Comment : Many advanced emacs users prefer to not use the customize system as it s error prone and intermingles all customizations . It s better to break your customization up into individual .el files and load them from init.el and add your mode customizations as elisp code within each one . See huaiyuan s answer above to see how to set font via elisp .", "Question : How can I adjust the term face in the new Emacs to get the same control that was possible with ansi-term-color-vector One of the new features http : www.masteringemacs.org articles 2013 03 11 whats-new-emacs-24-3 in Emacs 24.3 seems to be that it revamps the mechanism to control the face of term buffers i.e . : .. . .. . The variables term-default-fg-color and term-default-bg-color are now deprecated in favor of the customizable face term . .. . You can customize how to display ANSI terminal colors and styles by customizing the corresponding term-color-COLOR term-color-underline and term-color-bold faces . Mickey from Mastering Emacs comments the following http : www.masteringemacs.org articles 2013 03 11 whats-new-emacs-24-3 : .. . .. . If like me you customized ansi-color-names-vector to change the default term colours I suggest you switch to using the faces now . The good news here is you can should desire to change more than just the colours for each ANSI Color : there s nothing stopping you from forcing a different font for certain colours .. . .. . Like Mickey I was also using ansi-color-names-vector to make sure that the color of my term buffers looked well on dark themes e.g . tango-dark .. . .. . But this now results in an error : .. . .. . In an attempt to use the new face term when I go to M-x describe-face term I see the following : .. . .. . But how do I adjust these settings to get the same effect I achieved using ansi-term-color-vector Update .. . .. . I am still unable to fix the colors . Here is the menu that I get for M-x customize-theme tango-dark : .. . .. . enter image description here http : i.stack.imgur.com Uf7BQ.png .. . .. . And here is an example of one of the colors faces in a terminal that are hard to see : .. . .. . enter image description here http : i.stack.imgur.com i5E4E.png .. . Answer : In Emacs 24.3 you ll need to adjust the following faces : .. . .. . This code is from the latest version of Zenburn https : github.com bbatsov zenburn-emacs . Personally I feel that the new way of customising the faces is an improvement over the use of the obscure vector . Comment : Thanks . Any thoughts or pointers on how I could do this for a theme like tango-dark i.e . how can I find out the different colors supported by my theme such as zenburn-bg-1 etc . but for tango-dark Comment : Just do a M-x describe-theme tango-dark and see the colour definitions in tango-dark-theme.el . Comment : Thanks @Bodzhidar . I am sure you are right that I could follow your steps to fix this problem but unfortunately I can t figure out how to make it work for tango-dark . It looks like tango-dark already sets ansi-color-names-vector to a given set of colors in tango-dark.el see the code here : http : fossies.org unix misc emacs-24.3.tar.gz : a emacs-24.3 etc themes tango-da rk-theme.el . Moreover these colors seem to look fine when I look up M-x describe-theme tango-tark see the images I posted in the OP but for some reason they don t work well in terminals . Comment : Another thing I don t understand is why your background colors in zenburn the ones you defined above are different for each term-color shouldn t they be set to inherit the background-color of the terminal Comment : For each color you need a ligher foreground version and a darker background version . That s how the faces were defined in term.el it s not something I inventited for zenburn itself . Nothing in term actually uses those faces directly they are just used to derive other faces .", "Question : How can I adjust the term face in the new Emacs to get the same control that was possible with ansi-term-color-vector One of the new features http : www.masteringemacs.org articles 2013 03 11 whats-new-emacs-24-3 in Emacs 24.3 seems to be that it revamps the mechanism to control the face of term buffers i.e . : .. . .. . The variables term-default-fg-color and term-default-bg-color are now deprecated in favor of the customizable face term . .. . You can customize how to display ANSI terminal colors and styles by customizing the corresponding term-color-COLOR term-color-underline and term-color-bold faces . Mickey from Mastering Emacs comments the following http : www.masteringemacs.org articles 2013 03 11 whats-new-emacs-24-3 : .. . .. . If like me you customized ansi-color-names-vector to change the default term colours I suggest you switch to using the faces now . The good news here is you can should desire to change more than just the colours for each ANSI Color : there s nothing stopping you from forcing a different font for certain colours .. . .. . Like Mickey I was also using ansi-color-names-vector to make sure that the color of my term buffers looked well on dark themes e.g . tango-dark .. . .. . But this now results in an error : .. . .. . In an attempt to use the new face term when I go to M-x describe-face term I see the following : .. . .. . But how do I adjust these settings to get the same effect I achieved using ansi-term-color-vector Update .. . .. . I am still unable to fix the colors . Here is the menu that I get for M-x customize-theme tango-dark : .. . .. . enter image description here http : i.stack.imgur.com Uf7BQ.png .. . .. . And here is an example of one of the colors faces in a terminal that are hard to see : .. . .. . enter image description here http : i.stack.imgur.com i5E4E.png .. . Answer : This worked for me in Emacs 24.3.1 to set the colors of term and ansi-term . Just change the colors to your preferred values with the background adjusted accordingly .", "Question : How do you change the default face which Emacs uses to style text on a per-mode basis For example say that I am already happy with the face customizations that I have which include a default fixed-width font . However in one particular mode markdown-mode.el say I want the default font to be variable-width . It is easy to style headers links etc . uniquely for markdown-mode : simply place the cursor over the styled text and M-x describe-face then click the link-to customize it . However the default face is the face used if no other face is specified so it is not specific to markdown-mode and if modified will affect all other modes . What magic can I put in the markdown-mode-hook to set the default face for buffers using this mode Comment : If there is a some variable that controls the default faces then you can localized it for the current buffer only in a hook that getting called while opening a file w markdown . Comment : The question is asked in a general way then a specific example is made and answers revolve around this specific example . If you really need to Set Emacs defaut font-face per-mode see Using a different font for each major mode - Emacs Stack Exchange http : emacs.stackexchange.com questions 3038 using-a-different-font-for-each-major-mode 3042 3042 .. . Answer : It s actually straightforward even for emacs version 22.3.1 .. . .. . Just try the following : Comment : you could also find a definition of a function that easily changes the font of a buffer at junis.orgfree.com SetBufferFont.el http : junis.orgfree.com SetBufferFont.el Comment : overlays are not good because they are slow . they are good only if you do not have too many in the same time.. .", "Question : How can I adjust the term face in the new Emacs to get the same control that was possible with ansi-term-color-vector One of the new features http : www.masteringemacs.org articles 2013 03 11 whats-new-emacs-24-3 in Emacs 24.3 seems to be that it revamps the mechanism to control the face of term buffers i.e . : .. . .. . The variables term-default-fg-color and term-default-bg-color are now deprecated in favor of the customizable face term . .. . You can customize how to display ANSI terminal colors and styles by customizing the corresponding term-color-COLOR term-color-underline and term-color-bold faces . Mickey from Mastering Emacs comments the following http : www.masteringemacs.org articles 2013 03 11 whats-new-emacs-24-3 : .. . .. . If like me you customized ansi-color-names-vector to change the default term colours I suggest you switch to using the faces now . The good news here is you can should desire to change more than just the colours for each ANSI Color : there s nothing stopping you from forcing a different font for certain colours .. . .. . Like Mickey I was also using ansi-color-names-vector to make sure that the color of my term buffers looked well on dark themes e.g . tango-dark .. . .. . But this now results in an error : .. . .. . In an attempt to use the new face term when I go to M-x describe-face term I see the following : .. . .. . But how do I adjust these settings to get the same effect I achieved using ansi-term-color-vector Update .. . .. . I am still unable to fix the colors . Here is the menu that I get for M-x customize-theme tango-dark : .. . .. . enter image description here http : i.stack.imgur.com Uf7BQ.png .. . .. . And here is an example of one of the colors faces in a terminal that are hard to see : .. . .. . enter image description here http : i.stack.imgur.com i5E4E.png .. . Answer : I would suggest M-x customize-group RET term RET .. . as the easiest entry-point to customizing those colours .", "Question : How do you change the default face which Emacs uses to style text on a per-mode basis For example say that I am already happy with the face customizations that I have which include a default fixed-width font . However in one particular mode markdown-mode.el say I want the default font to be variable-width . It is easy to style headers links etc . uniquely for markdown-mode : simply place the cursor over the styled text and M-x describe-face then click the link-to customize it . However the default face is the face used if no other face is specified so it is not specific to markdown-mode and if modified will affect all other modes . What magic can I put in the markdown-mode-hook to set the default face for buffers using this mode Comment : If there is a some variable that controls the default faces then you can localized it for the current buffer only in a hook that getting called while opening a file w markdown . Comment : The question is asked in a general way then a specific example is made and answers revolve around this specific example . If you really need to Set Emacs defaut font-face per-mode see Using a different font for each major mode - Emacs Stack Exchange http : emacs.stackexchange.com questions 3038 using-a-different-font-for-each-major-mode 3042 3042 .. . Answer : There is a block of code which I find very convenient from EmacsWiki . The advantage of this is that you can set not only font-face but conveniently configure : height : width etc as well .. . .. . Combined with load-theme-buffer-local package you can even specify the color theme for the buffer easily :", "Question : How do you change the default face which Emacs uses to style text on a per-mode basis For example say that I am already happy with the face customizations that I have which include a default fixed-width font . However in one particular mode markdown-mode.el say I want the default font to be variable-width . It is easy to style headers links etc . uniquely for markdown-mode : simply place the cursor over the styled text and M-x describe-face then click the link-to customize it . However the default face is the face used if no other face is specified so it is not specific to markdown-mode and if modified will affect all other modes . What magic can I put in the markdown-mode-hook to set the default face for buffers using this mode Comment : If there is a some variable that controls the default faces then you can localized it for the current buffer only in a hook that getting called while opening a file w markdown . Comment : The question is asked in a general way then a specific example is made and answers revolve around this specific example . If you really need to Set Emacs defaut font-face per-mode see Using a different font for each major mode - Emacs Stack Exchange http : emacs.stackexchange.com questions 3038 using-a-different-font-for-each-major-mode 3042 3042 .. . Answer : I have to give a partial answer because this is too complicated to figure out on the spot and I already blew my time budget . Face is a frame property . A frame can display multiple buffers at the same time . Mode is a buffer property . You ask how to vary the face on a per-mode basis . Combining all this it seems that the question cannot not have a single fully-correct answer . You can approximate the desired answer if you assume that a given frame will never display more than one buffer . You can actually accomplish that with something like this but modified to use special-display-regexps and a set of regexps that match your markdown-mode buffer names . However this is probably not what you want . Your question seems to imply changing the face properties of a single frame . Again assuming that a frame will never display more than one buffer at a time you can try advising switch-to-buffer . But that might not be sufficiently low-level and it might be too slow . untested .. . .. . And now for my actual incomplete answer.. . .. . .. . A better albeit more complicated approach would instruct markdown-mode to use a new face for all regions that are not already assigned one of the built-in faces . You can create a new face with copy-face and give it interesting properties with set-face- . Modify markdown-mode s font-lock-defaults to override the default font-lock-fontify-region-function as described in the comment block near line 946 of font-lock.el that begins Fontification functions . You can probably use a very slightly modified font-lock-default-fontify-region that does just one extra step immediately after it does : .. . .. . The extra step parses the region similar to what font-lock-fontify-syntactically-region does breaking the region into interesting sub-regions . But this time you find sub-regions that have the default face and you put-text-property those sub-regions to the new face that you previously created . In all this feels like it should be only a couple lines of elisp in your .emacs file plus make a copy of font-lock-default-fontify-region that has only a minor diff from the original call one new function plus make a copy of font-lock-fontify-syntactically-region and modify it to do your bidding the most difficult part . Actually if you after advise font-lock-fontify-syntactically-region then you probably don t even need to modify font-lock-defaults or font-lock-default-fontify-region . Comment : Names and line numbers speak to GNU emacs 22.3.1 . Comment : Or just get a recent version of emacs and use buffer-face-mode . Comment : Cool . But I ll probably wait until emacs 23 actually ships before updating to it .", "Question : How do you change the default face which Emacs uses to style text on a per-mode basis For example say that I am already happy with the face customizations that I have which include a default fixed-width font . However in one particular mode markdown-mode.el say I want the default font to be variable-width . It is easy to style headers links etc . uniquely for markdown-mode : simply place the cursor over the styled text and M-x describe-face then click the link-to customize it . However the default face is the face used if no other face is specified so it is not specific to markdown-mode and if modified will affect all other modes . What magic can I put in the markdown-mode-hook to set the default face for buffers using this mode Comment : If there is a some variable that controls the default faces then you can localized it for the current buffer only in a hook that getting called while opening a file w markdown . Comment : The question is asked in a general way then a specific example is made and answers revolve around this specific example . If you really need to Set Emacs defaut font-face per-mode see Using a different font for each major mode - Emacs Stack Exchange http : emacs.stackexchange.com questions 3038 using-a-different-font-for-each-major-mode 3042 3042 .. . Answer : The variable-pitch -mode is awesome . I found out about it through this thread . But it can be made even more awesome : .. . .. . Just add whatever mode you want sans-serif fonts in to the list . Comment : What the code above does is to enable variable-pitch-mode for all the modes enumerated in all the lines except the last .", "Question : I defined a new face in Emacs but the coloring does not take effect . Here is the face and mode definition in .emacs : .. . .. . However when I use font-lock-builtin-face instead of sml-highlight-operator-face those characters are highlighted albeit with a color I don t want . What am I doing incorrectly .. . Answer : The element 0 sml-highlight-operator-face in your font-lock-keywords does not say use face sml-highlight-operator-face for sub-match 0 but use the result-of evaluating the expression sml-highlight-operator-face as the face to put on sub-match 0 . IOW you need to use 0 sml-highlight-operator-face . BTW the convention nowadays is to not use a -face suffix for faces tho such a suffix is still used of course for variables holding faces tho we haven t bothered to rename the font-lock-foo-face faces to font-lock-foo yet even though it would very much help the confusion you re seeing where a lot of font-lock rules say things like 0 font-lock-foo-face and people think it refers to the font-lock-foo-face face whereas it refers to the font-lock-foo-face variable whose value holds the font-lock-foo-face face . Comment : Very helpful . Thank you very much Stefan", "Question : Is there a way to easily modify the font-face under cursor For example the text in blue below is hard to read : .. . .. . enter image description here http : i.stack.imgur.com UNU7Z.png .. . .. . The above is the output of .. . .. . running on an ansi-term with tango-dark in Emacs 24.1 i.e . load-theme tango-dark t .. . .. . If I run what-cursor-position on the image above described here : Get font-face under cursor in Emacs http : stackoverflow.com questions 1242352 get-font-face-under-cursor-in-emacs I get : .. . .. . How can I modify this font In case you are wondering IPython only supports three color sets : .. . .. . Nocolor .. . Linux the one I am using above .. . LightBG for light backgrounds .. . .. . Update : .. . .. . I think font-lock-string-face is a different face : .. . .. . enter image description here http : i.stack.imgur.com C2Nuy.png .. . .. . In fact I think that s not the face that IPython uses to represent strings but the face that python-mode uses to represent strings in a buffer with regular python code in tango-dark -- see below -- . enter image description here http : i.stack.imgur.com lYWvG.png .. . Answer : M-x customize-face with your cursor over the particular thing you want to modify . Also available are set-face-foreground and set-face-background depending on what you want to do sometimes it s good to change the backing color to make the font easier to see in terminals . So I checked out IPython as mentioned in my comment below and ipython.el does no highlighting of its own . The coloring is all done by using terminal ANSI colors . It s possible in some terminals to change the colors via a .bashrc or .zshrc or whatever your shell is and running it from M-x term possibly . Through Emacs itself I cannot see a way of changing it as IPython only has 3 default schemes and no way to specify anything specific as far as I can see . Comment : Thanks but when I invoke M-x customize-face it prompts me with Customize face default all faces . I think all faces does not refer to the face under the cursor in my picture above . Am I wrong Comment : @user273158 It should be font-lock-string-face Comment : Thanks . Why is emacs not prompting me for that face Shouldn t that be the one that it asks me by default i.e . the one under cursor . Also how do you know that font-lock-string-face is specifically the face I have under the cursor Comment : @user273158 I don t use IPython so I m not sure but I can check for you : Comment : @user273158 It seems that ipython does it s own coloring outside of Emacs using ansi-colors . As such I don t think you can modify the colors except to one of the 3 color sets described . I looked through ipython.el and found no way to do this :", "Question : The idea is to redefine set-face-attribute so that it sets face attributes normally except for the : weight attribute which shall always be set to normal the default-value I think . With this I hope to disable bold fonts in Emacs once and for all . I got this : .. . .. . So far it doesn t work . If I do make-face-bold default I get Wrong type argument : symbolp : weight bold . I think what I have to do is remove elements that contain : weight from the list of arguments args . Comment : 1 You can use defalias instead of fset . 2 Because ARGS is a rest parameter you need to use apply : apply original-set-face-attributes face frame args . Comment : Personally although I too hate the effect of bold on faces on MS Windows at least I prefer to simply redefine the individual faces . For one thing there is usually something else I want to change about them if they use bold . Comment : @Drew But there are hundreds of faces.. . Comment : You re right . In my setup there are well over 300 . And I guess I don t bother to remove bold from all of them . But then again some of them I never see . I guess I fix faces to be what I want on an as-needed and as-seen basis . Comment : Where a bold font wants trumps another font I set the other one to nil -- : bold nil . I do the same for other attributes also . Here is an example : make-face linum-active set-face-attribute linum-active nil : foreground black : background eab700 : bold nil : italic nil : underline nil : box nil : overline nil : height 180 .. . Answer : Following Aaron s suggestion here s another solution using face-remap-add-relative . This one gets rid of bold fonts everywhere and also of variable-width fonts and sets all faces to the same height . Basically it s like running Emacs in a terminal window except with more colours . Comment : If you catch the return-value of FACE-REMAP-ADD-RELATIVE e.g . in a hashtable keyed by face then you can later pass it to FACE-REMAP-REMOVE-RELATIVE to disable the remapping .", "Question : this is in my .emacs can I mess with it or not so far I am adding everything I want above these lines.. . .. . Answer : Don t add anything to these lines manually your changes will be vanished by emacs on some events . Instead add custom variables with customize-set-variable and custom faces with set-face-attribute : .. . .. . In order to customize face of some package one sometimes need to request the package first and after that set its face :", "Question : I m in the process of configuring linum hlinum and hl-line for Emacs 24 and something I m running into some trouble with is getting the hlinum highlight to match inherit the background-color of the line highlight . In my Elisp file responsible for face customizations I have the following : .. . .. . However the hlinum face remains unchanged . Specifying the linum-highlight-face background manually works but I d rather have it pick up on the color for hl-line . How can I get linum-highlight-face to use the same background-color as hl-line .. . Answer : Related to this StackOverflow question http : stackoverflow.com questions 15733873 customizing-highlighting-faces-in-emacs-only-change-the-background-color I added .. . .. . below the : inherit line for hlinum and it used the same color .", "Question : The idea is to redefine set-face-attribute so that it sets face attributes normally except for the : weight attribute which shall always be set to normal the default-value I think . With this I hope to disable bold fonts in Emacs once and for all . I got this : .. . .. . So far it doesn t work . If I do make-face-bold default I get Wrong type argument : symbolp : weight bold . I think what I have to do is remove elements that contain : weight from the list of arguments args . Comment : 1 You can use defalias instead of fset . 2 Because ARGS is a rest parameter you need to use apply : apply original-set-face-attributes face frame args . Comment : Personally although I too hate the effect of bold on faces on MS Windows at least I prefer to simply redefine the individual faces . For one thing there is usually something else I want to change about them if they use bold . Comment : @Drew But there are hundreds of faces.. . Comment : You re right . In my setup there are well over 300 . And I guess I don t bother to remove bold from all of them . But then again some of them I never see . I guess I fix faces to be what I want on an as-needed and as-seen basis . Comment : Where a bold font wants trumps another font I set the other one to nil -- : bold nil . I do the same for other attributes also . Here is an example : make-face linum-active set-face-attribute linum-active nil : foreground black : background eab700 : bold nil : italic nil : underline nil : box nil : overline nil : height 180 .. . Answer : Here s some code to start you off : .. . .. . I ve seen this work for most of the cases except for basic-faces that don t call set-face-attribute for instance the error face . Comment : The attributes of the standard faces can be set via X resources it s the non-standard ones that trouble me ." ] }
[ "yes-answer-long", "yes-answer-short" ]
emacs
UNK_RELATION
war@html@154
war -- web application archive - is jar file used to distribute javaserver pages java servlets java classes xml files tag libraries and static web pages @placeholder and related files that together constitute a web application .
{ "confidence": [ 84.00947570800781, 53.716331481933594, 52.2575569152832, 50.487300872802734, 47.90102005004883, 47.60780334472656, 46.925533294677734, 46.8238639831543, 46.644004821777344, 46.43834686279297, 45.00468826293945, 44.54100036621094, 44.38775634765625, 44.10837173461914, 43.66986846923828, 43.64483642578125, 43.504451751708984, 43.28745651245117, 43.25991439819336, 43.249610900878906, 43.04233932495117, 43.04011154174805, 42.31134033203125, 41.95453643798828, 41.94209289550781, 41.7735481262207, 41.586273193359375, 41.499141693115234, 41.428035736083984, 41.41752243041992, 41.38172912597656, 41.32518005371094, 41.15286636352539, 41.07898712158203, 41.01618194580078, 40.95846939086914, 40.847900390625, 40.603118896484375, 40.48503875732422, 40.3693733215332, 39.83442687988281, 39.74946212768555, 39.74327850341797, 39.63497543334961, 39.60542678833008, 39.54667663574219, 39.48963928222656, 39.19972610473633, 39.12751388549805, 38.933929443359375, 38.90593338012695, 38.90593338012695, 38.90593338012695, 38.657657623291016, 38.61940383911133, 38.2574577331543, 37.6634635925293, 37.63700866699219, 37.430667877197266, 37.396263122558594, 37.30738067626953, 37.25447463989258, 37.22307205200195, 37.12104034423828, 37.11684799194336, 37.065589904785156, 37.02702713012695, 36.97319030761719, 36.97319030761719, 36.97319030761719, 36.91792297363281, 36.90851593017578, 36.83763885498047, 36.50564193725586, 36.46803283691406, 36.425437927246094, 36.419010162353516, 36.24871826171875, 36.24016189575195, 36.22114944458008, 36.0938720703125, 36.09285354614258, 36.06522750854492, 35.97277069091797, 35.94309616088867, 35.93582534790039, 35.92475128173828, 35.81618118286133, 35.78812789916992, 35.70935821533203, 35.70935821533203, 35.70935821533203, 35.580055236816406, 35.52373504638672, 35.508766174316406, 35.44120788574219, 35.440216064453125, 35.440216064453125, 35.421897888183594, 35.38148880004883 ], "content": [ "First of all why you need to do such thing .. . .. . As stated on wiki http : en.wikipedia.org wiki WAR file-format 28Sun 29 : .. . .. . A war file is a JAR file used to distribute a collection of JavaServer Pages servlets Java classes XML files tag libraries and static Web pages HTML and related files that together constitute a Web application .", "or is this .war file a standalone web-application", "The .java files are being deployed to WEB-INF classes with the .class files following a WAR file export .", "In Java web-applications all third party libraries used by your application must go in WEB-INF lib folder .", "The application was designed on JAVA in short it was a DYNAMIC JAVA WEB DATABASE APPLICATION .", "Is there any way to leave the classes files under WEB-INF classes for when java file changes there is no need to replace the whole jar file", "We sometimes need to put JAR files inside WEB-INF lib folder of the Java EE web application to make the code to run without facing java.lang.ClassNotFoundException on classes inside that JAR .", "His original post shows .jar files in the .war in WEB-INF lib .", "I developer a web application using Java .", "A WAR has web content in addition to descriptors and java classes .", ".war is a web archive for JEE servers", "Ok so I ve used Maven + antrun to copy the class files from WEB-INF classes to the root of the war file .", "I deployed a simple web application .war file on Weblogic Server .", "I have a web application A defined in a war project .", "I am using maven-war-plugin in my pom.xml to generate a jar file in parallel with my war file in an java web project build .", "I ve a Java web project in which I m using a lot of scss files .", "I have a Railo web application that is self-contained in a WAR file .", ".war files are intended to be run inside a web container .", "In the case of WAR files there is an additional layering of JAR files within the WEB-INF lib folder .", "check web.xml in both war files under web-inf .", "I have been working on a simple Java web application which contains JSP files .", "WAR Web Archive contains deployment-descriptor web.xml plus jar dependencies plus your classes and other resources .", "I have a Java web application deployed using Tomcat .", "I have 3 EAR packages which combined together makes one huge web java application .", "This is a web application .", "Now what happen now that when war file generates and web server runs then in the WEB-INF lib folder there is jar .", "Furthermore the WEB-INF dir in .war file consists only classes and lib directories WEB-INF spring and WEB-INF web.xml are missig .", "I have a large collection of different independent stateless web-services written in Java and compiled as WAR files .", "I develop a Java web application and deploy it on Oracle iPlanet 7 .", "I have some resource files that are in the classpath of my web application inside a JAR if that matters .", "The pages are located at and named web adminarchive web adminsettings web adminstuff etc.. .", "When I package my Java web application with war : war a zipped war is created .", "That said in a WAR libraries need to go in the WAR WEB-INF lib directory .", "the mobilefirst application required those .jar file and java classes inside project.war .", "The offending jar in the war is WEB-INF lib javax.servlet-api-3.1.0.jar .", "A Java web application will never make any resources under WEB-INF accessible through HTTP .", "Can I deploy a regular web application war to Railo", "Grizzly is a good empendedd Java server container that cannot handle the standard file for java Web Applications WAR which is kind of weird .", "Firstly The war file should be invoked via java command in cli and then access the application via web browser or any http client .", "I m trying to deploy the Java backend of a web application on GlassFish 4.1.1 .", "From Java EE6 you can package your EJBs together with other servlets jsps etc into WAR file you end up with web application which you can deploy only on java-ee-6 compatible server .", "If it is part of a web application then it will be packaged as a WAR or EAR and placed into the appropriate location on the web server .", "I then deployed an ec2 ubuntu instance and again used the tomcat web application manager and upload the .war file .", "Since part of the builds are also war files I use xsbt-web-plugin to create war files with sbt .", "The class must exist under WEB-INF classes or be inside a .jar file under WEB-INF lib .", "Here are examples of each of the steps : .. . .. . Preconditions .. . .. . We ll assume that you have your code organized like : .. . .. . basedir src : Java files properties XML config files .. . basedir web : Your JSP files .. . basedir web lib : Any JARs required at runtime .. . basedir web META-INF : Your manifest .. . basedir web WEB-INF : Your web.xml files .. . .. . Set up .. . .. . Define a setup task that creates the distribution directory and copies any artifacts that need to be WARred directly : .. . .. . Compile .. . .. . Build your Java files into classes and copy over any non-Java artifacts that reside under src but need to be available at runtime e.g .", "In our web project there are a couple of executions of maven-war-plugin that generates war files for each environment .", "In a Java EE project I moved all the libraries from the WAR WEB-INF lib to the EAR lib .", "I have a Java EE 5 Web Application running on WebLogic 10.3.0 .", "The problem is when the server restarts or the WAR is redeployed - it overwrites all the changes to 1 the Railo settings like datasources and 2 the modified files due to using the web application uploading modifying XML files .", "I m building a web application project using maven and packaging is set to war .", "If you export your Web Application they are not included in the final WAR give it a try .", "I m trying deploy a web application .war format in Weblogic 12c .", "You need to put .aar files into the WEB-INF services folder of an Axis2.war file then you can deploy the Axis2.war file to tomcat .", "I m working on a Java EE web application with the following source code-structure : .. . .. . The bit I m interested in is WEB-INF - it contains web.xml XML files for setting up servlets Spring bean wiring contexts and JSP tags and views .", "The problem is that those .tld .xhtml .xml files that are inside the jar s META-INF WEB-INF the jar is inside war s WEB-INF lib are not recognized .", "The jar file I tried to refer is in WEB-INF lib folder persistence.xml is in WEB-INF classes META-INF folder .", "Did you unzip the final WAR and look into WEB-INF classes", "First one that has Java classes and some WEB-INF artifacts .. . .. . Let say this represents the main WAR .", "Not sure this is related to the fact that you are deploying as a WAR but the path should be simply app-sevices-1.0.jar and the jar should be in the lib of the Java EE application .", "You can have a war file http : en.wikipedia.org wiki WAR file-format 28Sun 29 which is a way to package a web application .", "Servlets and Filters are registered with the web-fragment.xml .", "As you said there is a structural differences between war web-inf classes and jar and even I thought that could be the reason for this issue .", "While obfuscating the war file DashO is not taking into consideration the JSP files which have references to some Java files .", "I m new to Web java programming .", "copy WebContent to .. . copy build classes to WEB-INF classes create this fileset after you define the WEB-INF classes directory in the archive .. . 4 .", "I have one jar file with set of Servlets Filters and a web-fragment.xml file defined inside META-INF folder .", "I have java war file and i want deploy into IBM web sphere portal .", "No Sir...that is purely java war file and i want to deploy into web sphere portal..please help me in this..Thanks", "Most java web servers allow you to drop in a WAR file and it will deploy - I suppose IBM s RAD requires an EAR", "All this brings the following advantages https : en.wikipedia.org wiki WAR file-format Advantages of WAR files : .. . .. . Easy testing and deployment of web-applications .. . Easy identification of the version of the deployed application .. . All Java EE containers support WAR files .. . MVC Structure also support WAR files .", "a war which is dropped into a web server.. . What is a war", "I know a war file is zipped but the JAR URL is a java specificity .", "Take a look at a thread - Multiple war files for a single webapp or context - coderanch http : www.coderanch.com t 555880 Servlets java Multiple-war-files-single-webapp", "Access to those web module library JARs requires placement of the JAR files as exposed files .", "This is my maven-war-plugin configuration : .. . .. . If I delete webResources entry only default src main resources files are copied to WEB-INF classes but isn t in root war directory .", "Make renamed files available for maven-war-plugin .. . .. . Copy files : the idea is to copy the renamed files into a temp directory to be added by maven-war-plugin to the WAR file as a web-resource .", "I deployed the .war file using the tomcat web application manager using the deploy feature .", "You give this to a web server and it knows how to deploy it so that you can visit the web pages .", "The classpath of a webapplication consists of every jar under WEB-INF lib and every file under WEB-INF classes .. . .. . META-INF is not in the classpath .", "Create an executable-jar a war which is dropped into a web server or a library that is used by another project that is one of the previous two .", "I m working on a simple web application written in Clojure using the Compojure web application framework and Maven .", "I guess the majority of your WAR file size are libraries under WEB-INF lib .", "WAR files are zip files .", "It s a simple web-app with JSPs JSs and Servlets .", "File - Export - Web - WAR file .. . .. . OR in Kepler follow as shown below : .. . .. .", "Situation : I am working on a Web application that lives of uploads and other files that get generated during use .", "Web-tier components run on the Java EE server .", "I mean for JAR files I think I know but WAR files", "I am new to web application development .", "But after reloading Tomcat the web application appears again .", "You can t run a web application on your desktop .", "You can deploy the war file locally in any of the web containers such as Tomcat .", "Also since the class file is in a WEB-INF directory then I d suspect that this artifact would be of type war not jar .", "I have used ant this way to compile Java directories generating jar files updating zip files .. .", "As for WEB-INF classes - it exists in any web-app because that is the folder where all the compiled sources are placed not JARS but compiled .java files that you wrote yourself .", "I don t know why but maven-war-plugin stopped moving my files to WEB-INF config .", "We recently switched to Glassfish 3.1.2.2 and have several Web-Applications packaged as war files .", "If I deploy many java .war .jar applications inside an application server JBoss WebLogic etc .", "The net result is that the files of a deployed application expand two layers of the application structure : The EAR file itself is expanded and WAR files within the EAR are expanded ." ] }
{ "confidence": [ 124.65962982177734, 75.32678985595703, 66.69812774658203, 66.6495590209961, 65.7911376953125, 64.28843688964844, 61.65868377685547, 61.18111801147461, 60.48105239868164, 60.08853530883789, 58.26679611206055, 57.887386322021484, 57.5067138671875, 57.27442932128906, 55.96934127807617, 55.80488204956055, 55.587039947509766, 55.456321716308594, 54.811397552490234, 54.478702545166016 ], "content": [ "Question : I have a file in .war format . Is it possible to convert it to an .exe or .jar file Comment : a war file is just a plain zip file so you can do the same kind of things as a zip file Comment : maybe this helpful : github.com jfrichard executable-war https : github.com jfrichard executable-war Comment : @RageZ : but how can i convert that type of file to exe file is there any converter for it for jar to exe i already find the converter . @Thilo : this example need to use maven but i m using tomcat . .. . Answer : First of all why you need to do such thing .. . .. . As stated on wiki http : en.wikipedia.org wiki WAR file-format 28Sun 29 : .. . .. . A war file is a JAR file used to distribute a collection of JavaServer Pages servlets Java classes XML files tag libraries and static Web pages HTML and related files that together constitute a Web application . A war file is you application which is ready to run on server . As you said you are using tomcat you just need to put the war file in webapps folder of tomcat . And start the tomcat server . Its done . Your project will successfully run . No need to build exe of war for this . If you wanna give client a setup that will look like set up and setups all things to run your app then you can use a exe maker software like installJammer http : www.installjammer.com and make your exe such that it includes tomcat with your war in webapps . Make shortcut to startup file of tomcat . So now when user clicks on shortcut tomcat will start and with it your application will also start and user can access it on browser .", "Question : I m working on a Java EE web application with the following source code-structure : .. . .. . The bit I m interested in is WEB-INF - it contains web.xml XML files for setting up servlets Spring bean wiring contexts and JSP tags and views . The question title s basic but what I m trying to understand is what constrains defines this structure . E.g . would JSP files always have to be within WEB-INF or could they be somewhere else And is there anything else that might go in WEB-INF Wikipedia s WAR files http : en.wikipedia.org wiki WAR file-format 28Sun 29 entry mentions classes for Java classes and lib for JAR files - not sure I ve fully grasped when these would be needed in addition to the other source file locations . Comment : This may be helpful : gordondickens.com wordpress 2012 07 03 http : gordondickens.com wordpress 2012 07 03 enterprise-spring-best-practices-part-1-project-config Comment : FYI To learn about how servlet containers https : en.wikipedia.org wiki Web container load from WEB-INF and other locations see the question Controlling the classpath in a servlet http : stackoverflow.com q 264828 642706 especially this Answer http : stackoverflow.com a 265552 642706 . .. . Answer : You should put in WEB-INF any pages or pieces of pages that you do not want to be public . Usually JSP or facelets are found outside WEB-INF but in this case they are easily accesssible for any user . In case you have some authorization restrictions WEB-INF can be used for that . WEB-INF lib can contain 3rd party libraries which you do not want to pack at system level JARs can be available for all the applications running on your server but only for this particular applciation . Generally speaking many configurations files also go into WEB-INF . As for WEB-INF classes - it exists in any web-app because that is the folder where all the compiled sources are placed not JARS but compiled .java files that you wrote yourself .", "Question : I m working on a Java EE web application with the following source code-structure : .. . .. . The bit I m interested in is WEB-INF - it contains web.xml XML files for setting up servlets Spring bean wiring contexts and JSP tags and views . The question title s basic but what I m trying to understand is what constrains defines this structure . E.g . would JSP files always have to be within WEB-INF or could they be somewhere else And is there anything else that might go in WEB-INF Wikipedia s WAR files http : en.wikipedia.org wiki WAR file-format 28Sun 29 entry mentions classes for Java classes and lib for JAR files - not sure I ve fully grasped when these would be needed in addition to the other source file locations . Comment : This may be helpful : gordondickens.com wordpress 2012 07 03 http : gordondickens.com wordpress 2012 07 03 enterprise-spring-best-practices-part-1-project-config Comment : FYI To learn about how servlet containers https : en.wikipedia.org wiki Web container load from WEB-INF and other locations see the question Controlling the classpath in a servlet http : stackoverflow.com q 264828 642706 especially this Answer http : stackoverflow.com a 265552 642706 . .. . Answer : The Servlet 2.4 specification http : download.oracle.com otn-pub jcp servlet-2.4-fr-spec-oth-JSpec servlet-2 4-fr-spec.pdf says this about WEB-INF page 70 : .. . .. . A special directory exists within the application hierarchy named WEB-INF . This directory contains all things related to the application that aren t in the document root of the application . The WEB-INF node is not part of the public document tree of the application . No file contained in the WEB-INF directory may be served directly to a client by the container . However the contents of the WEB-INF directory are visible to servlet code using the getResource and getResourceAsStream method calls on the ServletContext and may be exposed using the RequestDispatcher calls . This means that WEB-INF resources are accessible to the resource loader of your Web-Application and not directly visible for the public . This is why a lot of projects put their resources like JSP files JARs libraries and their own class files or property files or any other sensitive information in the WEB-INF folder . Otherwise they would be accessible by using a simple static URL usefull to load CSS or Javascript for instance . Your JSP files can be anywhere though from a technical perspective . For instance in Spring you can configure them to be in WEB-INF explicitly : .. . .. . As to the WEB-INF classes and WEB-INF lib folders you ve there a Maven project structure . Those folders are by default not visible in a Maven project as it will automatically create and fill those folders during the build of the WAR file based on the source files and the pom dependencies . They are only visible in the produced WAR file . In a standard Eclipse dynamic web project the WEB-INF lib folder is however visible and one without Maven would need to manually drop physical JARs in there in order to install dependencies . Comment : The Servlet 3.0 changes these rules apparently . There can be files served from WEB-INF https : alexismp.wordpress.com 2010 04 28 web-inflib-jarmeta-infresources .", "Question : I finished developing my web app and now after packaging it I get the following structure in output path : .. . .. . folders http : i.stack.imgur.com FoIea.png .. . .. . Is it possible to package all these folders and files into a single war file like developers do it with uber-jar or fat-jar I mean I just want a single war file in target folder as result-of maven-package goal . I also want my single war file being executable on double-click if it is possible . Comment : your generated war already contains all needed files Comment : Why do you want to bring test classes with your war Comment : What do you mean by executable war Comment : @IngeniousTom yes consider it as an independent module which doesn t have any dependencies with the outer world Comment : @IngeniousTom : but war files are not supposed to execute themselves . They can only be executed by a JavaEE web container JBoss GlassFish WebSphere etc . . .. . Answer : I have no guess why do you want to make the entire target directory into single war file . 1 Is it possible to package all these folders and files into a single war file like developers do it with uber-jar or fat-jar I mean I just want a single war file in target folder as result-of maven-package goal . In case of any need modify the maven-package phase configuration in the pom.xml and add all the files directories to be packaged itself in the WebARchive WAR . But you don t need the directories files except the WAR file which contains necessary classes libs and resources in target directory anymore after maven package phase has been executed . If so then add following maven snippet in your project s pom file and modify the configuration section according to your need . maven-snippet .. . .. . 2 I also want my single war file being executable on double-click if it is possible . Yes it is possible . Before that you should know WAR files are intended to wrap-up the application as an archive for web containers such as Tomcat Glassfish Weblogic JBoss etc . It should be deployed via such containers for ease of access and configuring the application to avoid unexpected results in the runtime . Making an WAR file executable by embedding any one container which is above mentioned and suites for your need . But it should not exactly as like windows or executable-jar behaves . Firstly The war file should be invoked via java command in cli and then access the application via web browser or any http client . Here https : devcenter.heroku.com articles create-a-java-web-application-using-embedded-tomcat is an amazing article which provides guidance to embed apache tomcat app server into a java application . Hope this could help you for achieving you goal .", "Question : I m working on a Java EE web application with the following source code-structure : .. . .. . The bit I m interested in is WEB-INF - it contains web.xml XML files for setting up servlets Spring bean wiring contexts and JSP tags and views . The question title s basic but what I m trying to understand is what constrains defines this structure . E.g . would JSP files always have to be within WEB-INF or could they be somewhere else And is there anything else that might go in WEB-INF Wikipedia s WAR files http : en.wikipedia.org wiki WAR file-format 28Sun 29 entry mentions classes for Java classes and lib for JAR files - not sure I ve fully grasped when these would be needed in addition to the other source file locations . Comment : This may be helpful : gordondickens.com wordpress 2012 07 03 http : gordondickens.com wordpress 2012 07 03 enterprise-spring-best-practices-part-1-project-config Comment : FYI To learn about how servlet containers https : en.wikipedia.org wiki Web container load from WEB-INF and other locations see the question Controlling the classpath in a servlet http : stackoverflow.com q 264828 642706 especially this Answer http : stackoverflow.com a 265552 642706 . .. . Answer : There is a convention not necessary of placing jsp pages under WEB-INF directory so that they cannot be deep linked or bookmarked to . This way all requests to jsp page must be directed through our application so that user-experience is guaranteed .", "Question : I m working on a Java EE web application with the following source code-structure : .. . .. . The bit I m interested in is WEB-INF - it contains web.xml XML files for setting up servlets Spring bean wiring contexts and JSP tags and views . The question title s basic but what I m trying to understand is what constrains defines this structure . E.g . would JSP files always have to be within WEB-INF or could they be somewhere else And is there anything else that might go in WEB-INF Wikipedia s WAR files http : en.wikipedia.org wiki WAR file-format 28Sun 29 entry mentions classes for Java classes and lib for JAR files - not sure I ve fully grasped when these would be needed in addition to the other source file locations . Comment : This may be helpful : gordondickens.com wordpress 2012 07 03 http : gordondickens.com wordpress 2012 07 03 enterprise-spring-best-practices-part-1-project-config Comment : FYI To learn about how servlet containers https : en.wikipedia.org wiki Web container load from WEB-INF and other locations see the question Controlling the classpath in a servlet http : stackoverflow.com q 264828 642706 especially this Answer http : stackoverflow.com a 265552 642706 . .. . Answer : When you deploy a Java EE web application using frameworks or not its structure must follow some requirements specifications . These specifications come from : .. . .. . .. . The servlet container e.g Tomcat .. . Java Servlet API .. . Your application domain .. . .. . 1 . The Servlet container requirements .. . If you use Apache Tomcat the root directory of your application must be placed in the webapp folder . That may be different if you use another servlet container or application server . 2 . Java Servlet API requirements .. . Java Servlet API states that your root application directory must have the following structure : .. . .. . ApplicationName .. . .. . --META-INF .. . --WEB-INF .. . web.xml -- Here is the configuration file of your web app where you define servlets filters listeners.. . .. . classes --Here goes all the classes of your webapp following the package structure you defined . Only .. . lib --Here goes all the libraries jars your application need .. . .. . .. . These requirements are defined by Java Servlet API . 3 . Your application domain .. . Now that you ve followed the requirements of the Servlet container or application server and the Java Servlet API requirements you can organize the other parts of your webapp based upon what you need . - You can put your resources JSP files plain text-files script files in your application root directory . But then people can access them directly from their browser instead of their requests being processed by some logic provided by your application . So to prevent your resources being directly accessed like that you can put them in the WEB-INF directory whose contents is only accessible by the server . -If you use some frameworks they often use configuration-files . Most of these frameworks struts spring hibernate require you to put their configuration-files in the classpath the classes directory . Comment : Good one for mentioning where the layout definition comes from . Comment : Love answers with dir trees and explanatory comments .", "Question : I am installing a application .war file using wsadmin tool and I am using option .. . .. . -installed.ear.destination target folder .. . .. . to installed application in target folder . But after application is installed final folder structure for my web contents is like .. . .. . target folder testapp.ear testapp.war my contents .. . .. . why this .ear and .war folders are created and how can I install application so that my contents are present in target folder Comment : The EAR simply contains the WAR file inside it . Given that WebSphere maintains the EAR file structure for all applications it s unlikely that you can make my contents appear in the target folder . .. . Answer : That is the a part of the architecture of application deployment for IBM WebSphere Application Server . As a part of application deployment the application server places application files in a structure which is convenient for running the application . That means having easy access to all modules and means having easy access to files in web modules . In the case of EJB JAR files there is no additional layering in the file structure : All elements of an EJB JAR file are accessible through the JAR ZIP API which is provided by Java . There is a need to unpackage each EJB JAR file of an application but there is no need to unpackage elements within the EJB JAR files . In the case of WAR files there is an additional layering of JAR files within the WEB-INF lib folder . Access to those web module library JARs requires placement of the JAR files as exposed files . Also certain resources of WAR files are exposed in the file set for easy access from code areas which are not setup to handle JAR files . Most prominently JSP files are exposed on disk so that the JSP compiler has easy access to them . The net result is that the files of a deployed application expand two layers of the application structure : The EAR file itself is expanded and WAR files within the EAR are expanded . JAR type files EJB JARs application library JARs application-client JARs and simple utility JARs packaged within the EAR but not in the application library folder are not expanded . There is a possibility of building a more sophisticated API for accessing nested archive files JAR files within JAR files or more or less the same ZIP files within ZIP files which treats the nested contents of an application as an extension of the file system . There are two problems with this sort of strategy . Either nested archives must be expanded to temporary locations on demand or nested archives must be stored in non-compressed format in the nesting archives . These two steps are necessary because the ZIP file-format does not support seeks on archives which are stored within other archives where the archives are allowed to use compression on the nested archive . Because two levels of compression are performed a seek is possible on the nested archive without removing the level compression on the nested archive . Tooling can be set to prevent compression when storing a nested archive but this is not typically done . And archives usually have enough regularity that the default ZIP storage algorithm automatically uses compression when storing nested archives . The most common case is for nested archives to be provided for deployment having two levels compression . Thomas Bitonti IBM Application Server Development", "Question : I read this http : stackoverflow.com questions 3923514 ejb-explanation-ear-vs-war and this http : stackoverflow.com questions 1594667 war-vs-ear-file which are somewhat related to my question . But I came across this http : download.oracle.com docs cd E19798-01 821-1841 gippi index.html article that says that EJBs can be packaged in a war file . If this is the case why is there a need for an ear An explanation with an example will be highly appriciated . .. . Answer : Using EAR or WAR depends on the server you want to deploy it your application and on your personal preferences . From Java EE6 you can package your EJBs together with other servlets jsps etc into WAR file you end up with web application which you can deploy only on java-ee-6 compatible server . If you package your app the old way with ejbs in a separate package and war separately you can use java-ee-5 server if you haven t used other features of java ee6 within your application you can separate the deployments of your EJBs and WARs to have a clear separation of your business-layer EJB and your view Servlets JSP s etc .", "Question : persistence.xml looks like this : .. . .. . It is a web project so the deployment unit is a war file . The jar file I tried to refer is in WEB-INF lib folder persistence.xml is in WEB-INF classes META-INF folder . When being deployed it simply tells me .. . .. . WARNING : Unable to find file ignored : file : .. . . . lib app-services-1.0.jar . I also tried every possible path I could think of i.e . . . lib app-services-1.0.jar lib app-services-1.0.jar . What is the right path to do this Comment : What server are you running your app on JBoss GlassFish If it s JBoss you shouldn t need to specify Hibernate at all it s the default . Comment : GlassFish Matt . My problem is not about Hibernate or not it is about how to tell JPA provider the path to the jar file in order to auto scan entities . .. . Answer : Not sure this is related to the fact that you are deploying as a WAR but the path should be simply app-sevices-1.0.jar and the jar should be in the lib of the Java EE application . The thing is : I m not sure if this is available for the simplified war Java EE application . I suspect this is available only for the traditional Java EE deployment file ear . I would test making an EAR containing a WAR for the webapp JAR for the PU and your other JAR for app-services like a traditional Java EE deployment would be . Another thing to note is that relative paths are not supported and usage of this in SE environment is not supported by all vendors . Comment : Tried the simple app-services-1.0.jar path and as you suspected it does not work . So I guess the question is for war files that jar-file just can not be used", "Question : This question already has an answer here : .. . .. . Java war vs . jar - what is the difference questions 5871053 java-war-vs-jar-what-is-the-difference 11 answers .. . .. . Why do we need WAR if we can create JAR and deploy it on servlet container . Comment : Or you can use Spring Boot and embed the container in a self-contained jar . Comment : try putting some .war in an .ear http : stackoverflow.com questions 1594667 war-vs-ear-file for increased fun . .. . Answer : They are all compressed files if thats what you mean . But they are not all jars . The internal file layout are different between jar and war . WAR Web Archive contains deployment-descriptor web.xml plus jar dependencies plus your classes and other resources . A typical web container unpacks the deployed WAR file into the the webapp s directory before running the webapp . So put it very simple : - war may contain jar etc . - jar may contain classes etc .", "Question : I have a Maven project that is packaged as jar . And I also have a Maven project that is packaged as war . This war project has a tld file and some xhtml files the tag libs . The structure of the war project is basically : .. . .. . And then appeared a requirement to remove those xml xhtml and tld files from the war project and package them into the jar project . So my first try was add-in the jar project s POM : .. . .. . And put the files of course into src main tld the ones I wanted to export into META-INF and src main taglib the ones I wanted to export into WEB-INF . And the jar was created as I wish : .. . .. . And then I added this new jar to my first war project as a maven-dependency . The problem is that those .tld .xhtml .xml files that are inside the jar s META-INF WEB-INF the jar is inside war s WEB-INF lib are not recognized . Apparently they should be directly into the war structure unless some other configuration is performed . This is a must-have requirement because multiple war projects will use the features classes and taglibs of the jar project . Comment : Does it work if you put these files in the jar but not inside WEB-INF or META-INF folders Comment : no . the opposite . .. . Answer : The practice these days is to put the TLD files into the tag library JAR and let the class loader find them . Download the Apache JSTL JARs and see how they do it . I d recommend following that convention . It ll simplify your app too because you won t have to declare the TLD in your web.xml file : just put the JAR in your CLASSPATH and make sure that the URI in your .jsp matches that in the TLD . Comment : I was thinking too of downloading something an see how they do . I ll check it out and post the results . Comment : it works correctly . No need to declare anything into Manifests . Just inserting all the files inside jar s META-INF and letting maven build the war with the jar inside it s WEB-INF lib did the trick . The error was the targetPath of my second resource element .", "Question : null .. . Answer : I develop a Java web application and deploy it on Oracle iPlanet 7 . Currently I deploy the library dependencies with the application i.e . in WEB-INF lib . What I would like to do is deploy the application in a WAR file without the JAR files and specify the library dependencies in the MANIFEST.MF file . I think I understand what I m supposed to do . I want my JAR files in a separate directory . The MANIFEST.MF file needs a line like this : .. . .. . Then the directory containing the WAR file needs to look like this : .. . .. . The problem that I m running into with iPlanet 7 is that when I deploy the WAR file iPlanet unpacks it and places the app in another directory . I end up with a directory like this : .. . .. . Is there a way to tell iPlanet not to unpack my WAR file Comment : If the JARs aren t in the WAR then they should be on the app server lib level . I don t know any Java EE app server where you d do what you re suggesting . Comment : Oracle iPlanet to my knowledge is not an app server . It s just a web server servlet container .", "Question : I have a Maven project that is packaged as jar . And I also have a Maven project that is packaged as war . This war project has a tld file and some xhtml files the tag libs . The structure of the war project is basically : .. . .. . And then appeared a requirement to remove those xml xhtml and tld files from the war project and package them into the jar project . So my first try was add-in the jar project s POM : .. . .. . And put the files of course into src main tld the ones I wanted to export into META-INF and src main taglib the ones I wanted to export into WEB-INF . And the jar was created as I wish : .. . .. . And then I added this new jar to my first war project as a maven-dependency . The problem is that those .tld .xhtml .xml files that are inside the jar s META-INF WEB-INF the jar is inside war s WEB-INF lib are not recognized . Apparently they should be directly into the war structure unless some other configuration is performed . This is a must-have requirement because multiple war projects will use the features classes and taglibs of the jar project . Comment : Does it work if you put these files in the jar but not inside WEB-INF or META-INF folders Comment : no . the opposite . .. . Answer : @duffymo - Your solution totally works . Adding graphic to your description . Create a maven project that generates JAR . keep the structure like this below .. . .. . To your customTags.tld file add uri something like this .. . .. . Accessing tags in you WAR file .. . .. . War should have following structure .. . .. . web.xml .. . .. . Using tag in FTL or JSP file .. . .. . Ftl :", "Question : I use Maven WebSphere 6.x RAD 8.x and got a maven web project . I tried to add a MDB to the web project . I placed the MDB under src main java and placed ejb-jar.xml and the websphere binding under WEB-INF directly .. . .. . When I deploy the web project I don t see the MDB getting deployed . How can I fix this Should I add something in web.xml informing the web app that it has an EJB I asked a different question Here http : stackoverflow.com questions 29110946 java-mdb-ejb-project-maven-depends-on-web-project 29111706 29111706 where i created a MDB project separately and tried to depend on classes inside a web project and got a response that I could deploy my EJB as part of a web app itself . The MDB deploys properly when deployed as a separate ejb project . But the dependencies on the web project are unable to be found by the EJB project during runtime . Its throwing No Class Found exception . So please help me on one of these 2 .. . .. . 1 How to create EJB inside WAR and make the WAR understand that it has an EJB - in this case the war is not recognizing the ejb .. . .. . or .. . .. . 2 How to make a stand alone EJB project identify classes from inside a web project - in this case the ejb is not recognizing the war classes .. . Answer : It is not possible to create EJB inside WAR in WebSphere 6.1 as it is using Java EE 1.4 . You will need to upgrade to WebSphere 8.x for that . For WebSphere 6.1 you need to package war and ejb in single ear and change classloader settings for your application . After you deploy application in the console go to Enterprise Applications yourApp Class loader and in the WAR class loader policy set Single class loader for application these names are from 8.5 but you should have something very similar in 6.1 I dont have 6.1 console at hand as it very old and no longer supported . For details see Configuring application class loaders http : www-01.ibm.com support knowledgecenter SSAW57 6.1.0 com.ibm.websphere.nd.doc info ae ae trun classload entapp.html cp SSAW57 6.1.0 2F1-7-6-2 Comment : I would up-mark your answer if it was not for your suggestion to mess with the class loader . I m pretty sure that you cannot configure WAS 6.x to make WAR classes accessible to classes in the EAR not to mention it s impact on portability . The OP needs to move all the dependent classes into the EJB jar or a jar in the EAR lib directory . Comment : @SteveC Check this http : www-01.ibm.com support knowledgecenter SSAW57 6.1.0 com.ibm.websphere.nd.doc info ae ae trun classload entapp.html cp SSAW57 6.1.0 2F1-7-6-2 - Setting the value to Single class loader for application causes the application class loader to load the Web module contents as well as the EJB modules shared-libraries RAR files and dependency JAR files associated to the application . And regarding portability - OP is asking for solution for ancient specific WAS . Comment : Yeah - Ok . Just flag the portability issue . I ve done many WAS- JBoss Wildfly migrations and this would be quite a problem Comment : @Gas - Thank You.As you advised in the other thread I have added everything into ejb and made the web dependent on ejb.Now facing some issue in writing a test client.Posted that here . stackoverflow.com questions 29202105 http : stackoverflow.com questions 29202105 java-class-not-found-in-rad-8-5-client-to-post-message-to-websphere-q", "Question : I finished developing my web app and now after packaging it I get the following structure in output path : .. . .. . folders http : i.stack.imgur.com FoIea.png .. . .. . Is it possible to package all these folders and files into a single war file like developers do it with uber-jar or fat-jar I mean I just want a single war file in target folder as result-of maven-package goal . I also want my single war file being executable on double-click if it is possible . Comment : your generated war already contains all needed files Comment : Why do you want to bring test classes with your war Comment : What do you mean by executable war Comment : @IngeniousTom yes consider it as an independent module which doesn t have any dependencies with the outer world Comment : @IngeniousTom : but war files are not supposed to execute themselves . They can only be executed by a JavaEE web container JBoss GlassFish WebSphere etc . . .. . Answer : I think you just didn t understand the major idea of the .war packaging . You should consider it as an independent module which doesn t have any relations with the outer world . Therefore you could use it on different systems and with different web containers as has been mentioned in the comments they are JBoss GlassFish WebSphere . All this brings the following advantages https : en.wikipedia.org wiki WAR file-format Advantages of WAR files : .. . .. . Easy testing and deployment of web-applications .. . Easy identification of the version of the deployed application .. . All Java EE containers support WAR files .. . MVC Structure also support WAR files . Comment : Ok I understood . But what if my web app has embedded server like jetty How can I deploy or install my war on target machine Comment : @IngeniousTom I haven t done it before but I found this pretty answer http : stackoverflow.com questions 9807291 how-can-i-deploy-a-war-in-an-embedded-jetty-8 for you .", "Question : In some cases we add JAR files to the Build Path of Eclipse project to make the code compile . We sometimes need to put JAR files inside WEB-INF lib folder of the Java EE web application to make the code to run without facing java.lang.ClassNotFoundException on classes inside that JAR . I do not exactly understand in which cases we should add JARs to Build Path and when exactly those JARs should be placed in WEB-INF lib . .. . Answer : The Build Path is only for libraries which are required to get the project s code to compile . The Deployment Assembly or manually placing JAR in WEB-INF lib or letting an external build-system like Maven place the dependency as JAR in WEB-INF lib of produced WAR during the build is only for libraries which are required to get the code to deploy and run on the target environment too . Do note that you re not supposed to create subfolders in there . The JARs have to be placed in the root . Some libraries are already provided by the target Java EE server or servletcontainer such as JSP Servlet EL etc . So you do not need put JARs of those libraries in WEB-INF lib . Moreover it would only cause classloading trouble . It s sufficient to indirectly specify them in Build Path only . In Eclipse you normally do that by setting the Targeted Runtime accordingly . It will automatically end up in Build Path . See also How do I import the javax.servlet API in my Eclipse project http : stackoverflow.com questions 4076601 how-do-i-import-the-javax-servlet-api-in-my-eclipse-project .. . .. . Other libraries usually 3rd party ones like Apache Commons JDBC drivers and standard libraries not provided by the target servletcontainer e.g . Tomcat doesn t support JSF CDI JPA EJB etc out the box need to end up in WEB-INF lib . You do not necessarily need to specify it in Build Path . Only perhaps when you already have it as User Library but you should then use Deployment assembly setting for this . See also ClassNotFoundException when using User Libraries in Eclipse build path http : stackoverflow.com questions 7005644 classnotfoundexception-when-using-user-libraries-in-eclipse-build-path . In case you re using Maven then you need to make absolutely sure that you mark libraries as scope provided scope if those are already provided by the target runtime such as Java EE Servlet EL etc in case you deploy to WildFly TomEE etc . This way they won t end up in WEB-INF lib of produced WAR and potentially cause conflicts with server-bundled libraries but they will end up in Eclipse s Build Path and get the project s code to compile .", "Question : I m trying to make an executable war file java -jar myWarFile.war that will start up a Jetty webserver that hosts the webapp contained in the WAR file I executed . I found a page http : eclipsesource.com blogs 2009 10 02 executable-wars-with-jetty that described how to make what I m looking for : .. . .. . However following that advice along with how I think I m supposed to make an executable-jar war isn t working . I have an Ant task creating a WAR file with a manifest that looks like : .. . .. . .. . Manifest-Version : 1.0 .. . Ant-Version : Apache Ant 1.7.1 .. . Created-By : 1.5.0 18-b02 Sun Microsystems Inc . .. . Main-Class : Start .. . .. . .. . The contents of the WAR file look like : .. . .. . When I try to execute the WAR file the error is : .. . .. . There appears to be two errors here : one where it seems the JAR files can t be found and one where the Start class can t be found . To fix the first one I put the Jetty JAR files in the base of the WAR file and tried again -- same error . I also tried adding the WEB-INF lib specific-JAR-files to the Class-Path attribute of the manifest . That did not work either . Does anyone have any insight as to what I m doing right wrong and how I can get this executable WAR file up and running Comment : Do you have to have a .war file Why not have a .jar file that contains the .war file the jetty distribution and a main class that starts jetty programmatically and loads your webapp to a context . .. . Answer : Putting .jars inside a .war file root does nothing .. . Putting .jars inside WEB-INF lib doesn t help the JVM find the Jetty files to even begin launching your .war . It s too late to put them there . Putting .jars in the manifest Class-Path only works for external .jar files not those contained in the .jar .. . .. . So what to do Use a build script to simply merge all the .jar files you need into the .war file . This takes a little extra work . It s also a bit ugly in that the compiled code is part of the servable files in the .war .. . Add dependent .jars to the JVM s classpath with java -cp jetty.jar : .. . .. . Works though this kind of defeats the purpose of one stand-alone .war Comment : @Sean he is not putting jars inside .war file root he is putting the class file and it is perfectly valid as his link points to Comment : His original post shows .jar files in the .war in WEB-INF lib . Then he mentions putting .jars at the base of the .war . Your follow-up post shows .jars in the lib directory so what do you mean I could be wrong as I didn t try it myself but how does the JVM find Jetty classes in this case The post you mention shows Maven building the dependencies together and the Maven output I ve ever seen that does this just puts .class files together into one .jar .war which was my first answer .", "Question : What are the best practices of creating war files using eclipse to run on tomcat tutorials links examples are highly appreciated . .. . Answer : You can use Ant http : ant.apache.org manual to set up compile WAR http : ant.apache.org manual Tasks war.html and deploy your solution . You can then execute one click in Eclipse to run that Ant target . Here are examples of each of the steps : .. . .. . Preconditions .. . .. . We ll assume that you have your code organized like : .. . .. . basedir src : Java files properties XML config files .. . basedir web : Your JSP files .. . basedir web lib : Any JARs required at runtime .. . basedir web META-INF : Your manifest .. . basedir web WEB-INF : Your web.xml files .. . .. . Set up .. . .. . Define a setup task that creates the distribution directory and copies any artifacts that need to be WARred directly : .. . .. . Compile .. . .. . Build your Java files into classes and copy over any non-Java artifacts that reside under src but need to be available at runtime e.g . properties XML files etc . : .. . .. . Build WAR .. . .. . Create the WAR itself : .. . .. . Deploy .. . .. . Finally you can set up a task to deploy the WAR directly into your Tomcat deploy location : .. . .. . Click and go Once all this is set up simply launching the default target from Eclipse will compile WAR and deploy your solution . The advantage of this approach is that it will work outside Eclipse as well as within Eclipse and can be used to easily share your deployment strategy e.g . via source control with other developers who are also working on your project . Comment : well I want to deploy it to tomcat . How should I change the targer Comment : Could you please elaborate As long as tomcat.deploydir points to your Tomcat context deployment directory that should do it . No Comment : Why is there exclude name WEB-INF in the buildwar target Comment : In the war target there is unnecessary exclude name WEB-INF . You have generated .class files into this folder and excluding them does not work . Remove this exclude line from the war target it works . Comment : This answer is needlessly complicated .", "Question : I have been working on a simple Java web application which contains JSP files . I have been attempting to access resource files such as css file and images which resides within the WEB-INF classes directory through a JSP file which is located in the context root in the resultant WAR file . The project structure was created based on the recommended structure under Maven War Plugin http : maven.apache.org plugins maven-war-plugin usage.html usages . I went through several solutions provided for similar issues within this forum but none of them worked for this new structure . How do we access a resource located in WEB-INF classes directory from a JSP file located in the context-root for example example WAR file with the mentioned structure http : i.stack.imgur.com G2Czw.png Comment : I am not putting them within the WEB-INF actually if you check the link I have shared on Maven War Plugin usage it packs the images css files and etc . to the WEB-INF classes directory . It is the recommended structure . .. . Answer : If you want to access these resources through HTTP they must be elsewhere - they can t be in WEB-INF . That question would be a duplicate as it has been answered elsewhere multiple times just look up the related questions links for this question . A Java web application will never make any resources under WEB-INF accessible through HTTP . However as your question is about the recommended standard file structure let me tell you where the documentation you link is misleading : Any resources in src main resources will end up on the classpath e.g . in WEB-INF classes . It will not end up on the directory where the webapplication makes it available to the world . However the documentation uses an image which suggests that the image can be used within the webapplication . It can t . You can access it through the classloader in your case for example as : SomeClassFromYourWebapp.class.getResourceAsStream . This is more typically done with .properties files .xml or similar ones that get processed at runtime than with images . Truly misleading documentation I d say but it s correct just misleading .. . .. . Technically this would answer your question for how do I access the resource from a JSP because you can have this code in a JSP . I believe that your question is rather asking to address the resources through HTTP . And the answer to that is : Move the resources that you need available through HTTP to src main webapp and keep them out of WEB-INF . Otherwise they ll only be on the classpath . Comment : That being say it is still quite common to put resources in WEB-INF or in classpath and serve them for http from here . Spring does that for jsp for example . Comment : @user2189998 for jsp : Yes . However you can never serve them as WEB-INF index.jsp then as is the point in this answer but you ll need internal redirection magic . And I ve never seen it done for CSS and images even though it is theoretically possible . It s just too much hassle if all you need is a resource with a URL . Comment : Olaf Kock as you have mentioned it did work when I moved it to src main webapp .", "Question : null .. . Answer : I need a code that loads the .class-file which is in a war Archive file located in a shared location and then get the static variable value in it . Following is the code which I have tried which results in ClassNotFoundException when invoking the Class.ForName method . Can anyone guide me on how to fix this issue . The same code worked for jar file which is also in shared drive . Comment : not sure but are you confirm that jar : file : is correct way to read war also as far as i know the war structure is diffrent it doest work like a jar it need specila way to load in jvm which webserver is best in doing ServletContext is the best way to access loaded resources . Comment : What s your overall goal i.e . why do you need the value of that static variable Loading stuff from classes in WARs not on your classpath sounds wrong . Comment : @AmeyJadiye Right jar : file : + sharedDrivePath + AppUIWebApp.war WEB-INF classes is more likely to work . Note that sharedDrivePath should probably be URL-encoded or else it will probably fail if it contains + or perhaps other characters . Comment : @AmeyJadiye . I m able to connect to the shared drive and access the files in the war file using the above code . As you said there is a structural differences between war web-inf classes and jar and even I thought that could be the reason for this issue . Comment : @PhilippReichart I m writing a utility that needs to compare the value of this static variable with the classes variable that is already loaded in my web-app . I won t be using the class loaded from war file for any other purpose expect reading the static variable . Also I have created a new class loader and not initializing the class . Let me know if you foresee any issue" ] }
[ "yes-answer-long", "yes-answer-short" ]
html
UNK_RELATION
apache2@web@65
apache2 -- apache http server p t i is a modular cross-platform @placeholder server software with a large variety of features called modules including ssl compression log proxy and server-side programming language interfaces like perl python tcl and php .
{ "confidence": [ 45.57522964477539, 38.787315368652344, 38.581298828125, 36.75455093383789, 36.70227813720703, 35.7411994934082, 35.7411994934082, 35.45543670654297, 35.425086975097656, 35.09149169921875, 34.90311813354492, 34.51519775390625, 34.39264678955078, 34.12033462524414, 34.028343200683594, 33.76428985595703, 33.76088333129883, 33.669532775878906, 33.605228424072266, 33.575660705566406, 33.52138137817383, 33.52138137817383, 33.438907623291016, 33.24894714355469, 33.04480743408203, 33.01947021484375, 32.99863815307617, 32.91766357421875, 32.855865478515625, 32.69184875488281, 32.686161041259766, 32.554752349853516, 32.44792938232422, 32.442115783691406, 32.15062713623047, 32.14405059814453, 32.02829360961914, 32.02829360961914, 32.02829360961914, 32.02829360961914, 31.95403289794922, 31.7742919921875, 31.762683868408203, 31.683494567871094, 31.683494567871094, 31.61785316467285, 31.582927703857422, 31.440166473388672, 31.410079956054688, 31.410079956054688, 31.368030548095703, 31.36063003540039, 31.30596923828125, 31.276336669921875, 31.19021224975586, 30.964332580566406, 30.93621063232422, 30.75349998474121, 30.75349998474121, 30.729896545410156, 30.711933135986328, 30.678678512573242, 30.63576316833496, 30.61338996887207, 30.596885681152344, 30.58440399169922, 30.48309326171875, 30.4501953125, 30.441448211669922, 30.411510467529297, 30.404254913330078, 30.390777587890625, 30.353605270385742, 30.30339813232422, 30.288028717041016, 30.288028717041016, 30.26517105102539, 30.23601722717285, 30.185749053955078, 30.185749053955078, 30.168834686279297, 30.048236846923828, 30.01032257080078, 29.973539352416992, 29.931747436523438, 29.931747436523438, 29.873851776123047, 29.873851776123047, 29.800752639770508, 29.784423828125, 29.76755714416504, 29.73691749572754, 29.705204010009766, 29.700454711914062, 29.663883209228516, 29.64181137084961, 29.525890350341797, 29.44376564025879, 29.41701889038086, 29.3702449798584 ], "content": [ "The server is a apache2 server with COMODO SSL certificate .", "Apache http server is a general server for http requests .", "A working apache2 server version 2.2 .. . .. . What is the problem : .. . .. . The php and html files generated by the BOINC server are not servable by apache and I keep getting a 403 error .", "I have restarted apache server with command : sudo service apache2 restart", "I have a Apache2 server installed running with php and suhosin .", "After this need to restart apache2 server .", "mod-rewrite is enabled on my apache2 server .", "But after reloading server in webapp.mysite.com I got : .. . .. . Proxy Error .. . .. . The proxy server received an invalid response from an upstream server .", "but what is required to run a python script in a the apache server", "PD : I m running Apache2 Server and Debian .", "This server uses Ubuntu 14.04 and Apache2 .", "I wand to send post request to Apache HTTP server and then that request is to be forwarded to back end server It locates at somewhere else .", "The server also runs an apache2 server that hosts a site with its domain .", "I have not setup SSL on my server before so a fresh-ish apache2 install is present .", "It should be readable by the user running the apache server check the apache error-log .", "I have server with FreeBSD 8.0 Apache 2.2.23 and PHP 5.4.10 .", "I am reading a journal it stated .. . .. . Lighttpd is asynchronous server and Apache2 is a process-based server .", "I have an apache2 web server that handles reverse proxy for Rails3 app running on another machine .", "We are using OROCRM with Apache2 on our server .", "Or how to make GitLab application as root application on Apache2 HTTP server .", "rApache is specifically a handler for the apache http server .", "Restart ur computer and then install the apache http server .", "As for calling in lib s : .. . .. . is .. . .. . Apache : : Request old perl apache the same as HTTP : : Request Apache2 mod perl", "I have set apache2 server with mod disk cache .", "The server starts without complaint but as soon as I hit a page that requires an Apache2 module like Apache2 : : Cookie it dies :", "I want to have a apache http server in between my application and client .", "Unfortunately looks like the server is running Apache 2.2.19", "I have an Apache web server .", "I have installed on my server IceCast with SSL .", "My server hold on a strange apache2 error but I can t find out any reason from error-log .", "I have 2 crt files for Apache server : .. . .. . 1 root bundle.crt .. . 2 my domain name.com.crt .. . .. . And other bundle : .. . .. . 1 Intermediate.crt .. . 2 my domain name.com.crt .. . root.crt .. . .. . I have modified .. . .. . And tried various combinations of above mentioned files but after Apache2 service restart SSL does not work browser shows Connection is not secure : .. . .. . How to make SSL on Apache server", "If I try to access a url like .. . .. . I get an error from the Apache server : .. . .. . The requested URL index.cfm report http : www.google.com was not found on this server .", "Besides error reporting the server and Apache PHP runs flawlessly .", "I m currently reading the book The Apache Modules Book to learn writing Apache2 modules .", "The apache2 version is 2.4.7 ubuntu .. . .. . the apache2 version is 2.4.7 ubuntu .. . the apache2 logformat : X-Forwarded-For i l u t r s O T Referer i User-Agent i .. . PHP is 5.5.9-1ubuntu4.11 Zend Engine v2.5.0 .. . .. . What happened in our server", "The server runs linux and apache 2.0.63 .", "On my server I have both a tomcat7 and an apache2 installed .", "I have ubuntu-server with pre-installed apache2 mssql php5 .", "I have build LUCI to work over apache2 on a Ubuntu server .", "I have hgweb.wsgi setup on an ubuntu-server under apache2 .", "All I can do is to configure Tomcat or Apache HTTP Server .", "I have two virtualhosts on an apache web server .", "Then restart your apache2 server and everything will work fine .", "Start Apache Httpd Server .", "Which server apache", "i set up a new DEBIAN root server with apache2 PHP 5.6 and mysql-5.5 .", "So i went and configured etc apache2 apache2.conf from this : .. . .. . to this : .. . .. . However the Apache server still gives the same error message .", "Some resources like Python Comet Server http : stackoverflow.com questions 960969 python-comet-server say that PHP is not good for handling concurrent connections while Python is better choice .", "Everything works fine when running on Flask s dev server but the real server is Apache2 with WSGI .", "However new file are still generated as root : root .. . .. . Server A run Apache2 while Server B run Nginx .", "I actually set up vhost with apache2 and i ve a problem with the hardening of my vhost the apache version and server OS is displayed in the header .", "I am trying to make a server and host my own website and I am running a LAMP Linux Apache MySql PHP server .", "Because my server is not apache tomcat .", "I have a plesk 12 server in which php is running with server api CGI FastCGI .", "It is run with mod-python which I know is deprecated at apache2 server .", "Request and response between those two are ok . Now my problem is how to forward this request from Apache HTTP server to back end server .", "I found unknown request in my apache server .", "The proxy server could not handle the request GET .", "Example : Proxy requests from example to another server .", "Unfortunately I m not in a position to change the server config I would have added an Apache handler for Perl if this was the case .", "I ve got a Apache2 server using mod-fastcgi and am using Symfony2 .", "I am trying to set up my Ubuntu web server to host a remotestorage http : remotestorage.io server utilising the php-remote-storage https : github.com fkooman php-remote-storage blob master SERVER.md server .", "Server Version : Apache 2.4.7 Ubuntu PHP 5.5.9-1ubuntu4.14 mod perl 2.0.8 Perl v5.18.2 Server MPM : prefork Server Built : Oct 14 2015 14 : 20 : 21 .. . .. . Note that mod perl is included in the output and therefore I assume that the module is loading .", "I have put together a small ubuntu-10.04 server with apache2 and php for use only for testing purposes .", "The only log of today is this : in var log apache2 error-log Thu Mar 01 16 : 09 : 03 2012 warn RSA server certificate CommonName CN zulu1252 does NOT match server name", "It s hosted on EC2 Instance running on Apache2 server .", "About permissions for files should be readable from the apache server more precisely form the user that runs the apache server .", "The server implementation I m using is pywebsocket the extension for apache server .", "Are there any security performance concerns if we set the Apache web server to configure Apache to handle all HTML as PHP", "I have configure my apache2 server on my host server is running but it can t find cgi script as i put my CGI program in usr lib cgi-bin directory .", "I am trying to create a Apache Forward Proxy on a Debian 8.4 Jessie server for accessing servers outside the organization .", "Then I tried to set the httpd.conf within apache server like below .", "I have two machines : .. . .. . Machine A is running Apache 2 server .", "It might be in var log apache2 error.log or var log php error.log", "Apache 2.2.14 Ubuntu Server at localhost Port 80", "I m using Collabnet Subversion Server with Apache .", "Mod proxy will easily forward requests to your backend server .", "My server-side is hg 2.6.3 .", "I am trying to setup the Django app on Apache2 server with Ubuntu .", "I installed apache2 server and enabled a2ensite for my domain-name .", "for example ErrorLog var www www.localhost.com log-apache2 error.log in the apache virtualhost. .", "I have set up a mercurial-server through SSL .", "Error looks like : .. . .. . Here is apache2 error-log : .. . .. . It gives the error on both one using PHP and second Perl cgi scripts .", "As I checked the differed between apache and tomcat from this post http : stackoverflow.com questions 30632 difference-between-the-apache-http-server-and-apache-tomcat .", "I have cluster setup of Apache server .", "I had forgotten to restart the apache server.. .", "PS : I m running a Ubuntu 14.04 server with apache2 and PHP7 .", "My website is running on a Apache2 server deployed on an OPENSuse 10 Enterprise .", "So what I want is when client send request a Apache HTTP Server it should pass to back end server and then when response comes to Apache HTTP Server it should be modified using set handler in the server and send response back to client .", "The favored method is to start the application under it s own PSGI compliant server and use a front end web server to proxy the requests to this application server .", "from https : github.com gitlabhq gitlab-recipes blob master web-server apache gitlab-ssl-apache2.4.conf", "I ve used an Apache-like web server and the server works correctly for a generic site .", "Here is what I get when I export the key : .. . .. . I have been using this setup with Apache and ActiveState Perl on my Windows laptop and the Apache and Perl distributions that come with ArchLinux on my server .", "Using a high trace log level for mod-rewrite will slow down your Apache HTTP Server dramatically", "I would like to disable gzip compression for some media files which are already compressed on an Apache server via the .htaccess file .", "On my Ubuntu 14.04 server I added the following line to etc apache2 mods-enabled dav svn.conf .. . SVNListParentPath on .. . .. . Be sure to restart Apache : .. . sudo etc init.d apache2 restart", "With that type of environment what s the best app server choice for the Rails app knowing that Apache2 is already serving up PHP apps", ".. . in etc apache2 sites-available new swap file is appeared i removed and started the apache2 server again still it is not working .", "Is the link you are providing in the .htaccess file absolute server 404.php http : server 404.php or relative", "Setting up the proxy .. . .. . To set up a reverse-proxy with Apache2 you first need to enable the Apache proxy module and virtualhosts ." ] }
{ "confidence": [ 61.365604400634766, 55.11811828613281, 50.307640075683594, 50.243709564208984, 49.85282516479492, 48.99034118652344, 48.7336540222168, 48.36423873901367, 48.13191604614258, 47.37858963012695, 47.35047912597656, 47.19283676147461, 47.07349395751953, 46.386226654052734, 44.530067443847656, 44.1917610168457, 44.13603210449219, 43.99662399291992, 43.82878875732422, 43.67089080810547 ], "content": [ "Question : I m stack because all the websites on my Linux Apache2 web server which have a form to fulfil are returning 413 Request Entity Too Large Error only after first fulfil refresh makes it working . Error looks like : .. . .. . Here is apache2 error-log : .. . .. . It gives the error on both one using PHP and second Perl cgi scripts . I m not using SSL . Comment : Not sure if it has anything to do with the problem . But do you have Gzip compression enabled Might try to disable it. . That is where I would start looking. . .. . Answer : Maybe the form is submitted using the GET http method but the url built by the browser is too long . In this case the usual server answer is HTTP Error 413 Request entity too large . In this case you should use POST method to figure out this problem . Comment : thank you for answer bo no it is POST I ve added an error text to the question Comment : have you changed the apache and or php configuration during these days consider to build a simple php page with phpinfo inside to double check the php configuration .", "Question : My web-app is located in mysite.com : 8080 . I want to access to it by typing webapp.mysite.com . So I followed these steps : .. . .. . 1 Enable needed modules : .. . .. . a2enmod proxy a2enmod proxy http .. . .. . apache2 restart .. . .. . 2 Create etc apache2 sites-available mysite .. . .. . 3 Modify etc apache2 ports.conf .. . .. . I m used this settings some days and all be good . But after reloading server in webapp.mysite.com I got : .. . .. . Proxy Error .. . .. . The proxy server received an invalid response from an upstream server . The proxy server could not handle the request GET . .. . Reason : DNS lookup failure for : mysite.com .. . .. . Apache 2.2.9 Debian DAV 2 SVN 1.5.1 PHP 5.2.6-1+lenny4 with Suhosin-Patch mod-ssl 2.2.9 OpenSSL 0.9.8g mod perl 2.0.4 Perl v5.10.0 Server at webapp.mysite.com Port 80 .. . .. . Help me how can I fix it .. . Answer : Use the IP address instead . Comment : Thank s man It fixed my problem", "Question : I m vaguely aware that on a computer joined to a domain IE can be asked to send some extra headers that I could use to automatically sign on to an application . I ve got apache running on a windows-server with mod-php . I d like to be able to avoid the user having to log in if necessary . I ve found some links talking about Kerberos and Apache modules . http : www.onlamp.com pub a onlamp 2003 09 11 kerberos.html page last https : metacpan.org pod Apache2 : : AuthenNTLM .. . .. . Since I m running on Windows it s proven to be non-trivial to get Perl or Apache modules installed . But doesn t PHP already have access to HTTP headers I found this but it doesn t do any authentication it just shows that PHP can read the NTLM headers . http : siphon9.net loune 2007 10 simple-lightweight-ntlm-in-php .. . .. . I d like to be able to have my users just point to the application and have them automatically authenticated . Has anyone had any experience with this or gotten it to work at all UPDATE Since originally posting this question we ve changed setups to nginx and php-fcgi still running on windows . Apache2 and php-cgi on windows is probably one of the slowest setups you could configure on windows . It s looking like Apache might still be needed it works with php-fcgi but I would prefer a nginx solution . I also still don t understand and would love to be educated why HTTP server plugins are necessary and we can t have a PHP web server agnostic solution . Comment : Is this an internal behind-the-firewall application Comment : Yes it is internal Comment : Is there anything else I can add to improve this question .. . Answer : One option for you is to use CAS central authentication service . It has php client library . How-to link-to MS Active Directory : http : www.ja-sig.org wiki display CASUM Active+Directory .. . .. . You would require Apache maven-2 though .", "Question : I would restart Apache2 but there comes an Error .. . .. . But all error logs in var log apache2 are empty . Edit : The Files are at var log apache2 and there are several entries from previous Problems but this Task doesn t create any new etry .. . .. . .. . Where is the Problem .. . .. . I ve Solved the Problem .. . .. . It was a error in the SSL Certificate and the path to the error.log are changed in the vHost configuration . If you don t need SSL i don t because i m running a local system simply disable all vHost HTTPS SSL entrys in the configuration by command-line for line out . Comment : check syslog for errors Comment : Have you space on the disk Comment : Just a comment : is the server stopped If not it will fail if you run sudo service apache2 start . For a restart it should be : sudo service apache2 restart Comment : The server is down because it won t start at booting Comment : is there any other error is syslog that can affect apache .. . Answer : in the apache virtualhost you have to define the path to the error-log file . when apache2 start for the first time it will create it automatically . for example ErrorLog var www www.localhost.com log-apache2 error.log in the apache virtualhost. . Comment : No the Error files are at var log apache2 and there are serveral errors from previous Problems . But This Start-Attemp doesn t create new entrys in any error-log Comment : if the file exist may be you have a space problem with the disk check that too Comment : This is neither a problem .... . Comment : is it the same user created the previous logs or not it can be the users authorization to create the log file . i got the same issue before due to the user problem Comment : Yes . All entrys are from one user", "Question : I m trying to set a telegram-bot up . My favourite language is Java . In the past I had experience with Grizzly lightweight webserver so I d like to use it . The problem is that I don t know how to configure the whole environment in order to make it works with SSL . I configured Apache2 on my Debian machine and it works with an autosigned SSL certificate . So if I browse https : 10.0.0.1 I can see the Apache welcome page . The plan is to receive HTTPS POST requests containing a JSON and forward them to a Grizzly . How could I achieve it .. . Answer : Easy With ProxyPass in Apache2 Guide followed here https : www.digitalocean.com community tutorials how-to-use-apache-http-server-as-reverse-proxy-using-mod proxy-extension", "Question : null .. . Answer : I have an apache2 web server that handles reverse proxy for Rails3 app running on another machine . The setup works except URLs generated within the webapp aren t getting rewritten by my configuration for mod-proxy html . The Reverse Proxy Scenario http : www.apachetutor.org admin reverseproxies is exactly what I m trying to do so I ve followed the tutorial as completely as I know how . I ve applied or tried two answers supplied here http : stackoverflow.com questions 3479061 i-cant-seem-to-get-mod-proxy-html-working-at-all-no-debug-output-no-errors and here on stackoverflow to no effect . According to the Reverse Proxy Scenario you want a number of modules loaded . All those instructions are in my httpd.conf file and when I examine the output from .. . .. . all the expected modules show in amongst the listing . My external web server doing the reverse proxy is at www.ourdomain.org and the Rails app is internally available at apphost.local the server is Mac OS X Server 10.6 the rails app server is Mac OS X 10.6 . What s working right now is access to the webapp via the reverse proxy as : .. . .. . http : www.ourdomain.org apphost railsappname controllername action .. . .. . But none of the javascript files css files or other assets get loaded and links internal to the web app come out missing the apphost portion of the URL as-if my rewrite rule is configured incorrectly so of course I ve focused on that and can t seem to get anything to be added or deleted in the process of passing the html in from the apphost and out through the Apache server . Here s what my Apache directives look like : .. . .. . After every change I make to httpd.conf I religiously check apachectl -t just to be sane . I m definitely not an Apache expert but all the directives that follow mine seem to not overrule what I m doing here . But then nothing that I try seems to alter the URLs I see in my browser after hitting the Apache server with a request for my web app . Even if you can t tell what I ve done incorrectly I d welcome ideas on how to get Apache to help see what it s working on and doing to the html coming from my web app . That s what I understood the ProxyHTMLLogVerbose On and LogLevel Debug to be setting up but I m not seeing anything in the log files . Comment : Belongs on serverfault.com . Comment : I ll check out serverfault.com -- thanks", "Question : I would restart Apache2 but there comes an Error .. . .. . But all error logs in var log apache2 are empty . Edit : The Files are at var log apache2 and there are several entries from previous Problems but this Task doesn t create any new etry .. . .. . .. . Where is the Problem .. . .. . I ve Solved the Problem .. . .. . It was a error in the SSL Certificate and the path to the error.log are changed in the vHost configuration . If you don t need SSL i don t because i m running a local system simply disable all vHost HTTPS SSL entrys in the configuration by command-line for line out . Comment : check syslog for errors Comment : Have you space on the disk Comment : Just a comment : is the server stopped If not it will fail if you run sudo service apache2 start . For a restart it should be : sudo service apache2 restart Comment : The server is down because it won t start at booting Comment : is there any other error is syslog that can affect apache .. . Answer : I also just ran in to a similar problem that is service apache2 reload fails but prints no useful information . This is because the script in etc init.d apache on Debian at least eats the output of the apache2ctl configtest command it runs to sanitize the Apache config . An easy solution to get a more meaningful explanation for the failure is to run apache2ctl configtest again yourself which will print the hopefully useful error messages to the console . Comment : eats the output of.. . - great :", "Question : I m vaguely aware that on a computer joined to a domain IE can be asked to send some extra headers that I could use to automatically sign on to an application . I ve got apache running on a windows-server with mod-php . I d like to be able to avoid the user having to log in if necessary . I ve found some links talking about Kerberos and Apache modules . http : www.onlamp.com pub a onlamp 2003 09 11 kerberos.html page last https : metacpan.org pod Apache2 : : AuthenNTLM .. . .. . Since I m running on Windows it s proven to be non-trivial to get Perl or Apache modules installed . But doesn t PHP already have access to HTTP headers I found this but it doesn t do any authentication it just shows that PHP can read the NTLM headers . http : siphon9.net loune 2007 10 simple-lightweight-ntlm-in-php .. . .. . I d like to be able to have my users just point to the application and have them automatically authenticated . Has anyone had any experience with this or gotten it to work at all UPDATE Since originally posting this question we ve changed setups to nginx and php-fcgi still running on windows . Apache2 and php-cgi on windows is probably one of the slowest setups you could configure on windows . It s looking like Apache might still be needed it works with php-fcgi but I would prefer a nginx solution . I also still don t understand and would love to be educated why HTTP server plugins are necessary and we can t have a PHP web server agnostic solution . Comment : Is this an internal behind-the-firewall application Comment : Yes it is internal Comment : Is there anything else I can add to improve this question .. . Answer : I had a similar problem which I needed to solve for my organization . I was looking into using adLDAP http : adldap.sourceforge.net . There is some documentation on the site for achieving seamless authentication with Active Directory too . Comment : The link in question for the documentation is adldap.sourceforge.net wiki doku.php id seamless authentication http : adldap.sourceforge.net wiki doku.php id seamless authentication I ll take a look Comment : There is some good info about redirecting to an iis server for authentication with a token but it mainly pushes apache-modules on linux .", "Question : Hello Perl warriors . I m totally new to the language and have been placed on a interesting project of porting an application that was originally written for Apache 1.3 and the older Perl to RHEL CentOS 6 with Apache 2.2.x and mod perl . As for calling in lib s : .. . .. . is .. . .. . Apache : : Request old perl apache the same as HTTP : : Request Apache2 mod perl Additionally if anyone has any resources they have found to be particularly useful during a perl upgrade porting project it would be greatly appreciated . .. . Answer : No HTTP : : Request https : www.metacpan.org module HTTP 3a 3aRequest is part of the LWP https : www.metacpan.org module LWP ecosystem and is used for constructing client-side HTTP requests for Perl HTTP clients . You re probably looking for Apache2 : : Request https : www.metacpan.org module Apache2 3a 3aRequest which is part of the libapreq distribution for Apache 2 . Comment : Thank you . I did a little more digging and found the RPM that corresponds to these modules . yum install perl-libapreq2", "Question : I would restart Apache2 but there comes an Error .. . .. . But all error logs in var log apache2 are empty . Edit : The Files are at var log apache2 and there are several entries from previous Problems but this Task doesn t create any new etry .. . .. . .. . Where is the Problem .. . .. . I ve Solved the Problem .. . .. . It was a error in the SSL Certificate and the path to the error.log are changed in the vHost configuration . If you don t need SSL i don t because i m running a local system simply disable all vHost HTTPS SSL entrys in the configuration by command-line for line out . Comment : check syslog for errors Comment : Have you space on the disk Comment : Just a comment : is the server stopped If not it will fail if you run sudo service apache2 start . For a restart it should be : sudo service apache2 restart Comment : The server is down because it won t start at booting Comment : is there any other error is syslog that can affect apache .. . Answer : Thanks Tim Big stumper for me . A few other details others may find helpful : .. . .. . Apache2 on Ubuntu 12.04 .. . .. . I have two sites running on the same server and had just updated the SSL cert for one of them . Upon restarting the server I got that cryptic message and neither site worked obviously . I too found the redirect for the log files in the config files . I tracked that down and found the issue in the log file for the site I had just updated . My config files are located in etc apache2 sites-available .. . .. . vim or cat the file cat filename and look for the ErrorLog line . That tells you where to look on your server . cat that file and the error message I found was : .. . .. . I had copied one of my cert files to the wrong directory . I simply moved it to the correct directory and everything was fine on the next start . tip : where those file should be is also in the config file", "Question : null .. . Answer : My server hold on a strange apache2 error but I can t find out any reason from error-log . Like this it s offered by apache2 . The apache2 version is 2.4.7 ubuntu .. . .. . the apache2 version is 2.4.7 ubuntu .. . the apache2 logformat : X-Forwarded-For i l u t r s O T Referer i User-Agent i .. . PHP is 5.5.9-1ubuntu4.11 Zend Engine v2.5.0 .. . .. . What happened in our server And what I should fix it", "Question : I m vaguely aware that on a computer joined to a domain IE can be asked to send some extra headers that I could use to automatically sign on to an application . I ve got apache running on a windows-server with mod-php . I d like to be able to avoid the user having to log in if necessary . I ve found some links talking about Kerberos and Apache modules . http : www.onlamp.com pub a onlamp 2003 09 11 kerberos.html page last https : metacpan.org pod Apache2 : : AuthenNTLM .. . .. . Since I m running on Windows it s proven to be non-trivial to get Perl or Apache modules installed . But doesn t PHP already have access to HTTP headers I found this but it doesn t do any authentication it just shows that PHP can read the NTLM headers . http : siphon9.net loune 2007 10 simple-lightweight-ntlm-in-php .. . .. . I d like to be able to have my users just point to the application and have them automatically authenticated . Has anyone had any experience with this or gotten it to work at all UPDATE Since originally posting this question we ve changed setups to nginx and php-fcgi still running on windows . Apache2 and php-cgi on windows is probably one of the slowest setups you could configure on windows . It s looking like Apache might still be needed it works with php-fcgi but I would prefer a nginx solution . I also still don t understand and would love to be educated why HTTP server plugins are necessary and we can t have a PHP web server agnostic solution . Comment : Is this an internal behind-the-firewall application Comment : Yes it is internal Comment : Is there anything else I can add to improve this question .. . Answer : All you need is the mod auth sspi http : mod-auth-sspi.sourceforge.net Apache module . Sample configuration : .. . .. . And don t forget that you can also use Firefox for transparent SSO in a Windows domain http : kb.mozillazine.org Network.automatic-ntlm-auth.trusted-uris : Simply go to about : config search for network.automatic-ntlm-auth.trusted-uris and enter the host name or FQDN of your internal application like myserver or myserver.corp.domain.com . You can have more than one entry it s a comma-separated list . Comment : This works you get the bounty and I get stuck with apache . Some of the others might work too but still nothing that doesn t require apache or iis . I hope to revisit this problem one day .", "Question : I m vaguely aware that on a computer joined to a domain IE can be asked to send some extra headers that I could use to automatically sign on to an application . I ve got apache running on a windows-server with mod-php . I d like to be able to avoid the user having to log in if necessary . I ve found some links talking about Kerberos and Apache modules . http : www.onlamp.com pub a onlamp 2003 09 11 kerberos.html page last https : metacpan.org pod Apache2 : : AuthenNTLM .. . .. . Since I m running on Windows it s proven to be non-trivial to get Perl or Apache modules installed . But doesn t PHP already have access to HTTP headers I found this but it doesn t do any authentication it just shows that PHP can read the NTLM headers . http : siphon9.net loune 2007 10 simple-lightweight-ntlm-in-php .. . .. . I d like to be able to have my users just point to the application and have them automatically authenticated . Has anyone had any experience with this or gotten it to work at all UPDATE Since originally posting this question we ve changed setups to nginx and php-fcgi still running on windows . Apache2 and php-cgi on windows is probably one of the slowest setups you could configure on windows . It s looking like Apache might still be needed it works with php-fcgi but I would prefer a nginx solution . I also still don t understand and would love to be educated why HTTP server plugins are necessary and we can t have a PHP web server agnostic solution . Comment : Is this an internal behind-the-firewall application Comment : Yes it is internal Comment : Is there anything else I can add to improve this question .. . Answer : For IIS PHP FCGI You need to send out an unauthorized header : .. . .. . You can then get at the username with : .. . .. . I then make sure the winuser is in my database of allowed users . Be SURE and test this under a non-privileged account . When I first installed this I tested it and it worked fine but later when a standard non-server-admin user tried it this failed . Turns out some of the temporary directories need to have permissions changed for guest users . I can t recall the exact settings . Comment : Does this work for non iis servers Comment : I don t manage any non-iis servers so I don t know .", "Question : I m vaguely aware that on a computer joined to a domain IE can be asked to send some extra headers that I could use to automatically sign on to an application . I ve got apache running on a windows-server with mod-php . I d like to be able to avoid the user having to log in if necessary . I ve found some links talking about Kerberos and Apache modules . http : www.onlamp.com pub a onlamp 2003 09 11 kerberos.html page last https : metacpan.org pod Apache2 : : AuthenNTLM .. . .. . Since I m running on Windows it s proven to be non-trivial to get Perl or Apache modules installed . But doesn t PHP already have access to HTTP headers I found this but it doesn t do any authentication it just shows that PHP can read the NTLM headers . http : siphon9.net loune 2007 10 simple-lightweight-ntlm-in-php .. . .. . I d like to be able to have my users just point to the application and have them automatically authenticated . Has anyone had any experience with this or gotten it to work at all UPDATE Since originally posting this question we ve changed setups to nginx and php-fcgi still running on windows . Apache2 and php-cgi on windows is probably one of the slowest setups you could configure on windows . It s looking like Apache might still be needed it works with php-fcgi but I would prefer a nginx solution . I also still don t understand and would love to be educated why HTTP server plugins are necessary and we can t have a PHP web server agnostic solution . Comment : Is this an internal behind-the-firewall application Comment : Yes it is internal Comment : Is there anything else I can add to improve this question .. . Answer : I d be curious about a solution that uses OpenID as a backend of sorts for this.. . I wasn t seeing anything that would hook into ActiveDirectory directly when I googled quickly . However it could be pretty painless to implement over plain HTTP S you d be an OpenID provider that checked credentials against your local AD . In a best case scenario you might be able to just add a couple classes to your app and be off and running -- no web server modules required . There is a lot of open-source code out there for either side of this so if nothing else it s worth taking a look . If you exposed the backend to the users i.e . gave them OpenID URLs you d have the added benefit of them being able to log in to more than just your internal sites using these credentials . Example : Stack Overflow . As an aside I d be against making it so that Internet Explorer is required . I m not sure if that is the goal from the way you wrote the question but depending on your IT environment I d expect people who use Firefox or Safari or Opera or .. . to be less than enthusiastic . You re not developing against IE first are you That s been painful whenever I ve done so . This is not to say that you couldn t use this feature of IE just that it shouldn t be the only option . The link you posted stated that NTLM worked with more than IE but since I don t have any experience with it it s hard to judge how well that would work . Comment : All browsers support NTLM authentication . IE is no longer a requirement .", "Question : OS : Red Hat Enterprise Linux Server release 6.4 Santiago .. . .. . The current yum installation of apache on this OS is 2.2.15 . I require the latest 2.4.x branch so have gone about installing it manually . I have noted the complete procedure I undertook including unpacking apr and apr-util sources into the apache sources beforehand but I guess the following is the most important part of the procedure : .. . .. . NOTE : At the time of running the above etc http is empty . This seems to have gone fine until I attempt to start the httpd service . It seems that every module include in httpd.conf fails with a message similar to this one for mod-rewrite : .. . .. . I ve gone right through the list of enabled modules in httpd.conf and commented them out one at a time . All trigger an error as above however the undefined symbol : value is often different so not always ap global mutex create . Am I missing a step Although I find a some portion of that error on Google most of the solutions centre around the .so files not being reachable . That doesn t seem to be an issue here and the modules are present in etc http modules . NOTE : At the time of running the above etc http is empty . .. . Answer : You have the correct procedure but it s incomplete . After the installation you have to enable SSL in httpd.conf . and generate server.crt and server.key file . Below the complete procedure : .. . .. . 1 . Download Apache .. . .. . 2 . Download APR and APR-Util .. . .. . Now put the APR and APR-Util you downloaded into your apache source files . 3.Compile .. . .. . 4 . Enable SSL in httpd.conf .. . .. . Apache configuration file httpd.conf is located under usr local apache2 conf . Uncomment the httpd-ssl.conf Include line and the LoadModule ssl module line in the usr local apache2 conf httpd.conf file : .. . .. . View the httpd-ssl.conf to review all the default SSL configurations . For most cases you don t need to modify anything in this file . The SSL certificate and key are required before we start the Apache . The server.crt and server.key file mentioned in the httpd-ssl.conf needs to be created before we move forward . 5 . Generate server.crt and server.key file .. . .. . First Generate the server.key using openssl . The above command will ask for the password . Make sure to remember this password . You need this while starting your Apache later . Next generate a certificate request file server.csr using the above server.key file . Finally generate a self-signed ssl-certificate server.crt using the above server.key and server.csr file . Copy the server.key and server.crt file to appropriate Apache configuration directory location . 6 . Start Apache .. . .. . If you are getting the below error message : .. . .. . Make sure to uncomment the line shown below in httpd.conf : .. . .. . Finally this will prompt you to enter the password for your private key before starting up the apache . Verify that the Apache httpd process is running in the background . You should see something like that : .. . .. . By default Apache SSL runs on 443 port . Open a web browser and verify that you can access your Apache using https : your-ip-address .. . .. . I hope this help else I advise you to go see : http : jasonpowell42.wordpress.com 2013 04 05 install-apache-2-4-4-on-centos-6-4 Comment : Wow . Thank you very much for the detailed response . Comment : You re welcome : Comment : how to make it auto start with server Comment : For auto strat see this link : serverfault.com a 202886 http : serverfault.com a 202886", "Question : I would restart Apache2 but there comes an Error .. . .. . But all error logs in var log apache2 are empty . Edit : The Files are at var log apache2 and there are several entries from previous Problems but this Task doesn t create any new etry .. . .. . .. . Where is the Problem .. . .. . I ve Solved the Problem .. . .. . It was a error in the SSL Certificate and the path to the error.log are changed in the vHost configuration . If you don t need SSL i don t because i m running a local system simply disable all vHost HTTPS SSL entrys in the configuration by command-line for line out . Comment : check syslog for errors Comment : Have you space on the disk Comment : Just a comment : is the server stopped If not it will fail if you run sudo service apache2 start . For a restart it should be : sudo service apache2 restart Comment : The server is down because it won t start at booting Comment : is there any other error is syslog that can affect apache .. . Answer : Syntax errors in the config file seem to cause problems . I found what the problem was by going to the directory and excuting this from the command-line . This gave me the error Comment : Thanks for this . I don t live in the Apache world a lot . Spent the last two days trying to get SSL working-e info Comment : This command got me past my initial issues which was a bunch of syntax issues in the bitnami distribution I was working with . This at least got me to my next error : Comment : This saved my life", "Question : OS - Ubuntu 14.04.3 LTC .. . .. . git Tomcat7 mysql apache2 were installed . I configured tomcat7 to support SSL : server.xml .. . .. . And used mysql database : context.xml .. . .. . I deployed gerrit on tomcat7 with type auth development become any account . Next I created file gerrit auth.conf in folder etc apache2 sites-available .. . .. . And chaged auth type to http in gerrit.config .. . .. . and restarted services apache2 and tomcat7 . Now when I go to https : my gerrit site : 4432 I see tomcat7 .. . .. . It works when I go to https : my gerrit site : 4432 gerrit I see .. . .. . Configuration Error .. . .. . Check the HTTP server s authentication settings . .. . The HTTP server did not provide the username in the Authorization header when it forwarded the request to Gerrit Code Review . .. . If the HTTP server is Apache HTTPd check the proxy configuration includes an authorization directive with the proper location ensuring it ends-with : .. . .. . ServerName my gerrit site .. . .. . .. . ProxyRequests Off .. . ProxyVia Off .. . ProxyPreserveHost On .. . .. . Proxy .. . Order deny allow .. . Allow from all .. . Proxy .. . .. . Location gerrit login .. . AuthType Basic .. . AuthName Gerrit Code Review .. . Require valid-user .. . .. . .. . Location .. . .. . AllowEncodedSlashes On .. . ProxyPass gerrit http : .. . gerrit nodecode VirtualHost .. . .. . .. . when I go to http : my gerrit site : 82 I see .. . .. . Index of .. . .. . Apache 2.4.7 Ubuntu Server at my gerrit site Port 82 .. . .. . when I go to http : my gerrit site : 82 gerrit login I see window with authentication and when I login I see .. . .. . apache errorlog.log .. . .. . catalina.out .. . .. . What I do wrong What settings I need change Thanks Comment : Why are you using Tomcat Is it required It s better to let gerrit work on it own . Comment : Yes I use tomcat because it is requirement .. . Answer : You need to change the canonocalWebUrl to the external-url Comment : unfortunately It does not work . All are same errors and Internet Explorer cannot display the webpage my gerrit site : 82 https : my gerrit site : 82 and gerrit . As I understand apache use http not https", "Question : Raspberry Pi is still on Apache 2.2 2.2.22-13+deb7u4 right now . To use Apache as Proxy for Websockets ProxyPass Apache Module mod-proxy wstunnel is required . Apache Module mod-proxy wstunnel is available in httpd 2.4.5 and later . How can I add mod-proxy wstunnel to Apache2 2.2 on Raspberry Pi Backport mod-proxy wstunnel .. . Answer : Download Apache Source add patch from Vitkin compile Apache and add module mod-proxy wstunnel.so to Apache Modules .. . .. . Details about the patch : https : gist.github.com vitkin 6661683 .. . .. . Detailed steps : Comment : When I tried this I got the following after sudo service apache2 restart : apache2 : Syntax error on line 253 of etc apache2 apache2.conf : Syntax error on line 1 of etc apache2 mods-enabled mod-proxy wstunnel.load : Cannot load usr lib apache2 modules mod-proxy wstunnel.so into server : usr lib apache2 modules mod-proxy wstunnel.so : undefined symbol : ap proxy canonenc and so action configtest failed . Any ideas Comment : The solution was that you have to copy not just mod-proxy wstunnel but mod-proxy as well as seen here : amoss.me.uk 2013 06 https : www.amoss.me.uk 2013 06 apache-2-2-websocket-proxying-ubuntu-mod proxy wstunnel", "Question : Hello i m trying to configure apache2 server for python i used this command to install apache2 : .. . .. . edited the default file to : .. . .. . later i used this command : .. . .. . i got an error : .. . .. . when i tried to see what s the link that s present in mod python.load using cat command i got LoadModule python-module usr lib apache2 modules mod python.so .. . .. . please help me out . Continued. . Now i m getting a new error Sir i have placed a file hello.py having code .. . .. . in a folder called cgi-bin in var www when i run this on apache2 using .. . .. . http : localhost cgi-bin hello.py .. . .. . i m getting this error Comment : Don t type . Click on the button that shows the icon . Comment : Can you cat etc apache2 mods-enabled mod python.load and add the output to your question Also you don t have to do that symlink mess yourself...just run a2enmod modname Comment : sorry i m new didn t know how to show code snippet well i did the command cat over the mod python.load this is what i got : LoadModule python-module usr lib apache2 modules mod python.so Comment : @Bhuvan raj - it looks like there is a space between the leading and the rest of the path to the module . is there if so remove the space and try again.. . Comment : oh ya there was an space my bad i think this must be the height of stupidness you would have ever come across i m really sorry for your time : - thanks a ton its working now : : By the way i can run cgi programs written in python right .. . Answer : It looks like there is a space between the leading and the rest of the path to the module . Is there If so remove the space and try again.. . Comment : Sir right now i m getting an error i have placed a file hello.py having code usr bin python print Content-type : text html r n r n print html print head print title Hello Word - First CGI Program title print head print body print h2 Hello Word This is my first CGI program h2 print body print html in a folder called cgi-bin in var www when i run this on apache2 using http : localhost cgi-bin hello.py i m getting this error The requested URL cgi-bin hello.py was not found on this server . Apache 2.2.14 Ubuntu Server at localhost Port 80 Comment : @Bhuvan raj - i m happy to assist you with this error but this is a different problem from your original question . please accept an answer for this question and then open a new question for the URL not found issue . Comment : oh sorry. . I have asked a separate question . Thanks a lot for you time :", "Question : On my server I have both a tomcat7 and an apache2 installed . I stopped the tomcat7 service and want to listen to with apache2 on port 80 also tried for test with 8082 and port 443 and tested also with 442 . Before I stopped tomcat7 I tried it with 8082 and I could establish webside call and got the webside . But after I stopped tomcat7 and want to listen with apache2 to the ports 80 and 443 I could not establish a webside call also not again if i tried it again with 8082 and 442 . A netstat tulpe returned the following : .. . .. . My ports.conf : .. . .. . and the 000-default.conf .. . .. . a service status-all returned : .. . .. . The error-log shows : .. . .. . It seems that this lines are only warnings I tried on the terminal of the server a wget and got the right answere both with : .. . .. . and the sameanswere with the servername . But not on a webbrowser on an other machine . Why not BTW : A lsof -i returned noting . Why not Server version : Ubuntu 14.04.4 LTS .. . Answer : You have provided all the right troubleshooting tools thank you One recommendation : omit the e argument from the netstat - for this type of troubleshooting you want the numerical port numbers not the translations into human-readable form . The p argument also does nothing if you are not root but it doesn t hurt either . The key to solving your problem is the netstat output . Your netstat output shows that Apache is listening on port 8082 but not on port 442 . In your configuration you also have not provided any SSL configuration the 000-default.conf does not mention any SSL configuration options so most likely it is simply not configured . So that explains the port 442 issue . The second thing the netstat output shows is that Apache is listening on port 8082 but only on one particular IP address . Since your wget succeeds that is probably the correct one it is just a unusual issue and could potentially cause issues down the road if your network configuration changes . The last problem you mention is that you cannot reach the server from any other system . On that none of your config files give a clue but usually this type of problem is that you did not open port 8082 in your firewall . One more aside : instead of using wget for testing I d initially use telnet . Because telnet is lower level there are fewer moving parts that could interfere with your test . That s just a general tip though - in this case wget did give you the information you needed . Comment : Thank you very much for your answer I already added the SSL config file . But it case was really the firewall which could solved with : sudo iptables -A INPUT -p tcp --dport 8082 -j ACCEPT" ] }
[ "yes-answer-long", "yes-answer-short" ]
web
UNK_RELATION
snappydata@olap@147
snappydata -- snappydata is an open-source integration of the gemfirexd in-memory database and the apache-spark cluster-computing system for oltp @placeholder and approximate query processing workloads .
{ "confidence": [ 59.38526916503906, 58.643123626708984, 54.63155746459961, 53.62301254272461, 53.62301254272461, 52.76204299926758, 52.76204299926758, 52.398773193359375, 52.38700485229492, 48.72905731201172, 48.21881866455078, 47.898372650146484, 47.540496826171875, 47.058868408203125, 47.058868408203125, 43.30925750732422, 41.97221374511719, 41.97221374511719, 41.97221374511719, 41.97221374511719, 38.85907745361328, 38.85907745361328, 35.92228698730469, 35.154632568359375, 30.814281463623047, 30.15785026550293, 29.13825035095215, 29.13825035095215, 28.254436492919922, 26.154285430908203, 25.980106353759766, 25.980106353759766, 25.980106353759766, 25.980106353759766, 25.980106353759766, 25.421709060668945, 24.55816078186035, 24.55816078186035, 24.05743980407715, 23.68790054321289, 22.913799285888672, 22.349178314208984, 22.28615951538086, 22.236572265625, 22.1968936920166, 21.948551177978516, 21.732107162475586, 21.705764770507812, 21.65492057800293, 21.078828811645508, 20.037769317626953, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453, 17.801319122314453 ], "content": [ "Check configuring the cluster http : snappydatainc.github.io snappydata configuration .", "On a related note we at SnappyData Inc . are developing scripts to enable users quickly launch SnappyData cluster on AWS .", "Go to ec2 directory cd snappydata cluster ec2 .. . Run snappy-ec2 .", "Which version of SnappyData you are using", "I am using SnappyData-0.5 .", "I m new to OLAP and SnappyData .", "Perhaps it is SnappyData specific .", "Has anyone looked at SnappyData https : github.com SnappyDataInc snappydata", "SnappyData v.0.5 .. . .. . In our AWS SnappyData instance we have the following attributes : .. . .. . 1 .", "For now I did it in bin spark-class on all snappy server nodes .. . .. . Build SnappyData with scala 2.11 .. . .. . Appreciated Saif", "SnappyData https : github.com SnappyDataInc snappydata an in-memory SQL datastore is also in this camp but also permits the data store to run embedded within spark executors avoiding serialization deserialization issues .", "Can you check if snappydata-client.log is created", "http : snappydatainc.github.io snappydata connectingToCluster using-the-spark-shell-and-spark-submit .. . .. . Essentially you need to provide the locator property and this locator is the same which you have used to start the snappy cluster .", "I find that the SnappyData online links go to different old Gemfire docs .", "SnappyData directory install is owned by foo user and foo group .", "I want to know where to read further documentation on the SnappyData column query language for OLAP queries .", "Hi Saif I m an employee with SnappyData and I m letting you know I m going to get this answered for you ASAP .", "So I cannot reach my SnappyData Locator using this JDBC URL from an outside client host e.g .", "For SnappyData releases you may find it much easier to use the global configuration for all of the locators servers leads .", "SnappyData v.0-5 .. . .. . I am logged into Ubuntu as a non-root user foo .", "A better way for SnappyData pulse.war to do this in the future might be to use pulse.authentication.custom which would always load the default AuthenticationManager bean as long as a custom one was not configured .", "pulse.war is a pre-built web app in the SnappyData-0.5 dist so I don t have access to configure security like the thread above .", "SnappyData documentation and architecture diagrams seem to indicate that a JDBC thin-client connection goes from a client to a Locator and then it is routed to a direct connection to a Server .", ". snappy-ec2 -k ec2-keypair-name -i path to keypair private key file launch your-cluster-name .. . See this README https : github.com SnappyDataInc snappydata blob SNAP-864 docs snappyOnAWS.md for more details .", "So even if the --master is local the shell connects to the spark driver Job Server and utilize the servers setup for the snappy cluster", "The relevant properties can be found in application.conf https : github.com spark-jobserver spark-jobserver blob master job-server src main resources application.conf source .", "I have read through the documentation but can t find answer for the following questions : .. . .. . I would prefer to setup an already running spark cluster i.e .", "bin spark-shell --master local --conf snappydata.store.locators locatorhost : port --conf spark.ui.port 4041 .. . .. . Note that with the above a different compute cluster is created to run your program .", "In future we might make this shell connect to the snappy cluster in such a way that it uses the snappy cluster itself as its compute cluster .", "Its primary function is to host Spark driver orchestrate Spark Jobs and provide HA to Spark .", "add a jar to be able to use SnappyContext or is it mandatory to use bundled spark", "Right now you can use Snappy version of Spark .", "It tells how to start a spark-shell and connect it to snappy store .", "Configure a property to tell Spark to use a directory foo has permission to", "It seems that the current owner of tmp spark-jobserver is some other user .", "If multiple users will be running leads on the same machine you can configure the job-server directories to be elsewhere like mentioned here https : github.com spark-jobserver spark-jobserver context-configuration .", "Right now we don t have support for running Snappy with stock Spark but we are working towards it .", "Will any spark action utilize all conf servers hosts for computation and data distribution", "The snappy cluster is not used for computation when you run your code from this shell .", "Spark v . 0.5 .. . .. . Here s the command I used to start a Locator : .. . .. . It looks like it starts the DRDA server locally with no outside interface for a client to connect to .", "What is the status of the indexedRDD work in Spark", "This will allow specifying all options for all JVMs of the cluster in conf locators conf leads conf servers then starting with snappy-start-all.sh status with snappy-status-all.sh and stop all with snappy-stop-all.sh", "In addition to what @jagsr has mentioned if you do not intend to run the lead nodes and thus no Spark jobs or column store then you can run the cluster as pure row store using snappy-start-all.sh rowstore see rowstore docs http : rowstore.docs.snappydata.io docs getting started 15-minutes.html", "See here https : issues.apache.org jira browse SPARK-2629 jql text 20 20 22indexedRDD 22 for how state management will be addressed in a future version of Spark likely Spark 2.0 .", "I can t seem to find a way to start a shell using all the servers set up in conf servers .. . .. . Only found it possible to submit to cluster jobs using bin snappy-job.sh where I specify the lead location but would like to try real-time shell to perform some tests using the whole cluster .. . .. . Thank you .. . .. . Saif", "If the answer is to build pulse.war from scratch myself from the GitHub source with some other security configuration then let me know .", "16 07 21 23 : 12 : 26.883 UTC serverConnector INFO JobFileDAO : rootDir is tmp spark-jobserver filedao data 16 07 21 23 : 12 : 26.888 UTC serverConnector ERROR JobServer : Unable to start Spark JobServer : java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0 Native Method at sun.reflect.NativeConstructorAccessorImpl.newInstance NativeConstructorAccessorImpl.java : 62 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance DelegatingConstructorAccessorImpl.java : 45 at java.lang.reflect.Constructor.newInstance Constructor.java : 423 at spark.jobserver.JobServer .start JobServer.scala : 69 at io.snappydata.impl.LeadImpl.startAddOnServices LeadImpl.scala : 283 at io.snappydata.impl.LeadImpl .invokeLeadStartAddonService LeadImpl.scala : 360 at io.snappydata.ToolsCallbackImpl .invokeLeadStartAddonService ToolsCallbackImpl.scala : 28 at org.apache.spark.sql.SnappyContext .invokeServices SnappyContext.scala : 1362 at org.apache.spark.sql.SnappyContext .initGlobalSnappyContext SnappyContext.scala : 1340 at org.apache.spark.sql.SnappyContext .", "JobFileDAO.scala : 30 .. . 22 more 16 07 21 23 : 12 : 26.891 UTC Distributed system shutdown-hook INFO snappystore : VM is exiting - shutting down distributed-system .. . .. . Do I need to be a different user to start the Lead node", "SparkContext.scala : 601 at io.snappydata.impl.LeadImpl.start LeadImpl.scala : 129 at io.snappydata.impl.ServerImpl.start ServerImpl.scala : 32 at io.snappydata.tools.LeaderLauncher.startServerVM LeaderLauncher.scala : 91 at com.pivotal.gemfirexd.tools.internal.GfxdServerLauncher.connect GfxdServerLauncher.java : 174 at com.gemstone.gemfire.internal.cache.CacheServerLauncher AsyncServerLauncher.run CacheServerLauncher.java : 1003 at java.lang.Thread.run Thread.java : 745 Caused by : java.io.FileNotFoundException : tmp spark-jobserver filedao data jars.data Permission denied at java.io.FileOutputStream.open0 Native Method at java.io.FileOutputStream.open FileOutputStream.java : 270 at java.io.FileOutputStream .", "Here https : github.com amplab spark-indexedrdd is the Amplab work on IndexedRdd .", "For example given this query : .. . .. . I want to understand the constructs like description AirlineName .", "If possible please assist : SPARK HOME seems to be set on runtime by the launchers .. . .. . Where to define JAVA HOME .", "For Q2 you can set JAVA HOME in the command-line before starting Snappy servers .", "We have not tested Snappy with scala 2.11 .", "So not sure what issues may arise .", "Please see this link .", "The required table definition and data is fetched in efficient fashion from the snappy store .", "Whilst this may theoretically answer the question it would be preferable meta.stackoverflow.com q 8259 to include the essential parts of the answer here and provide the link for reference .", "yep realized it and edited my response .", "Thanks .", "I am trying to deploy the Pulse Web Application to an external Tomcat .", "I get this error when deploying .", "How should I fix this", "org.springframework.beans.factory.NoSuchBeanDefinitionException : No bean named org.springframework.security.authenticationManager is defined : Did you forget to add a gobal element to your configuration with child elements", "Alternatively you can use the authentication-manager-ref attribute on your and elements .", "Hi Jason will get an answer for you ASAP", "OK .", "This is fixed .", "To everyone also experiencing this.. . you must set the Spring Profile pulse.authentication.default or it will not load the AuthenticationManager Bean .", "The overall issue is with the RowStore s documentation which says this is OPTIONAL when in fact it is required .", "http : rowstore.docs.snappydata.io docs manage guide pulse quickstart.html topic 795C97B46B9843528961A094EE520782 .. . .. . It says at Step 4 .", "that configuring security is Optional when in fact you have to pass a Spring Profile .", "Also again in the section Authenticating Pulse Users it says this is not a requirement .", "To fix the issue I had to pass the Spring Profile pulse.authentication.default to activate the Bean in spring-security.xml and deploy pulse.war properly .", "Example change for future to make it truly optional :", "spring.profiles.default is set in web.xml and set to pulse.authentication.default .", "This should have worked without specifying any authentication settings .", "It would be helpful if you can specify the TC version you are using .", "I will also try in that version and see if it creates an issue .", "Which version of Tomcat are you using", "Here is another thread on the same issue with TC authentication http : stackoverflow.com questions 11657660 barebonds-hello-world-example-with-security .", "Else can you just try Pulse in the embedded mode", "However the RowStore docs at step 4 .", "say authentication is Optional .", "If it is required I will follow through with more set up but I don t want to do that unless necessary .", "Hoping one of our team members will revert back on if this capability has been tested or there is a simple fix .", "For now just try Pulse App running in the locator embedded mode .", "You need to mention a pulse.properties file in the classpath .", "For details you can check http : rowstore.docs.snappydata.io docs manage guide pulse quickstart.html topic 795C97B46B9843528961A094EE520782 .", "Let us know if you any problems further .", "I will follow your rowstore link and it s directions .", "This did not resolve the issue .", "I have put a pulse.properties into TOMCAT HOME lib as described in the documentation link you specified .", "The error remains .", "Also I see a PULSE.log.0 file and upon opening it it shows as well that it cannot find the pulse properties file .", "my SquirrelSQL editor .", "This does not connect : .. . .. . What property do I pass my . snappy-shell.sh location start command to get the DRDA Server to start on a public IP address instead of localhost 127.0.0.1", "Will get this answered for you ASAP", "Use -client-bind-address and -client-port options .", "For locator also use the -peer-discovery-address and -peer-discovery-port options to specify bind address for other locators servers leads that are passed to their -locators address : port : .. . .. . See the output of snappy-shell locator --help for commonly used options ." ] }
{ "confidence": [ 75.26005554199219, 68.22257232666016, 67.80325317382812, 63.74080276489258, 61.644954681396484, 59.80895233154297, 59.80171585083008, 58.556400299072266, 55.848854064941406, 53.265010833740234, 47.05124282836914, 47.005706787109375, 44.968963623046875, 38.056602478027344 ], "content": [ "Question : Spark v . 0.5 .. . .. . Here s the command I used to start a Locator : .. . .. . It looks like it starts the DRDA server locally with no outside interface for a client to connect to . So I cannot reach my SnappyData Locator using this JDBC URL from an outside client host e.g . my SquirrelSQL editor . This does not connect : .. . .. . What property do I pass my . snappy-shell.sh location start command to get the DRDA Server to start on a public IP address instead of localhost 127.0.0.1 Comment : Will get this answered for you ASAP .. . Answer : On a related note we at SnappyData Inc . are developing scripts to enable users quickly launch SnappyData cluster on AWS . If you want to try it out below steps would guide you . We would love to hear your feedback on this . Download its development branch git-clone https : github.com SnappyDataInc snappydata.git -b SNAP-864 You don t need to clone the repo for this but I could not find a way to attach the scripts here . Go to ec2 directory cd snappydata cluster ec2 .. . Run snappy-ec2 . . snappy-ec2 -k ec2-keypair-name -i path to keypair private key file launch your-cluster-name .. . See this README https : github.com SnappyDataInc snappydata blob SNAP-864 docs snappyOnAWS.md for more details .", "Question : What is the status of the indexedRDD work in Spark Has anyone looked at SnappyData https : github.com SnappyDataInc snappydata They make some claims around being able to do fast random reads and writes on dataframes . .. . Answer : Here https : github.com amplab spark-indexedrdd is the Amplab work on IndexedRdd . There are no commits to this project since Sept 2015 and seems like the approach required re-scans of the entire RDD to construct a new one on each update . See here https : issues.apache.org jira browse SPARK-2629 jql text 20 20 22indexedRDD 22 for how state management will be addressed in a future version of Spark likely Spark 2.0 . This relies on checkpointing RDD state at configured intervals . But it is more advisable to consider a third party data store for random RW like Cassandra http : cassandra.apache.org GemFire http : pivotal.io big-data pivotal-gemfire Redis http : redis.io etc . SnappyData https : github.com SnappyDataInc snappydata an in-memory SQL datastore is also in this camp but also permits the data store to run embedded within spark executors avoiding serialization deserialization issues .", "Question : I have read through the documentation but can t find answer for the following questions : .. . .. . I would prefer to setup an already running spark cluster i.e . add a jar to be able to use SnappyContext or is it mandatory to use bundled spark If possible please assist : SPARK HOME seems to be set on runtime by the launchers .. . .. . Where to define JAVA HOME . For now I did it in bin spark-class on all snappy server nodes .. . .. . Build SnappyData with scala 2.11 .. . .. . Appreciated Saif Comment : Hi Saif I m an employee with SnappyData and I m letting you know I m going to get this answered for you ASAP . .. . Answer : Right now we don t have support for running Snappy with stock Spark but we are working towards it . Right now you can use Snappy version of Spark . For Q2 you can set JAVA HOME in the command-line before starting Snappy servers . We have not tested Snappy with scala 2.11 . So not sure what issues may arise .", "Question : Spark v . 0.5 .. . .. . Here s the command I used to start a Locator : .. . .. . It looks like it starts the DRDA server locally with no outside interface for a client to connect to . So I cannot reach my SnappyData Locator using this JDBC URL from an outside client host e.g . my SquirrelSQL editor . This does not connect : .. . .. . What property do I pass my . snappy-shell.sh location start command to get the DRDA Server to start on a public IP address instead of localhost 127.0.0.1 Comment : Will get this answered for you ASAP .. . Answer : Use -client-bind-address and -client-port options . For locator also use the -peer-discovery-address and -peer-discovery-port options to specify bind address for other locators servers leads that are passed to their -locators address : port : .. . .. . See the output of snappy-shell locator --help for commonly used options . For SnappyData releases you may find it much easier to use the global configuration for all of the locators servers leads . Check configuring the cluster http : snappydatainc.github.io snappydata configuration . This will allow specifying all options for all JVMs of the cluster in conf locators conf leads conf servers then starting with snappy-start-all.sh status with snappy-status-all.sh and stop all with snappy-stop-all.sh Comment : is the -peer-discovery-address supposed to be a multicast address Comment : No the IP address of the machine . Multicast support has mostly been phased out . Typically peers will communicate on internal IP addresses while for clients it will be public IP addresses though the two can be same . Comment : Sounds good . Yeah I saw jgroups references in some stacktraces and also a set of mcast properties in the logs so I wasn t sure . We got it running . Just to clarify for others using AWS for -client-bind-address I used what AWS calls a Private IP which is indeed a public IP for Clients but not the same as the AWS Public IP which goes out over the Internet . :", "Question : null .. . Answer : I m new to OLAP and SnappyData . My question is very specific . I want to know where to read further documentation on the SnappyData column query language for OLAP queries . Perhaps it is an industry standard . Perhaps it is SnappyData specific . I don t know . For clarification I m looking at the QuickStart scripts and trying to make sense of the column tables AIRLINE and the queries in olap queries.sql . For example given this query : .. . .. . I want to understand the constructs like description AirlineName . How does the syntax dictate that description is from the join on airlineref Please somebody point me to where I can learn about this syntax .", "Question : SnappyData documentation and architecture diagrams seem to indicate that a JDBC thin-client connection goes from a client to a Locator and then it is routed to a direct connection to a Server . If this is true then I can run JDBC queries without a Lead node correct .. . Answer : In addition to what @jagsr has mentioned if you do not intend to run the lead nodes and thus no Spark jobs or column store then you can run the cluster as pure row store using snappy-start-all.sh rowstore see rowstore docs http : rowstore.docs.snappydata.io docs getting started 15-minutes.html", "Question : SnappyData v.0-5 .. . .. . I am logged into Ubuntu as a non-root user foo . SnappyData directory install is owned by foo user and foo group . I am starting ALL nodes locator lead server with a script here : .. . .. . SNAPPY HOME sbin snappy-start-all.sh .. . .. . Locator starts . Server starts . Lead dies with this error . 16 07 21 23 : 12 : 26.883 UTC serverConnector INFO JobFileDAO : rootDir is tmp spark-jobserver filedao data 16 07 21 23 : 12 : 26.888 UTC serverConnector ERROR JobServer : Unable to start Spark JobServer : java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0 Native Method at sun.reflect.NativeConstructorAccessorImpl.newInstance NativeConstructorAccessorImpl.java : 62 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance DelegatingConstructorAccessorImpl.java : 45 at java.lang.reflect.Constructor.newInstance Constructor.java : 423 at spark.jobserver.JobServer .start JobServer.scala : 69 at io.snappydata.impl.LeadImpl.startAddOnServices LeadImpl.scala : 283 at io.snappydata.impl.LeadImpl .invokeLeadStartAddonService LeadImpl.scala : 360 at io.snappydata.ToolsCallbackImpl .invokeLeadStartAddonService ToolsCallbackImpl.scala : 28 at org.apache.spark.sql.SnappyContext .invokeServices SnappyContext.scala : 1362 at org.apache.spark.sql.SnappyContext .initGlobalSnappyContext SnappyContext.scala : 1340 at org.apache.spark.sql.SnappyContext . SnappyContext.scala : 104 at org.apache.spark.sql.SnappyContext . SnappyContext.scala : 95 at org.apache.spark.sql.SnappyContext .newSnappyContext SnappyContext.scala : 1221 at org.apache.spark.sql.SnappyContext .apply SnappyContext.scala : 1249 at org.apache.spark.scheduler.SnappyTaskSchedulerImpl.postStartHook SnappyTaskSchedulerImpl.scala : 25 at org.apache.spark.SparkContext . SparkContext.scala : 601 at io.snappydata.impl.LeadImpl.start LeadImpl.scala : 129 at io.snappydata.impl.ServerImpl.start ServerImpl.scala : 32 at io.snappydata.tools.LeaderLauncher.startServerVM LeaderLauncher.scala : 91 at com.pivotal.gemfirexd.tools.internal.GfxdServerLauncher.connect GfxdServerLauncher.java : 174 at com.gemstone.gemfire.internal.cache.CacheServerLauncher AsyncServerLauncher.run CacheServerLauncher.java : 1003 at java.lang.Thread.run Thread.java : 745 Caused by : java.io.FileNotFoundException : tmp spark-jobserver filedao data jars.data Permission denied at java.io.FileOutputStream.open0 Native Method at java.io.FileOutputStream.open FileOutputStream.java : 270 at java.io.FileOutputStream . FileOutputStream.java : 213 at spark.jobserver.io.JobFileDAO.init JobFileDAO.scala : 90 at spark.jobserver.io.JobFileDAO . JobFileDAO.scala : 30 .. . 22 more 16 07 21 23 : 12 : 26.891 UTC Distributed system shutdown-hook INFO snappystore : VM is exiting - shutting down distributed-system .. . .. . Do I need to be a different user to start the Lead node Use sudo Configure a property to tell Spark to use a directory foo has permission to Create this directory myself ahead of time .. . Answer : It seems that the current owner of tmp spark-jobserver is some other user . Check the permissions on that directory and delete it . If multiple users will be running leads on the same machine you can configure the job-server directories to be elsewhere like mentioned here https : github.com spark-jobserver spark-jobserver context-configuration . The relevant properties can be found in application.conf https : github.com spark-jobserver spark-jobserver blob master job-server src main resources application.conf source . This is probably more trouble than worth so for now it will be easier to just ensure a single user starts the lead nodes on a machine . We shall be fixing the default to be inside work directory in next release SNAP-69 .", "Question : I can t seem to find a way to start a shell using all the servers set up in conf servers .. . .. . Only found it possible to submit to cluster jobs using bin snappy-job.sh where I specify the lead location but would like to try real-time shell to perform some tests using the whole cluster .. . .. . Thank you .. . .. . Saif .. . Answer : Please see this link . It tells how to start a spark-shell and connect it to snappy store . http : snappydatainc.github.io snappydata connectingToCluster using-the-spark-shell-and-spark-submit .. . .. . Essentially you need to provide the locator property and this locator is the same which you have used to start the snappy cluster . bin spark-shell --master local --conf snappydata.store.locators locatorhost : port --conf spark.ui.port 4041 .. . .. . Note that with the above a different compute cluster is created to run your program . The snappy cluster is not used for computation when you run your code from this shell . The required table definition and data is fetched in efficient fashion from the snappy store . In future we might make this shell connect to the snappy cluster in such a way that it uses the snappy cluster itself as its compute cluster . Comment : Whilst this may theoretically answer the question it would be preferable meta.stackoverflow.com q 8259 to include the essential parts of the answer here and provide the link for reference . Comment : yep realized it and edited my response . Comment : Thanks . So even if the --master is local the shell connects to the spark driver Job Server and utilize the servers setup for the snappy cluster Will any spark action utilize all conf servers hosts for computation and data distribution", "Question : I am trying to deploy the Pulse Web Application to an external Tomcat . I get this error when deploying . How should I fix this org.springframework.beans.factory.NoSuchBeanDefinitionException : No bean named org.springframework.security.authenticationManager is defined : Did you forget to add a gobal element to your configuration with child elements Alternatively you can use the authentication-manager-ref attribute on your and elements . Comment : Hi Jason will get an answer for you ASAP .. . Answer : Which version of SnappyData you are using You need to mention a pulse.properties file in the classpath . For details you can check http : rowstore.docs.snappydata.io docs manage guide pulse quickstart.html topic 795C97B46B9843528961A094EE520782 . Let us know if you any problems further . Comment : I am using SnappyData-0.5 . I find that the SnappyData online links go to different old Gemfire docs . I will follow your rowstore link and it s directions . Comment : This did not resolve the issue . I have put a pulse.properties into TOMCAT HOME lib as described in the documentation link you specified . The error remains . Also I see a PULSE.log.0 file and upon opening it it shows as well that it cannot find the pulse properties file .", "Question : SnappyData documentation and architecture diagrams seem to indicate that a JDBC thin-client connection goes from a client to a Locator and then it is routed to a direct connection to a Server . If this is true then I can run JDBC queries without a Lead node correct .. . Answer : Yes that is correct . The locator provides load and connectivity information back to the client that is now able to connect to one or more servers either for direct access to a bucket for low-latency queries but more importantly is HA - can failover and failback . So yes your connected clients will continue to function even when the locator goes away . Note that the lead plays a different role than the locator . Its primary function is to host Spark driver orchestrate Spark Jobs and provide HA to Spark . With no lead you won t be able to run such Jobs .", "Question : I am running this from ubuntu . The Gemfire client log is not logging . Is there something incorrect in my syntax or property settings .. . Answer : The settings look correct . Can you check if snappydata-client.log is created Comment : There is no log in the current directory where I started Spring Boot from the -jar . Where else should I look", "Question : SnappyData v.0.5 .. . .. . In our AWS SnappyData instance we have the following attributes : .. . .. . 1 . public IP : 52.x.x.x exposed to the Internet .. . 2 . private internal IP : 172.x.x.x exposed only inside AWS .. . 3 . private internal Name : ip-172-x-x-x.us-west-2.compute.internal exposed only inside AWS .. . .. . To connect with JDBC from my Windows client I use a JDBC URL like this : .. . .. . jdbc : snappydata : 52.x.x.x : 1527 .. . .. . The sequence of events the connection makes is : .. . .. . 1 . JDBC client connects into AWS and reaches the Locator at 172.x.x.x : 1527 .. . 2 . Locator finds the Server running at 172.x.x.x : somePort .. . 3 . Locator sends the internal host name back to the Windows Client .. . 4 . Windows JDBC Client tries to connect to this : .. . .. . ip-172-x-x-x.us-west-2.compute.internal .. . .. . The JDBC connection fails because only the 52.x.x.x IP address is really publicly available to the Internet . To remedy I had to change my Windows hosts-file adding a mapping of : .. . .. . Please advise on a better way so my clients don t need to hack their hosts files . .. . Answer : You can set the prefer-netserver-ipaddress property on servers to force sending the IP addresses back to clients e.g . -prefer-netserver-ipaddress .. . or -J-Dgemfirexd.prefer-netserver-ipaddress .. . on command-line see details here http : rowstore.docs.snappydata.io docs deploy guide Topics locator-server-starting.html .. . .. . The default is to convert to host names because in most scenarios it is the IP address that does the job of catering to both internal IP and external i.e . if looked up from inside the subnet then it resolves to internal IP address but from outside it resolves to external IP address .", "Question : I am trying to deploy the Pulse Web Application to an external Tomcat . I get this error when deploying . How should I fix this org.springframework.beans.factory.NoSuchBeanDefinitionException : No bean named org.springframework.security.authenticationManager is defined : Did you forget to add a gobal element to your configuration with child elements Alternatively you can use the authentication-manager-ref attribute on your and elements . Comment : Hi Jason will get an answer for you ASAP .. . Answer : Which version of Tomcat are you using Here is another thread on the same issue with TC authentication http : stackoverflow.com questions 11657660 barebonds-hello-world-example-with-security . Else can you just try Pulse in the embedded mode Comment : pulse.war is a pre-built web app in the SnappyData-0.5 dist so I don t have access to configure security like the thread above . If the answer is to build pulse.war from scratch myself from the GitHub source with some other security configuration then let me know . However the RowStore docs at step 4 . say authentication is Optional . If it is required I will follow through with more set up but I don t want to do that unless necessary . Comment : Hoping one of our team members will revert back on if this capability has been tested or there is a simple fix . For now just try Pulse App running in the locator embedded mode .", "Question : I am trying to deploy the Pulse Web Application to an external Tomcat . I get this error when deploying . How should I fix this org.springframework.beans.factory.NoSuchBeanDefinitionException : No bean named org.springframework.security.authenticationManager is defined : Did you forget to add a gobal element to your configuration with child elements Alternatively you can use the authentication-manager-ref attribute on your and elements . Comment : Hi Jason will get an answer for you ASAP .. . Answer : OK . This is fixed . To everyone also experiencing this.. . you must set the Spring Profile pulse.authentication.default or it will not load the AuthenticationManager Bean . The overall issue is with the RowStore s documentation which says this is OPTIONAL when in fact it is required . http : rowstore.docs.snappydata.io docs manage guide pulse quickstart.html topic 795C97B46B9843528961A094EE520782 .. . .. . It says at Step 4 . that configuring security is Optional when in fact you have to pass a Spring Profile . Also again in the section Authenticating Pulse Users it says this is not a requirement . To fix the issue I had to pass the Spring Profile pulse.authentication.default to activate the Bean in spring-security.xml and deploy pulse.war properly . A better way for SnappyData pulse.war to do this in the future might be to use pulse.authentication.custom which would always load the default AuthenticationManager bean as long as a custom one was not configured . Example change for future to make it truly optional : Comment : spring.profiles.default is set in web.xml and set to pulse.authentication.default . This should have worked without specifying any authentication settings . It would be helpful if you can specify the TC version you are using . I will also try in that version and see if it creates an issue ." ] }
[ "yes-answer-long", "yes-answer-short" ]
olap
UNK_RELATION
sonar-jira@project-management@90
sonar-jira -- the jira sonar plugin provides a convenient way to integrate the atlassian @placeholder system with the sonarqube continuous inspection platform .
{ "confidence": [], "content": [] }
{ "confidence": [], "content": [] }
[ "yes-answer-long", "yes-answer-short" ]
project-management
UNK_RELATION
ecmascript-2015@ecmascript-2015@65
ecmascript-2015 -- for javascript language features specific to @placeholder formerly known as ecmascript 6th edition .
{ "confidence": [ 15.627223014831543, 13.695869445800781, 13.274574279785156, 12.388132095336914, 11.478065490722656, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578, 8.906574249267578 ], "content": [ "Worth adding a link as I had not heard of this before : developers.google.com web updates 2015 01 https : developers.google.com web updates 2015 01 ES6-Template-Strings tagged-templates", "In this example the language specification determines the appropriate values to pass to the function the developer doesn t determine this .", "Also how would someone handle this specific case in their own tagged template function", "The first example log foo allows the language specification to determine the values passed to the log function See 12.3.7 http : www.ecma-international.org ecma-262 6.0 sec-tagged-templates .", "I have a simple logging function : .. . .. . If I call it without parentheses currently using Chrome s dev tools and pass in a template string like this : .. . .. . The output is : logged : foo raw : Array 1 .. . .. . If I call it with parentheses .. . .. . The output is : logged : foo .. . .. . Why does calling a function using a template string an no parentheses work in Javascript", "As I m reading here http : www.2ality.com 2014 09 es6-modules-final.html ES2015 allows you to export var const let function class and default .", "But I don t understand why .", "In my layman opinion there should be named exports and default exports .", "The type of what you are exporting doesn t seem to matter .", "I mean when you export default do you specify the type", "No you don t and it works .", "Additionally what difference can it make to export var or let", "What difference can it make to export const", "When you import a module it s immutable anyway AFAIK .", "So why do you have to specify the type of the export", "You don t have to specify the type of the export - you have to specify the type of the local binding in your module .", "there should be named exports and default exports .", "There are : .. . .. . All those examples you ve given are actually shorthands which both declare a local variable and export it under the same name : .. . .. . What difference can it make to export const", "When you import a module it s immutable anyway .", "That you cannot reassign it inside your module .", "The export doesn t export a value1 it exports a binding to your local variable .", "Imports actually aren t immutable they are only non-writable .", "1 : Default exports are a bit special in that regard .", "The export default declaration does indeed allow you to directly export the value of an expression or an anonymous function function class declaration but behind the scenes it actually does create a local variable in your module with the name default .", "Declaring variables functions or the new const values doesn t have anything to do with exports .", "The behavior of a var let or const is different within a module so you need to indicate what it is .", "If you export it or not is another thing .", "The values are immutable from the outside of a module but not from the inside from another exported function for instance .", "you are combining variable-declaration with module exports with code like .. . .. . in the same way that you can t declare a variable with only .. . .. . you can t declare a variable and then assign it to a named export with .. . .. . Here is what you can do : .. . .. . This is essentially just separating the logic of variable-declaration and naming module exports", "If your export is default you don t have to specify name or type of what you are exporting so you can do : .. . .. . but named exports are different you have to specify variable name so that you can import it by this name type is not important :", "What is happening that causes the result to be different from calling it with parentheses", "The second example log foo explicitly passes a single argument .", "Template literals can contain strings as well as expressions .", "Sometimes you may with to have more control over the compilation of a string from its string-parts and expression-parts .", "In this case you may be looking for tagged templates .", "Notice here how all of the strings are passed in through the first argument .", "As well all of the interpolated value expressions are passed in through the rest of the parameters pulled together into an array here .", "With this added control we could do all sorts of things such as localization .", "To contrast when you call log foo you wind up getting only the resulting string .", "No objects no parts no raw values .", "Take into consideration the following : .. . .. . Is 123 abc equivalent to 123 + abc", "In other words are ciblings converted to the 123 + abc format behind the scenes", "No they are passed as two separate arguments to the template tag with an empty string between them .", "Depending on the tag the outcome might be the same of course", "With String.raw the behavior is essentially the same .", "Both it and + with a string value perform concatenation achieving the same result .", ".. . .. . The difference between them is that the 1st line is deferring the concatenation for String.raw to perform with 123 and abc provided to it as separate arguments .", "In using + the concatenation is always performed upfront passing only a single value to String.raw for 123 + abc .", "With other tagged functions the difference may be more apparent as the function may perform other operations before or besides concatenation .", "A contrived example :", "Using + will also process the values from .valueOf whereas the template substitution method uses .toString .", "Not different for this case but very important in the general case ." ] }
{ "confidence": [ 20.712200164794922, 11.526988983154297, 8.946695327758789, 8.946695327758789, 8.946695327758789, 8.946695327758789 ], "content": [ "Question : I have a simple logging function : .. . .. . If I call it without parentheses currently using Chrome s dev tools and pass in a template string like this : .. . .. . The output is : logged : foo raw : Array 1 .. . .. . If I call it with parentheses .. . .. . The output is : logged : foo .. . .. . Why does calling a function using a template string an no parentheses work in Javascript What is happening that causes the result to be different from calling it with parentheses .. . Answer : The first example log foo allows the language specification to determine the values passed to the log function See 12.3.7 http : www.ecma-international.org ecma-262 6.0 sec-tagged-templates . The second example log foo explicitly passes a single argument . Template literals can contain strings as well as expressions . Sometimes you may with to have more control over the compilation of a string from its string-parts and expression-parts . In this case you may be looking for tagged templates . Notice here how all of the strings are passed in through the first argument . As well all of the interpolated value expressions are passed in through the rest of the parameters pulled together into an array here . With this added control we could do all sorts of things such as localization . In this example the language specification determines the appropriate values to pass to the function the developer doesn t determine this . To contrast when you call log foo you wind up getting only the resulting string . No objects no parts no raw values . Comment : Worth adding a link as I had not heard of this before : developers.google.com web updates 2015 01 https : developers.google.com web updates 2015 01 ES6-Template-Strings tagged-templates", "Question : Take into consideration the following : .. . .. . Is 123 abc equivalent to 123 + abc In other words are ciblings converted to the 123 + abc format behind the scenes Also how would someone handle this specific case in their own tagged template function Comment : No they are passed as two separate arguments to the template tag with an empty string between them . Depending on the tag the outcome might be the same of course .. . Answer : With String.raw the behavior is essentially the same . Both it and + with a string value perform concatenation achieving the same result . .. . .. . The difference between them is that the 1st line is deferring the concatenation for String.raw to perform with 123 and abc provided to it as separate arguments . In using + the concatenation is always performed upfront passing only a single value to String.raw for 123 + abc . With other tagged functions the difference may be more apparent as the function may perform other operations before or besides concatenation . A contrived example : Comment : Using + will also process the values from .valueOf whereas the template substitution method uses .toString . Not different for this case but very important in the general case .", "Question : As I m reading here http : www.2ality.com 2014 09 es6-modules-final.html ES2015 allows you to export var const let function class and default . But I don t understand why . In my layman opinion there should be named exports and default exports . The type of what you are exporting doesn t seem to matter . I mean when you export default do you specify the type No you don t and it works . Additionally what difference can it make to export var or let What difference can it make to export const When you import a module it s immutable anyway AFAIK . So why do you have to specify the type of the export .. . Answer : You don t have to specify the type of the export - you have to specify the type of the local binding in your module . there should be named exports and default exports . There are : .. . .. . All those examples you ve given are actually shorthands which both declare a local variable and export it under the same name : .. . .. . What difference can it make to export const When you import a module it s immutable anyway . That you cannot reassign it inside your module . The export doesn t export a value1 it exports a binding to your local variable . Imports actually aren t immutable they are only non-writable . 1 : Default exports are a bit special in that regard . The export default declaration does indeed allow you to directly export the value of an expression or an anonymous function function class declaration but behind the scenes it actually does create a local variable in your module with the name default .", "Question : As I m reading here http : www.2ality.com 2014 09 es6-modules-final.html ES2015 allows you to export var const let function class and default . But I don t understand why . In my layman opinion there should be named exports and default exports . The type of what you are exporting doesn t seem to matter . I mean when you export default do you specify the type No you don t and it works . Additionally what difference can it make to export var or let What difference can it make to export const When you import a module it s immutable anyway AFAIK . So why do you have to specify the type of the export .. . Answer : Declaring variables functions or the new const values doesn t have anything to do with exports . The behavior of a var let or const is different within a module so you need to indicate what it is . If you export it or not is another thing . The values are immutable from the outside of a module but not from the inside from another exported function for instance .", "Question : As I m reading here http : www.2ality.com 2014 09 es6-modules-final.html ES2015 allows you to export var const let function class and default . But I don t understand why . In my layman opinion there should be named exports and default exports . The type of what you are exporting doesn t seem to matter . I mean when you export default do you specify the type No you don t and it works . Additionally what difference can it make to export var or let What difference can it make to export const When you import a module it s immutable anyway AFAIK . So why do you have to specify the type of the export .. . Answer : you are combining variable-declaration with module exports with code like .. . .. . in the same way that you can t declare a variable with only .. . .. . you can t declare a variable and then assign it to a named export with .. . .. . Here is what you can do : .. . .. . This is essentially just separating the logic of variable-declaration and naming module exports", "Question : As I m reading here http : www.2ality.com 2014 09 es6-modules-final.html ES2015 allows you to export var const let function class and default . But I don t understand why . In my layman opinion there should be named exports and default exports . The type of what you are exporting doesn t seem to matter . I mean when you export default do you specify the type No you don t and it works . Additionally what difference can it make to export var or let What difference can it make to export const When you import a module it s immutable anyway AFAIK . So why do you have to specify the type of the export .. . Answer : If your export is default you don t have to specify name or type of what you are exporting so you can do : .. . .. . but named exports are different you have to specify variable name so that you can import it by this name type is not important :" ] }
[ "yes-answer-long", "yes-answer-short" ]
ecmascript-2015
UNK_RELATION
apache-commons-cli@api@66
apache-commons-cli -- the apache-commons-cli library provides an @placeholder for parsing command-line options passed to programs .
{ "confidence": [ 80.7779541015625, 71.88192749023438, 71.8705062866211, 71.83659362792969, 71.15336608886719, 70.74237060546875, 69.87374877929688, 68.77117919921875, 67.47760772705078, 67.40799713134766, 66.3782730102539, 65.9314956665039, 65.54364013671875, 65.2463150024414, 65.2463150024414, 64.52538299560547, 64.52538299560547, 64.36685180664062, 63.70913314819336, 62.789772033691406, 62.783931732177734, 61.9759635925293, 61.84117889404297, 61.701690673828125, 61.52717208862305, 61.464569091796875, 60.78062438964844, 60.525238037109375, 60.12105941772461, 58.7971076965332, 58.69297790527344, 58.64806365966797, 58.43320846557617, 58.12422180175781, 57.916290283203125, 57.86201858520508, 57.57164001464844, 57.57164001464844, 57.048648834228516, 57.048648834228516, 56.793800354003906, 56.02876281738281, 55.069759368896484, 55.04534149169922, 54.912845611572266, 54.55945587158203, 54.389625549316406, 54.389625549316406, 54.28865432739258, 53.511966705322266, 53.23979949951172, 53.012062072753906, 52.96086502075195, 52.79389572143555, 52.644325256347656, 52.20295715332031, 51.93624496459961, 51.57627868652344, 51.57627868652344, 51.49518585205078, 51.212379455566406, 51.212379455566406, 51.212379455566406, 51.05926513671875, 51.00750732421875, 50.85215759277344, 50.695465087890625, 50.665435791015625, 50.54328155517578, 50.22364807128906, 50.22364807128906, 49.82781982421875, 49.82781982421875, 49.23650360107422, 48.53997802734375, 48.38957214355469, 48.38957214355469, 48.15947723388672, 47.84893035888672, 47.66065216064453, 47.51650619506836, 47.49999237060547, 46.93525695800781, 46.18292236328125, 46.13896179199219, 45.79767608642578, 45.78998565673828, 45.78998565673828, 45.57306671142578, 45.05945587158203, 45.05945587158203, 45.05945587158203, 44.33081817626953, 44.118751525878906, 43.956504821777344, 43.404388427734375, 43.39665985107422, 43.14622497558594, 42.76708221435547, 42.65843963623047 ], "content": [ "I am using Apache commons cli 1.2 for command-line parsing .", "I am using Apache Commons cli .", "I m using the Apache Commons CLI .", "I am working with apache-commons-cli for parsing command-line-arguments in my java program .", "I m using the Apache Commons CLI to handle command-line-arguments in Java .", "I m using Apache Commons CLI 1.2 to parse a command-line that takes options and extra arguments at the end .", "Want to use Option apache.commons.cli http : commons.apache.org proper commons-cli javadocs api-1.0 org apache-commons-cli Options.html as command and sub-command .", "How can I define trailing args as part of the options using Apache Commons CLI http : commons.apache.org proper commons-cli", "I used to work with Apache Commons Cli 1.2 .", "I m trying out apache commons-cli to parse the command-line-arguments that were passed to the java command-line utility .", "It seems that this cannot be done using apache-commons-cli - An apache library that does very little .", "It is so lame that trailing args cannot be defined as part of apache-commons-cli .", "I m trying to use the Apache Commons CLI library to parse command-line options in an Eclipse project roughly following the examples in their Usage Scenarios https : commons.apache.org proper commons-cli usage.html .. . .. . I added the commons-cli-1.3.1 folder to the lib folder in the root of the Eclipse project .", "Using Apache Commons CLI 1.2 https : commons.apache.org proper commons-cli here .", "Option.Builder Java-Doc http : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli Option.Builder.html .", "See the javadoc of the Option class http : commons.apache.org proper commons-cli apidocs org apache-commons-cli Option.html for more details .", "Use CommandLine.getArgs http : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli CommandLine.html getArgs 28 29 .", "setArgs https : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli Option.html setArgs-int- is a method related to Option not Options", "commons-cli doesn t seem to support these options .", "M tryng to use apache-commons-cli My use-case is variable number of arguments with some options .", "@centic I also have similar question here http : stackoverflow.com questions 27614571 how-to-use-apache-commons-cli-to-parse-the-property-file-and-help-option which uses Apache Commons CLI .", "Looks to me like you could probably use an OptionGroup https : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli OptionGroup.html which is described as : .. . .. . A group of mutually exclusive options .", "Example pseudocode : .. . .. . I used this the solution by Pascal Sch fer : Can Apache Commons CLI options parser ignore unknown command-line options", "I am trying to set Option name with hyphens in it like source-files using the Apache Commons CLI java library .", "The Apache Commons CLI interface has been set up correctly and works .", "I am writing a Java application that takes command-line-arguments which are processed using Apache Commons CLI with the GnuParser .", "github.com apache commons-cli https : github.com apache commons-cli in case you are github member then if you select Watch on this page you will keep getting notifications as to when the 1.3 is released .", "the commons-cli is on git hub .", "See https : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli CommandLine.html getArgList-- for the full description .", "I am using commons-cli-1.3.1.jar https : commons.apache.org proper commons-cli download cli.cgi by the way .", "Unfortunately Commons CLI has no way of specifying interdependent options like that .", "I am writing command-line application in Java and I ve chosen Apache Commons CLI to parse input arguments .", "You can set the exact number of required arguments with Option.setArgs int num http : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli Option.html setArgs 28int 29 .", "This is not possible with Commons CLI .", "I would like to define an Apache Commons CLI parser that includes named arguments and positional arguments .", "This question already has an answer here : .. . .. . Commons CLI required groups questions 10798208 commons-cli-required-groups 1 answer .. . .. . I am currently using Apache s common CLI library to parse command-line options and I was wondering if there s an easy way for conditional requirements .", "addOption is overloaded and there is also variant that allows to provide BOTH short and long options http : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli Options.html addOption java.lang.String 20java.lang.String 20boolean 20java.lang.String", "From the documentation : http : commons.apache.org proper commons-cli javadocs api-1.3 org apache-commons-cli HelpFormatter.html setOptionComparator-java.util.Comparator- Passing in a null comparator will keep the options in the order they were declared .", "How can I do this in commons-cli", "By the way I used commons-cli 1.2 .", "Could not GET https : repository.apache.org content groups snapshots commons-cli commons-cli 1.3-SNAPSHOT maven-metadata.xml .", "To parse args passed in the main class I normally use by Apache Commons CLI .", "I noticed that Commons CLI http : commons.apache.org proper commons-cli index.html documentation mentions a hyphenated option name in one their examples .", ".. . Could not resolve commons-cli : commons-cli : 1.3-SNAPSHOT .", "I m using Apache Commons CLI 1.3.1 to process some options and some of the options can take one to unlimited number arguments .", "Trying to use Apache Commons Command Line Interface 1.3.1 from here https : commons.apache.org proper commons-cli javadocs api-release index.html It works fine for required arguments but seems to drop any optional arguments .", "http : stackoverflow.com questions 6049470 can-apache-commons-cli-options-parser-ignore-unknown-command-line-options .. . .. . This worked fine for me on 1.2 and it works fine on 1.3.1 as well .", "However look here http : stackoverflow.com questions 6049470 can-apache-commons-cli-options-parser-ignore-unknown-command-line-options for a quick way to potentially solve the unrecognized argument exception .", "I don t understand how to apply Options to DefaultParser in Commons CLI .", "As of Apache Commons CLI 1.3 they changed the outcome of passing a null comparator to setOptionComparator Comparator comparator .", "I am using Apache commons basic gnu parser to parse command-line options as shown below .", "I am using the commons-cli to handle the command-line parameters of my game OpenPatrician https : sourceforge.net p openpatrician .", "You can use OptionBuilder https : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli OptionBuilder.html like : .. . .. . Also look at : .. . .. . https : commons.apache.org proper commons-cli usage.html .. . .. . http : apache-commons.680414.n4.nabble.com cli-Example-using-of-option-with-two-mandatory-arguments-td3321524.html", "Commons-cli does not support special handling of the trailing arguments currently .", "Which version of commons-cli are you using", "Apache CLI has a method getArgList which returns all not handled options and arguments from the command-line .", "How to I configure commons-cli to have two arguments for filenames which are required based on the parameters options specified", "The doc on this is at commons.apache.org proper commons-cli http : commons.apache.org proper commons-cli usage.html Java Property Option", "See commons.apache.org proper commons-cli mail-lists.html http : commons.apache.org proper commons-cli mail-lists.html", "You can use this URL for obtaining finalized library https : repository.jboss.org nexus content groups public commons-cli commons-cli .. . .. . You may have to edit your repository URL to read from this as Apache repository is only having a snapshot .", "HelpFormatter supports setting a different Comparator see the javadoc http : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli HelpFormatter.html setOptionComparator 28java.util.Comparator 29 .", "It does so by calling its own isShortOption -gsd http : svn.apache.org viewvc commons proper cli trunk src main java org apache-commons-cli DefaultParser.java view markup l299 .", "Additionally the setValueSeparator seems to define what usually the equal sign is used for see the JavaDoc https : commons.apache.org proper commons-cli apidocs org apache-commons-cli Option.html setValueSeparator-char- i.e .", "In link http : stackoverflow.com questions 11741625 apache-commons-cli-ordering-help-options 12449193 12449193 4th answer has given return opt1.getKey .compareToIgnoreCase opt2.getKey You will get that .", "I am trying to build a program in java which uses Apache Commons CLI and I have gotten this error - it was working well until now .", "I think the problem might be the call to optionGSTypes.setArgs 3 according to the JavaDoc https : commons.apache.org proper commons-cli apidocs org apache-commons-cli Option.html setArgs-int- it instructs commons-cli to Sets the number of argument values this Option can take .", "In the Apache Commons CLI lib is it possible to bypass the usage of short-name thus forcing the user to use the long name", "You can try to exclude commons-cli-1.2 from Hadoop dependency in your pom.xml then Hadoop willl use your commons-cli-1.3.1 .", "You can use OptionBuilder See Commons CLI Usage Scenarios http : commons.apache.org proper commons-cli usage.html For complete code with working project see https : github.com firefoxNX StackOverflow tree master CommonsCli", "As a side note : from the Apache Commons CLI API documentation related to Options addOption String opt boolean hasArg String description http : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli Options.html addOption java.lang.String 20boolean 20java.lang.String emphasis mine : opt - Short single-character name of the option .", "As of Apache Commons CLI 1.2 you can set the comparator directly on the HelpFormatter class : .. . .. . setOptionComparator link http : commons.apache.org proper commons-cli javadocs api-1.2 org apache-commons-cli HelpFormatter.html setOptionComparator 28java.util.Comparator 29 .. . .. . public void setOptionComparator Comparator comparator .. . .. . Set the comparator used to sort the options when they output in help text .", "This option does not exist at the moment as part of the commons-cli .", "I need to pass tab as an argument in commons-cli .", "For Apache commons-cli library version : 1.3.1 I detected in the official JavaDoc https : commons.apache.org proper commons-cli apidocs org apache-commons-cli GnuParser.html that GnuParser is deprecated and DefaultParser should be used instead : .. . .. . @deprecated since 1.3 use the @link DefaultParser instead .. . .. . However the following code snippet stops working as expected : .. . .. . Note that setValueSeparator is used here to define a custom separator char to enable the CLI to support sevaral gst -types see code snippet .", "Required by : : dpg-variant-store : 0.1 Unable to load Maven meta-data from https : repository.apache.org content groups snapshots commons-cli commons-cli 1.3-SNAPSHOT maven-metadata.xml .", "I just found that hadoop use commons-CLi 1.2 .", "@dosyfier thank you for reply version is commons-cli-1.3.1", "I was wondering if there is a way to do this with Apache CLI", "Then the answer as far as I see is no with the current version of commons-cli you will need to file an enhancement request with commons-cli to get this added as option to HelpFormatter .", "Do I need to use CommandLine parser like Commons CLI for this in Java to achieve this and instead of doing manual parsing I should use Commons CLI to parse the file as well", "Apache Commons-CLI does not support this as it cannot know how you would convert more complex types of Object you will need to convert the String to Long in your code .", "I m having an issue properly setting up some options in Apache CLI .", "So what appears is : .. . .. . But I want to order them as follows : .. . .. . I know that there is a OptionFormatter class you can use and pass to the HelpFormatter but can t see any examples on how to use it for my purposes above http : www.marko.homeunix.org programming java commons-cli api org apache-commons-cli HelpFormatter.OptionComparator.html .", "I have used the Apache CLI library to create an executable-jar file .", "Then in the main method something akin to : .. . .. . EDIT : as it turns out this approach is similar to the answer provided here : Commons CLI required groups http : stackoverflow.com questions 10798208 commons-cli-required-groups .", "However when I print the usage statement for the jar I would like to show the following : .. . .. . Printing of all the options is easily done with commons-cli .", "Passing in null as short name works for me when using the latest version of Apache Commons Cli 1.3.1 and the DefaultParser which is the only one not deprecated now :", "Has anyone ever encountered the same behavior with Apache Commons-CLI when switching to DefaultParser and several option values and custom separators", "My objective is to know how commons-cli parses backslash itself .", "I want to run .. . .. . application.jar runs with Commons CLI and needs external log4j.xml file .", "I don t think it can be done or is a good idea to use commons-cli for any arbitrary arguments .", "I had the same error and I believe the problem is commons-cli version 1.3.x .", "-CatchArchive .. . -CSWConfig .. . -modelSources .. . -sbx .. . -stripInfo .. . -swSupplierName .. . .. . I read one link http : stackoverflow.com questions 11741625 apache-commons-cli-ordering-help-options 12449193 12449193 for this but I am not able to preserve the ordering while displaying help contents .", "First DefaultParser recognizes -gst as a short option by calling Options.hasShortOption -gst http : svn.apache.org viewvc commons proper cli trunk src main java org apache-commons-cli DefaultParser.java view markup l490 which returns true .", "After parsing the Options passed on the command-line the remaining arguments are available in the CommandLine.getArgs method .", "questions 320542 how-to-get-the-path-of-a-running-jar-file 30 answers .. . .. . I ve created an executable-jar and using commons-cli to give the user the ability to specify command-line parameters when he launches the client .", "Bellow block of code is how i interpreted Commons CLI docs : .. . .. . How come that line.getOptions is empty and how to apply the options properly", "I came across exactly this problem today when I had dependecy on commons-cli-1.3.1 but I had commons-cli-1.2 in my classpath because I used yarn jar to launch my application .. . .. . What you should do", "For eg : .. . .. . hadoop jar HADOOP HOME share hadoop tools lib hadoop-streaming-2.4.0.jar -D stream.map.output.field.separator t -file mapper.py -mapper mapper.py -file reducer.py -reducer reducer.py -input in -output out .. . .. . Apache Hadoop uses Apache Commons-cli as command-line utility .", "I m not sure Commons CLI works with unnamed position-dependent arguments which it seems like is what you re looking for ." ] }
{ "confidence": [ 82.0611801147461, 80.12728881835938, 79.84102630615234, 79.58126831054688, 79.53897094726562, 77.64886474609375, 77.49395751953125, 76.90394592285156, 75.6475601196289, 75.60833740234375, 75.3472900390625, 75.31260681152344, 75.18049621582031, 74.93669891357422, 74.89154815673828, 74.49127960205078, 73.74913024902344, 73.60894012451172, 72.2857894897461, 72.09901428222656 ], "content": [ "Question : I would like to define an Apache Commons CLI parser that includes named arguments and positional arguments . How do I validate pos1 and pos2 .. . Answer : One a quick read of the documentation I was not aware the the CommandLine class would provide access to the remaining positional parameters . After parsing the Options passed on the command-line the remaining arguments are available in the CommandLine.getArgs method .", "Question : I am working with apache-commons-cli for parsing command-line-arguments in my java program . Now I am trying to find a way to exclude displaying some sensitive or debug options from the usage help . I am using HelpFormatter for the help by the way . This is printing all the options . But I don t want the third option to be printed . Actual Output : .. . .. . Expected Output : .. . .. . This way the debug arguments will be known only to the people who actual need to know about it for debugging . Is there a way to disable a specific option from the help output alone . But still parse it just like any other option I am using commons-cli-1.3.1.jar https : commons.apache.org proper commons-cli download cli.cgi by the way . .. . Answer : As far as I see HelpFormatter is not intended to be subclassed for something like this especially appendOption is private and thus does not allow to filter out options . Therefore I would simply build two Options objects one for actual parsing of the commandline options and one for printing the help i.e .", "Question : I m trying to use the Apache Commons CLI library to parse command-line options in an Eclipse project roughly following the examples in their Usage Scenarios https : commons.apache.org proper commons-cli usage.html .. . .. . I added the commons-cli-1.3.1 folder to the lib folder in the root of the Eclipse project . I added this to my imports : .. . .. . And this to the top of my main : .. . .. . It compiles without error but when it runs the parser.parse call generates this error : .. . .. . I am not using any class loaders at this point . What does this error mean How can I resolve the error and parse the arguments Comment : What is the value of args Comment : args is the parameter passed to main . I m not sure what args I ve run it with it may have started with a directory path It s definitely been empty and I just tried with typing random strings . The error has been the same every time . Comment : I don t think it can be done or is a good idea to use commons-cli for any arbitrary arguments . AFIK it is meant to provide a set of predefined arguments and validate them . .. . Answer : I had the same error and I believe the problem is commons-cli version 1.3.x . I changed to version 1.2 and it worked like a charm .", "Question : I m using the Apache Commons CLI . By default it orders help options on the command-line alphabetically by key . So what appears is : .. . .. . But I want to order them as follows : .. . .. . I know that there is a OptionFormatter class you can use and pass to the HelpFormatter but can t see any examples on how to use it for my purposes above http : www.marko.homeunix.org programming java commons-cli api org apache-commons-cli HelpFormatter.OptionComparator.html . Just wondering has anyone done anything similar Thanks Comment : wow . You would think that something that simple would work . .. . Answer : As of Apache Commons CLI 1.2 you can set the comparator directly on the HelpFormatter class : .. . .. . setOptionComparator link http : commons.apache.org proper commons-cli javadocs api-1.2 org apache-commons-cli HelpFormatter.html setOptionComparator 28java.util.Comparator 29 .. . .. . public void setOptionComparator Comparator comparator .. . .. . Set the comparator used to sort the options when they output in help text . Passing in a null parameter will set the ordering to the default mode . You should supply your own implementation of Comparator Option that sorts your options in the order you desire . Comment : The default is alphabetic so passing null doesn t help . Comment : @smackfu Thanks - removed . Comment : As of Apache Commons CLI 1.3 they changed the outcome of passing a null comparator to setOptionComparator Comparator comparator . From the documentation : http : commons.apache.org proper commons-cli javadocs api-1.3 org apache-commons-cli HelpFormatter.html setOptionComparator-java.util.Comparator- Passing in a null comparator will keep the options in the order they were declared .", "Question : I m trying to use the Apache Commons CLI library to parse command-line options in an Eclipse project roughly following the examples in their Usage Scenarios https : commons.apache.org proper commons-cli usage.html .. . .. . I added the commons-cli-1.3.1 folder to the lib folder in the root of the Eclipse project . I added this to my imports : .. . .. . And this to the top of my main : .. . .. . It compiles without error but when it runs the parser.parse call generates this error : .. . .. . I am not using any class loaders at this point . What does this error mean How can I resolve the error and parse the arguments Comment : What is the value of args Comment : args is the parameter passed to main . I m not sure what args I ve run it with it may have started with a directory path It s definitely been empty and I just tried with typing random strings . The error has been the same every time . Comment : I don t think it can be done or is a good idea to use commons-cli for any arbitrary arguments . AFIK it is meant to provide a set of predefined arguments and validate them . .. . Answer : I am using the commons-cli to handle the command-line parameters of my game OpenPatrician https : sourceforge.net p openpatrician . Basically there are three parts to it . The definition of the allowed command-line-arguments : .. . .. . Providing a help message with all the possible parameters : .. . .. . And of course the parsing of the arguments : .. . .. . Note that I am using a PosixPaser here and not the default parser . So that might have different behaviour . Comment : The documentation says PosixParser is Deprecated since 1.3 use the DefaultParser instead and Eclipse complains about it . However if I switch to PosixParser I get a different error : Exception in thread main java.lang.ArrayIndexOutOfBoundsException : 0 Comment : If you switch to DefaultParser do you get the same error I get Comment : Well my code uses version 1.2 so maybe I should update", "Question : This question already has an answer here : .. . .. . Commons CLI required groups questions 10798208 commons-cli-required-groups 1 answer .. . .. . I am currently using Apache s common CLI library to parse command-line options and I was wondering if there s an easy way for conditional requirements . For example in the example below I have two required options -a and -b as well as an optional -h which should show some description . The way the parser works right now is that it expected to throw a ParserException whenever one of the required options is missing . So far so good . My question is if there is a way to not look for required options when -h is specified . Since this it s common that -h should only print help and not actually starting my app I d like to skip checking other command-line options . Comment : I found the answer to my problem here : stackoverflow.com questions 10798208 https : stackoverflow.com questions 10798208 commons-cli-required-groups So my question is a duplicate . .. . Answer : Looks to me like you could probably use an OptionGroup https : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli OptionGroup.html which is described as : .. . .. . A group of mutually exclusive options . So you would build one OptionGroup with your -h and one with all of the other options . Then add both OptionGroup s . .. . .. . Added .. . .. . Some research http : stackoverflow.com a 10798771 823393 suggests using multiple parse attempts : Comment : Unfortunately all options within one group are mutual independent but I would rather like to have a two mutually independent group of options . I am not sure this is what OptionGroup should be used for . Comment : @FLekschas - Looks like http : stackoverflow.com a 10798771 823393 you need to parse multiple times in that case . Comment : Look at my comment to my question", "Question : I m trying out apache commons-cli to parse the command-line-arguments that were passed to the java command-line utility . Is there a way for both -r and -R to mean Recurse subdirectories without adding 2 options to the parser which would mess up the usage printout . some code : .. . Answer : This option does not exist at the moment as part of the commons-cli . For now this will have to do : .. . .. . .. . The resulting usage info being :", "Question : I am trying to get multiple arguments passed to a java program . The Apache Commons CLI interface has been set up correctly and works . However when I try to use .. . .. . setArgs Option.UNLIMITED VALUES it gives me an error .. . .. . The method setArgs int is undefined for the type Options . .. . .. . My code looks like this : .. . Answer : setArgs https : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli Option.html setArgs-int- is a method related to Option not Options Comment : Worked Thanks Comment : However this creates another issue . Now the same line gives me Cannot make a static reference to the non-static method setArgs int from the type Option . Any clue Comment : You re probably calling Option.setArgs statically . Create an instance of Option before attempting to use setArgs on the instance of that class Comment : You re a lifesaver Thanks", "Question : I am using Apache Commons cli . I have created different Options using OptionBuilder : .. . .. . My problem is that I want to have a fixed number of arguments for an Option . If a user passes fewer or more arguments it should throw exception . For other options I want to set minimum and maximum numbers of arguments allowed . How can I achieve this .. . Answer : You can set the exact number of required arguments with Option.setArgs int num http : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli Option.html setArgs 28int 29 . It is not possible to set a minimum and maximum . Perhaps you could use setArgs to set a maximum and check the minimum number manually . Alternatively raise a feature request on the Jira site : https : issues.apache.org jira browse CLI Comment : yea I did it manually", "Question : I m using the Apache Commons CLI . By default it orders help options on the command-line alphabetically by key . So what appears is : .. . .. . But I want to order them as follows : .. . .. . I know that there is a OptionFormatter class you can use and pass to the HelpFormatter but can t see any examples on how to use it for my purposes above http : www.marko.homeunix.org programming java commons-cli api org apache-commons-cli HelpFormatter.OptionComparator.html . Just wondering has anyone done anything similar Thanks Comment : wow . You would think that something that simple would work . .. . Answer : And the best KISS-way to implement such comparator is : Comment : I d rather use a List and then it s indexOf optName method . Or even better I would add the same Option instance added to the Options class to a List Option and then use the list s indexOf option method inside the Comparator .", "Question : Want to use Option apache.commons.cli http : commons.apache.org proper commons-cli javadocs api-1.0 org apache-commons-cli Options.html as command and sub-command . Ex . 1 . myprogram job -dryrun .. . 2 . myprogram job -update .. . 3 . myprogram job -update -dryrun .. . .. . What is best way to do this Tried with simple program : .. . .. . Error : .. . Answer : Why are you using OptionGroup You can use OptionBuilder See Commons CLI Usage Scenarios http : commons.apache.org proper commons-cli usage.html For complete code with working project see https : github.com firefoxNX StackOverflow tree master CommonsCli", "Question : I used to work with Apache Commons Cli 1.2 . For reasons that are irrelevant for this question I wanted the parser to ignore arguments if they are unknown not added to an Options-Object . Example pseudocode : .. . .. . I used this the solution by Pascal Sch fer : Can Apache Commons CLI options parser ignore unknown command-line options http : stackoverflow.com questions 6049470 can-apache-commons-cli-options-parser-ignore-unknown-command-line-options .. . .. . This worked fine for me on 1.2 and it works fine on 1.3.1 as well . But its deprecated . The parser I used got replaced by the DefaultParser . I looked up the functionalities but there is no such method processOptions . I really would like to use code that is not going to be deleted in later releases . Does anyone have an idea how to solve this problem Comment : The question asked is for an older version on the plugin and i am even refering to it so how is this a dublicate Comment : And it doesnt asnwer my question . Comment : I vote for reopening because the question explicitly ask for a non-deprecated way to solve the issue . .. . Answer : This should work for your use-case : .. . .. . The important part for you is the false argument which says to not fail when unknown options are met . Comment : Sorry maybe i expressed myself bad : The Method you are telling me to use doesnt solve the problem since the programm will STOP parsing the argument even though he does not throw an exception . For my use-case the parsing has to go on and the unknown argument shall only be ignored or skipped . Going to add some details to the question . Sorry for that .", "Question : I d like to parse a command of the following format : mycmd source dest . If the source or dest isn t found I d like the parser to fail . How can I define trailing args as part of the options using Apache Commons CLI http : commons.apache.org proper commons-cli I couldn t find a way to do it . I have a feeling this cannot be done . If the trailing args could be defined I wouldn t have needed to add them manually to the help - as stated in this solution http : stackoverflow.com a 21871711 435605 . Comment : The question you linked to contains the mechanism to retrieve the extra arguments . Use CommandLine.getArgs http : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli CommandLine.html getArgs 28 29 . Comment : I m looking for more than a way to get the trailing args . I m looking for a way to parse them like any other option . For example if an option has an argument but the argument is missing the parsing will fail . I m looking to do the same with the trailing args . Comment : If those trailing args have a meaning different meaning why not give them an option Why not use mycmd -s source -d dest As far as I can see trailing args are used for args of the same type . Ant - for example - uses them to let the user specify several targets . Comment : Then for example there can be several sources - at least one . I don t want to complicate the question . .. . Answer : Commons-cli does not support special handling of the trailing arguments currently . You need to parse the trailing arguments yourself for now i.e . with something like this :", "Question : I am trying to build a program in java which uses Apache Commons CLI and I have gotten this error - it was working well until now . Does it mean Apache repository is down If so what is the best way to resolve this issue Could not resolve all dependencies for configuration : compile . .. . Could not resolve commons-cli : commons-cli : 1.3-SNAPSHOT . Required by : : dpg-variant-store : 0.1 Unable to load Maven meta-data from https : repository.apache.org content groups snapshots commons-cli commons-cli 1.3-SNAPSHOT maven-metadata.xml . Could not GET https : repository.apache.org content groups snapshots commons-cli commons-cli 1.3-SNAPSHOT maven-metadata.xml . Received status code 503 from server : Service Temporarily Unavailable Comment : anything with -SNAPSHOT in it is not yet final and it subject to change and can break your application if it does change so you should avoid putting in such versions yourself or using libraries which themselves depend on such things . looks like you might be using gradle you should always put the commands tools into any such report so you should get gradle to dump your dependencies with gradle dependencies and try to fix the versions you are using . also look at removing any repos which are not main stream in your build config . Comment : I asked a similar question http : stackoverflow.com questions 25431856 grails-2-2-4-unresolved-dependencies-commons-imaging earlier today . I have been using the commons-imaging snapshot for a while and it only started failing to download recently . Does anybody know what s up with Apache s repository .. . Answer : @simbo1905 is correct . It may be possible that snapshot library may have been edited or renamed . You must use a finalized library . You can use this URL for obtaining finalized library https : repository.jboss.org nexus content groups public commons-cli commons-cli .. . .. . You may have to edit your repository URL to read from this as Apache repository is only having a snapshot . Comment : Thanks how can I know when 1.3 will be released Comment : You need to keep looking at public repositories . Like mvnrepository.com or on repository.jboss.org nexus content groups public https : repository.jboss.org nexus content groups public Comment : Is there any other way to know when that release is scheduled other than checking the list everyday Comment : I am not aware of that . Sorry . Comment : the commons-cli is on git hub . github.com apache commons-cli https : github.com apache commons-cli in case you are github member then if you select Watch on this page you will keep getting notifications as to when the 1.3 is released .", "Question : I am using Apache commons basic gnu parser to parse command-line options as shown below . I am invoking program using below mention list of parameters . Out put i am getting is just first IP address how can i get all three IP addresses with port which are passed as an argument to --iplist variable Here are the options i am using . Comment : have you tried java -jar myjar.jar --iplist 160.1.1.1 3009 160.1.1.1 3003 160.1.1.1 3004 Comment : Please also show how you define the options Comment : @centic I just added the code for options . Comment : @ymonad double quote solution is working but i can t force user to pass arguments in quotes . .. . Answer : You can use OptionBuilder https : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli OptionBuilder.html like : .. . .. . Also look at : .. . .. . https : commons.apache.org proper commons-cli usage.html .. . .. . http : apache-commons.680414.n4.nabble.com cli-Example-using-of-option-with-two-mandatory-arguments-td3321524.html Comment : withArgs method is deprecated Option server Option.builder r .argName ipl .longOpt iplist .hasArg .desc Name of server where decoder or collector can listen IP PORT .required .build Comment : Or it is possible if i give values of iplist two times and get value out of it . java -jar myjar.jar --iplist 160.1.1.1 3009 --iplist 160.1.1.1 3010 Comment : I am not sure but I guess it is a valid usage so you can try . But be careful about hasArg and hasArgs . Use second for multiple arguments .", "Question : I m using the Apache Commons CLI . By default it orders help options on the command-line alphabetically by key . So what appears is : .. . .. . But I want to order them as follows : .. . .. . I know that there is a OptionFormatter class you can use and pass to the HelpFormatter but can t see any examples on how to use it for my purposes above http : www.marko.homeunix.org programming java commons-cli api org apache-commons-cli HelpFormatter.OptionComparator.html . Just wondering has anyone done anything similar Thanks Comment : wow . You would think that something that simple would work . .. . Answer : Currently it is not supported . But it is an open-source so you know what to do.. . .. . .. . From the source code : .. . .. . You can override the default comparator and define the order you want .", "Question : I have following arguments to add to CLI .. . -sbx .. . -CSWConfig .. . -stripInfo .. . -modelSources .. . -catchArchive .. . -swSupplierName .. . -modelsSWExchnage .. . .. . but while displaying help it is showing these options in sorted order as shown below which I dont want I want all the options to be in order as they are added . -CatchArchive .. . -CSWConfig .. . -modelSources .. . -sbx .. . -stripInfo .. . -swSupplierName .. . .. . I read one link http : stackoverflow.com questions 11741625 apache-commons-cli-ordering-help-options 12449193 12449193 for this but I am not able to preserve the ordering while displaying help contents . Comment : In link http : stackoverflow.com questions 11741625 apache-commons-cli-ordering-help-options 12449193 12449193 4th answer has given return opt1.getKey .compareToIgnoreCase opt2.getKey You will get that . .. . Answer : As the Options class stores the options in Maps internally it does not keep any ordering . That means you need to provide your own order as you already found out . To get the ordering you can put the keys in a List upfront to have an index of required order for each element : .. . .. . Then in the Comparator you can compare by index in this list : Comment : thanks for help but how we will get key in this statement optionKeys.indexOf o1.key I am getting error for o1.key Comment : Sorry that was an error in the sample corrected now.. . Comment : @centic I also have similar question here http : stackoverflow.com questions 27614571 how-to-use-apache-commons-cli-to-parse-the-property-file-and-help-option which uses Apache Commons CLI . If possible can you help me out there", "Question : I don t know if I was clear but I want to use Commons CLI without flags with minus like -t or --args . In fact I want to use it as the IRC commands . In the example : .. . .. . I created a option with -send . Could I create it without the minus Thank you all . Comment : As a side note : from the Apache Commons CLI API documentation related to Options addOption String opt boolean hasArg String description http : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli Options.html addOption java.lang.String 20boolean 20java.lang.String emphasis mine : opt - Short single-character name of the option . Comment : addOption is overloaded and there is also variant that allows to provide BOTH short and long options http : commons.apache.org proper commons-cli javadocs api-release org apache-commons-cli Options.html addOption java.lang.String 20java.lang.String 20boolean 20java.lang.String .. . Answer : I achieve this changing the source code . In a certain part of the code is verified if the -- is used . Remove this made the solution . However I see that the best was develop my own code . If someone need a simple code to parse arg arg1 format here it is . https : github.com faelcorreia SimpleCLI", "Question : I m using the Apache Commons CLI . By default it orders help options on the command-line alphabetically by key . So what appears is : .. . .. . But I want to order them as follows : .. . .. . I know that there is a OptionFormatter class you can use and pass to the HelpFormatter but can t see any examples on how to use it for my purposes above http : www.marko.homeunix.org programming java commons-cli api org apache-commons-cli HelpFormatter.OptionComparator.html . Just wondering has anyone done anything similar Thanks Comment : wow . You would think that something that simple would work . .. . Answer : If you know exact order of the options you can extend Option class to include your ordering number and provider your OrderedOption instances to the Options instance using Options.add Option opt method . Then create a comparator and compare order numbers in your OrderedOptions.. . I would recommend not to mix both types of Option instances in one Options instance as it can complicate ordering and also testing for the valid OrderedOption instance in Comparator .", "Question : I m using Apache Commons CLI 1.2 to parse a command-line that takes options and extra arguments at the end . Ex : mycmd -d DIR extra stuff .. . .. . I know how to get extra and stuff using CommandLine.getArgs but I don t know how to display those extra arguments in my help output . When I make a call like this : .. . .. . I get output like : .. . .. . without the extra arguments . Could someone point me in the right direction Comment : It is so lame that trailing args cannot be defined as part of apache-commons-cli . .. . Answer : As far as I can tell the only way to display those extra arguments would be to not print the automatically generated usage statement and instead print a custom usage statement like this : .. . .. . or this .. . .. . or however you want to format your usage statement . Comment : Thanks . I previously tried your second example with a third argument of true but that displayed the arguments after extra stuff which looked weird . I ended up using a variation of example 2 but with a header : new HelpFormatter .printHelp mycmd OPTIONS extra stuff Where OPTIONS can be : opts null ." ] }
[ "yes-answer-long", "yes-answer-short" ]
api
UNK_RELATION
asp.net@web@35
asp.net -- asp.net is a microsoft @placeholder application development framework that allows programmers to build dynamic web sites web-applications and web-services .
{ "confidence": [ 60.60664367675781, 53.5226936340332, 52.1630744934082, 50.931556701660156, 50.656211853027344, 50.316226959228516, 50.171775817871094, 48.834556579589844, 48.54518127441406, 48.37161636352539, 48.30598449707031, 48.17399215698242, 48.093536376953125, 47.80364990234375, 46.87138748168945, 46.627017974853516, 46.5267448425293, 46.24599838256836, 46.160118103027344, 46.160118103027344, 46.017642974853516, 45.984710693359375, 45.78933334350586, 45.63591384887695, 45.32243347167969, 45.283203125, 45.26432418823242, 45.25364303588867, 44.997310638427734, 44.9056396484375, 44.831626892089844, 44.78876876831055, 44.764007568359375, 44.74161911010742, 44.27962112426758, 44.27962112426758, 44.27962112426758, 44.237483978271484, 44.20133972167969, 44.16866683959961, 44.135555267333984, 43.89860153198242, 43.84866714477539, 43.83911895751953, 43.752777099609375, 43.694175720214844, 43.662696838378906, 43.473045349121094, 43.44193649291992, 43.44193649291992, 43.44193649291992, 43.44193649291992, 43.44193649291992, 43.44193649291992, 43.3816032409668, 43.34712219238281, 43.23339080810547, 43.23339080810547, 43.23339080810547, 43.16067123413086, 43.12127685546875, 43.086570739746094, 42.8458251953125, 42.809364318847656, 42.8076057434082, 42.8076057434082, 42.65288543701172, 42.65288543701172, 42.6266975402832, 42.492366790771484, 42.36371612548828, 42.21626281738281, 42.187461853027344, 42.13856506347656, 42.13376235961914, 42.13376235961914, 42.13376235961914, 42.13376235961914, 42.07221984863281, 42.07221984863281, 42.07221984863281, 42.07221984863281, 41.997127532958984, 41.98616409301758, 41.96992111206055, 41.93922805786133, 41.92498016357422, 41.91331100463867, 41.911319732666016, 41.85346984863281, 41.80519104003906, 41.79893112182617, 41.798667907714844, 41.752742767333984, 41.752742767333984, 41.70138931274414, 41.673858642578125, 41.61143493652344 ], "content": [ "Appears this is for ASP.NET Web Applications not ASP.NET Web Sites .", "What is the difference between these two ASP.NET Web Application and ASP.NET Web Sites", "Could it be that my IIS web server is supporting ASP.Net web sites but not ASP.Net web-applications", "In ASP.Net WebForms is a web framework just like ASP.Net MVC is a web framework .", "@digitalanalog ASP.NET is a web application framework .", "-Web - ASP.NET Web Application .", "Is this fixed in Microsoft ASP.NET Web Optimization Framework 1.1.3", "For an example the development of ASP.Net MVC and ASP.Net Web API .", "I am using the asp.net mvc4 as the backend framework to build a web application .", "I am using Microsoft ASP.NET Web API 2.2 in a web application .", "I am refactoring a working ASP.NET Web Application to expose Web Services interface using ASP.NET Web Service .", "Framework is ASP.NET Web API .", "services that exist in your ASP.NET web application .", "I m developing a web application ASP.NET 3.5 that will consume a number of web-services .", "ASP.NET Core Web Application .NET Framework - Used to create pre-release ASP.NET Core applications that are dependent on .NET Framework .", "This is a ASP.NET Web Forms Application .", "It is also possible to host web sites and web-services based on ASP.NET in Cassini Web Server .", "ASP.NET web application .", "Possible Duplicate : .. . ASP.NET : Web Site or Web Application", "I migrated a ASP.NET Web Project to a Web Application .", "Asp.Net and Web services are typically responsive .", "It was in Dest Microsoft ASP.NET ASP.NET Web Stack 5 VS 12 COMMON7 IDE Extensions Microsoft Web Mvc Scaffolding folder .", "The web page is of ASP.NET application .", "I added Microsoft ASP.NET Web Optimization Framework through NuGet Packages .", "I m using ASP.NET web application not a web site .", "ASP.NET routing can be used only with .NET Framework-based Web applications .", "This is an asp.net-3.5 framework web project .", "It is asp.net web forms application .", "The App Code folder must be specific to ASP.NET Web Sites and not Applications .", "We have MVC ASP.NET Web Applications written within the ASP.NET 4 .", "That is ASP.NET website project or asp.net web application project", "I am using the new ASP.Net and Web Tools 2012.2 Publish Profiles for Web Sites not web application .", "ASP.NET coding in VB.NET -- web application .", "We are using Microsoft ASP.NET MVC OData WebAPI for our web-services .", "I m developing an ASP.net web application .", "I ve created a web application in asp.net .", "It s a C ASP.Net Web Application .", "The web-reference is the old school ASP.NET web-services with the .asmx file extension .", "So unit-testing ASP.NET Web Sites is not possible", "Coded as a suite of Web sites pages Web Services and desktop applications .", "ASP.NET MVC .. . .. . ASP.NET Web API", "I m working on an ASP.NET web application .", "Is it possible to deploy an ASP.NET vNext web application to Azure Cloud Services", "I have put together a dynamic data web application using ASP.NET .", "It s a browser independent web part framework for Asp.Net .", "I have deployed a asp.net-2.0 framework web application on IIS 7.0 .", "Are there other possibilities besides IIS for hosting web sites and web-services based on ASP.NET which are recommended by Microsoft for small-scale environments", "Under the Web templates you should have three selections : .. . .. . ASP.NET Web Application .NET Framework - Used to create classic web-applications .", "I m building a web application with asp.net .", "I developed web application with asp.net .", "I m developing an ASP.NET web application .", "The Web Application is using ASP.NET WebForms .", "I ve a web application ASP.NET WebForms .", "I m working on an ASP.NET web application .", "ASP.NET Web Forms : .. . .. . Development supports state Gives the illusion that a web application is aware of what the user has been doing similar to Windows applications .", "Are you using IIS or the ASP.NET Web Development Server", "I was looking for a best framework to develop an ASP.Net Web application .", "Create new ASP.NET Core Web Application .NET Framework project .", "I am designing a web application using the ASP.net MVC framework .", "Copy the folders from the ASP.Net Web Application to the ASP.Net MVC Application folders .", "ASP.NET web-services for example uses this principle .", "Is it possible to develop OData services in .NET Framework 4 Microsoft ASP.NET Web API .. . .. . But System.Web.OData is still not available .", "I am new to asp.net and C web application development .", "Is this ASP.Net Web Form or ASP.Net MVC", "It is an asp.net-mvc web project framework 4.5.1 .", "Suitable for use in the ASP.NET Web Pages framework Razor .", "We have an existing application that was build on ASP.NET MVC 4 Web API .", "I am using ASP.NET MVC 3 to build a web application .", "In most cases I ve seen with ASP.NET web-applications business logic is hosted in the web server s asp.net hosts processes .", "What is the difference between Asp.Net Web Forms and Asp.Net Web Pages", "From asp.net web application connecting the SSAS cube .", "Hosting the Silverlight application in a ASP.NET Web Application Project .", "Scroll down to the root Web Server IIS expand Web Server expand Application Development and select ASP.NET 3.5 and ASP.NET 4.5 and Install .", "It can be dynamically added to a running ASP.NET web application or even all ASP.NET web-applications on a machine without any need for re-compilation or re-deployment .", "I want to access the web cam from my asp.net web application .", "The web site modal was introduced with ASP.NET 2.0 the web application model is the original .", "I have a web forms web application asp.net-2.0 .", "Currently I m converting a web application from web forms to ASP.NET MVC .", "Created an ASP.NET empty web application in VS2013 .. . 2 .", "Complex web application + tight schedule ASP.NET MVC .", "I am working with Profiles in an ASP.NEt Web Application .", "In my Asp.net MVC 2.0 web Application .", "I m using ASP.NET Web API v2.0 to build an web-api .", "I have a ASP.NET web application project with a virtual path provider that uses ASP.NET web forms as page templates .", "ASP.NET Web API does but not every framework is supposed to .", "I installed Microsoft ASP.NET and Web Tools 2015 RC and then created a new AspNet web application .", "My ASP.NET application runs in IIS on my web server and uses Microsoft .NET Framework 4 Beta 2 .", "Can we implement asp.net web-hooks in web-form based application having framework .NET 4.5", "I have a ASP.NET web application that uses Entity Framework .", "In development one plugin is one separated asp.net-mvc web application .", "Microsoft recommends using any of ASP.NET Web API WCF Data Services or Entity Framework APIs complex ops", "I am working on an asp.net-mvc web application .", "Is it possible to make use of SharePoint search feature within the custom web application ASP.NET Web Forms ASP.NET MVC", "I have an embed VLC Web Plugin in a web application asp.net .", "Web Application can be used for ASP.NET MVC or Web Forms .", "Is a asp.net web application hosted in IIS considered a process", "If you are developing a new ASP.NET Web application that uses either ASP.NET MVC or ASP.NET Dynamic Data technologies use ASP.NET routing .", "My current application is an ASP.NET 3.5 web site ." ] }
{ "confidence": [ 60.64280319213867, 53.74115753173828, 53.06744384765625, 51.93748474121094, 51.78642654418945, 51.60930633544922, 51.42353439331055, 50.94881057739258, 50.82027816772461, 49.43690872192383, 49.16810607910156, 48.86176681518555, 48.78848648071289, 48.47532272338867, 48.12939453125, 48.112037658691406, 47.975669860839844 ], "content": [ "Question : Are there other possibilities besides IIS for hosting web sites and web-services based on ASP.NET which are recommended by Microsoft for small-scale environments .. . Answer : It is also possible to host web sites and web-services based on ASP.NET in Cassini Web Server . Here http : www.ultidev.com Products Cassini is web site of Cassini Web Server . The overview from site : .. . .. . UltiDev Cassini is a free light-weight and redistributable web server that can host ASP.NET 3.5 3.0 2.0 and 1.1 applications and static HTML sites . Of course it is not recommended by Microsoft but this web server can be embedded to the application setup package . Comment : You may be interested in this list of Cassini builds : stackoverflow.com questions 5385006 http : stackoverflow.com questions 5385006 which-build-of-cassini-should-i-choose-for-production-there-are-8-public-builds", "Question : I am trying to replicate the exact functionality of this dialogue in Visual Studio 2008 in a build script : alt text http : i41.tinypic.com 1osl1f.png .. . .. . This is an ASP.NET web site not a web application . I have Googled around this and turned up quite a bit of stuff involving MSBuild but this all seems to concern solutions laid out as ASP.NET Web Applications : .. . .. . http : www.driebier.net post Using-MSBuild-to-deploy-visual-studio-2005-web-applications.aspx http : blog.donnfelker.com post TFS-Build-Not-Publishing-Web-Applications.aspx .. . .. . This article http : codingcockerel.co.uk 2008 05 18 how-to-publish-a-web-site-with-msbuild seems to be relevant to ASP.NET Web Sites but I find that I m getting an error when trying to build using those suggestions : .. . .. . The solution I m trying to publish inherited not my own doesn t have .csproj files where I could import the CopyWebApplication target from C : Program Files x86 MSBuild Microsoft VisualStudio v9.0 WebApplications Microsoft.WebApplication.targets .. . .. . Perhaps this is a Visual Studio 2005 2008 difference Anyway I feel that I m going down the wrong path there . Essentially I just need to achieve exactly what the above dialogue does but from the command-line . Thanks very much .. . Answer : The following command duplicates the Publish Web Site dialog with default settings . Command for Publish Web Site with Default Settings .. . .. . aspnet compiler -nologo -v -p C : WebSite1 -u C : TargetPath .. . .. . Reference .. . .. . 1 See Community Content titled You want Publish a site but you have not Visual Studio then.. . at http : msdn.microsoft.com en-us library 20yh9f1b 28classic 29.aspx . Microsoft Visual Studio 2005 Visual Studio 2005 Command Prompt .. . Microsoft Visual Studio 2008 Visual Studio 2008 Command Prompt .. . Microsoft .NET Framework SDK v2.0 SDK Command Prompt .. . .. . 2 See ASP.NET Compilation Tool Aspnet compiler.exe at http : msdn.microsoft.com en-us library ms229863.aspx . 3 Following excerpt from Walkthrough : Deploying an ASP.NET Web Application Using XCOPY at http : msdn.microsoft.com en-us library f735abw9.aspx .. . .. . As an alternative to using the XCOPY command-line tool which is supported by all versions of the .NET Framework you can use the new .NET Framework 2.0 tool located at SystemRoot Microsoft.NET Framework version 2 or later Aspnet compiler.exe to compile and deploy your Web application . For more information see ASP.NET Compilation Tool Aspnet compiler.exe http : msdn.microsoft.com en-us library ms229863.aspx . 4 Following excerpt from How to : Precompile ASP.NET Web Sites for Deployment at http : msdn.microsoft.com en-us library ms227976.aspx . If your Web site is not an Internet Information Services IIS application and therefore has no entry in the IIS metabase used the following value for the -v switch . .. . aspnet compiler -p physicalOrRelativePath -v targetPath .. . .. . In this case the physicalOrRelativePath parameter refers to the fully qualified directory path in which the Web site files are located or a path relative to the current directory . The period . operator is allowed in the physicalOrRelativePath parameter . The -v switch specifies a root that the compiler will use to resolve application-root references for example with the tilde operator . When you specify the value of for the -v switch the compiler will resolve the paths using the physical path as the root . Comment : Thank you . You re awesome Comment : @AMissico do you have to run the aspnet compiler command manually I will upvote your answer . Thanks .", "Question : Is it possible to use the Asp.Net MVC framework within SharePoint sites Comment : Ashish Sharma you have to mark some answer as a correct one . Comment : Have a look here as well interah.com products Documents Items 20Selector.pdf http : www.interah.com products Documents Items 20Selector.pdf .. . Answer : One possible architecture is to use an asp.net or an asp.net-mvc frontend . Then accessing sharepoint functionality via web-services . This has the benefit of giving you access to the functionality of sharepoint without having the extra development cost of using sharepoint . Comment : I was wondering about this logic myself . Are there any examples of using WSS web-services in a .Net MVC application", "Question : When I start a new ASP.NET project in Visual Studio I can create a ASP.NET Web Application and new ASP.NET websites in Visual Studio creates new Website . What is the difference between these two ASP.NET Web Application and ASP.NET Web Sites Why would I choose one over other If I am using Visual Studio 2005 instead of Visual Studio 2008 or Visual Studio 2010 is the answer different Comment : This is good question and also basic question but developer do not bother about this . Comment : Oh don t they I think this question needs a review for vs2015 . stackoverflow.com questions 34886885 http : stackoverflow.com questions 34886885 asp-net-web-site-or-asp-net-web-application-in-visual-studio-2015 .. . Answer : Web Site is what you deploy to an ASP.NET web server such as IIS . Just a bunch of files and folders . There s nothing in a Web Site that ties you to Visual Studio there s no project file . Code-generation and compilation of web pages such as .aspx .ascx .master is done dynamically at runtime http : msdn.microsoft.com library ms366723 and changes to these files are detected by the framework and automatically re-compiled . You can put code that you want to share between pages http : msdn.microsoft.com library t990ks23 in the special App Code folder or you can pre-compile it and put the assembly in the Bin folder . Web Application is a special Visual Studio project . The main difference with Web Sites is that when you build the project all the code files are compiled into a single assembly which is placed in the bin directory . You don t deploy code files to the web server . Instead of having a special folder for shared code files you can put them anywhere just like you would do in class-library . Because Web Applications contains files that are not meant to be deployed such as project and code files there s a Publish http : msdn.microsoft.com library aa983453 command in Visual Studio to output a Web Site to a specified location . App Code vs Bin .. . .. . Deploying shared code files is generally a bad idea but that doesn t mean you have to choose Web Application . You can have a Web Site that references a class-library project that holds all the code for the Web Site . Web Applications is just a convenient way to do it . CodeBehind .. . .. . This topic is specific to .aspx and .ascx files . This topic is decreasingly relevant in new application frameworks such as ASP.NET MVC and ASP.NET Web Pages which do not use codebehind files . .. . .. . By having all code files compiled into a single assembly including codebehind http : msdn.microsoft.com magazine cc163675 files of .aspx pages and .ascx controls in Web Applications you have to re-build for every little change and you cannot make live changes . This can be a real pain during development since you have to keep re-building to see the changes while with Web Sites changes are detected by the runtime and pages controls are automatically recompiled . Having the runtime manage the codebehind assemblies is less work for you since you don t need to worry about giving pages controls unique names or organizing them into different namespaces . I m not saying deploying code files is always a good idea specially not in the case of shared code files but codebehind files should only contain code that perform UI specific tasks wire-up events handlers etc . Your application should be layered so that important code always end up in the Bin folder . If that is the case then deploying codebehind files shouldn t be considered harmful . Another limitation of Web Applications is that you can only use the language of the project . In Web Sites you can have some pages in C some in VB etc . No need for special Visual Studio support . That s the beauty of the build provider extensibility . Also in Web Applications you don t get error detection in pages controls as the compiler only compiles your codebehind classes and not the markup code in MVC you can fix this using the MvcBuildViews option which is compiled at runtime . Visual Studio .. . .. . Because Web Applications are Visual Studio projects you get some features not available in Web Sites . For instance you can use build events to perform a variety of tasks e.g . minify and or combine Javascript files . Another nice feature introduced in Visual Studio 2010 is Web.config transformation http : msdn.microsoft.com library dd465318 . del This is also not available in Web Sites . del Now works with Web Sites in VS 2013 . Building a Web Application is faster than building a Web Site specially for large sites . This is mainly because Web Applications do not compile the markup code . In MVC if you set MvcBuildViews to true then it compiles the markup code and you get error detection which is very useful . The down side is that every time you build the solution it builds the complete site which can be slow and inefficient specially if you are not editing the site . l find myself turning MvcBuildViews on and off which requires a project unload . On the other hand with Web Sites you can choose if you want to build the site as part of the solution or not . If you choose not to then building the solution is very fast and you can always click on the Web Site node and select Build if you ve made changes . In an MVC Web Application project you have extra commands and dialogs for common tasks like Add View Go To View Add Controller etc . These are not available in an MVC Web Site . If you use IIS Express as the development server in Web Sites you can add virtual directories . This option is not available in Web Applications . del NuGet Package Restore does not work on Web Sites you have to manually install packages listed on packages.config del Package Restore now works with Web Sites starting NuGet 2.7 http : docs.nuget.org docs reference package-restore Comment : Because the programmers write the application the application is then built . The test team tests the application on the test system . Then the customer installs the applications . That LAST think you want is anyone making live changes Comment : I m not saying making live changes is good or bad just that webapp projects doesn t support them . Comment : Which is a good thing IMHO . It makes a mockery of any code test release process which has to be the bedrock of any serious application Comment : To me having the choice is the best on websites you can always inherit from a pre-compiled base-class if you want to . There are many languages frameworks e.g . PHP where people are used to the idea of deploying source code . That doesn t mean those are not serious applications . Comment : Actually you don t manage those DLL s .. . you don t even have to know they exists . Not an issue . - Until the framework gets confused doesn t clean the old versions up correctly and starts throwing compilation exceptions with conflicting names all over the site.. . You can add error detection of the markup through the use of a WebDeployment project . I m also not sure on your last point with websites you can use IIS as the server you can do this with a Web Application as well - and I have projects like this where the project is part of a larger web application .", "Question : I am looking for information on how to create an ASP.NET web farm - that is how to make an ASP.NET application initially designed to work on a single web server work on 2 3 10 etc . servers We created a web application which works fine when say there are 500 users at the same time . But now we need to make it work for 10 000 users working with the web app at the same time . So we need to set up 20 web servers and make something so that 10 000 users could work with the web app by typing www.MyWebApp.ru in their web browsers though their requests would be handled by 20 web-servers without their knowing that . 1 Is there special standard software to create an ASP.NET web farm 2 Or should we create a web farm ourselves by transferring requests between different web servers manually using ASP.NET C I found very little information on ASP.NET web farms and scalability on the web : in most cases articles on scalability tell how to optimize and ASP.NET app and make it run faster . But I found no example of a Hello world -like ASP.NET web app running on 2 web servers . Would be great if someone could post a link-to an article or better tell about one s own experience in ASP.NET web farming and addressing scalability issues . Thank you Mikhail . .. . Answer : 1 Is there special standard software to create an ASP.NET web farm No . 2 Or should we create a web farm ourselves by transferring requests between different web servers manually using ASP.NET C No . To build a web farm you will need some form of load-balancing . For up to 8 servers or so you can use Network Load Balancing NLB which is built-in to Windows . For more than 8 servers you should use a hardware load balancer . However load-balancing is really just the tip of the iceberg . There are many other issues that you should address including things like : .. . .. . 1 . State management cookies ViewState session-state etc .. . 2 . Caching and cache invalidation .. . 3 . Database loading managing round-trips partitioning disk subsystem etc .. . 4 . Application pool management WSRM pool resets partitioning .. . 5 . Deployment .. . 6 . Monitoring .. . .. . In case it might be helpful I cover many of these issues in my book : Ultra-Fast ASP.NET : Build Ultra-Fast and Ultra-Scalable web sites using ASP.NET and SQL Server http : rads.stackoverflow.com amzn click 1430223839 . Comment : Thank you very much Richard And we will try look for information in your book Comment : Richard Wikipedia says that NLBS is intended for . . stateless applications en.wikipedia.org wiki Network Load Balancing Services http : en.wikipedia.org wiki Network Load Balancing Services . Is this information correct or not Our application is absolutely stateful Comment : The statement is technically true but it s also misleading . HTTP itself is considered to be a stateless protocol . The first thing that happens at a high level is that each incoming request from clients can be directed to any one of your web servers . That function is performed by NLB or by a hardware load balancer . In order for any server to be able to process each request your application state can t be stored on a single web server it either needs to follow the request in some way such as ViewState or be included in the HTTP headers cookies or be stored in the back-end database . Comment : Does the Microsoft Web Farm Framework not count as standard software iis.net downloads microsoft web-farm-framework http : www.iis.net downloads microsoft web-farm-framework", "Question : If given the choice which path would you take ASP.NET Webforms + ASP.NET AJAX .. . .. . or .. . .. . ASP.NET MVC + JavaScript Framework of your Choice .. . .. . Are there any limitations that ASP.NET Webforms ASP.NET AJAX has vis-a-vis MVC Comment : what about ASP.NET Webforms + JavaScript Framework or ASP.NET Webforms + ASP.NET AJAX+ JavaScript Framework .. . Answer : My experience has been with programming web apps for apache servers in php and ruby . When I got a job maintaining a web app written in asp.net webforms I dove into learning the microsoft way of building web apps . I will have to say I was completely mortified I was thinking WTF is all this viewstate garbage being sent back in forth Is this even necessary And then I decided to look at doing some simple things with ajax and jquery which lead me to update panels and clientIDs being generated and not what I set in the view . What a waste of my time Why can t I have multiple forms on one page Why can t I just use regular ajax calls Why do my views have server logic These were all questions that im sure that many web programmers face with asp.net webforms . Then I discovered .NET MVC . My life just got a lot easier . I was used to using MVC frameworks like Rails and CakePHP to create web apps the way they were meant to be programmed . With technologies actually meant for the web . My suggestion would be this Leave WebForms for people that are used to programming winforms type applications because it tries to abstract the fact that you are programming on the web . If you want to have real freedom to develop applications for the web which actually make sense to web programmers use .NET MVC or something similar that wont get in your way . Thats my two cents.. . Comment : Although less experiences I used to program web based logic using Perl . I went some way into PHP after that and then got into ASP . I have to say the way Microsoft feel the need to micromanage everything is a royal pain in the ass . I very much like C as a language though and writing the business logic is a joy to behold . Making it interact with the actual web page is a nightmare . All this is because MS think it makes the whole thing more secure and can sell it to business managers that way . I ve not touched MVC but going by what I ve heard I need this in my life", "Question : When I start a new ASP.NET project in Visual Studio I can create a ASP.NET Web Application and new ASP.NET websites in Visual Studio creates new Website . What is the difference between these two ASP.NET Web Application and ASP.NET Web Sites Why would I choose one over other If I am using Visual Studio 2005 instead of Visual Studio 2008 or Visual Studio 2010 is the answer different Comment : This is good question and also basic question but developer do not bother about this . Comment : Oh don t they I think this question needs a review for vs2015 . stackoverflow.com questions 34886885 http : stackoverflow.com questions 34886885 asp-net-web-site-or-asp-net-web-application-in-visual-studio-2015 .. . Answer : Web Site use when the website is created by graphic designers and the programmers only edit one or two pages .. . .. . Web Application use when the application is created by programmers and the graphic designers only edit one or two paged images . Web Sites can be worked on using any HTML tools without having to have developer studio as project files don t need to be updated etc . Web applications are best when the team is mostly using developer studio and there is a high code content . Some coding errors are found in Web Applications at compile-time that are not found in Web Sites until run time . Warning : I wrote this answer many years ago and have not used Asp.net since . I expect things have now moved on .", "Question : We are starting a new web based product in which we are planning to expose our business logic through WCF services . We will be using ASP.NET 4.0 C EF 4.0 . In future we want to build iphone applications and WPF applications based on the services . I have been reading a lot about using POCO vs Self Tracking Entities STE and from my understand the STEs do not work well with the web scenario . Can anyone shed more light on this issue Comment : I appreciate that this question was asked a while ago now but I am curious as to what you ultimately decided on the POCO vs STE situation .. . Answer : Refer to http : msdn.microsoft.com en-us data jj613924.aspx as STEs is No Longer Recommended Microsoft recommends using any of ASP.NET Web API WCF Data Services or Entity Framework APIs complex ops", "Question : What is the minimum .NET framework required for OData service development Is it possible to develop OData services in .NET Framework 4 Microsoft ASP.NET Web API .. . .. . But System.Web.OData is still not available . Do I have to develop a project using .NET Framweork 4.5 minimum Microsoft ASP.NET Web API 2 .. . Answer : WebAPI OData V4 is using .NET Framework 4.5 if you want to use .NET Framework 4 you can try with System.Web.Http.OData which is WebAPI OData V3 but it s under maintanance and won t add new features anymore my recommandation is to move to use WebAPI OData V4 or try Restier https : github.com OData RESTier if you just start to build an OData service .", "Question : If given the choice which path would you take ASP.NET Webforms + ASP.NET AJAX .. . .. . or .. . .. . ASP.NET MVC + JavaScript Framework of your Choice .. . .. . Are there any limitations that ASP.NET Webforms ASP.NET AJAX has vis-a-vis MVC Comment : what about ASP.NET Webforms + JavaScript Framework or ASP.NET Webforms + ASP.NET AJAX+ JavaScript Framework .. . Answer : I see that the majority of the responses came out prior to MVC 1.0 . Since we are now in 2.0 Preview I thought it might nice to revisit . I was a ASP.NET developer for about five years before I made the move to MVC last March . I haven t regretted it for a second . I realize now that the stronger I got in ASP.NET WebForms the more difficult it became to learn other technologies such as JavaScript and the non-Microsoft implementation of AJAX . Microsoft leveraged their ASP.NET development approach from their WinForms development approach which helped with the learning curve if you were coming from WebForms development but it s not a good way to develop web-applications if you understand the differences between the two approaches . The latest project I m working required me to learn ASP.NET MVC JavaScript jQuery CSS 2 and AJAX non-Microsoft . After only nine months I feel much better prepared to approach web development projects than I did after five years of ASP.NET development . The ASP.NET implementation makes things so much more difficult to maintain long-term . MVC makes things so much easier because you re less dependent on shortcuts . It takes a while to learn the framework but the more you learn about the framework the less dependent on the framework you become and the more you start to learn and understand the established standards like JavaScript and AJAX . For me it is a clear-cut choice . I will never go back to ASP.NET . If I can t use ASP.NET MVC I ll learn Ruby or PHP . I want the progress and advancement of my web development tools to be motivated by the needs of the developer community not by profit . Comment : I must say I followed almost exactly the same path as you and I would never go back to ASP.NET WebForms again either . So far in the last few months I learned still do JS jQuery so-so more about HTML and HTTP standards which I thought I knew well but I knew almost nothing about the insides and it is so much easier to do things like partial rendering AJAX posts gets pure HTML control just everything . MS hid everything from us with WebForms - and it was nice technologies and I liked it but from now on I m going to only maintain it but develop new things in MVC .", "Question : I have an application which is built-in ASP.Net WebForms and Silverlight . There is another WCF services application which is accessed by silverlight part of my application . Now I have to Re create the whole application in an MVC Single Page Application SPA and of course the WCF one because now I would need Web API for that . An initial solution comes into mind is to add a web-api project into wcf services application and start creating web methods there and call wcf methods from there if that functionality was already there . And for webform start a new spa with mvc project from scratch and use durandal or any other spa client framework hell of coding . Any useful solution advise as I am looking for simplicity . I searched around and found http : stackoverflow.com questions 1652201 add-a-single-page-of-asp-net-mvc-to-an-existing-web-forms-app some questions but really did not helped as they are about merging with existing apps . Note : application is a large application with a lot of functionalities Comment : This should hopefully get you going : ASP.Net - Single Page Application : KnockoutJS template http : www.asp.net single-page-application overview introduction knockoutjs-template .. . Answer : You have to decide how confident your team is with client-side frameworks . Development of Single page applications may not be easy in the beginning but you will get used to it very quickly . It s very important to give your team the right training . In my opinion Durandal is the simpliest most elegant and complete framework to build enterprise level SPAs . It is important to know how knockout requre and durandal s router and composition work . For data centric application I would use breezejs to manipulate and cache data on the client-side and request it from the server-side . Breeze works best with Entity Framework on the server-side but it s not necessary . If you can use Entity Framework it will simplify your development because it can generate metadata of your database structure for breeze . If Entity Framework is not an option metadata can be written by hand . I would make server-side as thin as possible . Serving data from your database using web-api with ORM of your choice and some cshtml pages . Durandal Get Started http : durandaljs.com pages get-started is a good place to start . Durandal Auth https : durandalauth.azurewebsites.net is a very good template for enterprise level SPA . It may not suit you completely but you can use it as a guidance to build different modules of your application . Breeze samples http : www.breezejs.com samples I suggest you consider using breeze . There are good courses available on pluralsight . Knockoutjs http : knockoutjs.com has good training on data-binding . Comment : Can i have your comments of modular approach of durandal and how can it could be mimic on server-side . You are mentioning that server-side should be thin and i agree with that but can we make a system like orchard CMS or Sharepoint or wordpress that allows for plugging modules on demand basis and how can i do that in SPA . Comment : you can build your plugging modules as widgets http : durandaljs.com documentation Creating-A-Widget.html . Then you can read user content settings from web-api and use durandal s Composition module Composition module http : durandaljs.com documentation Using-Composition.html . Using dynamic composition you can selectively display your widgets .", "Question : Server Error in Application . .. . .. . Parser Error .. . .. . Description : An error occurred during the parsing of a resource required to service this request . Please review the following specific parse-error details and modify your source file appropriately . Parser Error Message : Could not load type WebApplication1.SiteMaster . .. . .. . Source Error : .. . .. . Line 1 : @ Master Language C AutoEventWireup true CodeBehind Site.master.cs Inherits WebApplication1.SiteMaster .. . Line 2 : .. . Line 3 : .. . .. . Source File : eco Site.Master Line : 1 .. . .. . Version Information : Microsoft .NET Framework Version : 4.0.30319 ASP.NET Version : 4.0.30319.17929 .. . .. . I can t find the error when I publish to my localhost IIS server it works fine but when I m publishing to my web server it gives me this error Can anyone help with this Comment : try to clean build and publish again Comment : How does your publish process look like Do you use the publish dialog Comment : I m publishing right from Visual Studio just right-click on the Project and click publish and follow the steps . Before that I was publishing directly on the server copy-paste . Comment : I don t know if I understand you correctly . I hope you are talking about copy-paste the published files and not the source code . Check if your remote IIS server has all the required ASP.Net and .Net framework versions installed . Also check the app pool version numbers Comment : the Framework version on my IIS web server is 4.0 and the ASP.Net is 4.0 but I can t find the app pool version . And Yes by Copy Paste I mean copying the published files not the source code . Could it be that my IIS web server is supporting ASP.Net web sites but not ASP.Net web-applications Because on my localhost I had to convert my website to web application . .. . Answer : built and clean solution then republish it again . and also check the version of application-pool of IIS on web server . Comment : I clean the solution and build it again and republish but I m still getting the same error . The Framework version application-pool of IIS on web server is 4.0.30319.17929 . I don t know what could be the problem : Comment : @SlobodanJovanovski Is your Site.Master and other pages within a folder in a parent website rootsite.com home.aspx -- Home page rootsite.com webapp home.aspx -- Masterpage page Comment : It s in the ROOT folder where all other .aspx pages are but I found the problem the problem was that I should also copy .aspx.cs files and write CodeFile instead of CodeBehind all of the .aspx pages .", "Question : I have a web application that allows the users to access the pages if their Windows login name to the domain is in the web-config s app settings . For example : Logged on username : SampleDomain SampleUser .. . .. . on Web.config : .. . .. . successful scenario : SampleUser should be able to browse the website . .. . .. . I was able to do it successfully during development locally on my machine but when I deployed it to a server then I try to browse it from my local machine the Windows login that it gets is NT AUTHORITY NETWORK SERVICE so it redirects to my customized error page . I SampleUser am in the AuthorizedUsers . I should be able to browse it . Please help me . Thank you very much . .. . Answer : You need to use ASP.NET impersonation feature . When using impersonation ASP.NET applications can execute with the Windows identity user account of the user making the request . Impersonation is commonly used in applications that rely on Microsoft Internet Information Services IIS to authenticate the user . Such behavior can be configured in web-config using the following code : .. . .. . More info : http : msdn.microsoft.com en-us library xh507fc5 28v vs.100 29.aspx Comment : I think I should also note here that Anonymous Access must be disabled . Thank you for your help", "Question : I have experience in client-server application development in C C++ on Windows platform . I would like to get into web based application development . I have an understanding of web application development concepts in general . Which web application development framework would be the quickest to learn master I am currently learning .NET and C but the current Microsoft web application development stack appears to have a steeper learning curve with its myriad technologies like ASP.NET MVC SilverLight and WCF . On the other hand I keep hearing about Ruby and Rails and it appears that Ruby is much easier to learn and Rails inherent use of MVC is the most natural way to develop web-applications is also much quicker to develop . I am leaning more towards Ruby but I am worried that I may slowly move away from the Windows platform into some unchartered territory . .. . Answer : It s not that Ruby-on-Rails is bad stuff - in fact it s awesome Yet everything is about trying out and especially your own preference . You have experience with C and .NET I guess you have also experience with Windows Forms . The concept of Windows Forms and C as the code-behind you ll have no big issues adapting to WebForms or Silverlight . Except there are some web specific things but there is an amazing learning opportunity at http : www.asp.net .. . .. . I have had the same learning curve as you have and learned basic ASP.NET development in less than a month . Things that I couldn t do either in PHP Symfony nor JS out of the box . ASP.NET MVC is a great framework that has a similar functionality to Ruby-on-Rails Symfony - yet it is a little bit different and has some MS specific features which are also amazing . I would suggest you to get the following book : Professional ASP.NET MVC 1.0 http : www.wrox.com WileyCDA WroxTitle Professional-ASP-NET-MVC-1-0.productCd-0470384611.html", "Question : When I start a new ASP.NET project in Visual Studio I can create a ASP.NET Web Application and new ASP.NET websites in Visual Studio creates new Website . What is the difference between these two ASP.NET Web Application and ASP.NET Web Sites Why would I choose one over other If I am using Visual Studio 2005 instead of Visual Studio 2008 or Visual Studio 2010 is the answer different Comment : This is good question and also basic question but developer do not bother about this . Comment : Oh don t they I think this question needs a review for vs2015 . stackoverflow.com questions 34886885 http : stackoverflow.com questions 34886885 asp-net-web-site-or-asp-net-web-application-in-visual-studio-2015 .. . Answer : Web Application project model .. . .. . Provides the same Web project semantics as Visual Studio .NET Web projects . Has a project file structure based on project files . Build model - all code in the project is compiled into a single assembly . Supports both IIS and the built-in ASP.NET Development Server . Supports all the features of Visual Studio 2005 refactoring generics etc . and of ASP.NET master-pages membership and login site navigation themes etc . Using FrontPage Server Extensions FPSE are no longer a requirement . Web Site project model .. . .. . No project file Based on file system . New compilation model . Dynamic compilation and working on pages without building entire site on each page view . Supports both IIS and the built-in ASP.NET Development Server . Each page has it s own assembly . Defferent code model . Comment : -1 : haven t I read this somewhere before", "Question : I have a website created using asp and I want to make it accessible to mobile-phones such that a user can use it through his her cell phone . I don t have any knowledge of XML or .NET . How can I do this Thanks . Comment : I wonder how did you create an ASP.NET site without knowledge of .NET Comment : Is there any reason you want to develop on ASP.NET It may help people help you by stating your programming background . Comment : @DarinDimitrov : Cuse he she is PHP Ferrari .. . Answer : ASP.NET Mobile Web Pages http : msdn.microsoft.com en-us library b73x06dt 28VS.85 29.aspx says .. . .. . The Microsoft Visual Studio integrated development-environment IDE enables you to easily build ASP.NET applications that include mobile Web pages . You can include mobile Web pages in any ASP.NET Web site alongside ASP.NET Web pages . In Visual Studio you can work with the adaptive rendering customization and extensibility features of ASP.NET mobile controls using the standard IDE design tools : the page designer the Toolbox the debugger Source view Design view and more . Getting Started with ASP.NET Mobile Pages http : msdn.microsoft.com en-us library 1zh1s348 28v VS.85 29.aspx .. . .. . .. . .. . .. . .. . .. . Some other useful tutorials : .. . .. . Mobile Web Development with ASP.NET 2.0 http : blogs.msdn.com b trobbins archive 2007 07 13 mobile-web-development-with-asp-net-2-0.aspx .. . Building Mobile Web Applications with .NET Mobile Web SDK ASP.NET http : www.wirelessdevnet.com channels wap features mobilesdk3.html .. . Introduction to ASP.NET Mobile http : www.geekpedia.com tutorial120 Introduction-to-ASP.NET-Mobile.html", "Question : I am trying to replicate the exact functionality of this dialogue in Visual Studio 2008 in a build script : alt text http : i41.tinypic.com 1osl1f.png .. . .. . This is an ASP.NET web site not a web application . I have Googled around this and turned up quite a bit of stuff involving MSBuild but this all seems to concern solutions laid out as ASP.NET Web Applications : .. . .. . http : www.driebier.net post Using-MSBuild-to-deploy-visual-studio-2005-web-applications.aspx http : blog.donnfelker.com post TFS-Build-Not-Publishing-Web-Applications.aspx .. . .. . This article http : codingcockerel.co.uk 2008 05 18 how-to-publish-a-web-site-with-msbuild seems to be relevant to ASP.NET Web Sites but I find that I m getting an error when trying to build using those suggestions : .. . .. . The solution I m trying to publish inherited not my own doesn t have .csproj files where I could import the CopyWebApplication target from C : Program Files x86 MSBuild Microsoft VisualStudio v9.0 WebApplications Microsoft.WebApplication.targets .. . .. . Perhaps this is a Visual Studio 2005 2008 difference Anyway I feel that I m going down the wrong path there . Essentially I just need to achieve exactly what the above dialogue does but from the command-line . Thanks very much .. . Answer : Here s a little PowerShell script that builds a solution then publishes a web project from it . The MSBuild is for .Net 3.5 so change to v4.0 if needed . The ResolveReferences must come before CopyWebApplication otherwise dependencies go missing . The example paths given here build to : .. . .. . C : Project AdminWebSite AdminWebSite.sln .. . C : Project AdminWebSite Admin.Web Admin.Web.csproj Comment : Appears this is for ASP.NET Web Applications not ASP.NET Web Sites . The distinction is that Web Site projects do not have a project file only a solution file . That s why this question is tricky . Thanks anyway though . Comment : IIRC Visual Studio creates a temporary fake Solution file when it builds publishes a csproj ." ] }
[ "yes-answer-long", "yes-answer-short" ]
web
UNK_RELATION
boost-format@formatting@63
boost-format -- the boost-format library provides a class for @placeholder arguments according to a format-string .
{ "confidence": [ 53.910804748535156, 50.374420166015625, 50.374420166015625, 49.039730072021484, 48.41937255859375, 48.41937255859375, 47.636962890625, 47.46483612060547, 47.36398696899414, 46.613563537597656, 46.34589385986328, 45.45680618286133, 44.60020446777344, 43.81952667236328, 43.60462188720703, 43.28617858886719, 43.28617858886719, 43.28617858886719, 42.80363845825195, 42.00899887084961, 41.71128845214844, 41.71128845214844, 41.71128845214844, 41.12916946411133, 40.04734802246094, 40.04734802246094, 39.687950134277344, 39.107421875, 39.0814208984375, 38.812538146972656, 37.793399810791016, 37.793399810791016, 37.793399810791016, 37.793399810791016, 37.793399810791016, 37.793399810791016, 37.793399810791016, 37.793399810791016, 37.793399810791016, 37.423431396484375, 36.272705078125, 36.24053955078125, 36.218505859375, 36.218505859375, 36.13795471191406, 35.80690002441406, 35.74571990966797, 35.24009704589844, 34.431697845458984, 34.002281188964844, 33.94804382324219, 33.73353958129883, 33.65098571777344, 33.195045471191406, 33.158714294433594, 32.85680389404297, 32.710243225097656, 31.60593605041504, 30.995086669921875, 30.933021545410156, 30.844623565673828, 30.80643081665039, 30.688007354736328, 30.666473388671875, 30.666473388671875, 30.197132110595703, 29.935443878173828, 29.647541046142578, 29.564212799072266, 29.564212799072266, 29.507064819335938, 29.507064819335938, 29.507064819335938, 29.507064819335938, 29.231538772583008, 29.124683380126953, 29.124683380126953, 29.113113403320312, 28.950679779052734, 28.779651641845703, 28.621421813964844, 28.621421813964844, 28.621421813964844, 28.621421813964844, 27.997583389282227, 27.671419143676758, 27.593212127685547, 27.572772979736328, 26.861434936523438, 26.675296783447266, 26.675296783447266, 26.675296783447266, 26.578577041625977, 26.35739517211914, 26.35739517211914, 26.35739517211914, 26.35334014892578, 25.79495620727539, 25.724470138549805, 25.678218841552734 ], "content": [ "It is safe to use s with boost : : format and std : : string .", "boost : : format is the type you want .", "What is the return-type of boost : : format", "Outside of adding a using declaration into boost-format feed args.hpp is there a convenient way to make boost : : format look for my operator", "For some reason I fail to use boost : : format in a boost : : lambda .", "In boost there s an operator that knows about cout ostream really and boost : : format .", "I64X is not a valid format specification for boost : : format it s Microsoft-specific .", "Your cformat contains a boost : : format and its template operator just forwards to the boost : : format : : operator .", "You mean boost : : format is inherited from iostream", "I know that using the s format specifier and std : : string like this leads to undefined behaviour : .. . .. . But is it save to use the same specifier and a std : : string with boost : : format", "I would like to use boost : : format to convert a float number to string .", "How boost : : format works .. . .. . I looked into the source of boost : : format and this is how it works described below is str calls either str or uses standard std : : ostream stuff : .. . .. . the format class stores all arguments and format string separatly sometimes using the custom allocator sometimes using the default allocator .. . when str is called it creates a new std : : string and makes it large enough for the result using the custom allocator .. . it then appends all arguments and static string pieces from the format string to the result string .. . finally it returns the result string by value .. . .. . So the final result string is not stored inside the format class but created when needed .", "How do I print boolean values with boost : : format as symbolic values", "You could use C++ Format https : github.com cppformat cppformat as a faster alternative to Boost Format .", "boost-format documentation provides the following example for formatting a custom types : http : www.boost.org doc libs 1 49 0 libs format example sample userType.cpp", "@Slav cout doesn t know about some boost : : format .", "This application uses boost : : format and the output in non-ASCII characters is not aligning properly .", "Boost : : format accepts a std : : locale as an optional template parameter .", "The Boost Format documentatio http : www.boost.org doc libs 1 55 0 libs format doc choices.html n says : .. . .. . One of its goal is to provide a replacement for printf that means format can parse a format-string designed for printf apply it to the given arguments and produce the same result as printf would have .", "Boost : : format is a type-safe library where the format specifiers dictate how a variable will be output but limited by the actual type of said variable which takes precedence .", "Karma will make the model-view separation easier than Boost Format .", "I have a new project where I cannot use boost : : format .", "Even the most trivial attempt to use boost : : format does that .", "Initial Idea .. . .. . Looking at the source http : www.boost.org doc libs 1 47 0 boost-format format class.hpp it seems you can use your own allocator which is then used by the internal stream internal streambuf t of boost : : format .", "I have a C++ object boost : : format that has a str function which returns an std : : string .", "my str does not match its use - it takes a const std : : string not a const boost : : format and that is where the problem is .", "Unfortunately Boost format uses overloaded operator to separate arguments which will not work with expanded argument packs .", "For example with a float by I don t know how to convert from boost : : format to float .. . .. . Thanks in advance", "But in the case that no implicit-conversion exist compiler will generate error for this because there is no operator+ for boost : : formatter and std : : string and for you to correct it either as format s .", "This is also verified more specifically by the text from this link http : boost.2283326.n4.nabble.com Boost-Format-format-strings-and-character-types-td2575140.html : .. . .. . My colleagues and I have found though that when a d descriptor is used to print a char variable the result is as though a c descriptor had been used - printf and boost : : format don t produce the same result .", "For some reason your code evaluates boost : : format 10d bl : : 1 immediately rather than on each invocation of the lambda .", "To prevent this you need to wrap boost : : format 10d in a call to bl : : var just as you have done with std : : cout .", "But I don t understand how cout knows about some boost : : format type", "It will look something like ostream operator ostream out const boost : : format fmt out fmt.str return fmt .", "length s specifier boost : : format counts chars which does not do the right thing with utf8 strings .", "You mean that boost : : format counts bytes when it should count chars don t you", "My interest is in modifying boost : : format so that it deals with at least some of the other characters even if not all .", "As correctly pointed out by nosid neither C++11 nor C++14 provide an equivalent to Boost Format .", "I ve looked around and I ve been unable to find a solution to storing what is returned from a boost-format into a char array .", "I need to write the class which will accept boost : : format through the operator like cout does : .. . .. . Which type of operator s parameter must be", "In the boost manual http : www.boost.org doc libs 1 59 0 libs format doc format.html printf directives it is written about the classical type-specification you uses : .. . .. . But the classical type-specification flag of printf has a weaker meaning in format .", "I m trying to format a binary array : char memblock to a hex string .", "How can I use boost : : format but specify the number of digits via a variable", "put the number of digits in unsigned int numberOfDigits 5 and then use numberOfDigits with boost : : format", "Conversion to string will by default throw an exception if less arguments are fed to format than needed .", "I think the reason for this is same as std : : stringstream in that context you should also use .str to convert the stream to string and same for boost : : formatter and the reason is as : .. . .. . Now if boost : : formatter was implicitly convertible to std : : string then it produce Hello .World because format s .", "I am using boost : : format variable to get elapsed time in seconds .. . .. . But I use the timer several times to cumulate durations .", "This is given : .. . .. . greetingwithname should combine and reuses greeting and name so that it is equivalent to this : .. . .. . How do I What is the best way to create a boost : : format object from multiple boost : format objects", "In this case it is not practical to change the existing code base to use UCS2 or UCS4 or UTF-16 etc but it is possible to modify boost : : format if necessary .", "The documentation http : www.boost.org doc libs 1 57 0 libs format doc format.html syntax states my bold : .. . .. . Legacy printf format strings : spec where spec is a printf format specification .", "Boost does not use the sf printf routines provided by your implementation s runtime which is why the fact that it works with Visual Studio s fprintf doesn t really affect what boost : : format supports .", "s1 + s2 or str format s .", "When I use the following : .. . .. . I get the following output : .. . .. . When I try to use boost : : format on an ofstream like so : .. . .. . I get a weird output like this seen in Vi : 0x0 .", "Cheap solution : concatenate the format strings instead of the formatter objects .", "In contrast to printf the type character in the format string does not impose the concerned arguments to be of a restricted set of types but merely sets the flags that are associated with this type specification .", "My new project will compile boost : : format if I turn MS language extensions ON . strike .. . .. . So the question becomes who is wrong and how", "@sehe Boost version boost-1.51 .", "But the classical type-specification flag of printf has a weaker meaning in format .", "To quote boost.format documentation Once all arguments have been fed you can dump the format object to a stream .", "For example : .. . .. . This works great for printing with operator directly : .. . .. . However using boost : : format is impossible : .. . .. . The problem is fairly obvious : Boost has no idea that I would like it to use my custom operator to print types which have nothing to do with my namespace .", "The format specification types are not platform-specific .", "Plus it is nowhere near as nice as the Python s format .", "Did you install Boost", "Instead of passing a locale each time to the boost : : format constructor you could also set the default locale of your application which might help you avoid other problems .", "If the functionality can use a locale std : : regex std : : sort boost : : format give it a unicode aware locale and you should be safe and if you arent please tell me I want to know .", "Given that the character for 0x7f is CTRL- it looks like it s outputting the memblock 0 as a character rather than a hex value despite your format string .", "http : www.boost.org doc libs 1 49 0 libs format doc format.html printf directives", "How to link boost to your project .", "I usually think that the boost libs are well designed .", "Can this be done without boost : : io : : group", "In other words using on a format actually replaces the string data with whatever you d into it .", ".. . The result string stays accessible in the format object until another argument is passed at which time it is reinitialised .", "When I compare the output of boost : format and printf using the same format string I get different outputs .", "@user694733 : Boost.Format cannot change the compile-time overloading of operator based on the run-time contents of the format string .", "though : format 0.00000123456 3 prints 1.23e-06", "boost : : lambda : : var should only be necessary when neither arguments is a lambda expression .", "@Chap : IDEONE doesn t have Boost so I had to fabricate something simple to just illustrate the unpacking of the variadic arguments .", "what version of Boost", "Boost follows the model of std : : string and std : : stringstream neither of which provide implicit conversions to their content types .", "@jrok There is a good rationale here : boost.org doc libs 1 51 0 libs format doc choices.html http : www.boost.org doc libs 1 51 0 libs format doc choices.html", "My bet is that you re running into the fact that a format used is no longer usable .", "The second does indeed reinitialize the format but that should be a good thing in my case", "see http : www.boost.org doc libs 1 55 0 libs format doc format.html .", "For that matter Boost.Format doesn t hold a candle to the syntax of Python format .", "I already used boost : : format in many case but I found one for which the windows implementation doesn t react as I expected because it throw an exception .. . .. . I use macro to define hexa number output format for different platform : .. . .. . and call format like below : .. . .. . Remark that I use a syntax working perfectly with a fprintf .", "Are you asking if there are any semantic issues that prevent Boost from implementing such a thing", "Go to Project - Properties - Linker - General - Additional Library Directories and add boost stage lib directory to it .", "Both Clang and GCC can check printf-style functions for mismatches between their format strings and their arguments .", "A solution in your specific case may be just to cast your char to an int or some other type that intelligently handles the x format specifier :", "https : svn.boost.org trac boost ticket 7477", "Is there an elegant way to do this using C++ or boost", "I guess it would be rejected for inclusion in boost for example .", "For example you could use something like the libstdc++ array allocator http : gcc.gnu.org onlinedocs libstdc++ latest-doxygen a00031.html .. . .. . Unfortunately boost : : format also uses a couple of std : : vector which do not use the custom allocator which may be a problem in your case", "I was aiming for a nice and concise syntax using boost : : lambda : Too bad", "You forgot to add include boost format.hpp in your file .", "You don t have boost http : www.boost.org users download installed .", "However the fmt library https : github.com fmtlib fmt which optionally uses C++ 11 features such as variadic-templates provides an implementation of the Python-like format function : .. . .. . and safe alternatives to printf functions : .. . .. . Disclaimer : I m the author of this library", "I filed a report https : svn.boost.org trac boost ticket 7477 with boost also although I made it clear that the bug is not in their code .", "I think it is because you can only build the result after all arguments are known it wastes space to store the result and you probably only need the result just once for a given format argument combination .", "Also I looked into the source of format and I think using an allocator is difficult to do ." ] }
{ "confidence": [ 55.26276397705078, 53.938743591308594, 51.844200134277344, 51.49646759033203, 50.57597351074219, 50.30558776855469, 50.11022186279297, 49.258766174316406, 48.80229949951172, 48.07378387451172, 48.07099533081055, 46.57765579223633, 46.43565368652344, 44.91123580932617, 44.671714782714844, 44.60517501831055, 43.99821090698242, 43.84925079345703, 43.49056625366211, 43.470970153808594 ], "content": [ "Question : I need to write the class which will accept boost : : format through the operator like cout does : .. . .. . Which type of operator s parameter must be So that the class will be declared like this : .. . .. . Thanks . .. . Answer : boost : : format is the type you want . It has a str member to get a std : : string . Comment : Emm that s right - too trivial : Comment : But I don t understand how cout knows about some boost : : format type Comment : @Slav cout doesn t know about some boost : : format . In boost there s an operator that knows about cout ostream really and boost : : format . The key is operator doesn t need to be a member . The iostream library was designed to be extended for new types this way . Comment : You mean boost : : format is inherited from iostream Comment : No . There is no inheritance needed . It s simply another overload of operator . It will look something like ostream operator ostream out const boost : : format fmt out fmt.str return fmt . Again operator can be a free function it doesn t have to be a member .", "Question : I know that using the s format specifier and std : : string like this leads to undefined behaviour : .. . .. . But is it save to use the same specifier and a std : : string with boost : : format .. . .. . s specifies a const char but I provide a std : : string . Could this lead to UB too Comment : I may be missing the point but why not pass std : : string.c str Comment : Because I found a lot of those calls in some legacy code and I am trying to decide whether I need to fix it or not . Also I would like to know how to use the s specifier correctly in the future . .. . Answer : It is safe to use s with boost : : format and std : : string . In contrast to printf the type character in the format string does not impose the concerned arguments to be of a restricted set of types but merely sets the flags that are associated with this type specification . http : www.boost.org doc libs 1 49 0 libs format doc format.html printf directives", "Question : I was wondering whether Boost.Format http : www.boost.org doc libs 1 47 0 libs format does support using a fixed-width preallocated buffer as output instead of a dynamic buffer managed by the lib itself That is normally you d do : .. . .. . so the Boost : Format lib will automatically take care of allocating enough space and managing the output buffer for you . I was wondering if there s any way to use a predefine non-dynamic buffer with Boost.Format that is something like : .. . .. . I know I could just sift through the examples the docs and the source but apart from lacking time atm . and the very possibility of missing something it would be interesting to know : If it is not possible it would be great if someone could explain why if there is are specific whys -- was it deliberate doesn t it match the API well .. . Disclaimer : This question is not about performance Comment : What do you want to happen when you run out of room For a fixed buff I would use snprintf but that s me : Comment : @nhed If it doesn t fit the library can could either throw an exception or just stop filling the buffer similar to the options http : www.boost.org doc libs 1 47 0 libs format doc format.html exceptions already available Comment : I m not sure that those exceptions apply to the target buffer .. . Answer : Initial Idea .. . .. . Looking at the source http : www.boost.org doc libs 1 47 0 boost-format format class.hpp it seems you can use your own allocator which is then used by the internal stream internal streambuf t of boost : : format . Would that be good enough for your case For example you could use something like the libstdc++ array allocator http : gcc.gnu.org onlinedocs libstdc++ latest-doxygen a00031.html .. . .. . Unfortunately boost : : format also uses a couple of std : : vector which do not use the custom allocator which may be a problem in your case How boost : : format works .. . .. . I looked into the source of boost : : format and this is how it works described below is str calls either str or uses standard std : : ostream stuff : .. . .. . the format class stores all arguments and format string separatly sometimes using the custom allocator sometimes using the default allocator .. . when str is called it creates a new std : : string and makes it large enough for the result using the custom allocator .. . it then appends all arguments and static string pieces from the format string to the result string .. . finally it returns the result string by value .. . .. . So the final result string is not stored inside the format class but created when needed . So even if you can find the location of the result string when using a custom allocator it is only available after during a call to str . This should explain why it is not possible : the formatted result is never stored inside an output buffer in the class . Why it works like this .. . .. . Why they did it this way I do not know . I think it is because you can only build the result after all arguments are known it wastes space to store the result and you probably only need the result just once for a given format argument combination . So creating it when needed does not result in extra work since typically str is only called once . Solutions .. . .. . Create some wrapper around str or and copy the result into your fixed buffer .. . Use a stream buffer to stream the string into the buffer see example below .. . Inherit the class and add your own str function which stores the result in a fixed buffer . Possible solution using boost : : iostreams http : www.boost.org doc libs 1 47 0 libs iostreams doc guide guide.html tested : Comment : Useful info . I think a slight problem with allocators is that they are only allowed to report failure via bad-alloc correct Comment : @Martin : I think you are right . Also I looked into the source of format and I think using an allocator is difficult to do . I have updated my answer with the things I found . Comment : Nice job Do I understand you correctly : The output string is re-built every time .str is called Comment : @Martin : Yes the output string is re-build every time str is called .", "Question : I ve looked around and I ve been unable to find a solution to storing what is returned from a boost-format into a char array . For example : .. . .. . I get the error : .. . .. . error : expected an expression .. . .. . I don t know if I m just overlooking a simple solution but I need a const char in return . There s large amounts of code that can t be rewritten for now . I m working on VS2013 C++ Comment : What is the return-type of boost : : format .. . Answer : You could use C++ Format https : github.com cppformat cppformat as a faster alternative to Boost Format . It allows formatting directly into a character array : .. . .. . or even better it can allocate the array automatically in this case it will be allocated entirely on stack so no performance loss compared to a fixed buffer : .. . .. . The library uses Python-like format string syntax although safe printf implementation is also provided . Disclaimer : I m the author of this library .", "Question : Anything like Boost.Format in the C++11 standard I ve been able to avoid using Boost with a better C++11 option for every other need I ve had . For that matter Boost.Format doesn t hold a candle to the syntax of Python format . Something like that would be even better . Comment : What s wrong with good old C K R xxprintf Comment : I like it in general but it can t accept string directly which is annoying . I would prefer a method that doesn t require me to call .c str on all my strings . Plus it is nowhere near as nice as the Python s format . .. . Answer : As correctly pointed out by nosid neither C++11 nor C++14 provide an equivalent to Boost Format . However the fmt library https : github.com fmtlib fmt which optionally uses C++ 11 features such as variadic-templates provides an implementation of the Python-like format function : .. . .. . and safe alternatives to printf functions : .. . .. . Disclaimer : I m the author of this library", "Question : I m trying to format a binary array : char memblock to a hex string . When I use the following : .. . .. . I get the following output : .. . .. . When I try to use boost : : format on an ofstream like so : .. . .. . I get a weird output like this seen in Vi : 0x0 . What gives .. . Answer : Given that the character for 0x7f is CTRL- it looks like it s outputting the memblock 0 as a character rather than a hex value despite your format string . This actually makes sense based on what I ve read in the documentation . Boost : : format is a type-safe library where the format specifiers dictate how a variable will be output but limited by the actual type of said variable which takes precedence . The documentation http : www.boost.org doc libs 1 57 0 libs format doc format.html syntax states my bold : .. . .. . Legacy printf format strings : spec where spec is a printf format specification . .. . spec passes formatting options like width alignment numerical base used for formatting numbers as well as other specific flags . But the classical type-specification flag of printf has a weaker meaning in format . .. . It merely sets the appropriate flags on the internal stream and or formatting parameters but does not require the corresponding argument to be of a specific type . e.g . : the specification 2 x meaning print argument number 2 which is an integral number in hexa for printf merely means print argument 2 with stream basefield flags set to hex for format . And presumably having the field flag set to hex doesn t make a lot of sense when you re printing a char so it s ignored . Additionally from that documentation though paraphrased a little : .. . .. . The type-char does not impose the concerned argument to be of a restricted set of types but merely sets the flags that are associated with this type specification . A type-char of p or x means hexadecimal output but simply sets the hex flag on the stream . This is also verified more specifically by the text from this link http : boost.2283326.n4.nabble.com Boost-Format-format-strings-and-character-types-td2575140.html : .. . .. . My colleagues and I have found though that when a d descriptor is used to print a char variable the result is as though a c descriptor had been used - printf and boost : : format don t produce the same result . The Boost documentation linked to above also explains that the zero-padding 0 modifier works on all types not just integral ones which is why you re getting the second 0 in 0x0 the is a single character . .. . .. . In many ways this is similar to the problem of trying to output a const char in C++ so that you see a pointer . The following code : .. . .. . will produce something like : .. . .. . because the standard libraries know that C-style strings are a special case but if you tell them it s a void pointer they ll give you a pointer as output . A solution in your specific case may be just to cast your char to an int or some other type that intelligently handles the x format specifier : Comment : Thank you this makes sense .", "Question : For some reason I fail to use boost : : format in a boost : : lambda . Here is a hopefully compilable simplification of my code : .. . .. . The first std : : for each produces the expected output .. . The second std : : for each only outputs whitespaces without any number .. . .. . Why is that I m really not familiar with boost : : lambda so I might be missing the obvious here . Please do not suggest std : : copy based answers : my actual code does not work on std : : vector but on boost : : fusion : : vector and std : : for each is in fact a boost : : fusion : : for each . .. . Answer : My bet is that you re running into the fact that a format used is no longer usable . In other words using on a format actually replaces the string data with whatever you d into it . The cooler thing is that the second use above will silently fail . I know kind of counter-intuitive but it is what it is . Comment : thank you for your answer but I believe the code you provided works as expected . To quote boost.format documentation Once all arguments have been fed you can dump the format object to a stream . .. . The result string stays accessible in the format object until another argument is passed at which time it is reinitialised . The second does indeed reinitialize the format but that should be a good thing in my case Comment : In my experience it doesn t but if your millage varies I suggest ignoring my response . No idea what else your problem could be .", "Question : Following is not possible : .. . .. . You have to explicitely call the method str : .. . .. . It would only be syntactic-sugar but why not just add the conversion Comment : I m not sure what kind of answer you re looking for here . Are you asking if there are any semantic issues that prevent Boost from implementing such a thing Or are you just saying They should have done it this way . Comment : I am trying to understand the semantic issues . I usually think that the boost libs are well designed . Comment : Implicit conversions are sometimes convenient but also cause problems by hiding bugs when you really didn t want a conversion . Boost follows the model of std : : string and std : : stringstream neither of which provide implicit conversions to their content types . Comment : @jrok And what is bad in overloading Comment : @jrok There is a good rationale here : boost.org doc libs 1 51 0 libs format doc choices.html http : www.boost.org doc libs 1 51 0 libs format doc choices.html .. . Answer : I think the reason for this is same as std : : stringstream in that context you should also use .str to convert the stream to string and same for boost : : formatter and the reason is as : .. . .. . Now if boost : : formatter was implicitly convertible to std : : string then it produce Hello .World because format s . s1 will be converted to Hello . and then it will be implicitly converted to std : : string and use operator+ to add it with s2 but probably most programmers want to have Hello World . and that will be a source of error an confusion . But in the case that no implicit-conversion exist compiler will generate error for this because there is no operator+ for boost : : formatter and std : : string and for you to correct it either as format s . s1 + s2 or str format s . s1 + s2", "Question : The Boost Format documentatio http : www.boost.org doc libs 1 55 0 libs format doc choices.html n says : .. . .. . One of its goal is to provide a replacement for printf that means format can parse a format-string designed for printf apply it to the given arguments and produce the same result as printf would have . When I compare the output of boost : format and printf using the same format string I get different outputs . Online example is here http : coliru.stacked-crooked.com a c092e14322841f99 .. . .. . The output is : .. . .. . BoostFormat : A : A : A : 65 .. . .. . printf : 65 : 41 : A : 65 .. . .. . The difference is when I want to display a char as integral type . Why there is a difference Is this a bug or wanted behavior .. . Answer : This is expected behaviour . In the boost manual http : www.boost.org doc libs 1 59 0 libs format doc format.html printf directives it is written about the classical type-specification you uses : .. . .. . But the classical type-specification flag of printf has a weaker meaning in format . It merely sets the appropriate flags on the internal stream and or formatting parameters but does not require the corresponding argument to be of a specific type . Please note also that in the stdlib-printf call all char arguments are automatically converted to int due to the vararg-call . So the generated code is identical to : .. . .. . This automatic conversion is not done with the operator . Comment : +1 But wow that s horrible . I wonder what s their reasoning for this is It seems they took C style format which isn t great to begin with and yet still did not make it backwards compatible . Like picking worse of both worlds . Comment : Thanks your answer . Good to know that is expected behavior however it was not what I expected . Here the actual type overrules the specifier . So for char it makes no difference between d und c Strange Comment : @user694733 : Boost.Format cannot change the compile-time overloading of operator based on the run-time contents of the format string . Now you can hide the problem but that does add significant complexity - you d have to do implement the possible overload scenarios at compile-time and choose the correct one at runtime . This isn t space-efficient either .", "Question : null .. . Answer : This is given : .. . .. . greetingwithname should combine and reuses greeting and name so that it is equivalent to this : .. . .. . How do I What is the best way to create a boost : : format object from multiple boost : format objects Comment : It s not an option and AFAICT it s not implementable from the public interface . Cheap solution : concatenate the format strings instead of the formatter objects . Comment : Thanks . Yes if there is no easy solution I will work with the std : : string and apply the final result to the formatter .", "Question : I am using boost : : format variable to get elapsed time in seconds .. . .. . But I use the timer several times to cumulate durations . I want to know with which type of variable can I cumulate durations use the operator + . For example with a float by I don t know how to convert from boost : : format to float .. . .. . Thanks in advance .. . Answer : According to the documentation documentation http : www.boost.org doc libs 1 49 0 doc html date time posix time.html time duration operators time duration has operator + . So it is possible to use time duration itself to accumulate durations .", "Question : For some reason I fail to use boost : : format in a boost : : lambda . Here is a hopefully compilable simplification of my code : .. . .. . The first std : : for each produces the expected output .. . The second std : : for each only outputs whitespaces without any number .. . .. . Why is that I m really not familiar with boost : : lambda so I might be missing the obvious here . Please do not suggest std : : copy based answers : my actual code does not work on std : : vector but on boost : : fusion : : vector and std : : for each is in fact a boost : : fusion : : for each . .. . Answer : For some reason your code evaluates boost : : format 10d bl : : 1 immediately rather than on each invocation of the lambda . To prevent this you need to wrap boost : : format 10d in a call to bl : : var just as you have done with std : : cout . Unfortunately doing this requires Boost.Lambda to deduce the return-type of the call to operator which it is unable to do . Therefore the return-type must be specified explicitly using bl : : ret . Note that this return-type must be a reference in order that std : : cout accesses the returned object directly rather than a copy of it . We thus get the following code which produces the expected output : Comment : yep this works but I have no idea why it is necessary boost : : lambda : : var should only be necessary when neither arguments is a lambda expression . I was aiming for a nice and concise syntax using boost : : lambda : Too bad", "Question : Following is not possible : .. . .. . You have to explicitely call the method str : .. . .. . It would only be syntactic-sugar but why not just add the conversion Comment : I m not sure what kind of answer you re looking for here . Are you asking if there are any semantic issues that prevent Boost from implementing such a thing Or are you just saying They should have done it this way . Comment : I am trying to understand the semantic issues . I usually think that the boost libs are well designed . Comment : Implicit conversions are sometimes convenient but also cause problems by hiding bugs when you really didn t want a conversion . Boost follows the model of std : : string and std : : stringstream neither of which provide implicit conversions to their content types . Comment : @jrok And what is bad in overloading Comment : @jrok There is a good rationale here : boost.org doc libs 1 51 0 libs format doc choices.html http : www.boost.org doc libs 1 51 0 libs format doc choices.html .. . Answer : It is not a very good thing if an implicit-conversion can throw exceptions . Conversion to string will by default throw an exception if less arguments are fed to format than needed . E.g . Such implicit conversions make it hard to spot and analyze the parts of code that can throw exceptions . But explicit .str calls provide a hint of such possible exceptions which makes life easier when ensuring the surrounding code s exception safety as well as in this particular case hinting to double-check preceding code to prevent said exception from happening in the first place . Comment : Both answers this and the one of BigBoss give good reasons for not having the implicit-conversion . But I had to accept only one : - Comment : @mr georg Thanks :", "Question : How do I print boolean values with boost : : format as symbolic values Can this be done without boost : : io : : group It seems that flags sent to the stream beforehand get retested : .. . .. . Output .. . Answer : It doesn t appear to me that you can . I looked at the Boost.Format documentation and the code and didn t see anything . On the other hand the sample code http : www.boost.org doc libs 1 52 0 libs format example sample userType.cpp shows how to write a formatter for a user-defined type . You could write one for bool", "Question : I already used boost : : format in many case but I found one for which the windows implementation doesn t react as I expected because it throw an exception .. . .. . I use macro to define hexa number output format for different platform : .. . .. . and call format like below : .. . .. . Remark that I use a syntax working perfectly with a fprintf . I suppose that it come from the uint64 t format as an hexa but do you know to write the same line in a way it will work for all platform .. . Answer : I64X is not a valid format specification for boost : : format it s Microsoft-specific . The format specification types are not platform-specific . Boost does not use the sf printf routines provided by your implementation s runtime which is why the fact that it works with Visual Studio s fprintf doesn t really affect what boost : : format supports . You should be using either lX or llX as your non-Windows clause is doing . I would probably just use llX everywhere and cast output variables to long-long e.g . : .. . .. . This should work anywhere that unsigned long-long is sufficient to represent uint64 t and you can add a static assertion as shown to ensure that .", "Question : We are adding support for UTF8 to an existing application with a large code base . This application uses boost : : format and the output in non-ASCII characters is not aligning properly . Specifically when using the width . length s specifier boost : : format counts chars which does not do the right thing with utf8 strings . I think it should be possible to change the string-length code which is probably string : : size to use utf8len or something analogous based on .. . something In this case it is not practical to change the existing code base to use UCS2 or UCS4 or UTF-16 etc but it is possible to modify boost : : format if necessary . I was hoping someone else had run across this need and can point me to a possible solution . Note : I found some web pages on using locales with utf8 but most of that seemed more applicable to converting to from utf8 and UCS4 in streams . Comment : You mean that boost : : format counts bytes when it should count chars don t you Comment : What does aligning even mean in Unicode It s fundamentally an ASCII thing not unicode . See e.g . mothy.org hacks unicodewidth UnicodeWidth.html http : mothy.org hacks unicodewidth UnicodeWidth.html . Take a very simple example : A . That should probably be 2 characters wide . Mind you that s no A . It s U+FF21 Fullwidth Latin Capital A . Comment : @cjm - Yes bytes is correct although I was referring to chars as in the plural of char and not characters as in the logical printed unit . Comment : @MSalters - We use a monospace font for rendering so we cheat : all characters are one printed unit wide . It would be better if we used a variable pitch font and did alignment calculations in pels but we don t . Old code base in an embedded system precludes making these changes . Comment : @all - Thank you for all your comments . I understand that there are many different issues with the rich set of characters in Unicode . My interest is in modifying boost : : format so that it deals with at least some of the other characters even if not all . In the real world of adding multiple language support to a product we have control over the translation and we don t want to re-write all the output code . An 80 general solution that covers 100 of our cases is a good solution . continued .. . Answer : This is probably too late for you but maybe it will help someone else . Boost : : format accepts a std : : locale as an optional template parameter . see http : www.boost.org doc libs 1 55 0 libs format doc format.html . If you pass it a unicod aware locale such as the boost : : locale en US.UTF-8 you should get the desired behavior . Instead of passing a locale each time to the boost : : format constructor you could also set the default locale of your application which might help you avoid other problems . If you take this route I would recomment the use of a boost : : locale over a std : : locale as the boost : : locale s won t modify your numeric formatting unless you explicity ask it to docs here http : www.boost.org doc libs 1 59 0 libs locale doc html locale gen.html . In general this is a goto approach for making an application in C++ work nicely with Unicode . If the functionality can use a locale std : : regex std : : sort boost : : format give it a unicode aware locale and you should be safe and if you arent please tell me I want to know . If you are making a small lightweight application and only care about the 80 case you may not want to pay the price for including ICU Internation Components for Unicode which is the default engine boost-locale wraps around when providing unicde support . In this case build Boos using your OS s or Posix unicode support and your application will remain small and light but you won t have a lot of unicode support like multiple collation levels . For the problem you are describing Posix support is likely sufficent .", "Question : I tried this : .. . .. . and formatted ended up as hello 004B54D8 but I d like it to be hello world . I ve tried some variations like defining the operator within namespaces . What am I missing The operator doesn t appear to get called . Thanks . boost-format documentation provides the following example for formatting a custom types : http : www.boost.org doc libs 1 49 0 libs format example sample userType.cpp .. . Answer : Doh . I missed the w s :", "Question : Both Clang and GCC can check printf-style functions for mismatches between their format strings and their arguments . For example they ll complain about statements like this : .. . .. . Does anything similar exist for Boost.Format http : www.boost.org doc libs release libs format In other words are there any compiler switches static-analysis tools etc . that can warn about code like .. . .. . or .. . Answer : Looks like it is not supported A ticket has been created on boost as well to track it . You may want to pick up trunk version if you really need it . https : svn.boost.org trac boost ticket 6815", "Question : I have a C++ object boost : : format that has a str function which returns an std : : string . So when I need a formatted C string I need to write something like : .. . .. . I find that rather verbose and I need it a lot . I thought of creating a derived-class which has an operator char and would work like this Ch char or wchar-t : .. . .. . But of course the string returned by str is deallocated when the function returns and no valid C string is returned . Is there any kind of workaround The workaround needs to create a string that exists as long as the surrounding function-call : Comment : Don t use c-str or character pointers Comment : @JoachimPileborg That s easier said than done when 3rd party APIs are involved.. . .. . Answer : The most obvious solution is to define a type which contains the std : : string and converts implicitly to a char const . Something like : .. . .. . which could be used : .. . .. . Such implicit conversions are not usually a good idea but if you document the class well that it should only be used for this particular scenario I think it would be acceptable . EDIT : .. . .. . It occurs to me that to encourage only using this class as a temporary in this particular scenario you could name it using the naming-conventions you normally use for functions and not those you use for classes the user would then have the impression that he was using a function and it would stick out like a sore thumb if he used it otherwise . Comment : Depending on the compiler and the compiler settings RVO http : en.wikipedia.org wiki Return value optimization may or may not be exploited in initializing ToPlainC : : myValue . What if we make myValue a const reference to string . I believe the behavior is still defined . @James Can you please share your views Comment : +1 This gave me the idea how to do it without any additional writing . My cformat class inherits from boost : : function defines operator and operator Ch const so now I can write lib function cformat 1 2 1 2 Comment : @MohitJain Making myValue a reference results in undefined-behavior : initializing a const reference in an initializer-list is a special case which only extends the lifetime of the temporary for the lifetime of the constructor . If you think about where the temporary is located in a typical implementation and imagine that none of the functions are inlined it should be obvious why . And I m not sure where RVO changes anything here . Move semantics on the other hand do . Comment : @FelixDombek If you define operator then you probably don t need inheritance . Your cformat contains a boost : : format and its template operator just forwards to the boost : : format : : operator . You could even take advantage of this to use something other than which is a particularly poor choice . Comment : If you intend to use ToPlainC as a temporary shouldn t the conversion be ref-qualified operator const char", "Question : I would like to zeropad a number such that it has 5 digits and get it as a string . This can be done with the following : .. . .. . However I do not want to hardcode the number of digits i.e . the 5 in 05u . How can I use boost : : format but specify the number of digits via a variable i.e . put the number of digits in unsigned int numberOfDigits 5 and then use numberOfDigits with boost : : format .. . Answer : Maybe you can modify the formatter items using standard io manipulators : .. . .. . With a given format you can also add that inline : .. . .. . DEMO .. . .. . Live On Coliru http : coliru.stacked-crooked.com a 99899029327942a4 .. . .. . Where it prints .. . .. . because it is invoked with 4 parameters Comment : Thanks . That s great . I ll give it a little more time before I accept it as an answer because I d like to see if other people might also have good answers ." ] }
[ "yes-answer-long", "yes-answer-short" ]
formatting
UNK_RELATION
auraphp@php@33
auraphp -- the aura project for @placeholder is a set of well-tested and fully decoupled components libraries .
{ "confidence": [ 43.97869110107422, 38.5926628112793, 32.36808776855469, 30.172943115234375, 30.144546508789062, 30.144546508789062, 29.13991928100586, 27.54717445373535, 26.092639923095703, 25.93240737915039, 24.129188537597656, 24.104652404785156, 22.785808563232422, 22.785808563232422, 22.785808563232422, 22.681407928466797, 22.171436309814453, 21.362564086914062, 20.146869659423828, 17.81110191345215, 17.615991592407227, 15.97280216217041, 15.97280216217041, 15.790386199951172, 15.790386199951172, 15.085415840148926, 15.085415840148926, 15.085415840148926, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 15.042350769042969, 14.488052368164062, 13.054361343383789, 13.054361343383789, 13.054361343383789, 13.054361343383789, 13.054361343383789, 13.054361343383789, 13.054361343383789, 13.054361343383789, 13.054361343383789, 13.054361343383789, 13.054361343383789, 13.054361343383789, 13.054361343383789, 13.054361343383789, 13.054361343383789, 13.054361343383789, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371, 11.735518455505371 ], "content": [ "@HariKT i download aura from here github.com auraphp Aura.Sql https : github.com auraphp Aura.Sql .", "See https : github.com auraphp Aura.Sql blob develop src Aura Sql Connection AbstractConnection.php L953 .", "Thanks for using Aura .", "i have got a little problem in my auraphp router .", "Hi am using Aura sql to perform querying .", "What is the equivalent function for mysql-num-rows in aura sql .", "Does your composer.json look like github.com auraphp Aura.Sql blob develop composer.json L14-L17 https : github.com auraphp Aura.Sql blob develop composer.json L14-L17 .", "I am using aura sqlquery https : packagist.org packages aura sqlquery as a SQL query generator .", "If you are using v1 of aura insert update delete etc always returns the number of affected rows .", "Optional Params https : github.com auraphp Aura.Router optional-params .. . .. . router- add archive oleje 134 motorove-oleje-pro-automobily oleje number .. . .. . 2 .", "If you are using a select statement you could make use of the count or you can use fetchOne https : github.com auraphp Aura.Sql tree develop fetching-results .", "This is my Aura Config .. . .. . And this is the class in question that needs to use different classes depending on the source it finds .", "I integrated Aura Sessions like the following : .. . .. . This works definetly with Relayphp and Guzzle Http message interface .", "I m running into a problem with the function and I m not sure whether it s a bug in Cake 3.2.8 Aura Intl or my code .", "Any ideas how to get variable binding in aura sqlquery when using a mysqli connection", "I bet I ve got my design structure off but I m also not seeing how to do this in Aura DI through the config .", "I am using PHP 5.4 RC5 and starting the server via terminal .. . .. . Currently using Aura.Router https : github.com auraphp Aura.Router and at the root I have index.php file with code .. . .. . A request for http : localhost : 8000 blog read 1 works as expected .", "If your PHP version is 5.6 here is a function that you can use to run a query from aura sqlquery against mysqli .. . .. . used like this", "Wild card Params https : github.com auraphp Aura.Router wildcard-params .. . .. . router- add wild post oleje 134 motorove-oleje-pro-automobily - setWildcard other .. . .. . this matches with the following values route router- match oleje 134 motorove-oleje-pro-automobily oleje-shell 35 SERVER route- params other array oleje-shell 35 .. . .. . In both cases you may want to check whether the one you got is string or number .", "You might find some unexpected errors when you go live with the project if you do not sync the same program versions on your test and production servers .", "I have overlooked that I can set Sessions inside of the anonymous function which I have to implement in my middleware list like stated before but didnt realize it though so lets say I want to create a Session when a user logs in with Aura Session and PSR7-Middlewares it could look like the following : .. . .. . And the method setUserSession could be :", "Something I would like to clarify is you don t need to use set method like many of the di containers out here .", "You can modify the code to .. . .. . You can make use of set when you want to pass the same object to many other objects .", "How can I access the function set in the middlewares array", "Or do I have to set all Sessions before dispatching the middlewares together", "Dumping the Session Variable gives me the basic Session data with empty values because i didnt set anything .", "Unfortunately I couldn t find any easy to understand info on how I can set the Session inside the middleware-system .", "I tried also to just use the AuraSession Class and set Variables over that class but it doesnt work .", "But when a dot json or dot html like http : localhost : 8000 blog read 1.json http : localhost : 8000 blog read 1.html request comes the php throws .. . .. . As I am running the server with the built-in php server where can I fix not to throw the html and json file-not-found error", "Or do I want to go and install apache and enable mod-rewrite and stuffs", "You are trying to make use of a router script for the PHP built-in webserver without specifying it : .. . .. . Instead add your router script : .. . .. . A router script should either handle the request if a request matches or it should return FALSE in case it want s the standard routing to apply .", "Compare Built-in web server Docs http : php.net manual en features.commandline.webserver.php .", "I have no clue if Aura.Router offers support for the built-in web server out-of-the-box or if it requires you to write an adapter for it .", "Like you would need to configure your webserver for that router library you need to configure the built-in web server too .", "That s the router.php script in the example above .", "You are right .", "php -S localhost : 8000 router.php will work : .", "you can specify the document root by passing the -t option like so :", "Sorry I m not familiar with Aura.Router .", "However I would use whatever is going on the production server .", "I have to check : .. . .. . For this i need the equivalent function in Aura.Sql .", "auraphp.com manuals http : auraphp.com manuals", "@SverriM.Olsen manual is pointing to framework .", "It should be pointed to packages .", "auraphp.com packages Aura.Sql http : auraphp.com packages Aura.Sql .", "next2u which version of Aura.Sql are you using", "v1 or v2", "i can t find the version from here .", "Especially having installer-default php-5.4", "Aura.Sql uses PDO internally .", "The equivalent to mysql-num-rows http : www.php.net manual en function.mysql-num-rows.php points to http : www.php.net manual en pdostatement.rowcount.php .", "So in this case I will say .. . .. . Let me know if that helps", "i currently using the count of result for this. . you also prescribe it anyways thanks for your valuable answer and it will help me for my further works. .", "Good to hear : .", "For example i have this URL : oleje 134 motorove-oleje-pro-automobily .. . .. . But i can have this URl also : oleje 134 motorove-oleje-pro-automobily oleje-shell .. . .. . The oleje-shell part of URL is optional and i need to put behind this part one more optional parameter called per page .", "So i need something like : oleje 134 motorove-oleje-pro-automobily 35 or : oleje 134 motorove-oleje-pro-automobily oleje-shell 35 .", "I hope you got it .", "Thanks for help .", "2 options are coming to my mind .", "1 .", "Hope that help", "Bad translation definition .. . .. . You may well find at some point in the future that translations like Teams are very problematic depending on how that loose word is being used they are an indicator of bad translation definitions .", "I m new to modern method of dependency-injection and I m trying to figure out how to have a method pick which class to use based on a condition .", "Is it that I need to split my processing at the point right after the source is determined so a new class can be initialized with that source as a parameter", "The only way I can see to do this in the config is to do a lazy anonymous function to return the proper source class but this also feels against modern design-principles .", "Don t use newInstance for it will create the object on calling the same .", "You probably may need to make use of lazyNew or lazyGet functionalities .", "Regarding your question about dynamic decision making .", "Here is my thoughts I did have came across this question some time before .", "But didn t see what I did so iirc what I did was injected a factory to IncomingOrder class which can create object .", "The good thing about it is if your source parse needs some sort of dependency you can make use of di inside the factory .", "Eg : .. . .. . Hope that helps .", "Thank you", "So in my config I put definitions for the various source parsers .", "If I m understanding correctly then the SourceFactory is injected into the IncomingOrder then after the source is known I call sourceParser this- sourceFactory- newInstance source .", "I will try this .", "Thank you very much .", "Yes you are correct understanding the same .", "I ve installed the following composer packages : .. . .. . .. . .. . and now I want to glue these packages together with the psr7-middlewares packages .", "Unfortunately I couldn t find any info on how to use each library from these middlewares outside of the dispatcher .", "Basic things like Access Logging and Routing work already without problems .", "At the End I got an Response and can get its body and Headers but not more .", "But how are they then integrated into it", "I ve tried the same thing in Cake 1.3 and it works as I expect it to but it s possible that my expectations are simply that way because that s how it worked in 1.3 . : - .. . .. . When I am building my menus I use things like Teams but I also have pages that use things like n Team Teams count player- teams .", "The i18n shell extracts these into the default.pot separately so when I translate it to French it s like this : .. . .. . If I call Team I correctly get quipe returned and if I call n Team Teams x I correctly get quipe or quipes returned depending on the value of x .", "But if I call Teams I get back .. . .. . This is the case even if I eliminate the msgid Teams section leaving only the plural definition .", "In Cake 1.3 Teams would simply return quipes .", "Don t know what it might do in 2.x as I skipped over that entirely .", "So whose bug is this", "In Cake 1.3 Teams would simply return quipes . Assuming that s true I m quite surprised - the internal logic for parsing po files has been rewritten several times but the fundamental mechanism explained in both answers below hasn t changed .", "You have two Teams message IDs .", "The problem is that the CakePHP message file parser stores the messages in a key-value fashion where the message ID is used as the key resulting in the Teams messages for msgid plural to override the Teams message from the preceding msgid .", "https : github.com cakephp cakephp blob 3.2.8 src I18n Parser PoFileParser.php L149 https : github.com cakephp cakephp blob 3.2.8 src I18n Parser PoFileParser.php L172 .. . .. . https : github.com cakephp cakephp blob 3.2.8 src I18n Parser MoFileParser.php L137-L140 .. . .. . Since gettext seems to be able to handle this I d say that it s at least a missing feature which might be intentional however it might even be a bug I can t tell for sure but I d tend towards bug .", "For clarification open an issue over at GitHub https : github.com cakephp cakephp issues .", "To temporarily workaround this issue you could use contexts .", "Duplicate message definition .. . .. . This is problematic : .. . .. . The first means you have or are expecting to have Teams in the application code which expects to return a string .", "The second scenario is going to create ambiguous data when the po file is parsed .", "The class responsible for converting po files to the array format is the PoFileParser https : github.com cakephp cakephp blob master src I18n Parser PoFileParser.php which contains these lines : .. . .. . Where messages is the array used to lookup translations indexed by the translation key .", "So the reason for the observed behavior is because this code : .. . .. . is going to look for messages Teams .. . .. . This code : .. . .. . is going to look for messages Teams index and the messages array is going to contain the parsed data from the plural translation only which overwrote the singular version of the string as it was earlier in the file .", "The code-level solution is to ensure that all msgid and msgid plural keys are unique since they are essentially the same thing ." ] }
{ "confidence": [ 54.791603088378906, 34.518409729003906, 29.929275512695312, 29.353012084960938, 28.482067108154297, 28.068042755126953, 27.544628143310547, 27.037208557128906, 25.414470672607422, 19.572750091552734, 17.691268920898438 ], "content": [ "Question : Hi am using Aura sql to perform querying . What is the equivalent function for mysql-num-rows in aura sql . I have to check : .. . .. . For this i need the equivalent function in Aura.Sql . Comment : auraphp.com manuals http : auraphp.com manuals Comment : @SverriM.Olsen manual is pointing to framework . It should be pointed to packages . auraphp.com packages Aura.Sql http : auraphp.com packages Aura.Sql . next2u which version of Aura.Sql are you using v1 or v2 Comment : @HariKT i download aura from here github.com auraphp Aura.Sql https : github.com auraphp Aura.Sql . i can t find the version from here . Comment : Does your composer.json look like github.com auraphp Aura.Sql blob develop composer.json L14-L17 https : github.com auraphp Aura.Sql blob develop composer.json L14-L17 . Especially having installer-default php-5.4 .. . Answer : Aura.Sql uses PDO internally . The equivalent to mysql-num-rows http : www.php.net manual en function.mysql-num-rows.php points to http : www.php.net manual en pdostatement.rowcount.php . If you are using v1 of aura insert update delete etc always returns the number of affected rows . See https : github.com auraphp Aura.Sql blob develop src Aura Sql Connection AbstractConnection.php L953 . If you are using a select statement you could make use of the count or you can use fetchOne https : github.com auraphp Aura.Sql tree develop fetching-results . So in this case I will say .. . .. . Let me know if that helps Comment : i currently using the count of result for this. . you also prescribe it anyways thanks for your valuable answer and it will help me for my further works. . Comment : Good to hear : . Thanks for using Aura .", "Question : i have got a little problem in my auraphp router . For example i have this URL : oleje 134 motorove-oleje-pro-automobily .. . .. . But i can have this URl also : oleje 134 motorove-oleje-pro-automobily oleje-shell .. . .. . The oleje-shell part of URL is optional and i need to put behind this part one more optional parameter called per page . So i need something like : oleje 134 motorove-oleje-pro-automobily 35 or : oleje 134 motorove-oleje-pro-automobily oleje-shell 35 . I hope you got it . Thanks for help . .. . Answer : 2 options are coming to my mind . 1 . Optional Params https : github.com auraphp Aura.Router optional-params .. . .. . router- add archive oleje 134 motorove-oleje-pro-automobily oleje number .. . .. . 2 . Wild card Params https : github.com auraphp Aura.Router wildcard-params .. . .. . router- add wild post oleje 134 motorove-oleje-pro-automobily - setWildcard other .. . .. . this matches with the following values route router- match oleje 134 motorove-oleje-pro-automobily oleje-shell 35 SERVER route- params other array oleje-shell 35 .. . .. . In both cases you may want to check whether the one you got is string or number . Hope that help", "Question : I am using PHP 5.4 RC5 and starting the server via terminal .. . .. . Currently using Aura.Router https : github.com auraphp Aura.Router and at the root I have index.php file with code .. . .. . A request for http : localhost : 8000 blog read 1 works as expected . But when a dot json or dot html like http : localhost : 8000 blog read 1.json http : localhost : 8000 blog read 1.html request comes the php throws .. . .. . As I am running the server with the built-in php server where can I fix not to throw the html and json file-not-found error Or do I want to go and install apache and enable mod-rewrite and stuffs .. . Answer : Sorry I m not familiar with Aura.Router . However I would use whatever is going on the production server . You might find some unexpected errors when you go live with the project if you do not sync the same program versions on your test and production servers .", "Question : I am using PHP 5.4 RC5 and starting the server via terminal .. . .. . Currently using Aura.Router https : github.com auraphp Aura.Router and at the root I have index.php file with code .. . .. . A request for http : localhost : 8000 blog read 1 works as expected . But when a dot json or dot html like http : localhost : 8000 blog read 1.json http : localhost : 8000 blog read 1.html request comes the php throws .. . .. . As I am running the server with the built-in php server where can I fix not to throw the html and json file-not-found error Or do I want to go and install apache and enable mod-rewrite and stuffs .. . Answer : you can specify the document root by passing the -t option like so :", "Question : I ve got a legacy app that uses mysqli functions actually it uses mysql functions . Gah . I am using aura sqlquery https : packagist.org packages aura sqlquery as a SQL query generator . For example : .. . .. . Then we get the raw SQL by casting to string : .. . .. . Now I want to do do some variable binding in a where : .. . .. . When I cast to string the escaping binding never seems to be occur . It appears that the binding only takes place when one uses PDO and prepared statements . Any ideas how to get variable binding in aura sqlquery when using a mysqli connection Comment : I suppose that a query-builder is a requirement and you don t want a solution that works with raw SQL Comment : @YourCommonSense I prefer to use a query-builder to deal with complex joins . For example if a User model has several methods which need several joins then it s easy to perform those common joins in a single helper method and then pass around the select-object . Managing raw SQL text feels cumbersome to me . Comment : Yes I see . But still . Your requirement is not clear to me . You need to get a raw SQL only to be used with mysql functions and that s the only option Comment : Yep unless I convert to mysqli which I should probably do anyway and use mysqli- prepare as you suggest providing that the PHP ver is high enough which really is out of my immediate control . .. . Answer : If your PHP version is 5.6 here is a function that you can use to run a query from aura sqlquery against mysqli .. . .. . used like this Comment : I think David Weinraub this is the answer you may need for you are looking to make use of mysqli connection and not pdo .", "Question : I m new to modern method of dependency-injection and I m trying to figure out how to have a method pick which class to use based on a condition . I bet I ve got my design structure off but I m also not seeing how to do this in Aura DI through the config . This is my Aura Config .. . .. . And this is the class in question that needs to use different classes depending on the source it finds . Is it that I need to split my processing at the point right after the source is determined so a new class can be initialized with that source as a parameter The only way I can see to do this in the config is to do a lazy anonymous function to return the proper source class but this also feels against modern design-principles . .. . Answer : Something I would like to clarify is you don t need to use set method like many of the di containers out here . You can modify the code to .. . .. . You can make use of set when you want to pass the same object to many other objects . Don t use newInstance for it will create the object on calling the same . You probably may need to make use of lazyNew or lazyGet functionalities . Regarding your question about dynamic decision making . Here is my thoughts I did have came across this question some time before . But didn t see what I did so iirc what I did was injected a factory to IncomingOrder class which can create object . The good thing about it is if your source parse needs some sort of dependency you can make use of di inside the factory . Eg : .. . .. . Hope that helps . Thank you Comment : So in my config I put definitions for the various source parsers . If I m understanding correctly then the SourceFactory is injected into the IncomingOrder then after the source is known I call sourceParser this- sourceFactory- newInstance source . I will try this . Thank you very much . Comment : Yes you are correct understanding the same .", "Question : I ve installed the following composer packages : .. . .. . .. . .. . and now I want to glue these packages together with the psr7-middlewares packages . Unfortunately I couldn t find any info on how to use each library from these middlewares outside of the dispatcher . Basic things like Access Logging and Routing work already without problems . I integrated Aura Sessions like the following : .. . .. . This works definetly with Relayphp and Guzzle Http message interface . Dumping the Session Variable gives me the basic Session data with empty values because i didnt set anything . Unfortunately I couldn t find any easy to understand info on how I can set the Session inside the middleware-system . At the End I got an Response and can get its body and Headers but not more . How can I access the function set in the middlewares array I tried also to just use the AuraSession Class and set Variables over that class but it doesnt work . Or do I have to set all Sessions before dispatching the middlewares together But how are they then integrated into it .. . Answer : I have overlooked that I can set Sessions inside of the anonymous function which I have to implement in my middleware list like stated before but didnt realize it though so lets say I want to create a Session when a user logs in with Aura Session and PSR7-Middlewares it could look like the following : .. . .. . And the method setUserSession could be :", "Question : I ve got a legacy app that uses mysqli functions actually it uses mysql functions . Gah . I am using aura sqlquery https : packagist.org packages aura sqlquery as a SQL query generator . For example : .. . .. . Then we get the raw SQL by casting to string : .. . .. . Now I want to do do some variable binding in a where : .. . .. . When I cast to string the escaping binding never seems to be occur . It appears that the binding only takes place when one uses PDO and prepared statements . Any ideas how to get variable binding in aura sqlquery when using a mysqli connection Comment : I suppose that a query-builder is a requirement and you don t want a solution that works with raw SQL Comment : @YourCommonSense I prefer to use a query-builder to deal with complex joins . For example if a User model has several methods which need several joins then it s easy to perform those common joins in a single helper method and then pass around the select-object . Managing raw SQL text feels cumbersome to me . Comment : Yes I see . But still . Your requirement is not clear to me . You need to get a raw SQL only to be used with mysql functions and that s the only option Comment : Yep unless I convert to mysqli which I should probably do anyway and use mysqli- prepare as you suggest providing that the PHP ver is high enough which really is out of my immediate control . .. . Answer : You can use select- getBindValues to get the bind values . I will say make use of Aura.Sql than pdo for it helps you in certain other cases like IN query . Taking an example from readme . Let me know in case you need more clarification for the same . Thank you . Comment : Thanks for the quick response . I understand that I can get those bind values to use with PDO . The issue is how to generate raw SQL that I can use with mysql or mysqli . Comment : There is no other way I am aware of : .", "Question : I am using PHP 5.4 RC5 and starting the server via terminal .. . .. . Currently using Aura.Router https : github.com auraphp Aura.Router and at the root I have index.php file with code .. . .. . A request for http : localhost : 8000 blog read 1 works as expected . But when a dot json or dot html like http : localhost : 8000 blog read 1.json http : localhost : 8000 blog read 1.html request comes the php throws .. . .. . As I am running the server with the built-in php server where can I fix not to throw the html and json file-not-found error Or do I want to go and install apache and enable mod-rewrite and stuffs .. . Answer : You are trying to make use of a router script for the PHP built-in webserver without specifying it : .. . .. . Instead add your router script : .. . .. . A router script should either handle the request if a request matches or it should return FALSE in case it want s the standard routing to apply . Compare Built-in web server Docs http : php.net manual en features.commandline.webserver.php . I have no clue if Aura.Router offers support for the built-in web server out-of-the-box or if it requires you to write an adapter for it . Like you would need to configure your webserver for that router library you need to configure the built-in web server too . That s the router.php script in the example above . Comment : You are right . php -S localhost : 8000 router.php will work : .", "Question : I m running into a problem with the function and I m not sure whether it s a bug in Cake 3.2.8 Aura Intl or my code . I ve tried the same thing in Cake 1.3 and it works as I expect it to but it s possible that my expectations are simply that way because that s how it worked in 1.3 . : - .. . .. . When I am building my menus I use things like Teams but I also have pages that use things like n Team Teams count player- teams . The i18n shell extracts these into the default.pot separately so when I translate it to French it s like this : .. . .. . If I call Team I correctly get quipe returned and if I call n Team Teams x I correctly get quipe or quipes returned depending on the value of x . But if I call Teams I get back .. . .. . This is the case even if I eliminate the msgid Teams section leaving only the plural definition . In Cake 1.3 Teams would simply return quipes . Don t know what it might do in 2.x as I skipped over that entirely . So whose bug is this Comment : In Cake 1.3 Teams would simply return quipes . Assuming that s true I m quite surprised - the internal logic for parsing po files has been rewritten several times but the fundamental mechanism explained in both answers below hasn t changed . .. . Answer : You have two Teams message IDs . The problem is that the CakePHP message file parser stores the messages in a key-value fashion where the message ID is used as the key resulting in the Teams messages for msgid plural to override the Teams message from the preceding msgid . https : github.com cakephp cakephp blob 3.2.8 src I18n Parser PoFileParser.php L149 https : github.com cakephp cakephp blob 3.2.8 src I18n Parser PoFileParser.php L172 .. . .. . https : github.com cakephp cakephp blob 3.2.8 src I18n Parser MoFileParser.php L137-L140 .. . .. . Since gettext seems to be able to handle this I d say that it s at least a missing feature which might be intentional however it might even be a bug I can t tell for sure but I d tend towards bug . For clarification open an issue over at GitHub https : github.com cakephp cakephp issues . To temporarily workaround this issue you could use contexts .", "Question : I m running into a problem with the function and I m not sure whether it s a bug in Cake 3.2.8 Aura Intl or my code . I ve tried the same thing in Cake 1.3 and it works as I expect it to but it s possible that my expectations are simply that way because that s how it worked in 1.3 . : - .. . .. . When I am building my menus I use things like Teams but I also have pages that use things like n Team Teams count player- teams . The i18n shell extracts these into the default.pot separately so when I translate it to French it s like this : .. . .. . If I call Team I correctly get quipe returned and if I call n Team Teams x I correctly get quipe or quipes returned depending on the value of x . But if I call Teams I get back .. . .. . This is the case even if I eliminate the msgid Teams section leaving only the plural definition . In Cake 1.3 Teams would simply return quipes . Don t know what it might do in 2.x as I skipped over that entirely . So whose bug is this Comment : In Cake 1.3 Teams would simply return quipes . Assuming that s true I m quite surprised - the internal logic for parsing po files has been rewritten several times but the fundamental mechanism explained in both answers below hasn t changed . .. . Answer : Duplicate message definition .. . .. . This is problematic : .. . .. . The first means you have or are expecting to have Teams in the application code which expects to return a string . The second scenario is going to create ambiguous data when the po file is parsed . The class responsible for converting po files to the array format is the PoFileParser https : github.com cakephp cakephp blob master src I18n Parser PoFileParser.php which contains these lines : .. . .. . Where messages is the array used to lookup translations indexed by the translation key . So the reason for the observed behavior is because this code : .. . .. . is going to look for messages Teams .. . .. . This code : .. . .. . is going to look for messages Teams index and the messages array is going to contain the parsed data from the plural translation only which overwrote the singular version of the string as it was earlier in the file . The code-level solution is to ensure that all msgid and msgid plural keys are unique since they are essentially the same thing . Bad translation definition .. . .. . You may well find at some point in the future that translations like Teams are very problematic depending on how that loose word is being used they are an indicator of bad translation definitions . To give an example CakePHP used to have translations of this form in baked output : .. . .. . Which was later changed to https : github.com cakephp cakephp commit 6d092552e52afde662bce11f309dd7faab91b262 : .. . .. . Because the translation of Invalid s can change depending on what s is - so can the translation of s . Comment : I did have the Invalid s type of strings in the previous 1.3 version of my code but have come to that same realization and replaced them all in the new version so I don t expect to run into the problems you discuss in the second part . Comment : I d be fine with deleting the stand-alone Teams translation entirely and just keeping the plural one except that if I use that outside of the n function I get back the array . : - Comment : what is the context i.e . the code around it where you are using Teams Is it a menu item for example Comment : Primarily menus breadcrumbs that kind of thing . The same sort of situation is going to arise with a number of my models I expect the application is 100 000 lines-of-code so I m not looking forward to going through all of that to add contexts.. . Comment : All of the translation functions are wrapped in function exists checks https : github.com cakephp cakephp blob master src I18n functions.php L17 . So you could define that function to check if the return-value is an array and if so call n or simply pop off the last value . Though I think doing that will simply postpone the inevitable task of find and replace Teams with d menu Teams or x menu Teams - something laborious but not complex or difficult to do ." ] }
[ "yes-answer-long", "yes-answer-short" ]
php
UNK_RELATION
calendarextender@user@81
calendarextender -- calendarextender is an ajax control popping a calendar upon @placeholder click on the target control .
{ "confidence": [ 57.530853271484375, 53.81015396118164, 53.09853744506836, 53.09853744506836, 52.384620666503906, 49.76802062988281, 49.49422836303711, 48.26732635498047, 48.26732635498047, 47.17253875732422, 47.165130615234375, 46.78187561035156, 46.25190353393555, 44.75820541381836, 44.036827087402344, 43.855926513671875, 43.855926513671875, 43.25312042236328, 42.761138916015625, 42.749752044677734, 42.38054275512695, 42.38054275512695, 41.759708404541016, 41.759708404541016, 41.759708404541016, 41.43025207519531, 40.846195220947266, 40.730281829833984, 40.730281829833984, 40.730281829833984, 40.6649169921875, 39.63549041748047, 38.963218688964844, 38.26007080078125, 38.23155975341797, 38.115264892578125, 38.115264892578125, 37.77690505981445, 37.77690505981445, 37.312957763671875, 37.312957763671875, 37.312957763671875, 37.312957763671875, 37.020477294921875, 36.569297790527344, 36.218170166015625, 36.218170166015625, 36.218170166015625, 35.68179702758789, 35.465065002441406, 34.90603256225586, 34.80841827392578, 34.800140380859375, 34.800140380859375, 34.478546142578125, 34.36009979248047, 34.36009979248047, 34.176422119140625, 32.709842681884766, 32.709842681884766, 32.709842681884766, 32.709842681884766, 32.709842681884766, 32.709842681884766, 32.55339050292969, 32.406253814697266, 31.735675811767578, 31.725566864013672, 31.61505126953125, 31.61505126953125, 30.473041534423828, 30.302915573120117, 29.892635345458984, 28.99148941040039, 28.209415435791016, 28.181758880615234, 27.400535583496094, 27.30569839477539, 27.239160537719727, 27.239160537719727, 27.071857452392578, 26.737262725830078, 26.737262725830078, 26.737262725830078, 26.53150177001953, 26.53150177001953, 26.53150177001953, 26.43109893798828, 26.056747436523438, 25.436737060546875, 25.436710357666016, 25.423017501831055, 25.423017501831055, 25.29190444946289, 25.29190444946289, 25.247516632080078, 25.02588653564453, 24.961957931518555, 24.86290740966797, 24.855131149291992 ], "content": [ "CalendarExtender fires on target click event .", "But I am not using Asp.net calendar extender I am using Ajax CalendarExtender and EndDate Property is not present for this control .", "Remove PopupButtonID property from the CalendarExtender control", "How to set current date in CalendarExtender control .", "Just add an attribute StartDate DateTime.Now in you ajaxtoolkit calendarextender control", "Do you use Ajax- CalendarExtender s at all", "@Nalini yes you are using ajax calendarextender from asp.net-ajax control toolkit .", "The format of the date entered in the textbox matches the same format used by the CalendarExtender control .", "That being said the correct way to handle this is to call the set selectedDate function of the CalendarExtender control .", "I m using a CalendarExtender control with the help of img to populate a TextBox with a date .", "On an ASP.NET page I have a pair of CalendarExtender AJAX Control Toolkit for ASP.NET 4.0 controls on a page acting as a date-range .", "This TextBox is the TargetControl of a CalendarExtender .. . 2 .", "Following link might help you : Disable dates in CalendarExtender http : gratisaccount.wordpress.com 2008 10 22 disable-dates-in-calendarextender", "I m trying to add dynamically a control CalendarExtender from ASP.NET Ajax Toolkit to the WebForm page .", "There is no way to disable dates in a CalendarExtender .", "I m using an Ajax CalendarExtender attached to a textbox in my page .", "Yes I don t have EndDate property for my Ajax calendarextender .", "Add an OnClientShown event to the CalendarExtender ie .", "I am using the ajax calendarextender on an ASP.NET WebForms application .", "You can trigger the CalendarExtender on both Popup button click and Textbox focus .", "Any idea on how to refresh the behavior of the second CalendarExtender", "The page loads fine after I disable the calendarextender .", "http : stackoverflow.com questions 5608062 how-to-disable-previous-dates-in-calendarextender-control-through-its-render-eve .. . .. . but it s not the same .", "I m working on a .NET web application and I m using a CalendarExtender control within it to have the user specify a date .", "I have a CalendarExtender control on my page and sometimes have to change the date to the next occuring Sunday .", "How to disable previous dates while using in ajaxToolkit CalendarExtender", "I used CalendarExtender with TextBox in aspnet .", "I am using ajaxtoolkit calendarextender with image .", "To do this I am using ajaxToolkit s CalendarExtender .", "The CalendarExtender on dateHasChanged event dateHasChanged does not fire .", "I have used this CalendarExtender control in four or five other places in this project also .", "You can make use of the OnClientDateSelectionChanged event of the CalendarExtender .", "If you have problem in displaying CalendarExtender when it appears like this : .. . .. .", "Selecting the textbox linked with the calendarextender works fine in IE and Firefox but in chrome there is a very long delay before the calendar displays .", "I have two pages with the same code for UpdatePanel ScriptManager and CalendarExtender in one of them the CalendarExtender is working fine but in the other it s giving me this error : .. . .. . CalendarExtender is not a known Element .. . .. . Here s my code on aspx .. . .. . But still giving the error.. . .. . .. . --Update 2-- .. . .. . Now i m getting this error : .. . The TargetControlID of CalendarExtender1 is not valid .", ".. . .. . Update examples .. . .. . This is the asp.net-ajax calendarExtender I am using the page has live examples of it in use .", "Even though the post title says CalendarExtender v3.5 I was using a v3.5.40412.0 version of Ajax ControlToolkit.dll and these properties did not exist .", "I m trying to use a CalendarExtender control with a MaskedEditExtender because I don t want the user to be able to enter anything except a valid date into the box .", "I can make something similar with JavaScript and alert message : .. . .. . how to disable previous dates in CalendarExtender control through its render event", "You can simply change the display mode of the CalendarExtender to month .", "Have you added a Register directive to your page for the CalendarExtender", "I am adding a CalendarExtender to a page using the default styles .", "The CalendarExtender and TextBox are part of a WebPart added to a SharePoint 2007 Page .", "I have a popup ajax calendarextender that populates a text box with the selected date MM dd yyyy .", "I know it s too late to reply this post but it my help someone .. . .. . Disable dates in Ajax Calendar Extender with different dates examples http : www.advancesharp.com blog 1002 disable-dates-in-ajax-calendarextender", "I want to have the option to choose the months and years as in ajaxToolkit : CalendarExtender .. . .. .", "TL DR - How do you change the height for the CalendarExtender", "How do I make the calendarextender show just a few days", "Unfortunately there is no Z-Index attribute to the CalendarExtender unless you want to write an entire style for the calendar which I don t want to do .", "Source : Calendar control is not popping-up when clicked on image http : stackoverflow.com questions 7467362 calendar-control-is-not-popping-up-when-clicked-on-image .. . .. . Because of the dynamic way in which the actual form is created it is impossible for me to hardcode several instances of CalendarExtender in the .ascx and call them in the .cs so as to prevent this issue eg I can only have this dateCal .", "This css code will modify the underlying class for the previous and next month images of the CalendarExtender", "Possible Duplicate : .. . The Controls collection cannot be modified because the control contains code blocks http : stackoverflow.com questions 778952 the-controls-collection-cannot-be-modified-because-the-control-contains-code-bl .. . .. . What could be the possible solution to avoid the conflict between Page.ResolveUrl and CalendarExtender of Ajax", "There is a Format property of Calendar Control http : www.asp.net ajax ajaxcontroltoolkit Samples Calendar Calendar.aspx .", "I have an user control in AJAX for the date calendar and I want to disable the future dates in the Calendar .", "I have a textbox and a calendar extender control with target control id property set to the textbox .", "A way to force the AjaxControlToolKit CalendarExtender to use a time component is to append it using OnClientDateSelectionChanged and JavaScript .", "It s a long time ago and i cannot test it now but i m using the CalendarExtender s OnClientDateSelectionChanged event .", "But when I click on the image the calendar control is not poping up .", "Everything works fine except if one of the textboxes being cloned has a CalendarExtender attached for date picking .", "I m using the CalendarExtender to make the entry easy and all is working well with displaying or editing a record .", "The only way I found to solve this problem was to write some css rules for the calendarExtender .", "How do I update the CalendarExtender to have the new date that has one I selected in javascript", "Changing the value of the textbox that is the TargetControlId for the CalendarExtender affects the selected date if the following 2 conditions are met : .. . .. . 1 .", "Wrap your textbox and calendarExtender in a div with position : relative .. . .. . That fixed the problem i was facing i hope it does the trick for you too", "in VIEW1 when I click textBoxDOB it doesn t pop Ajax Calendar Extender but when I visit VIEW2 and click a TextBoxFromDate then it shows the Ajax Calendar Extender and now Ajax Calendar Extender also starts working in VIEW1 .", "Perhaps the child of an ajax control", "I work with Visual Studio 2015 and I need to use the CalendarExtender component from the toolbox but I can t because the only available component is Calendar .", "A solution if you want to call it that could be to manually assign SelectedDate using conversion from the textbox this requires you to set the format in the markup though : .. . .. . Where blah is the Text Control and blahCalendarExtender is the extender extending blah .. . .. . It seems that the calendarExtender control should be intelligent enough to do this on its own though .", "Your CalendarExtender has dd-MM-yyyy as format and you re parsing it as yyyy MM dd HH : mm : ss .", "i m sorry i did not notice CalendarExtender so i ve edited my answer", "I have a form that formerly used assembly version 1.0.10301.0 of the AjaxControlToolKit.Dll and when upgrading to newer versions such as 4.1.7.607 the CalendarExtender object stops working in that the calendar button no longer creates a drop down-esque selection object .", "On Page Load event I set current date and time to TextBox s value : .. . .. . Then CalendarExtender doesn t work correctly .", "The problem is that I cant set the asp.net calendarExtender display date when opened correctly when setting the date on the text box dynamically .", "Is this the code in calendar one client click", "From what I ve read as soon as you start augmenting the position attribute of a div tag-it affects the z-index of the rendering which only gets complicated when the calendar control is popping up dynamically .", "Yesterday it decided not to change the month in the textbox when a different date was chosen in the calendar control .", "Are there any calendar objects different from ajax toolkit calendar extender that can be used with asp.net that offer a None option", "I have AJAX calendar extender inside an updatepanel .", "How did you update your ajax control toolkit", "Run forest - run away from the ajax control toolkit .", "I have been working on a project and I got stuck with a problem i.e I am able to select first and last date using asp.net calendar control but i want it to be done with calendar extender .. . .. . the code shown as below is for calender control ..please provide me the solution for calendar extender with required modification............. .", "Here is my code : .. . .. . If I could figure out how to get the date-format of the CalendarExtender to MM DD YYYY instead of just M D YYYY that would fix it .", "Then I added this to my web.config : .. . .. . I added this to my master page : .. . .. . I have this on a webform page and a page using my master page template : .. . .. . The CalendarExtender doesn t do anything.. . why", "Assuming you re trying to only show dates from DateTime.Now onwards this may help you : Disable previous Dates in ajaxToolkit CalendarExtender http : stackoverflow.com q 820192 441574", "This does result in the calendar popup appearing vertically above the extender control instead of vertically below as normal .", "is there any reason why you chose to use this calendar control instead of the jquery datepicker plug-in", "I chose to use this calendar control because I m developing in ASP.Net and we have to limit what we use .", "When I click the calendar button to trigger the calendar popup the calendar displays normally .", "3-click on the textbox opening the calendar extender .", "the query does work if I use it in the query functionality of SSMS 2014 : .. . .. . This is my .aspx page code : .. . .. . asp : Label ID Label1 runat server Text Start Date asp : Label asp : TextBox ID StartDateTextBox runat server asp : TextBox cc1 : CalendarExtender ID CalendarExtender1 runat server TargetControlID StartDateTextBox Format dd MM yyyy Enabled True cc1 : CalendarExtender asp : Label ID Label2 runat server Text End Date asp : Label asp : TextBox ID EndDateTextBox runat server asp : TextBox cc1 : CalendarExtender ID CalendarExtender2 runat server TargetControlID EndDateTextBox Format dd MM yyyy Enabled True cc1 : CalendarExtender asp : Button ID showbtn runat server Text Button onclick showvisits asp : Label ID uniquevisits runat server Text asp : Label asp : Label ID failure runat server Text asp : Label .. . .. . And in code-behind : .. . .. . Do you know what s wrong with the above code", "Can the calendar control be customsised so that say you have a system of renting out a holiday home .", "I m using ASP.NET AJAX calendar extender inside my asp.net gridview .", "I have 2 Ajax Calendar Extender in separate VIEWS .", "While I am working with ajax calender it showing error like Error Creating Control - Calendarextender3Unknown server tag ajax : CalendarExtender .", "We already have the Ajax control toolkit in our project so I have to stick to that .", "and add a javascript function like this .. . .. . That should display the calendar when you click on the Textbox and the calendar will be hidden once you click anywhere else on the form", "Each control is appearing twice .", "Just click on the text box and add the calendar extender", "It is simple html control this is the reason why the calender control does not reconise this image control. .", "You will need to not make the control read only ." ] }
{ "confidence": [ 70.90647888183594, 67.17683410644531, 65.88877868652344, 64.74786376953125, 64.53431701660156, 64.08950805664062, 61.13213348388672, 61.016021728515625, 60.94223403930664, 60.856082916259766, 60.61697006225586, 58.79582595825195, 58.167057037353516, 57.36680603027344, 57.209312438964844, 57.20851135253906, 56.78888702392578, 55.94511413574219, 55.677371978759766, 55.47534942626953 ], "content": [ "Question : CalendarExtender fires on target click event . So if you need to open calendar extender when textbox get focus like with TAB key it wont work just by itself . .. . Answer : Remove PopupButtonID property from the CalendarExtender control Comment : LOL.It s certainly the easiest way . Who would say that papup control isnt required .", "Question : I have an user control in AJAX for the date calendar and I want to disable the future dates in the Calendar . I have tried to do it by using the Maximum Value property but that doesn t disables the control . Any suggestions or help Comment : If future date disable is required then following link can help aspsnippets.com Articles http : www.aspsnippets.com Articles Disable-Future-Dates-in-ASPNet-AJAX-Calendar-Extender-Control.aspx .. . Answer : I want to disable the future dates in the Asp.net ajax calendar extender .. . .. . By setting the EndDate property of calendar extender you can achieve this required functionality or by using css class . css class technique is given below in the second link .. . .. . For reference please check the following links In the second link it uses css class to disable future dates . Disable Future and Past Date http : www.c-sharpcorner.com UploadFile 0c1bb2 disable-future-and-past-date-of-ajax-calendar-in-Asp-Net-C-Sharp .. . .. . Disable Future Dates in ASP.Net AJAX http : www.aspsnippets.com Articles Disable-Future-Dates-in-ASPNet-AJAX-Calendar-Extender-Control.aspx Comment : Thanks Tanzeel But I am not using Asp.net calendar extender I am using Ajax CalendarExtender and EndDate Property is not present for this control . Also I already came across both the links you sent but they were not useful . Comment : @Nalini yes you are using ajax calendarextender from asp.net-ajax control toolkit . did you try this code ceDateEntry.EndDate . if this is not helpful please let me know which version of ajax controls you are using . Comment : Yes I don t have EndDate property for my Ajax calendarextender . I am using 1.0.10618.0 version", "Question : CalendarExtender fires on target click event . So if you need to open calendar extender when textbox get focus like with TAB key it wont work just by itself . .. . Answer : You can trigger the CalendarExtender on both Popup button click and Textbox focus . Try the following line of code to show the calendar on both Textbox and Image click . and add a javascript function like this .. . .. . That should display the calendar when you click on the Textbox and the calendar will be hidden once you click anywhere else on the form", "Question : null .. . Answer : I have a form that formerly used assembly version 1.0.10301.0 of the AjaxControlToolKit.Dll and when upgrading to newer versions such as 4.1.7.607 the CalendarExtender object stops working in that the calendar button no longer creates a drop down-esque selection object . Nothing has changed in my code only the Third Party dll as it jumped from 764KB to 6.5MB . The issue seems to be that if there is more than one image with the same ID I have three this issue occurs . Source : Calendar control is not popping-up when clicked on image http : stackoverflow.com questions 7467362 calendar-control-is-not-popping-up-when-clicked-on-image .. . .. . Because of the dynamic way in which the actual form is created it is impossible for me to hardcode several instances of CalendarExtender in the .ascx and call them in the .cs so as to prevent this issue eg I can only have this dateCal . Is there a way to resolve this issue that will still allow me to upgrade to the latest version of the Dll such as some sort of flag that allows for multiple instances of the same ID Code : .. . .. . Form Pre-DLL Upgrade : .. . Correct http : i.stack.imgur.com 748Q3.png .. . Form Post-DLL Upgrade : .. . enter image description here http : i.stack.imgur.com axbqy.png Comment : How did you update your ajax control toolkit From codeplex Nuget Comment : Could you post the code that is dynamically creating the controls Comment : @Adaam Codeplex Comment : @Garrison Neely The dynamic process is long and complex but the code that creates the control is control DateTb LoadControl Form Controls DateTb.ascx where control is System.Web.UI.Control object . I would like to point out this control creation has not changed at all only the .Dll", "Question : I have a CalendarExtender control on my page and sometimes have to change the date to the next occuring Sunday . I m currently using the OnClientDateSelectionChanged property of the control to call a function that will add some days to the date until its Sunday . The problem I m having is that if I select a Tuesday in my calendar the textbox will display the next Sunday but the selected date in the calendar is still Tuesday . How do I update the CalendarExtender to have the new date that has one I selected in javascript The textbox the CalendarExtendar is connected to shows the correct date.. . Comment : is there any reason why you chose to use this calendar control instead of the jquery datepicker plug-in Comment : I chose to use this calendar control because I m developing in ASP.Net and we have to limit what we use . We already have the Ajax control toolkit in our project so I have to stick to that . .. . Answer : Changing the value of the textbox that is the TargetControlId for the CalendarExtender affects the selected date if the following 2 conditions are met : .. . .. . 1 . An onchange event is fired on the textbox either by changing the text manually or by calling an explicit javascript fireEvent method . 2 . The format of the date entered in the textbox matches the same format used by the CalendarExtender control . That being said the correct way to handle this is to call the set selectedDate function of the CalendarExtender control . This one call not only sets the selected on the Calendar but also on the Targeted textbox at the same time . Here s the example code : Comment : Nice work . Hope you get that bounty . +1 Comment : well i tried that and didn t get it to work . I m gonna try putting the code in the comments.. . Here s what I have : function onDateSelected sender args var selectedDate sender.get selectedDate while selectedDate.getDay 0 selectedDate.setDate selectedDate.getDate + 1 alert selectedDate sender.setSelectedDate selectedDate alert finished I see the alert that shows me the date and its the right date but I never see the finished box because I get a javascript error before that . Comment : Here s the error I get : Object doesn t support this property or method Comment : well just found the mistake you had in there sender.setSelectedDate and it was sender.set selectedDate . Thanks for the help Comment : I m glad you got it to work . I can t believe I missed the underscore in the method name : -", "Question : I m working on a .NET web application and I m using a CalendarExtender control within it to have the user specify a date . For some reason when I click the icon to display the calendar the background seems to be transparent . I m using the extender on other pages and do not run into this issue . I m not sure if it is worth mentioning but the calendar is nested within a panel that has a rounded corner extender attached to it as well as the panel below it where the From is overlapping . Within that panel I do have a div layout setup to create two columns . EDIT : The other thing to note here is that the section that has the name and placeholders for nickname are all ASP.NET label controls if that matters . .. . Answer : So some more poking around and I figured out the issue . Part of the problem arises from the fact that the div layout I setup to create two separate columns is using the position : relative and float : right left attributes . From what I ve read as soon as you start augmenting the position attribute of a div tag-it affects the z-index of the rendering which only gets complicated when the calendar control is popping up dynamically . Unfortunately there is no Z-Index attribute to the CalendarExtender unless you want to write an entire style for the calendar which I don t want to do . However you can extend the default style by adding the following to your CSS file : .. . .. . If you aren t using a CSS file you can also add this into the head section of your page : .. . .. . and that should do the trick . It worked for me . If for some reason this doesn t work and some people were still reporting problems a little more aggressive approach was to wrap the input fields and CalendarExtender in a DIV tag and then add the following to your CSS file HEAD section : .. . .. . ...and hopefully that will work for you . Comment : For me .ajax calendar container z-index : 1000 didn t work . But .ajax calendar z-index : 5000 did work Thanks .", "Question : I m trying to have a textbox function exactly like the third textbox down on this page : http : www.asp.net AJAX AjaxControlToolkit Samples MaskedEdit MaskedEdit.aspx . I m trying to use a CalendarExtender control with a MaskedEditExtender because I don t want the user to be able to enter anything except a valid date into the box . On my maskededitextender I have a mask of 99 99 9999 but it seems to only work when the date is actually 8 digits e.g . 12 12 2000 and not when the date is 7 or 6 digits e.g . 1 1 2000 or 1 14 2000 . The mask screws up when the date is less than 8 digits . Here is my code : .. . .. . If I could figure out how to get the date-format of the CalendarExtender to MM DD YYYY instead of just M D YYYY that would fix it . .. . Answer : There is a Format property of Calendar Control http : www.asp.net ajax ajaxcontroltoolkit Samples Calendar Calendar.aspx . Use that to set to Comment : hi what about on dd.MMM.yyyy format . what mask for maskededitextender . Comment : @Rob try Mask 99.LLL.9999 asp.net ajaxLibrary AjaxControlToolkitSampleSite MaskedEdit http : www.asp.net ajaxLibrary AjaxControlToolkitSampleSite MaskedEdit MaskedEdit.aspx Comment : What about ddMMyy I can paste it in but it gets changed to MM dd yyyy . Still works but I d rather it didn t change .", "Question : I m trying to use Ajax Toolkit in ASP.NET page to display a Calendar Extender with this code but it s not working for me . It s not displaying the calendar . What s the problem .. . Answer : Have you added a Register directive to your page for the CalendarExtender Or added it in web.config like Steve suggested .. . .. . Have you added an assembly reference to the AjaxControlToolkit dll Comment : I putted those lines but in the design tab I have this error message : Unable to display this control because its TagPrefix is not registered in this form .", "Question : How to disable previous dates while using in ajaxToolkit CalendarExtender .. . Answer : Just add an attribute StartDate DateTime.Now in you ajaxtoolkit calendarextender control", "Question : please help. . how to modify calendar extender display in ajax calendar extender to show only month and year i mean the calendar view NOT the textbox text format so i only select month name in specific year . .. . Answer : You can simply change the display mode of the CalendarExtender to month . Step 1 . Add an OnClientShown event to the CalendarExtender ie . Step 2 . Handle the OnClientShown event to switch mode of calendar ie .", "Question : I m working on a .NET web application and I m using a CalendarExtender control within it to have the user specify a date . For some reason when I click the icon to display the calendar the background seems to be transparent . I m using the extender on other pages and do not run into this issue . I m not sure if it is worth mentioning but the calendar is nested within a panel that has a rounded corner extender attached to it as well as the panel below it where the From is overlapping . Within that panel I do have a div layout setup to create two columns . EDIT : The other thing to note here is that the section that has the name and placeholders for nickname are all ASP.NET label controls if that matters . .. . Answer : The only way I found to solve this problem was to write some css rules for the calendarExtender . It worked for me . The code is below : .. . .. . https : gist.github.com carlosmr12 5825371", "Question : CalendarExtender fires on target click event . So if you need to open calendar extender when textbox get focus like with TAB key it wont work just by itself . .. . Answer : You need to add methods that will trigger click events when texbox get focus or lost .", "Question : I m working on a .NET web application and I m using a CalendarExtender control within it to have the user specify a date . For some reason when I click the icon to display the calendar the background seems to be transparent . I m using the extender on other pages and do not run into this issue . I m not sure if it is worth mentioning but the calendar is nested within a panel that has a rounded corner extender attached to it as well as the panel below it where the From is overlapping . Within that panel I do have a div layout setup to create two columns . EDIT : The other thing to note here is that the section that has the name and placeholders for nickname are all ASP.NET label controls if that matters . .. . Answer : I had a similar issue which I fixed with z-index on fieldsets .. . .. . If you have .. . .. . then the ajax popup pops up underneath the second fieldset to fix set the z-index on the first fieldset to be higher than the one on the second ie as below .", "Question : I thought something like this .. . .. . But it doesnt work . I can make something similar with JavaScript and alert message : .. . .. . how to disable previous dates in CalendarExtender control through its render event http : stackoverflow.com questions 5608062 how-to-disable-previous-dates-in-calendarextender-control-through-its-render-eve .. . .. . but it s not the same . .. . Answer : Assuming you re trying to only show dates from DateTime.Now onwards this may help you : Disable previous Dates in ajaxToolkit CalendarExtender http : stackoverflow.com q 820192 441574", "Question : How to disable previous dates while using in ajaxToolkit CalendarExtender .. . Answer : Using the Ajax toolkit Calendar Extender in the html markup : .. . .. . Above you will see that the Calendar only allows one to choose between today or tomorrow by setting .. . .. . StartDate DateTime.Now .. . .. . and .. . .. . EndDate DateTime.Now.AddDays 1 .. . .. . This can also be done in the backend using CalendarExtender1.StartDate DateTime.Now or CalendarExtender1.EndDate DateTime.Now.AddDays 1", "Question : I m using a CalendarExtender control with the help of img to populate a TextBox with a date . I am using this in EditItemTemplate of GridView . But when I click on the image the calendar control is not poping up . I have used this CalendarExtender control in four or five other places in this project also . Everywhere else it is working fine . I have compared the code from the well working version to this code . No difference at all . I have written the code like below : .. . .. . Can anybody please tell where could be the problem Comment : how many row do you have in grid also probably you have more than one image with such id Comment : You are right Samich . Thank you very much . One more doubt - Now the calendar is coming so ugly i.e . with awkward horizontal rules inside the calendar . How can I format the calendar to make it look neat Comment : Forget about it : It s good that you solve your problem Comment : Hi Samich I am getting the calendar but with the awkward horizontal lines . How can I format the calendar to make it look neat PLEASE HELP ME ON THIS . Comment : @Samich You should re enter your comment as an answer so it could be accepted . .. . Answer : The image tag which you have used is not a server control . It is simple html control this is the reason why the calender control does not reconise this image control. . Try using asp.net image button over here instead of . It should work then . cheers... . .. . .. . Rahul C .", "Question : I am using the ajax calendarextender on an ASP.NET WebForms application . Selecting the textbox linked with the calendarextender works fine in IE and Firefox but in chrome there is a very long delay before the calendar displays . Does anyone know what is causing this more information .. . .. . The issue occurs when the page is navigated to from the server-side tried both server.transfer and response.redirect but not when the page is navigated to directly from the menu . Again everything works with IE FF but not with chrome . Comment : Is the same behavior reproduced on this page : asp.net ajaxLibrary AjaxControlToolkitSampleSite Calendar http : www.asp.net ajaxLibrary AjaxControlToolkitSampleSite Calendar Calendar.aspx Comment : I too have just noticed this issue today in the latest version of google-chrome 26.0 . Is your color-picker in a tabcontrol I also only notice this in production hosted on IIS 7.5 .. . Answer : I too noticed this issue today in the most recent version of google-chrome 26.0 . I had searched the Chrome known issues for similar problems but nothing came up pretty much your question is what I found.. . I had also noticed that on the demo site the colorpickerextender example works fine in chrome 26.0 but not on mine . I ended up resolving this issue though in both production development environments . My issue was that I had the colorpicker control within a tabcontrol which that tabcontainer had AutoPostBack true . Setting the autopostback to false on the tabcontainer was what I had to do to resolve this issue although it required me to change my logic a bit and pre load the tabs . Any chance your control is a child of a control with AutoPostBack true Perhaps the child of an ajax control EDIT : I also navigate to the page containing the colorpicker via server-side .", "Question : I m using a CalendarExtender control with the help of img to populate a TextBox with a date . I am using this in EditItemTemplate of GridView . But when I click on the image the calendar control is not poping up . I have used this CalendarExtender control in four or five other places in this project also . Everywhere else it is working fine . I have compared the code from the well working version to this code . No difference at all . I have written the code like below : .. . .. . Can anybody please tell where could be the problem Comment : how many row do you have in grid also probably you have more than one image with such id Comment : You are right Samich . Thank you very much . One more doubt - Now the calendar is coming so ugly i.e . with awkward horizontal rules inside the calendar . How can I format the calendar to make it look neat Comment : Forget about it : It s good that you solve your problem Comment : Hi Samich I am getting the calendar but with the awkward horizontal lines . How can I format the calendar to make it look neat PLEASE HELP ME ON THIS . Comment : @Samich You should re enter your comment as an answer so it could be accepted . .. . Answer : how many row do you have in grid also probably you have more than one image with such id Comment : This does not provide an answer to the question . To critique or request clarification from an author leave a comment below their post . Comment : Actually it was the answer . If you check the comments under question you can find that the problem was exactly with multiple control with the same Id . I ve just reposted comment as an answer to allow to accept the answer on the question for OP .", "Question : I am adding a CalendarExtender to a page using the default styles . When I click the calendar button to trigger the calendar popup the calendar displays normally . However when I scroll down and click the button again the calendar s position is not where it should be as seen below . alt text http : ktrauberman.wordpress.com files 2009 06 calendarproblem.gif .. . .. . Why is this occuring and how do I fix it EDIT : A bit about the implementation of this page . The CalendarExtender and TextBox are part of a WebPart added to a SharePoint 2007 Page . I am creating the extender like so : .. . Answer : Since this is an old post I found trying to solve this situation for myself unsuccessful following previous answers I thought my solution to the same issue might be relevant to others . We where using an outdated version : 3.0.xxx .. . We had to upgrade to latest version : 4.1.xxx .. . .. . Above versions is the AjaxControlToolkit dll version - not the version you see on NuGet today the NuGet package Ajax Control Toolkit will be something like 7.xxx . FYI - My research : I ve been using the samples of latest AjaxControlToolkit version to verify if my bug was solved if I upgraded since I knew exactly how to reproduce my position-issue . At least one of the two sites below should work : .. . .. . http : www.asp.net ajaxlibrary ajaxcontroltoolkitsamplesite official - slower .. . http : www.ajaxcontroltoolkit.com independent - faster", "Question : I am using VS2008 with Ajax control toolkit v3.5 and i have used calendar extender tool in a textbox and When i click the textbox the calendar pops up and i shouldn t allow users to click previous or future dates from it.Only today date should be enabled and highlighted and all other dates should be disabled . I have gone through some suggestions but i couldn t get the exact result . So anyone who might be able to help my situation will be greatly appreciated . .. . Answer : To disable a past date use the following code in the Page load : .. . .. . add Header .. . .. . Markup : .. . .. . To disable a future date use the following code in the Page load : Comment : Even though the post title says CalendarExtender v3.5 I was using a v3.5.40412.0 version of Ajax ControlToolkit.dll and these properties did not exist . So I downloaded the latest version currently 15.1.4 from DevExpress on CodePlex and then I had the properties available and it worked great Latest version is here : ajaxcontroltoolkit.codeplex.com https : ajaxcontroltoolkit.codeplex.com" ] }
[ "yes-answer-long", "yes-answer-short" ]
user
UNK_RELATION
hardware-port@cpu@51
hardware-port -- low-level i o ports accessed via @placeholder instructions .
{ "confidence": [ 45.05208969116211, 43.98881912231445, 40.052955627441406, 39.867950439453125, 33.84663772583008, 32.699222564697266, 32.29551315307617, 30.73141860961914, 30.453662872314453, 29.07282257080078, 28.91967010498047, 28.659751892089844, 27.047027587890625, 26.35100555419922, 26.26580238342285, 26.243366241455078, 26.17172622680664, 26.14044952392578, 25.816974639892578, 25.49480628967285, 25.173397064208984, 25.05612564086914, 24.67013931274414, 24.469791412353516, 24.221254348754883, 23.573938369750977, 23.54445457458496, 23.17949676513672, 23.044349670410156, 23.00479507446289, 22.964767456054688, 22.850955963134766, 22.715559005737305, 22.715559005737305, 22.63610076904297, 22.50940704345703, 22.487730026245117, 22.385318756103516, 22.22809600830078, 21.76795768737793, 21.571565628051758, 21.551464080810547, 21.551464080810547, 21.521860122680664, 21.48588752746582, 21.346736907958984, 21.19304656982422, 21.19304656982422, 21.19304656982422, 21.19304656982422, 21.19304656982422, 21.19304656982422, 21.162303924560547, 21.018136978149414, 20.942657470703125, 20.865497589111328, 20.6280460357666, 20.531953811645508, 20.487043380737305, 20.434886932373047, 20.322248458862305, 20.074806213378906, 19.91806411743164, 19.701778411865234, 19.671035766601562, 19.357501983642578, 19.20913314819336, 18.846580505371094, 18.744625091552734, 18.68160629272461, 18.567646026611328, 18.13426971435547, 18.13426971435547, 17.899147033691406, 17.899147033691406, 17.88370704650879, 17.865798950195312, 17.865798950195312, 17.865798950195312, 17.629579544067383, 17.50345802307129, 17.50345802307129, 17.50345802307129, 17.4018611907959, 17.267757415771484, 16.98916244506836, 16.796207427978516, 16.648008346557617, 16.63946533203125, 16.550941467285156, 16.538238525390625, 16.538238525390625, 16.49874496459961, 16.466196060180664, 16.372800827026367, 16.317190170288086, 16.255672454833984, 16.255672454833984, 16.24736976623535, 16.24736976623535 ], "content": [ "The default protection level for I O ports in Windows prevents a user-mode program from using inp and out instructions on any port .", "Assembler I O instructions are hardware processor specific .", "low-level i o functions .", "This is I O port access and I O ports are not the same as memory .", "Yes the out port and in port instructions can be encoded for 8 bits of data or 16 bits of data .", "OUT http : pdos.csail.mit.edu 6.828 2011 readings i386 OUT.htm and IN http : pdos.csail.mit.edu 6.828 2011 readings i386 IN.htm are instructions for transferring data between I O ports .", "I think that Java can t access low-level I O address natively .", "x86 processors have a separate concept of I O ports but this might not be one", "Possible duplicate of What are IN OUT instructions in x86 used for", "It s like there s 2 address spaces - one for normal physical addresses and a completely separate one for IO ports where normal instructions indirectly access normal physical memory and the IO port instructions IN OUT INSB W D OUTSB W D access the separate IO address space .", "This application writes and reads some I O port addresses .", "http : stackoverflow.com questions 3215878 what-are-in-out-instructions-in-x86-used-for", "Memory-mapped I O is the other and most common method nowadays where no special instructions are needed as everything lives in the same address space .", "There are several freely available drivers around that change that protection level so that ring 3 code can access the ports .", "Here s the problem : I need to program some hardware via 2 pins of the PIO 1 clock 1 data .", "As you mentioned the b is the byte form of those instructions which is appropriate since you re using the lower byte of ax al .", "The keyboard.S has something like .. . .. . and .. . .. . I think the pending b means byte but i still cannot find what these instructions mean .", "GPIO1X index 0x10 is used to set if the 8 GPIO ports that are connected to GPIO1x are output ports or input ports .", "However to use these commands I need the correct I O ports for the device .", "I am not sure if this is entirely related but see this http : stackoverflow.com questions 8925489 pc-hardware-port-access-from-java-on-linux link", "The code is then an unambiguous statement that I O is being performed regardless of whether the architecture uses I O ports or memory-mapped I O .", "My intention is to get better understanding of the hardware so I want to access it at the lowest level by means of method as simple as it could be .", "0x378 is an output port not an input port .", "The 8086 inherited these instructions from its predecessors 8080 and 8085 where a separate I O space was very useful in order not to waste any of the 64k memory-address space .", "This is a totally different type of I O .", "Output values for GPIOs are set using the index 0x11 and if the ports work as input ports then index 0x12 is used for reading input values .", "Is there a way to find which device maps to which I O port in Linux", "outb writes the byte specified by its second argument to the I O port specified by its first argument .", "I am trying to understand the following code : .. . .. . The output is 0xff 255 in decimal whether I write on Port 1 or Port 0 using outb .", "@karan - Some ports are just for output like one connected to a printer .", "very little difference other than x86 that control signal was tied to special instructions .", "The result-of doing inb 0x378 is hardware-dependent .", "What is the Java-on-Linux equivalent to the C byte-sized PC-architecture hardware-port input output functions", "That seems like a monumentally different question to PC hardware-port access from Java on Linux .", "Port 0x61 is a keyboard control register .", "@mat its a parallel port i haven t attached anything", "Intel cores have an I O bus distinct from the memory bus .", "When I have the correct I O ports I can find the information I am looking for very easily however I do not know a way to find the base address of a device s I O ports in Linux .", "They are ubicated in debian 6 in a port represented with an integer in the positions o 1 and 2 .", "Is there an established way to do this sort of thing or should I simply get the hardware guys to add a PIC or somesuch .", "But am puzzled in what functions Win32 or .NET provide that allow me permission to access direct memory mapped ports .", "I was reading LLD it tells to use inb outb function to access the i o port .", "i think inb uses i o address space to read port instead of using memory mapped space .", "You could also accomplish it via sun.misc.Unsafe possibly but I didn t advice that .", "A CPU-to-peripheral communication method and it is used when the processor uses a different address bus to talk to devices and memory thus needing special instructions .", "The data is trasmitted and received at the clock edges synchronous Reading the code I cannot see clearly which of them clock or data is being accessed and when .", "What s supposed to be behind that port and is it supposed to return anything else than 0xFF", "In any case it is not the port to read bytes from a potentially connected device .", "@BoPersson : its status but then again that is at a different read-only port IIRC .", "first see how the port can behave as input or output or both . .", "Instead of writing directly to the SMBus port I d rather use the i2c libraries .", "I2C and SMBUS use two Port Pins one for the clock and one for the data .", "if inb does not read byte on the port then for what it is used....please explain as i am a newbie...... .", "I know it s possible to access parallel port from user space .", "The I O operations are unique to x86 .", "I have some Linux code that monitors our hardware by collecting temperatures voltages and fan speeds from the motherboard using inb outb inl etc .", "All this of course whilst I maintain very high level services CAN bus TCP IP .", "At least the status of the port is not the same as it was before the module loaded .", "I understand how to get the address of the I O port that I am looking for when I have the signature of the PCI device .", "It seems that the clearup function of parport pc did something that made the hardware unusable .", "Easy user-mode I O is available in 2.6 kernels fairly readily -- there are features in 2.4 kernels but they may require more work .", "My challenge is to port that code over to run under Windows as a simple console app .", "Most hardware locations are mapped in areas not accesible from userspace so you are going to need a device-driver that provides the desired API .", "Why do you need a kernel module to access the parallel port", "My question is why and what should I do to recover the port instead of reload parport pc", "Now what is port-mapped IO", "Other processor families use what is called memory mapped I O .", "On my Linux machine Debian Wheezy I tried to access the parallel port by request region but it failed because the system had already loaded the kernel module parport .. .", "In this context a port is a means for the CPU to communication with another chip .", "the out and in instruction and a few family members change whether you are doing an I O access or memory access and traditinally the interrupt controller was a chip that decoded the memory bus looking for I O access with the address allocated for that device .", "the code below initialize the Programmable Interrupt Controller .. . .. . can someone explain to me how it works : .. . .. . -the role of outb i didn t understand the linux man .. . .. . -the addresses and their meaning .. . .. . another unrelated question i read that outb and inb are for port-mapped I O can we use memory-mapped I o for doing Input output communication", "In AVR i use to access the Port like this .", "In AVR i use to access the Port like this .", "You can use C to write a small program that will read and write directly from to the pins on the parallel port by way of the outb and inb functions .", "Usually by default address 0x378 is the address of the parallel port LPT0 in memory so you it s just a matter of using inb and outp to read-write to this address .", "sorry i don t get it does this mean that x86 use port mapped rather than memory mapped access", "You can run C on Linux obviously so that proves not all Linux I O is file oriented .", "The control signal separating the accesses into I O and Memory creating two separate address spaces .", "the I O address range 0x60-0x6F is used for the keyboard in IBM PC compatible computers .", "It is not enough to simply unload the parport module as it leaves the ports in an inconsistent state .", "Still I O what I need because it s been a huge waste of time trying to make sounds any other way .", "Yes I am trying to explain what I O mapped vs memory mapped means it traditionally for x86 means a single control line .", "There is an IOPM I O protection map I think per VM in this case even a simple app on a linux machine you have a separate IOPM .", "For hardware which is controlled by memory mapped IO which the PIC is not you can of course do memory mapped IO .", "Java is a object-oriented high-level language compiling to a virtual-machine architecture .", "You could of course not use define for your port and use this construction literally everywhere you need to access the port .", "To answer your question : .. . .. . outb is a function wrapper to an assembly instruction with the same name used to talk to port-mapped devices e.g .", "If this is not an issue then it is fine to access your port directly .", "For example the 8259A Programmable Interrupt Controller datasheet http : pdos.csail.mit.edu 6.828 2005 readings hardware 8259A.pdf clearly but concisely explains almost everything .", "Are you accessing hardware from a userspace program or from a kernel module", "I cannot understand why it is 255 when I am writing 0 to it .", "I would like to use it that way : .. . .. . But I get : .. . .. . Is it even possible", "Why can I not write data out though I have got the I O region", "Am I right", "sorry I forgot to accept the answer.. .", "I have tried to translate this to Linux compatible functions inb and outb and this is what I got .", "When i do proc ioports i see keyboard port as 0x60-0x64 and 0x60 is for accepting commands .", "This is printing me a white box.If I try listening to port 0x64 I get some different character .", "I don t want to code a system driver either .", "I am reading some code of Linux ." ] }
{ "confidence": [ 57.758628845214844, 46.699607849121094, 46.327476501464844, 45.359920501708984, 44.7305908203125, 41.44603729248047, 41.41605758666992, 39.32622528076172, 36.52147674560547, 34.483558654785156, 34.08034896850586, 33.19988250732422, 33.152217864990234, 33.08272171020508, 29.152217864990234, 28.851787567138672, 28.842243194580078, 28.772207260131836, 28.663780212402344, 27.899085998535156 ], "content": [ "Question : I have some Linux code that monitors our hardware by collecting temperatures voltages and fan speeds from the motherboard using inb outb inl etc . low-level i o functions . My challenge is to port that code over to run under Windows as a simple console app . But am puzzled in what functions Win32 or .NET provide that allow me permission to access direct memory mapped ports . I don t want to code a system driver either . My Windows tool preference is VS2008 . fyi .. . .. . Is this possible .. . Answer : The default protection level for I O ports in Windows prevents a user-mode program from using inp and out instructions on any port . Your program will die with a GPF . There are several freely available drivers around that change that protection level so that ring 3 code can access the ports . Which is okay if you re interested in killer pokes . The canonical one is inpout32 http : logix4u.net Legacy Ports Parallel Port Inpout32.dll for Windows 98 2000 NT XP.html .", "Question : I ve a C application . This application writes and reads some I O port addresses . I think that Java can t access low-level I O address natively . Am I right Here is an example of C++ app : .. . .. . How can I do the same in Java Comment : Write some JNI to do it for you Comment : I am not sure if this is entirely related but see this http : stackoverflow.com questions 8925489 pc-hardware-port-access-from-java-on-linux link Comment : You could also accomplish it via sun.misc.Unsafe possibly but I didn t advice that . Comment : People talking about unsafe are I believe correct although it is called unsafe for a reason and is undocumented by design . What are you trying to achieve There is usually a better way to achieve things that going through the dark arts Comment : This is not memory access . This is I O port access and I O ports are not the same as memory . You can t access them even with sun.misc.Unsafe and I didn t know you could access them outside the kernel at all . You will need to use JNI or find a pre-existing library that uses JNI . Edit : This depends on the architecture . x86 processors have a separate concept of I O ports but this might not be one .. . Answer : I think sun.misc.Unsafe might help you for this . It has methods like void putAddress long address long value that may suit your need . To be honest I haven t worked on this but you could know more about it from .. . .. . http : mydailyjava.blogspot.co.uk 2013 12 sunmiscunsafe.html .. . .. . http : mishadoff.github.io blog java-magic-part-4-sun-dot-misc-dot-unsafe .. . .. . http : highlyscalable.wordpress.com 2012 02 02 direct-memory-access-in-java .. . .. . A small sample program could be found on .. . .. . http : robaustin.wikidot.com how-to-write-to-direct-memory-locations-in-java Comment : This is a totally different type of I O . It s not memory access that Unsafe would be able to do .", "Question : I have some Linux code that monitors our hardware by collecting temperatures voltages and fan speeds from the motherboard using inb outb inl etc . low-level i o functions . My challenge is to port that code over to run under Windows as a simple console app . But am puzzled in what functions Win32 or .NET provide that allow me permission to access direct memory mapped ports . I don t want to code a system driver either . My Windows tool preference is VS2008 . fyi .. . .. . Is this possible .. . Answer : Most hardware locations are mapped in areas not accesible from userspace so you are going to need a device-driver that provides the desired API . You can also check the UNIX Application Migration Guide http : msdn.microsoft.com en-us library ms811897 ad MSDN .", "Question : I am reading some code of Linux . The keyboard.S has something like .. . .. . and .. . .. . I think the pending b means byte but i still cannot find what these instructions mean . Comment : Intel cores have an I O bus distinct from the memory bus . Port 0x61 is a keyboard control register . tek-tips.com viewthread.cfm qid 258828 http : www.tek-tips.com viewthread.cfm qid 258828 Comment : Possible duplicate of What are IN OUT instructions in x86 used for http : stackoverflow.com questions 3215878 what-are-in-out-instructions-in-x86-used-for .. . Answer : OUT http : pdos.csail.mit.edu 6.828 2011 readings i386 OUT.htm and IN http : pdos.csail.mit.edu 6.828 2011 readings i386 IN.htm are instructions for transferring data between I O ports . Those are a couple of links I found which provide a bit more information . As you mentioned the b is the byte form of those instructions which is appropriate since you re using the lower byte of ax al . Comment : sorry I forgot to accept the answer.. .", "Question : I have some Linux code that monitors our hardware by collecting temperatures voltages and fan speeds from the motherboard using inb outb inl etc . low-level i o functions . My challenge is to port that code over to run under Windows as a simple console app . But am puzzled in what functions Win32 or .NET provide that allow me permission to access direct memory mapped ports . I don t want to code a system driver either . My Windows tool preference is VS2008 . fyi .. . .. . Is this possible .. . Answer : Well after much searching with some trial and error the two most useful bits I found to be helpful are : .. . .. . WinRing0 http : sourceforge.net projects winring0 and IO.DLL http : www.geekhideout.com iodll.shtml . They pretty much do the same thing the difference is the samples of code you will find to help you get started using them . Hope this helps for others .", "Question : I am reading some code of Linux . The keyboard.S has something like .. . .. . and .. . .. . I think the pending b means byte but i still cannot find what these instructions mean . Comment : Intel cores have an I O bus distinct from the memory bus . Port 0x61 is a keyboard control register . tek-tips.com viewthread.cfm qid 258828 http : www.tek-tips.com viewthread.cfm qid 258828 Comment : Possible duplicate of What are IN OUT instructions in x86 used for http : stackoverflow.com questions 3215878 what-are-in-out-instructions-in-x86-used-for .. . Answer : Yes the out port and in port instructions can be encoded for 8 bits of data or 16 bits of data . The b indicates byte which is the 8 bit version .", "Question : i m having hard time trying to understand how interrupts work . the code below initialize the Programmable Interrupt Controller .. . .. . can someone explain to me how it works : .. . .. . -the role of outb i didn t understand the linux man .. . .. . -the addresses and their meaning .. . .. . another unrelated question i read that outb and inb are for port-mapped I O can we use memory-mapped I o for doing Input output communication thanks . Comment : For hardware which is controlled by memory mapped IO which the PIC is not you can of course do memory mapped IO . Comment : The 8086 inherited these instructions from its predecessors 8080 and 8085 where a separate I O space was very useful in order not to waste any of the 64k memory-address space . .. . Answer : Device specific code is best read in conjunction with the corresponding datasheet . For example the 8259A Programmable Interrupt Controller datasheet http : pdos.csail.mit.edu 6.828 2005 readings hardware 8259A.pdf clearly but concisely explains almost everything . However this datasheet will only explain how the chip can be used in any system and won t explain how the chip is used in a specific system e.g . in PC compatible 80x86 systems . For that you need to rely on implied de facto standards as a lot of the features of the PIC chips aren t used on PC compatible 80x86 systems and may not be supported on modern integrated chipsets . Normally for historical reasons the PIC chip s IRQs are mapped to interrupts in a strange bad way . For example IRQ 0 is mapped to interrupt 8 and conflicts with the CPU s double fault exception . The specific code you ve posted remaps the PIC chips so that IRQ0 is mapped to interrupt 0x20 and IRQ1 to interrupt 0x21 .. . IRQ 15 mapped to IRQ 0x2F . It s something an OS typically does to avoid the conflicts e.g . so that each interrupt is used for an IRQ or an exception and never both . To understand outb look at the OUT instruction in Intel s manuals . It s like there s 2 address spaces - one for normal physical addresses and a completely separate one for IO ports where normal instructions indirectly access normal physical memory and the IO port instructions IN OUT INSB W D OUTSB W D access the separate IO address space .", "Question : What is the Java-on-Linux equivalent to the C byte-sized PC-architecture hardware-port input output functions For output there is outb as in this : .. . .. . For input there is inb as in this : .. . .. . Purpose : I want to implement something that imposes less overhead than this : .. . .. . as an alternative to sending code 7 the bell char to the standard output because that seems to have been aggressively disabled in Ubuntu . Toolkit s beep is also mute . Comment : In Linux everything is file . Comment : You can run C on Linux obviously so that proves not all Linux I O is file oriented . Comment : No Kangkan is suggesting you to open some device file like e.g . dev tty0 or dev lp0 . See also stackoverflow.com a 8923009 841108 http : stackoverflow.com a 8923009 841108 and easysw.com mike serial http : www.easysw.com mike serial Comment : If you need that exact functionality use jni - write a small C function build it into a shared library load it and call into it . .. . Answer : I think you re barking up the wrong train . Java is a object-oriented high-level language compiling to a virtual-machine architecture . Assembler I O instructions are hardware processor specific . There is no direct equivalence between the two . The best you could hope for is to interface your Java code using pipes shared-memory sockets etc with a native Linux app which performs the required I O . Comment : Update : my purpose has been described . Comment : So your actual question is : How do I create a system beep from Java That seems like a monumentally different question to PC hardware-port access from Java on Linux . Comment : Still I O what I need because it s been a huge waste of time trying to make sounds any other way . And I ve tried many . The example code is not assembler : it s processor agnostic code . Comment : Anything that involves inb outb it NOT processor agnostic . The I O operations are unique to x86 . Comment : There are C compilers that are not x86 so there must be inb and outb that are non x86 .", "Question : Can someone please explain the meaning of .. . .. . I tried figuring out by googling it but for no use . Comment : What did you google for A simple search for outb gave me lots of good hits . Comment : outb 0x10 short base+2 Comment : Thank you for your answers : .. . Answer : To answer your question : .. . .. . outb is a function wrapper to an assembly instruction with the same name used to talk to port-mapped devices e.g . the I O address range 0x60-0x6F is used for the keyboard in IBM PC compatible computers . Now what is port-mapped IO A CPU-to-peripheral communication method and it is used when the processor uses a different address bus to talk to devices and memory thus needing special instructions . Memory-mapped I O is the other and most common method nowadays where no special instructions are needed as everything lives in the same address space .", "Question : i m having hard time trying to understand how interrupts work . the code below initialize the Programmable Interrupt Controller .. . .. . can someone explain to me how it works : .. . .. . -the role of outb i didn t understand the linux man .. . .. . -the addresses and their meaning .. . .. . another unrelated question i read that outb and inb are for port-mapped I O can we use memory-mapped I o for doing Input output communication thanks . Comment : For hardware which is controlled by memory mapped IO which the PIC is not you can of course do memory mapped IO . Comment : The 8086 inherited these instructions from its predecessors 8080 and 8085 where a separate I O space was very useful in order not to waste any of the 64k memory-address space . .. . Answer : outb writes the byte specified by its second argument to the I O port specified by its first argument . In this context a port is a means for the CPU to communication with another chip . The specific C code that you present relates to the 8259A Programmable Interrupt Controller PIC . You can read about the PIC here http : www.brokenthorn.com Resources OSDevPic.html and here http : www.acm.uiuc.edu sigops roll your own i386 irq.html . If that doesn t provide enough details to understand the commands and the bit masks you could always refer to the chip s datasheet http : www6.in.tum.de pub Main TeachingWs2009Echtzeitsysteme intel-8259.pdf .", "Question : I am trying to communicate with a disk drive using inb inw outb and outw commands so I can find specific information about the drive . However to use these commands I need the correct I O ports for the device . When I have the correct I O ports I can find the information I am looking for very easily however I do not know a way to find the base address of a device s I O ports in Linux . In DOS I am able to use Hdat2 to find the device s base address however I am trying to find the address in Linux . Is there a way to find which device maps to which I O port in Linux There is a file in proc called ioports that contains some information but I don t how to associate this information with specific devices . Any help would be greatly appreciated . Thanks .. . Answer : Are you accessing hardware from a userspace program or from a kernel module If you re doing it from userspace the reason it s hard to find physical address information is that nobody accesses hardware that way anything that needs to touch raw hardware lives in the kernel . If you re writing a kernel module you get address information from in-kernel structures not by accessing sys .. . Comment : Thanks Eric I am doing this from user space . I hate the way I am having to communicate with the drive but that is the only way that the hardware vendor allows users to find the information I am looking for .", "Question : I have an atom board with a Fintek F75111 GPIO . I have info from the manufacturer that the SMbus address to access the chip is 06EH . I am trying to read and write values to the GPIO in Linux . I have a sample program from manufacturer written for Windows that looks like this . I have tried to translate this to Linux compatible functions inb and outb and this is what I got . GPIO1X index 0x10 is used to set if the 8 GPIO ports that are connected to GPIO1x are output ports or input ports . Output values for GPIOs are set using the index 0x11 and if the ports work as input ports then index 0x12 is used for reading input values . The problem is that I do not know if this is correct or how to read the values why the read function outputs something before reading When I run : .. . .. . Changing X with values from 1..9 I get this as output : 0 8 8 0 0 0 0 0 0 .. . .. . The number 8 confuses me.. . Comment : Did you eventually get this working I am working on a similar project using the Aaeon Gene-CVO5 board . Unfortunately their Linux support is not so strong . The board uses an Intel 82801G as the i2c master . Using lm-sensors sensors-detect programme I cannot see the F75111 listed . .. . Answer : Instead of writing directly to the SMBus port I d rather use the i2c libraries . I2C and SMBUS use two Port Pins one for the clock and one for the data . The data is trasmitted and received at the clock edges synchronous Reading the code I cannot see clearly which of them clock or data is being accessed and when . To get started I d use i2ctools as a start point check this site : http : elinux.org Interfacing with I2C Devices . This tool helps you to find devices connected to the I2C bus to your microprocessor and also perform basic commmunication . Hope it helps.. .", "Question : I am trying to understand the following code : .. . .. . The output is 0xff 255 in decimal whether I write on Port 1 or Port 0 using outb . I cannot understand why it is 255 when I am writing 0 to it . Comment : What s supposed to be behind that port and is it supposed to return anything else than 0xFF Comment : @mat its a parallel port i haven t attached anything Comment : 0x378 is an output port not an input port . .. . Answer : The result-of doing inb 0x378 is hardware-dependent . Some chips return the value you have written previously with outb and some other chips just return garbage . In any case it is not the port to read bytes from a potentially connected device . Comment : if inb does not read byte on the port then for what it is used....please explain as i am a newbie...... . Comment : @karan - Some ports are just for output like one connected to a printer . What would you be reading from the printer Comment : @BoPersson : its status but then again that is at a different read-only port IIRC .", "Question : i m having hard time trying to understand how interrupts work . the code below initialize the Programmable Interrupt Controller .. . .. . can someone explain to me how it works : .. . .. . -the role of outb i didn t understand the linux man .. . .. . -the addresses and their meaning .. . .. . another unrelated question i read that outb and inb are for port-mapped I O can we use memory-mapped I o for doing Input output communication thanks . Comment : For hardware which is controlled by memory mapped IO which the PIC is not you can of course do memory mapped IO . Comment : The 8086 inherited these instructions from its predecessors 8080 and 8085 where a separate I O space was very useful in order not to waste any of the 64k memory-address space . .. . Answer : The traditional 8088 86 had has a memory control signal that is essentially another address bit tied directly to the instruction . The control signal separating the accesses into I O and Memory creating two separate address spaces . Not unlike CS DS etc creating separate memory spaces inside the chip before hitting the external memory space . Other processor families use what is called memory mapped I O . These days the memory controllers system is chopped up inside and outside the chip in all different ways sometimes for example with many control signals that indicate instruction vs data cache line fills write through vs write back etc . To save on external circuitry the memory mapping happens inside the chip and for example dedicated rom interfaces separate from ram etc are found on the edge far more complicated and separate than I O space vs Memory space of the old 8088 86 . the out and in instruction and a few family members change whether you are doing an I O access or memory access and traditinally the interrupt controller was a chip that decoded the memory bus looking for I O access with the address allocated for that device . Decades of reverse compatibility later and you have the present code you are looking at . If you really want to understand it you need to find the datasheets for the device that contains the interrupt controller likely to be combined with a bunch of other logic on a big support chip . Other datasheets may be required as well . Comment : sorry i don t get it does this mean that x86 use port mapped rather than memory mapped access Comment : Yes I am trying to explain what I O mapped vs memory mapped means it traditionally for x86 means a single control line . Other architectures used one or more of the address bits to do the same thing . very little difference other than x86 that control signal was tied to special instructions . Comment : pci added to the complication by allowing some items to be addressable in either address space . sticking with in out possibly makes it easier to control and virtualize compared to memory . There is an IOPM I O protection map I think per VM in this case even a simple app on a linux machine you have a separate IOPM . Look up the giveio driver for windows to learn a little more about this and how to get around it .", "Question : I am trying to communicate with a disk drive using inb inw outb and outw commands so I can find specific information about the drive . However to use these commands I need the correct I O ports for the device . When I have the correct I O ports I can find the information I am looking for very easily however I do not know a way to find the base address of a device s I O ports in Linux . In DOS I am able to use Hdat2 to find the device s base address however I am trying to find the address in Linux . Is there a way to find which device maps to which I O port in Linux There is a file in proc called ioports that contains some information but I don t how to associate this information with specific devices . Any help would be greatly appreciated . Thanks .. . Answer : The path seems have chanced in kernel 3.10 this is how I find the corresponding device node :", "Question : I am trying to communicate with a disk drive using inb inw outb and outw commands so I can find specific information about the drive . However to use these commands I need the correct I O ports for the device . When I have the correct I O ports I can find the information I am looking for very easily however I do not know a way to find the base address of a device s I O ports in Linux . In DOS I am able to use Hdat2 to find the device s base address however I am trying to find the address in Linux . Is there a way to find which device maps to which I O port in Linux There is a file in proc called ioports that contains some information but I don t how to associate this information with specific devices . Any help would be greatly appreciated . Thanks .. . Answer : The device is most probably hanging off of the PCI bus so lspci 8 is the first to look at . Then figure out where under sys the controller is described . Here for example I have : .. . .. . This shows controller s PCI configuration space . See the details in Linux Device Drivers Third Edition . Chapter 12 : PCI Drivers http : lwn.net images pdf LDD3 ch12.pdf . Edit : .. . .. . Take a look into this partition and mass-storage naming howto http : tldp.org HOWTO Partition-Mass-Storage-Definitions-Naming-HOWTO index.html for help on Linux drive naming . Comment : Thanks Nikolai the link-to the Linux Device Drivers book really helped . I understand how to get the address of the I O port that I am looking for when I have the signature of the PCI device . However I don t understand how you go from dev sda to 0000 : 03 : 00.0 Thanks again for all your help Comment : You can go from sda to a pci id by looking at the symlink sys block sda device .", "Question : I am trying to communicate with a disk drive using inb inw outb and outw commands so I can find specific information about the drive . However to use these commands I need the correct I O ports for the device . When I have the correct I O ports I can find the information I am looking for very easily however I do not know a way to find the base address of a device s I O ports in Linux . In DOS I am able to use Hdat2 to find the device s base address however I am trying to find the address in Linux . Is there a way to find which device maps to which I O port in Linux There is a file in proc called ioports that contains some information but I don t how to associate this information with specific devices . Any help would be greatly appreciated . Thanks .. . Answer : So I did find something although it isn t the most elegant solution and it definitely doesn t work everywhere it has worked on my hardware so I figured I would share . First you have to get the address of the SATA Controller from the lspci command like Nikolai showed the -D just shows the full domain numbers : .. . .. . Now with this address 0000 : 00 : 1f.2 you can go into sys . In sys bus pci devices your device should be listed : .. . .. . Now in this directory there will be several hostX directories . In one of these hostX directories there will be a targetX : X : X directory . This targetX : X : X directory will then have a directory called X : X : X : X the X s are numbers that can vary . In the X : X : X : X directory there is a link named block : sdX where X is a letter . This sdX is the name of the drive that this directory corresponds to . So dev sda corresponds to host 0 on the SATA Controller at 0000 : 00 : 1f.2 . Now to find the address that we can use to talk to dev sda through inb and outb commands we look in the file named resource in sys bus pci devices 0000 : 00 : 1f.2 . The address we are looking for is fe00 which is on the first line . We want the first line because it is host 0 if it were host 1 we would look on the second line and host 2 the third line and so on . The host number was given by the hostX directory that we found earlier . Each line in the resource file is separated into 3 columns : .. . .. . Column 1 beginning address Column 2 end address Column 3 flags .. . .. . So this is how I get from dev sda to 0xfe00 in order to send commands to the device . If anybody know any better way to do this I am all ears.. .", "Question : On my Linux machine Debian Wheezy I tried to access the parallel port by request region but it failed because the system had already loaded the kernel module parport .. . So I rmmod the modules lp ppdev parport pc and parport . Then I could successfully insert my module . However from the base address inb returned 0xff no matter what value was written . Before rmmod those module from kernel I could wrote and read this register . Then I blacklisted those module from being loaded at system start up and I could read and write these registers and my module also worked . It seems that the clearup function of parport pc did something that made the hardware unusable . At least the status of the port is not the same as it was before the module loaded . My question is why and what should I do to recover the port instead of reload parport pc Comment : Why do you need a kernel module to access the parallel port Can you use the interface provided by Linux Comment : My intention is to get better understanding of the hardware so I want to access it at the lowest level by means of method as simple as it could be . Yes I can use parport provided by Linux but the question is I can t unuse it . .. . Answer : You can use C to write a small program that will read and write directly from to the pins on the parallel port by way of the outb and inb functions . Then you can simply call the C program from the command-line of shelling from some other script . Usually by default address 0x378 is the address of the parallel port LPT0 in memory so you it s just a matter of using inb and outp to read-write to this address . For example : Comment : Thanks for your answer . But probably you don t quite get what I mean . I know it s possible to access parallel port from user space . and from kernel space too . But if you rmmod parport pc firstly I did tried this program could not work correctly .", "Question : Here s the problem : I need to program some hardware via 2 pins of the PIO 1 clock 1 data . Timing constraints are tight - 10ms clock cycle time . All this of course whilst I maintain very high level services CAN bus TCP IP . The downstream unit also ACKS by asserting a PIO pin configured as an input high . So this loop has to both read and write . I need to send 16 bits in the serial stream . Is there an established way to do this sort of thing or should I simply get the hardware guys to add a PIC or somesuch . I d much prefer to avoid exotics like RTAI extensions at this stage . I did once see a reference to user-mode IO which implied a possible interrupt driven driver but lost track of it . Any pointers welcomed . .. . Answer : The easiest way in my experience is to write a kernel driver . Provided of course that one doesn t already exist -- 1 clock 1 data sounds i2c-like though 10ms cycle sounds much slower than i2c and there are bit-banging i2c drivers for Coldfire already in existence . Even if it s not i2c you might find i2c-adap-mcf gpio of use as a starting point . You re actually lucky in that it s a 10ms cycle -- default kernel tick is 10ms and it can be adjusted if necessary so you should be able to use the appropriate kernel sleep functions . This all also depends on which kernel you re using . Easy user-mode I O is available in 2.6 kernels fairly readily -- there are features in 2.4 kernels but they may require more work .", "Question : On my Linux machine Debian Wheezy I tried to access the parallel port by request region but it failed because the system had already loaded the kernel module parport .. . So I rmmod the modules lp ppdev parport pc and parport . Then I could successfully insert my module . However from the base address inb returned 0xff no matter what value was written . Before rmmod those module from kernel I could wrote and read this register . Then I blacklisted those module from being loaded at system start up and I could read and write these registers and my module also worked . It seems that the clearup function of parport pc did something that made the hardware unusable . At least the status of the port is not the same as it was before the module loaded . My question is why and what should I do to recover the port instead of reload parport pc Comment : Why do you need a kernel module to access the parallel port Can you use the interface provided by Linux Comment : My intention is to get better understanding of the hardware so I want to access it at the lowest level by means of method as simple as it could be . Yes I can use parport provided by Linux but the question is I can t unuse it . .. . Answer : Edit the etc modprobe.d blacklist.conf file and add the following lines then reboot your linux . And if cups is installed you should modify etc modules-load.d cups-filters.conf : .. . .. . Here is some details : http : stackoverflow.com a 27423675 4350106" ] }
[ "yes-answer-long", "yes-answer-short" ]
cpu
UNK_RELATION
core-location@ios@55
core-location -- this proprietary apple framework for @placeholder and mac os x allows apps to obtain information on a device s current location latitude-longitude and on some devices altitude direction and speed .
{ "confidence": [ 53.01625442504883, 49.85568618774414, 43.452537536621094, 43.38235855102539, 42.78466796875, 40.653934478759766, 40.58700180053711, 40.227195739746094, 38.980709075927734, 38.94556427001953, 37.302303314208984, 37.275550842285156, 36.365596771240234, 36.35007095336914, 36.19886016845703, 36.0240364074707, 35.602760314941406, 34.4434928894043, 34.33964157104492, 34.19660568237305, 33.92332077026367, 33.86085510253906, 33.5379638671875, 33.05923843383789, 32.89311599731445, 32.82487487792969, 32.76774597167969, 32.74264907836914, 32.73954391479492, 32.68009948730469, 32.64930725097656, 32.573753356933594, 32.560367584228516, 32.43406677246094, 32.286773681640625, 32.19734191894531, 32.05333709716797, 32.001338958740234, 31.941516876220703, 31.901500701904297, 31.89752197265625, 31.869537353515625, 31.869537353515625, 31.869537353515625, 31.869537353515625, 31.789913177490234, 31.789913177490234, 31.744583129882812, 31.709789276123047, 31.703754425048828, 31.6712646484375, 31.63576889038086, 31.622413635253906, 31.622413635253906, 31.622413635253906, 31.562278747558594, 31.505794525146484, 31.456634521484375, 31.440380096435547, 31.390689849853516, 31.355545043945312, 31.352176666259766, 31.190670013427734, 31.160709381103516, 31.011287689208984, 31.011287689208984, 30.904598236083984, 30.894100189208984, 30.65280532836914, 30.64252471923828, 30.6357421875, 30.510162353515625, 30.413665771484375, 30.410858154296875, 30.410858154296875, 30.399417877197266, 30.330142974853516, 30.328548431396484, 30.326709747314453, 30.31609344482422, 30.31609344482422, 30.31609344482422, 30.31609344482422, 30.266151428222656, 30.236469268798828, 30.236469268798828, 30.217144012451172, 30.160511016845703, 30.160511016845703, 30.160511016845703, 30.150310516357422, 30.054306030273438, 29.83053207397461, 29.83053207397461, 29.826908111572266, 29.798511505126953, 29.784908294677734, 29.724185943603516, 29.724185943603516 ], "content": [ "Get the current location and destination location s latitude and longitude .", "will location manager return the latitude and longitude of current location in iran", "Core Location does not always report altitude immediately .", "The GPS and other devices that obtain location information might not be initialized .", "I ve been working on a app that displays the current location of the user in a UILabel using the core-location framework in Xcode When a button is clicked the app calls the CLLocationManager that gets the users latitude and longitude .", "If it is on then try to check whether your current location manager holds the region you ve specified by checking NSLog @ Monitored Regions @ self.locationManager.monitoredRegions .. . .. . Then if the user device is at current location Latitude and longitude the didEnterRegion : and didExitRegion : delegates will not be triggering .", "I am using the Apple maps in my application it will return the latitude and longitude when my current location is different than Iran country .", "To get a real latitude and longitude you ll have to simulate a location .", "I have been working on a simple app to get the users current location using the Core Location framework from Apple in Xcode and when i run the app i get an error .", "Consider latitude as x and longitude as y for now .", "I am trying to get the user s current location using the Core Location Framework in Xcode 6.3.1 I did following things : .. . .. . 1 .", "If this method returns NO and you start location updates anyway the Core Location framework prompts the user to confirm whether location services should be reenabled .", "The current location of the device is not even close to any of the regions .", ".. . .. . While retrieving data after getting user s latitude and longitude from core-location I am trying to : .. . .. . First problem arises here with observeEventType .", "How do I get the current location of my iOS device", "The latitude and longitude coordinates seem to be correct as each time the locations are updated the new location from the last time is being stored as the old location .", "Current location must be known .", "I m developing an iPhone application that uses Core Location to determine the device s location .", "It s iOS Core Location geocoding .", "The whole flow : - Implemented with startMonitoringSignificantLocationChanges and an API call to my server to update the location latitude and longitude - Set the location updates background mode capability to true - Run the app so the location manager is initiated and the app is listening for location changes - Force closed the app - Set the debug- location on simulator to freeway drive - Opened maps to see if the location is changing - Waited on the server to see for location updates and was getting new results every about 3 minutes .. . .. . However I m still not sure if this is fine enough on a real device .", ".. . You should check the return-value of this method before starting location updates to determine whether the user has location services enabled for the current device .", "Core Location doesn t give you history .", "How are we intended to get the user s location in an OS X Today Extension", "But these method is no longer returning current the location .", "Is there some way to use current location to determine proximity to any of n defined and non-monitored regions and then populate your monitored regions based on the current location", "How do I pass the latitude and longitude data back to my ViewControllers as soon as the user s latitude and longitude is calculated", "From the Apple docs : With this service location updates are generated only when the user s location changes significantly thus it is ideal for social applications or applications that provide the user with noncritical location-relevant information .", "Here is a great example in Swift nshipster.com core-location-in-ios-8 http : nshipster.com core-location-in-ios-8 that I found really helpful .", "It turns out I mixed up the longitute and latitude when creating the location .", "Tap Current Location button in lower left corner .", "To answer your question from comments I am afraid Apple does not provide deep insights into their core-location technology .", "Does Core Location support that and falls back to GPS-only no cell triangulation or WiFi location mapping", "I have a Core Data database with latitude and longitude properties .", "It usually takes a few seconds to obtain the current location and it will most likely be nil until then resulting in geocode error 8 or kCLErrorGeocodeFoundNoResult .", "If the device is not capable of location updates it will never prompt the user for location .", "There are two ways to simulate location updates : .. . .. . In the iOS Simulator under Debug Location you re able to specify a constant latitude-longitude or select several predefined profiles like City Run or Freeway Drive .", "Only GPS can deliver the location attributes : course and speed .", "I have the background location on and imported the coreLocation framework .", "It goes into the challenges to indoor location the different types of sources you can obtain location and some math for indoor positioning .", "After months of trials and errors by experimenting the Core Location Framework I have found the solution to get location update even when the app is killed suspended .", "According to Apple docs .. . .. . After returning a current location fix the receiver generates update events only when a significant change in the user s location is detected .", "I am trying to get the users latitude and longitude .", "But actual process is that it store Longitude and latitude of particular region .", "Make the delegate methods update the latitude and longitude properties .", "In other ViewControllers read this singleton s latitude and longitude properties .", "Added Core Location Framework under Target - General - Linked Frameworks Libraries .. . 2 .", "Added Core Location Framework under Target- General- Linked Frameworks Libraries .. . .. . Added in .plist file .. . .. . See Screenshot : .. . .. .", "For the true heading other Core Location services are required geolocation to obtain the deviation of magnetic from true north .", "I am wondering. . is it save to ask location manager for a current location when didExitRegion or didEnterRegion is called", "When I am trying to install this in a device the core-location never asks the user permission .", "On the Simulator you need to simulate the location and then using a VPN on your Mac .", "Satellite Direction Navigation services of Apple are not present in Iran thats why you are not getting the location coordinates .", "I think apple map is not allowed for Iran location .", "I have a strange issue with the apple location service .", "Issues like this can be resolved by setting location as Apple .", "Getting accurate location information requires power and the more often you get the location the more power you use .", "Register current location in region monitoring .", "But Core Location makes use of many different technologies to increase accuracy .", "Some iOS devices have a real GPS chip allowing you to get location data even with no Internet connection .", "Im using this : NSString stringWithFormat : @ maps.google.com maps http : maps.google.com maps geo q f f output xml ll f f spn f f quot latitude-longitude latitude-longitude location horizontalAccuracy location horizontalAccuracy", "i try to get the longitude latitude of the user current location my code is simply this : .. . .. . i got always this error from the didFailWithError method : .. . .. . can you please tell me what i miss", "Core Location lets you monitor a total of 20 CLRegion s per app .", "I can t seem to find any information on how Core Location handles overlapping geofences .", "override init .. . super.init .. . .. . func processLocation current : CLLocation .. . guard last nil else .. . last current .. . return .. . .. . var speed current.speed .. . if speed 0 .. . print speed or whatever .. . else .. . speed last .distance from : current current.timestamp.timeIntervalSince last .timestamp .. . print speed .. . .. . last current .. . .. . func locationManager manager : CLLocationManager .. . didUpdateLocations locations : CLLocation .. . for location in locations .. . processLocation location .. . .. . .. . .. . .. . var del locationDelegate .. . var lm CLLocationManager .. . lm.delegate del .. . lm.startUpdatingLocation", "I m using Core Location with ios 6 .", "Trying to fetch before getting the core-location .", "Core Location framework .. . CLHeading .. . .. . From Location Awareness Programming Guide http : developer.apple.com library ios documentation UserExperience Conceptual LocationAwarenessPG GettingHeadings GettingHeadings.html apple ref doc uid TP40009497-CH5-SW1 .. . .. . Getting Heading-Related Events .. . .. . Heading events are available to apps running on a device that contains a magnetometer .", "So now I could manage to start from web server background location update on ios device then send user location to server and stop updating location on ios device from server on my own .", "Putting it another way if device is at location X then load region 1 through 20 .", "That is 180 to x latitude and 360 to y longitude .. . .. . .. . Something like this should do the trick .", "But you can get much lower power requirements at the expense of less-frequent location updates by using other means-- for example the significant location update option in Core Location .", "Still I couldn t tell 100 if the location property is set at the time didEnterRegion is called because there is a cloud of mystery around core-location .", "The app is a location based one and should gather current location and send the coordinates to server every 5 or other value minutes .", "Tap Current Location button in lower left corner again .", "This assumes the use-case where the current location is suddenly desired by the user .", "In addition utilize this function in your CLLocationManagerDelegate .. . .. . This allows the app to respond properly if they change the location permissions in the middle of using your location services after the viewDidLoad .", "This all assumes that the device has the correct location abilities .", "Having said that there may be situations where the user s current location is now being shown but i still want to get the user s current location .", "As discussed on other communities you can have mapView.showUserLocation YES and still use CLLocationManager to retrieve the most current location information .", "They are all placed at latitude 0 and longitude 0 .", "My initial reaction was convert latitude-longitude to radians", "Why do you normalize180 the longitude and not the latitude", "How to calculate the latitude and longitude of these locations on the radius", "How bad is it to use Location Manager to retrieve the location information when MapView.showUserLocation is also TRUE", "So far I know to use co-ordinates to show pin points on map with core-location framework .", "Could the problem possibly lie within my Core Location framework or my iPhone itself", "From the last two locations and the given speed you can calculate where the next location is likely to be and already display that location .", "4 The core-location delegate routine is tricky to get accurate updates out of .", "Then on a button click I am invoking the core-location api as below .", "This is my shouldFetchUserLocation method : .. . .. . Here is my core-location delegate method :", "One of my friend told that core-location permission is not asking for his device iPod .", "I have a situation where i want to show the blue dot to indicate the user s current location and i want to record the user s current location after some time interval .", "As my whole app is based on current location .", "On exit log and register again the current location as region .", "Here is the solution : - .. . .. . If your app is a location based mobile-application that needs to monitor the location of the device when it has significant changes the iOS will return you some location coordinates when the device has moved more than 500 meters from the last known location .", "That said if you look at this article from NSHipster http : nshipster.com core-location-in-ios-8 it references some current issues with CLVists for iOS 8.1 .", "Still now the apps i stand with is simple regionMonitoring which is based on users current location .", "As it uses the core-location and bluetooth so i enabled the Location Bluetoothconfiguration from the capabilities .", "I have added a map to it and enabled Core Location and Show User Location but it doesn t display ." ] }
{ "confidence": [ 60.00730895996094, 55.92361068725586, 51.5576286315918, 49.44959259033203, 49.380855560302734, 48.57117462158203, 48.47888946533203, 47.866302490234375, 47.65972900390625, 47.042991638183594, 46.90022659301758, 46.645843505859375, 46.3203239440918, 46.24382019042969, 46.115257263183594, 45.70757293701172, 45.44047546386719, 45.081581115722656, 44.77459716796875, 44.71173858642578 ], "content": [ "Question : I am creating an app like Uber in Iran but my location manager will not give me the current location of the user it will give me only null values . How can I fetch the current location of the user in Iran As my whole app is based on current location . I am using the Apple maps in my application it will return the latitude and longitude when my current location is different than Iran country . Comment : Please share the code What you have tried... . Comment : I think apple map is not allowed for Iran location . you have to use google map to fetch current location of Iraq . Comment : If you want to get current location of Iran then you must use Google map . Comment : will location manager return the latitude and longitude of current location in iran Comment : I expect that Apple as an American firm must obey US export regulations even under sufferance and the regulations say that Iran is a country worth placing under a financial and services embargo . I suspect you will need to use a third-party service that is not hosted within the US . .. . Answer : Satellite Direction Navigation services of Apple are not present in Iran thats why you are not getting the location coordinates . Please check this link from Apple : http : www.apple.com in ios feature-availability .. . .. . Is better you use Google maps in your app to get your location coordinates for Iran . https : developers.google.com maps documentation ios-sdk intro this link will be helpful to you Comment : will location manager return the latitude and longitude of current location in iran Comment : yes but on real device not on simulator Comment : thanks and thanks everyone", "Question : I have a UIImageView representing a simple knob : it has nothing to do with stereo hi-fi it represents a sort of compass : .. . .. . enter image description here http : i.stack.imgur.com ITcQS.png .. . .. . My goal is the following : I want the compass to point a precise direction starting from the current position of the device and it must update too : if the user turns the device elsewhere the knob should rotate accordingly . What I tried until now : .. . .. . I have this function : .. . .. . and I call it this way using the CoreLocation framework : .. . .. . and : .. . .. . Problem is for some reason the knob turns once into one wrong direction then stops working . Can you help me Any tip is appreciated : - .. . .. . P.S . : I red many related-posts none solves this issue Comment : I d take out the animation first and see if it works if not then put some print statements in the didUpdateHeading and make sure thats called and check the value of geoAngle to see if its being updated . See if that gets you anywhere Comment : @daven11 : it s exactly what I did before posting : - They get updated maybe the problem is in the animation Comment : sorry to state the obvious - difficult to tell how experienced developers are on here . I haven t used the CoreLocation framework so good luck .. . Answer : Consider latitude as x and longitude as y for now . Pre-requisites : .. . .. . 1 . Destination location must be known . 2 . Current location must be known . I would show you how to calculate the angle towards the direction now . It is as follows 1 . Get the current location and destination location s latitude and longitude . Pseudo Code : .. . .. . Let currentLocation lat long .. . Let destinationLocation lat long .. . angleTowardsDestination 2 . Calculate the base and hypotenuse for Pythagorus theorem . Now base currentLocation.lat - destinationLocation.lat 2 - currentLocation.long - currentLocation.long 2 .. . hypotenuse currentLocation.lat - destinationLocation.lat 2 - currentLocation.long - destinationLocation.long 2 .. . .. . .. . 3 . Calculate the angle now angleTowardsDestination Cos-1 base hypotenuse .. . .. . And that s the angle you need in degrees . Feel free to convert it to radian if needed . Kind Regards .. . Suman Adhikari Comment : maybe I found what s wrong in the code : in the last function body direction must be cast to CGFloat and there s no need to convert it to radians . Thanks anyway for your comment : - Comment : Your Welcome . And good luck with your project . Do write an update on what worked for you It can help someone in the future . Comment : of course my friend", "Question : I have multiple view controllers that need to get the user s location so I wanted to create a separate class that the ViewControllers can call to get the user s latest location . locationManager : didUpdateToLocation : fromLocation returns void . How do I pass the latitude and longitude data back to my ViewControllers as soon as the user s latitude and longitude is calculated I could try writing getters and setters in my locationManaging class but if I do that how do I know when to call the latitude getter and longitude getter methods from my ViewController class How do I hold the ViewController s main thread to wait for the latitude and longitude values from the locationManaging class Thanks Comment : locationManager : didUpdateToLocation : fromLocation is a delegate method . The location manager uses this method to inform your object that the location was updated with a new value - it s up to you to implement this method to do something with the value . .. . Answer : Here s what I did when implementing a location manger singleton in swift . It s based on user1071136 s strategy as well as this swift pattern http : stackoverflow.com a 24073016 3330743 . Comment : Wear oven mitts when using a device running this code . Comment : I m currently trying to use your class but the app never asks for authorization nor i get a location . What do i need to do to use the class Comment : never forget the info.plst : stackoverflow.com questions 24050633 http : stackoverflow.com questions 24050633 implement-cllocationmanagerdelegate-methods-in-swift 24056771 24056771 Comment : @quellish can you explain your comment. . are you saying that this is a bad solution - for battery I am thinking of a pattern to implement CLLocation for multiple views as well . Comment : @SamYoungNY this class is setting the location accuracy and distance filter to reject any location data with a precision of less than 50 meters . That and constantly turning location updates on off like some other answers is not healthy for the device and does not help the application .", "Question : I have two ways of getting the magnetic fields strength x y and z using the iOS device s magnetometer . 1 Core Location .. . Used the CLHeading from CLLocationManagerDelegate method locationManager : didUpdateHeading : . This is similar to Apple s Teslameter sample app . 2 Core Motion .. . Used CMMagneticField from CMMotionManager s magnetometerData.magneticField . Questions : .. . a What is the difference between the two I am getting different values from both . I was expecting that they will return the same values . The difference is most notable when I start the app from a resting position face up in a table and then lift the device up in to the air . b If there is a difference when should I use the magnetic field from Core Location heading and when should I use the magnetic field from Core Motion Note : I also am not sure if the magnetic field of Core Location and Core Motion refer to different magnetic field concepts . Note : I computed strength as the square-root of x 2 + y 2 + z 2 for both approaches . Comment : +1 hmmm interesting question . Comment : Are you using the magneticHeading property of the CLHeading Comment : @ThomasW No sir I m using CLHeading s x y and z . .. . Answer : To unravel this I ve spent a bit too much time digging through the Apple docs . There are three ways of obtaining magnetometer data .. . .. . 1 Core Motion framework http : developer.apple.com library ios documentation CoreMotion Reference CoreMotion Reference index.html .. . CMMotionManagers s CMMagnetometer http : developer.apple.com library ios documentation CoreMotion Reference CMMagnetometerData Class Reference Reference.html apple ref doc c ref CMMagnetometerData class .. . .. . 2 Core Motion framework .. . CMDeviceMotion http : developer.apple.com library ios documentation CoreMotion Reference CMDeviceMotion Class Reference Reference.html apple ref doc c ref CMDeviceMotion CMCalibratedMagneticField property .. . .. . 3 Core Location framework https : developer.apple.com library IOs documentation CoreLocation Reference CLLocation Class CLLocation CLLocation.html .. . CLLocationManager s CLHeading .. . .. . 1 supplies raw data from the magnetometer . 2 and 3 return derived data . The numbers in both cases are similar though not exactly the same . Difference between Core Motion s CMMagnetometer and CMCalibratedMagneticField .. . .. . 1 and 2 - both from the Core Motion framework - differ as follows : .. . .. . CMDeviceMotion Class Reference .. . .. . Discussion .. . The CMCalibratedMagneticField returned by this property gives you the total magnetic field in the device s vicinity without device bias . Unlike the magneticField property of the CMMagnetometer class these values reflect the earth s magnetic field plus surrounding fields minus device bias . CMMagnetometer gives us raw data CMCalibratedMagneticField is adjusted data . Difference between Core Motion s CMCalibratedMagneticField and Core Location s CLHeading .. . .. . The docs are not immediately clear on the difference between 2 and 3 but they do generate different numbers so let s do some digging . Core Location framework .. . CLHeading .. . .. . From Location Awareness Programming Guide http : developer.apple.com library ios documentation UserExperience Conceptual LocationAwarenessPG GettingHeadings GettingHeadings.html apple ref doc uid TP40009497-CH5-SW1 .. . .. . Getting Heading-Related Events .. . .. . Heading events are available to apps running on a device that contains a magnetometer . A magnetometer measures nearby magnetic fields emanating from the Earth and uses them to determine the precise orientation of the device . Although a magnetometer can be affected by local magnetic fields such as those emanating from fixed magnets found in audio speakers motors and many other types of electronic devices Core Location is smart enough to filter out fields that move with the device . Here are the relevant CLHeading raw properties .. . .. . The geomagnetic data measured in microteslas for the x y z -axis . read-only .. . This value represents the x y z -axis deviation from the magnetic field lines being tracked by the device . older versions of the docs add : The value reported by this property is normalized to the range -128 to +128 . I am not clear how a microtesla measurement can be normalized compressed clipped to a range of + -128 and still represent the unit it claims to measure . Perhaps that s why the sentence was removed from the docs . The units on an iPad mini do seem to conform to this kind of range but the iPhone4S gives CMMagnetometer readings in higher ranges eg 200-500 . The API clearly expects you to use the derived properties : .. . .. . which give stable N S E W compass readings in degrees 0 North 180 South etc . For the true heading other Core Location services are required geolocation to obtain the deviation of magnetic from true north . Here is a snippet from the CLHeading header file .. . .. . Core Motion framework .. . CMDeviceMotion CMCalibratedMagneticField .. . .. . CMMagnetometer .. . .. . CMMagneticField .. . This is the struct that holds the vector . It s the same for CMDeviceMotion s calibrated magnetic field and CMMagnetometer s uncalibrated version : .. . .. . .. . .. . The difference between 2 and 3 are hinted at here : .. . .. . Core Location CLHeading .. . .. . Represents a vector pointing to magnetic North constructed from axis component values x y and z .. . .. . Core Location is smart enough to filter out fields that move with the device .. . .. . Core Motion CMCalibratedMagneticField .. . .. . represents Earth s magnetic field plus surrounding fields without device bias .. . .. . So - according to the docs - we have : .. . .. . 1 CMMagnetometer .. . Raw readings from the magnetometer .. . .. . 2 CMDeviceMotion CMCalibratedMagneticField magneticField .. . Magnetometer readings corrected for device bias onboard magnetic fields .. . .. . 3 CLHeading x y z .. . Magnetometer readings corrected for device bias and filtered to eliminate local external magnetic fields as detected by device movement - if the field moves with the device ignore it otherwise measure it .. . .. . Testing the theory .. . .. . enter image description here http : i.stack.imgur.com 32Tgu.png .. . .. . I have put a Magnet-O-Meter demo app on gitHub https : github.com foundry MagnetoMeter which displays some of these differences . It s quite revealing to wave a magnet around your device when the app is running and watching how the various APIs react : .. . .. . CMMagnetometer doesn t react much to anything unless you pull a rare earth magnet up close . The onboard magnetic fields seem far more significant than local external fields or the earth s magnetic field . On my iPhone 4S it consistently points to the bottom left of the device on the iPad mini it points usually to the top right . CLHeading . x y z is the most vulnerable responsive to local external fields whether moving or static relative to the device . CMDevice CMCalibratedMagneticField is the most steady in the face of varying external fields but otherwise tracks it s Core Location counterpart CLHeading . x y z pretty closely . CLHeading.magneticHeading - Apple s recommendation for magnetic compass reading - is far more stable than any of these . It is using data from the other sensors to stabilise the magnetometer data . But you don t get a raw breakdown of x y z .. . .. . yellow CMMagnetometer .. . green CLHeading . x y z .. . blue CMCalibratedMagneticField .. . red CLHeading.magneticHeading .. . .. . This does seem to contradict the docs which suggest that CLHeading . x y z should be less influenced by local external fields than CMCalibratedMagneticField . What approach should you take Based on my limited testing I would suggest .. . If you want a compass reading .. . CLHeading s magneticHeading and trueHeading will give you the most accurate and most stable compass reading . If you need to avoid Core Location .. . CMDeviceMotion s CMCalibratedMagneticField seems to be the next most desirable although considerably less stable and accurate than magneticHeading . If you are interested in local magnetic fields .. . CLHeading s raw x y and z properties seem to be more sensitive to local magnetic fields . If you want all of the data including onboard magnetic fields .. . Raw magnetometer data from CMMagnetometer . There is really not much point using this unless you are prepared to do tons of filtering as it is hugely influenced by magnetic fields generated on the device itself . Comment : Will there be a difference in values if CMAttitudeReferenceFrameXMagneticNorthZVertical is changed say to CMAttitudeReferenceFrameXTrueNorthZVertical If yes why did you choose CMAttitudeReferenceFrameXMagneticNorthZVertical Comment : @MiuMiu it won t make any difference as the reference frame only affects CMAttitude roll pitch yaw etc - which I am not using in this demo . Comment : Thank you for your answer . Since I am interested in local magnetic fields I will proceed with using CLHeading s raw x y and z values . Comment : This answer doesn t have nearly enough upvotes for its thoroughness . Comment : @nhgrif - thanks for the voluntary bounty award - your kind gesture is truly amazing", "Question : I am trying to build and run the WhereamI.app example of the Big Nerd Ranch book : iOS Programming chapter4 . Compiling works just fine and it runs but the output to console is : server did not accept client registration 68 instead of providing the current GPS position and altitude . I am runing Xcode 4.1 on OS X Lion with the 4.3 SDK . There is nothing fancy at all in the code . JUst and instance of Corelocation manager and a simple delegation to WhereAmI.app .. . .. . Any clues .. . Answer : Like Brian Liang I don t think the code offered in the big nerd ranch forums is a fix per se because if you use that code you eliminate not only the application crash server did not accept client registration 68 you also render the application useless because the workaround overrides the method that a delegate for CLLocationManager would use to be aware of location updates overrides it in a way that basically says always update the location to lat : 42 long : -50 . So the forum code snippet mentioned here does eliminate the application crash but it makes all location updates amount to the same coordinates so you really can t use the application anymore . Not a fix in any grander sense of the word . Kind of let down really . Maybe this is just a simulator problem and not an issue on an actual phone Comment : Also if you use the forum hack update the lat and long to match the front door of apple headquarters so when you place your first annotation it shows up on the screen so you see it is working . I used initWithLatitude : 37.33165 longitude : -122.03075 and when I hit return for the first annotation a red pin pops up right next to the blue blinking apple headquarters location . Then also if you scroll away from apple headquarters and place another pin the map will center you back near apple headquarters so you can see the relocation feature in action too .", "Question : null .. . Answer : I ve been working on a app that displays the current location of the user in a UILabel using the core-location framework in Xcode When a button is clicked the app calls the CLLocationManager that gets the users latitude and longitude . I also included reverse-geocoding to present the coordinates in a human-readable form . I have this code here . Header file .. . .. . Implementation file .. . .. . I got this output Comment : A line is causing the issue Because this message should be the equivalent of kill -15 so user killed the app . Comment : yea i misunderstood that line . There is no output actually when i run the app . when i click the Button that was supposed to get the location nothing happens . I think it is because i didn t request for authorization for the app to use the location services .", "Question : This question already has an answer here : .. . .. . iOS - MKMapView place annotation by using address instead of lat long questions 9606031 ios-mkmapview-place-annotation-by-using-address-instead-of-lat-long 5 answers .. . .. . I have a list of addresses with postcodes which I need to display on a map pin point . So far I know to use co-ordinates to show pin points on map with core-location framework . Is there any other way of doing it Like getting co-ordinates from address or use address to show pin points on map The main purpose is to calculate distances between locations . Please guide me here . Thanks Comment : Please try to search before asking . How can I plot addresses in Swift converting address to longitude and latitude coordinates http : stackoverflow.com questions 24706885 how-can-i-plot-addresses-in-swift-converting-address-to-longitude-and-latitude Comment : Thank you some times you don t have right search string when looking for any answers..Appreciate your time and guidance .. . Answer : To create an annotation from an address you need to use CLGeocoder s method geocodeAddressString : .. . .. . If you only want to get the coordinates for the location : Comment : Thank you..will try this now .", "Question : i try to get the longitude latitude of the user current location my code is simply this : .. . .. . i got always this error from the didFailWithError method : .. . .. . can you please tell me what i miss thx in advance : .. . Answer : Issues like this can be resolved by setting location as Apple . At least it works for testing purpose .", "Question : I know Core Location isnt always accurate on the iPhone . Is there a way to use the location lat long along with the accuracy to then grab all of the possible suburbs streets in that area So instead of using the reverse-geocoding and having it guess the best possible suburb street is there a way to make it give an array or in some other format of all the possible suburbs streets that it could consider Thanks Comment : Hey Zac Take a look ate the comment that I have posted under yours on my answer . .. . Answer : So the best approach to do this is using the Google maps API . For example take a look ate the following url : http : maps.google.com maps geo q 38.4417077 -90.7122047 output xml http : maps.google.com maps geo q 38.4417077 -90.7122047 output xml .. . .. . As you can see for this pair latitude-longitude you have 10 possible placemarks for this coordinates . The documentation for this you can find at : http : code.google.com apis maps documentation geocoding index.html .. . .. . You can see that you get the info in XML JSON CSV . Take a look at the status code it is important to verify if the request was successful usually 200 or 200 and something . So how to use it VFN It is simple . on locationString is the response from Google Geocoder now you can use the info as you want . Remember to first check the status code and than parse the info . If you want only the first placemark that is selected by Google Geocoder I would suggest you to use the output in CSV that is easy to work with . If you have any queries let me know Cheers .. . VFN Comment : I have no trouble getting the street suburb city postal-code . What I want to do it use the coordinate and the radius that Core Location gives me to then get all of the streets suburbs within the radius from the coordinate . So lets say I have the coordinate -33.888068 151.205521 and an accuracy of 3km . I want to find all of the suburbs within 3km of that coordinate . Those being Chippendale Surry Hills Redfern Alexandria Eveleigh etc . Thanks for the help but it gives me the same info that I already have . Comment : Hey Zac Because of that I put the link of for the documentation on my answer . Take a look at : code.google.com apis maps documentation geocoding Viewports http : code.google.com apis maps documentation geocoding Viewports You can define the center of the region and the span for the bounding-box . The code posted above is only to illustrate in the case that you didn t know how to use the API . Let me know if it is enough . Cheers Comment : So how do I use that information to then get the suburbs Preferably in an array . Sorry i havent used XML before . Im using this : NSString stringWithFormat : @ maps.google.com maps http : maps.google.com maps geo q f f output xml ll f f spn f f quot latitude-longitude latitude-longitude location horizontalAccuracy location horizontalAccuracy Comment : Here it is how to work with XML developer.apple.com mac library documentation Cocoa Reference http : developer.apple.com mac library documentation Cocoa Reference Foundation Classes NSXMLParser Class Reference Reference.html and you can check the Apple examples at : developer.apple.com mac library samplecode ImageMap index.html http : developer.apple.com mac library samplecode ImageMap index.html apple ref doc uid DTS40009015 Comment : ok so i have been able to get it to save an array of the locations . so that is all good but while it is parsing the xml the whole UITableView is unusable . So I either need to do some sort of threading or something so that the user can still use the app while the location is being found . Is there a shorthand way with XML or do I have to get in to threading", "Question : Prior to iOS 4.0 CoreLocation was reporting altitude correctly now it always reports as 0 ft . .. . .. . Not working on Device nor Simulator does anyone else experience this issue Comment : Are you testing this on a device or on the Simulator Comment : Device and Simulator . .. . Answer : Core Location does not always report altitude immediately . I usually check for a zero altitude in my success delegate method . If the altitude is still 0 I keep checking otherwise I turn of CoreLocation .", "Question : I m requesting user location when a button is pressed which then triggers an API call . However I don t want to make this API call before the latitude-longitude values are obtained from the requestLocation call . I thought I could just poll with a while-loop checking if my optional variables latitude nil longitude nil but then just sits in the while-loop forever . I need to have some kind of waiting for those values because if I don t it just would send nils to the API call since it takes a few seconds to get the location . What would I do to make sure the API request isn t called until the latitude-longitude values are set from the requestLocation call Comment : Instead of making the call when the button is pressed make the call when you receive the latitude-longitude values Comment : Add a completion handler .. . Answer : Make the api call in the delegate where the location is being updated . DidUpdateLocation . I don t remember the name exactly . Didupdatelocations first location will be an older location so make sure the location you used to send the request is close to accurate .", "Question : I have multiple view controllers that need to get the user s location so I wanted to create a separate class that the ViewControllers can call to get the user s latest location . locationManager : didUpdateToLocation : fromLocation returns void . How do I pass the latitude and longitude data back to my ViewControllers as soon as the user s latitude and longitude is calculated I could try writing getters and setters in my locationManaging class but if I do that how do I know when to call the latitude getter and longitude getter methods from my ViewController class How do I hold the ViewController s main thread to wait for the latitude and longitude values from the locationManaging class Thanks Comment : locationManager : didUpdateToLocation : fromLocation is a delegate method . The location manager uses this method to inform your object that the location was updated with a new value - it s up to you to implement this method to do something with the value . .. . Answer : Create a singleton class which has a latitude and longitude properties startLocating and endLocating . In the class create a CLLocationManager instance and set its delegate to be the singleton . In startLocating and endLocating call the appropriate methods of the CLLocationManager instance . Make the delegate methods update the latitude and longitude properties . In other ViewControllers read this singleton s latitude and longitude properties . To know when to read those properties from another ViewController set an observer on these properties see the NSKeyValueObserving Protocol Reference https : developer.apple.com library mac documentation Cocoa Reference Foundation Protocols NSKeyValueObserving Protocol Reference Reference.html .. . .. . Before doing this look up the Internets for existing code . After doing this upload it to GitHub with a permissive license . Comment : thanks my follow up question is. . how do i know when my ViewController should call the singleton s latitude and longitude properties In other words how do I lock my ViewController s main thread to wait for valid lat long values in my singleton Comment : It s in the second paragraph might ve added it while you were reading my initial post Comment : you access the singletons properties inside the observers change-notification method Comment : I tried this today . But my code was not updating position until the class was declared singleton . But why Why we need to have a singleton . I did not even create multiple object . I was testing with single object .", "Question : I have multiple view controllers that need to get the user s location so I wanted to create a separate class that the ViewControllers can call to get the user s latest location . locationManager : didUpdateToLocation : fromLocation returns void . How do I pass the latitude and longitude data back to my ViewControllers as soon as the user s latitude and longitude is calculated I could try writing getters and setters in my locationManaging class but if I do that how do I know when to call the latitude getter and longitude getter methods from my ViewController class How do I hold the ViewController s main thread to wait for the latitude and longitude values from the locationManaging class Thanks Comment : locationManager : didUpdateToLocation : fromLocation is a delegate method . The location manager uses this method to inform your object that the location was updated with a new value - it s up to you to implement this method to do something with the value . .. . Answer : As user1071136 said a singleton location manager is probably what you want . Create a class a subclass of NSObject with just one property a CLLocationManager . LocationManagerSingleton.h : .. . .. . LocationManagerSingleton.m : .. . .. . To get the most recently received location simply use LocationManagerSingleton sharedSingleton .locationManager.location . It might take a few seconds to warm up the GPS to get accurate locations . Comment : Might want to update your @synchronized block to a dispatch once . Comment : @Rickay will this return result in case of Airplane mode Comment : If you check this answer : stackoverflow.com questions 7376294 http : stackoverflow.com questions 7376294 how-is-it-that-cllocationmanager-gets-a-location-when-airplane-mode-is-on you will find that in this case CLLocationManager returns the most recently acquired location but not new location information .", "Question : Is there a way to manually tell the device to dispatch a significant location change-notification that will wake up any applications registered for this notification This is for testing only and I realize this private API call would get rejected upon submission to the app-store . Comment : I dug through the private framework headers and could not find anything that resembled a trigger for this . It s not convenient to only be able to test this by getting in the car and driving around with a laptop . Comment : If you use the CLLocationManager didUpdateToLocation : fromLocation : delegate then you can use startUpdatingLocation instead of startMonitoringSignificantLocationChanges for test-purpose . With no filter set inside the CLLocationManager it calls didUpdateToLocation nearly every second if you have medium-good gps-reception . For test-purpose this could help . Comment : It s not really a matter of testing the output of CLLocationManager as much as the lifecycle of the app when woken up by a significant location change . Comment : If you have an Apple Dev account you may want to take a look at the iOS5 UIAutomation . It may eventually provide you with a solution . The only road-block is I don t know if you can put a program into background mode via UIAutomation . .. . Answer : I was struggling with the same issue how to test startMonitoringSignificantLocationChanges and check if my app is receiving location updates when suspended . I couldn t manage to catch the execution on a breakpoint but I managed to see the results of my implementation working by sending the new location data to the server . The whole flow : - Implemented with startMonitoringSignificantLocationChanges and an API call to my server to update the location latitude and longitude - Set the location updates background mode capability to true - Run the app so the location manager is initiated and the app is listening for location changes - Force closed the app - Set the debug- location on simulator to freeway drive - Opened maps to see if the location is changing - Waited on the server to see for location updates and was getting new results every about 3 minutes .. . .. . However I m still not sure if this is fine enough on a real device . I m working on Xcode Version 6.0.1 6A317 tested on Simulator iPhone 5s 8.0 .", "Question : i try to get the longitude latitude of the user current location my code is simply this : .. . .. . i got always this error from the didFailWithError method : .. . .. . can you please tell me what i miss thx in advance : .. . Answer : Simply ignore this error and wait for more updates or a different error . The docs for the location manager say that this error is temporary . It s letting you know that it failed to immediately retrieve a location but it continues to try . In such a situation you can simply ignore the error and wait for a new event . Which is a really boneheaded way to use a method named locationManager : didFailWithError : - Thanks Apple Apple Documentation https : developer.apple.com library ios documentation corelocation reference cllocationmanagerdelegate protocol CLLocationManagerDelegate CLLocationManagerDelegate.html apple ref occ intfm CLLocationManagerDelegate locationManager : didFailWithError :", "Question : Is it possible to search for all iBeacons which are nearby I know it s possible to search iBeacons by UUID . But i want to find all iBeacons nearby . Comment : The API does not allow for such a call for security reasons but I can see how this would be very interesting . One idea would be to reverse engineer the iBeacon specification scan for all nearby peripherals then see if the broadcasted advertisements are iBeacons . Unfortunately Apple has not released the iBeacon specification . But it seems that they use encoded information in the advertisement to create an iBeacon . Because UUIDs of iBeacons will be random its doubtful that you can determine if a peripheral is an iBeacon from the advertisement alone unless you are Apple . Comment : I have a mac application that is useful for debugging but it can t run on iOS devices.. . You can find it here if you was interested : github.com liamnichols iBeaconScanner https : github.com liamnichols iBeaconScanner Comment : I made an app that does run on iOS devices requires jailbreak : malcolmhall.com products ibeaconscanner http : www.malcolmhall.com products ibeaconscanner .. . Answer : each APP would use it s own specific UUID using the major and minor integer values to differentiate between beacons . for example the UUID would be associated with a chain of shops major would identify the shop and minor the aisle or even a group of products . scanning for unknown UUID s would not be very useful as your app would not know what to do with the information . the UUID is generated once and for all using the uuidgen command in the terminal . sadly there is no protocol to actually communicate with beacons hence there is no standard to get the location of a beacon or any other useful info . it would have been so much better if we could open a connection to a beacon usually the closest one and obtain additional data from it without having to be on the same WIFI network . you either have to use bonjour to communicate with the device over WIFI or use the major and minor id to obtain data from a webservice of some kind . Comment : scanning for unknown UUID s would not be very useful as your app would not know what to do with the information . That is horribly false as sometimes one needs to see all beacons without any context", "Question : I have multiple view controllers that need to get the user s location so I wanted to create a separate class that the ViewControllers can call to get the user s latest location . locationManager : didUpdateToLocation : fromLocation returns void . How do I pass the latitude and longitude data back to my ViewControllers as soon as the user s latitude and longitude is calculated I could try writing getters and setters in my locationManaging class but if I do that how do I know when to call the latitude getter and longitude getter methods from my ViewController class How do I hold the ViewController s main thread to wait for the latitude and longitude values from the locationManaging class Thanks Comment : locationManager : didUpdateToLocation : fromLocation is a delegate method . The location manager uses this method to inform your object that the location was updated with a new value - it s up to you to implement this method to do something with the value . .. . Answer : Based on the above answers here is what I did and you can find the complete example on github https : github.com irfanlone CLLocationManager-Singleton-Swift .. . .. . Just import this file in your project then you can either choose to implement the LocationUpdateProtocol or listen to notification for location updates .. . .. . Usage :", "Question : I need to find my current location with CoreLocation I tried multiple methods but so far my CLLocationManager has only returned 0 s. . 0.000.00.000 . Here s my code updated to work : .. . .. . Imports : .. . .. . Declared : .. . .. . Functions : .. . Answer : With CLLocationManager you don t necessary get the location information immediately . The GPS and other devices that obtain location information might not be initialized . They can take a while before they have any information . Instead you need to create a delegate object that responds to locationManager : didUpdateToLocation : fromLocation : and then set it as the delegate of the location manager . see here http : developer.apple.com library ios documentation CoreLocation Reference CLLocationManagerDelegate Protocol CLLocationManagerDelegate CLLocationManagerDelegate.html apple ref occ intfm CLLocationManagerDelegate locationManager 3adidUpdateToLocation 3afromLocation Comment : This article mobileorchard.com hello-there-a-corelocation-tutorial http : mobileorchard.com hello-there-a-corelocation-tutorial taken from a related stackoverflow question shows what to do .", "Question : I need to capture the GPS coordinates no reverse-geocoding names etc in regions where there is no internet such as on a sailing boat or in the Sahara desert so that you just get the latitude and longitude of where you are . Does Core Location support that and falls back to GPS-only no cell triangulation or WiFi location mapping I think it does but just want to be sure . Comment : At first I was inclined to say no but when I honestly look at it I wonder if it s a separate component.. . another question I would have would be If so would it charge the user anything depending on their data plan . Can you edit that in +1 for good question . Comment : I always assumed the GPS was just triangulation of cell towers but who knows Comment : @AlbertRenshaw No GPS doesn t have to do anything with cell tower triangulation . It s based on satellite + clock signals . But Core Location makes use of many different technologies to increase accuracy . GPS itself is slow and less accurate depending on where you are . And it doesn t work in a garage . or when you re in a building . So by combining GPS with cell triangulation and WiFi networks to coordinate mapping they achieve better accuracy in certain tricky situations and also get the location much faster than plain vanilla GPS . .. . Answer : Some iOS devices have a real GPS chip allowing you to get location data even with no Internet connection . I believe the last few iPhones all have GPS . Some of the iPad models have GPS . I don t believe any of the iPod touch models have GPS . Obviously without Internet you can t show any map data unless it is part of the app but the app will be able to record real location data . Also without Internet the GPS may take longer to get an initial position . The devices with GPS have what is called assisted GPS . This means Cellular and or WiFi triangulation is used to help get an initial position fix quicker that without . Devices without GPS use cellular and or WiFi triangulation to get estimated location data which is far less accurate than devices with GPS . Comment : All iPhones have a GPS chip so do all iPads that have cellular data Wifi only iPads do not have GPS chip . Data connection does speed up the acquisition time by providing an initial fix but is also used to download satellite ephemeris which is a lot faster than downloading it from the satellites themselves . Comment : @progrmr +1 . To be more precise I believe that the original iPhone did not have GPS but all of the other models do . But for all practical purposes you are correct . Comment : @rob you are correct I forgot that one . Comment : @progrmr : I like your point but can you please provide some link substantiating your point . Comment : It s called Assisted GPS http : en.wikipedia.org wiki Assisted GPS", "Question : Prior to iOS 4.0 CoreLocation was reporting altitude correctly now it always reports as 0 ft . .. . .. . Not working on Device nor Simulator does anyone else experience this issue Comment : Are you testing this on a device or on the Simulator Comment : Device and Simulator . .. . Answer : From the Core Location Data Types Reference http : developer.apple.com library ios documentation CoreLocation Reference CoreLocationDataTypesRef Reference reference.html : .. . .. . The CLLocationDistance data type the data type for altitude is a double . The formatter you are using for your stringWithFormat is an integer . You need to cast your altitude to an integer first or use a double f formatter . Comment : I am converting altitude to an integer . As I stated this worked perfectly ie . no code changed prior to iOS 4.0 . Comment : Also the way I have it gave me perfect altitude used to show for example 5280 ft . Comment : @WrightsCS have you tried the double formatter as suggested to see if that makes a difference Comment : Yes produces all 0 s ." ] }
[ "yes-answer-long", "yes-answer-short" ]
ios
UNK_RELATION
git-tfs@git-svn@97
git-tfs -- git-tfs is a windows open sourced two-way bridge between tfs tfvc and git similar to @placeholder .
{ "confidence": [ 86.78936767578125, 79.56803131103516, 79.50445556640625, 74.90773010253906, 74.84953308105469, 74.55956268310547, 74.31059265136719, 74.14997100830078, 73.87892150878906, 73.38212585449219, 73.31920623779297, 72.95055389404297, 72.86445617675781, 72.86445617675781, 72.86445617675781, 71.67817687988281, 71.62832641601562, 71.45603942871094, 70.54517364501953, 70.08307647705078, 69.82849884033203, 69.69978332519531, 68.84829711914062, 68.7500228881836, 68.74662780761719, 68.54285430908203, 68.52278137207031, 68.51194763183594, 67.67269897460938, 67.65597534179688, 67.54923248291016, 67.5384521484375, 67.25199127197266, 67.17813110351562, 67.09292602539062, 67.05307006835938, 66.90962219238281, 66.74779510498047, 66.72612762451172, 66.52901458740234, 66.52901458740234, 66.26371765136719, 66.05377960205078, 65.7481689453125, 65.7481689453125, 65.7481689453125, 65.7481689453125, 65.71426391601562, 65.49856567382812, 65.47349548339844, 65.44851684570312, 65.3534164428711, 65.3534164428711, 65.34727478027344, 65.29435729980469, 65.01680755615234, 64.73385620117188, 64.69380950927734, 64.64822387695312, 64.29658508300781, 64.29658508300781, 64.29658508300781, 64.29658508300781, 64.22880554199219, 64.02943420410156, 63.944435119628906, 63.84418487548828, 63.5588264465332, 63.5588264465332, 63.500404357910156, 63.500404357910156, 63.38408660888672, 63.35847091674805, 63.22651672363281, 63.22651672363281, 63.22651672363281, 63.22651672363281, 63.178897857666016, 62.92948913574219, 62.92948913574219, 62.7024040222168, 62.574241638183594, 62.36765670776367, 62.052490234375, 61.9144172668457, 61.9144172668457, 61.88233947753906, 61.664215087890625, 61.507781982421875, 61.480735778808594, 61.44623565673828, 61.44623565673828, 60.978755950927734, 60.978755950927734, 60.978755950927734, 60.978755950927734, 60.978755950927734, 60.9564094543457, 60.81473922729492 ], "content": [ "Are you looking for this : .. . .. . git-tfs is a two-way bridge between TFS Team Foundation Server and git similar to git-svn .", "feature request for git-tfs github.com git-tfs git-tfs issues 913 https : github.com git-tfs git-tfs issues 913", "github.com git-tfs git-tfs issues 950 https : github.com git-tfs git-tfs issues 950", "There is a direct way its called git-tfs https : github.com git-tfs git-tfs and it s up on github .", "I used git-tfs to work with a TFVC repository .", "Git + TFS", "I m using git-tfs and I was wondering if it is possible to merge two TFS branches using git-tfs .", "I m looking into plugin git-tfs https : github.com git-tfs git-tfs .", "TFS VC or TFS Git", "Here is a good doc how to migrate from TFVC : github.com git-tfs git-tfs blob master doc usecases https : github.com git-tfs git-tfs blob master doc usecases migrate tfs to git.md", "I haven t tried but I see multiple open issues on renames here : github.com git-tfs git-tfs issues https : github.com git-tfs git-tfs issues", "It s now possible to get the TFS branches to be correct Git branches if cloning using git-tfs https : github.com git-tfs git-tfs .", "Download zip https : github.com git-tfs git-tfs releases .. . 2 .", "Bind TFS to Git repository and then upload Git changes to TFS .", "Git tfs manages it s awareness of areas of TFS using git-config .", "As the main developer of git-tfs believe me that s not possible.. . .. . .. . Git-tfs can only manage one TFVC repository .", "Using git-tfs https : github.com spraints git-tfs I can clone a TFS repository or branch into a git repository .", "Instead of git-tfs try using git-tfs like so : .. . .. . More information : https : github.com git-tfs git-tfs issues 31", "Why with git-tfs", "it has known bugs https : github.com git-tfs git-tfs issues sort comments state open .", "@Wilbert There is a way to avoid that : pull request merged https : github.com git-tfs git-tfs pull 513 doc https : github.com git-tfs git-tfs blob master doc special-actions-in-commit-messages.md", "@Philippe git-tfs is an un-official plugin that is still on prototype version 0.19.2 https : github.com git-tfs git-tfs tree v0.19.2 .", "I m busy experimenting with git-tfs do tfs to git conversion .", "Is there any way to prevent git-tfs from checking these files into TFS while still tracking the changes in git", "If you use TFS Git or git-tfs to checkin in TFS VC https : github.com git-tfs git-tfs blob master doc special-actions-in-commit-messages.md there is no problem in using the convention.. .", "My team uses TFS and I prefer git so I use git-tfs to bridge the two for source control .", "There is a similar issue in Git-Hub for your reference : Object reference not set to an instance of an object https : github.com git-tfs git-tfs issues 300 .", "report here : https : github.com git-tfs git-tfs issues 461 .", "More details about it : https : github.com git-tfs git-tfs", "Git in TFS does not use TFS source control .", "I use git-tfs https : github.com git-tfs git-tfs to be able to work .", "I m using git-tfs to migrate .", "I am trying to migrate a TFVC project to Visual Studio Online git repository using git-tfs https : github.com git-tfs git-tfs blob master doc usecases migrate tfs to git.md .", "When you rcheckin git commits in TFS git-tfs for each commit create the corresponding changeset in tfs and fetch the content of this changeset to recreate a git-commit .", "2 . git-tfs init http : tfs-repository .. . 3 . git-tfs rchekin - ERROR : No TFS parents found .", "TFS supports git now : tfs news git support http : tfs.visualstudio.com en-us home news git 20support", "With TFS 2013 you can choose between classical TFS Version Control TFVC and Git for the source control backend .", "First you should be aware of the difference between checkin and rcheckin See git-tfs documentation for the commands for that https : github.com git-tfs git-tfs .. .", "I see you reported the error https : github.com git-tfs git-tfs issues 637 on the Git-Tfs project site and the issue was marked as fixed two weeks ago .", "Using TFS 2013 with Git .", "Git-tfs is not intended to do that .", "The git-tfs tool allows you to clone TFS branches to Git repositories .", "TFS 2015 supports and hosts Git repositories as well as TFVC .", "The exact goal of git-tfs is to check in tfs the exact content of the git commits you ve created .", "Then you can use git-tfs fetch or git-tfs pull to get the remaining history from that point on .", "If TFS supports using git out-of-the-box I would not use git-tfs .", "Can I use git-tfs checkin or git-tfs clone command in this case", "We use git-tfs the other way around where the shared repository is TFS and we all use git with git-tfs to make commits .", "All in all git-tfs makes using TFS bearable .", "With git-tfs https : github.com git-tfs git-tfs you can associate workitems in a commit-message using metadatas https : github.com git-tfs git-tfs blob master doc special-actions-in-commit-messages.md and even force commit policy .", "git-tfs clone tfs : 8080 tfs DefaultCollection http : tfs : 8080 tfs DefaultCollection some project", "Using Git and TFS .", "To a Git Repository on TFS", "Perhaps you should have followed the link given by git-tfs .. . .. . The link was this one https : github.com git-tfs git-tfs issues 461 .", "http : github.com spraints git-tfs", "Wouldn t git-tfs clone work on it", "I m new to git-tfs and was wonder if there was a way to ensure that some version of the .git folder would be sent to TFS for storage", "There are two fundamental differences between the two tools : .. . .. . git-tfs was built for Windows users and written on top of the .NET TFS SDK .", "We use TFS 2010 at work and I use git-tfs so I can use git locally .", "REPO-A is managed using GIT-TFS and REPO-B was a GIT repo .", "We use git-tfs when we CAN T use pure git .", "Both are checked out as different git repositories using git-tfs .", "Does anyone know if git-tf not git-tfs allows this kind of merging", "For a remote-worker without access to our TFS we cloned a TFS repository using git-tfs .", "Please see this link http : groups.google.com group git-tfs-dev browse thread thread 929d005ff9cdcc23 and this link https : github.com git-tfs git-tfs issues 91 for more details .", "We are using git for TFS .", "https : github.com git-tfs git-tfs blob master doc commands branch.md init-an-existing-tfs-branches .. . .. . And since the release 0.19 you can do a git-merge of 2 TFS branches and checkin it in TFS with rcheckin and it will be checked in as a merge changeset : https : github.com git-tfs git-tfs blob master doc commands rcheckin.md checkin-a-merge-changeset .. . .. . The only limitation due to TFS is that all the commits should have been already checked in TFS before doing your merge with git and check it in TFS .", "Before being able to work with git-tfs and use the rcheckin command you MUST clone https : github.com git-tfs git-tfs blob master doc commands clone.md your tfs repository .", "I explained all I can in the git-tfs documentation about branches https : github.com git-tfs git-tfs blob master doc usecases manage tfs branches.md merge-2-branches-and-checkin-this-merge-in-tfs", "I am migrating from TFS to GIT .", "I m trying to migrate our TFS repository to Git .", "created a branch locally git-checkout -b testbranch .. . created the same branch on TFS git-tfs branch Repo testbranch .. . made some changes for test and a commited on git only git-add git-commit on testbranch .", "See : .. . .. . Managing branches with git-tfs https : github.com git-tfs git-tfs blob master doc usecases manage tfs branches.md .. . git-tfs branch command documentation https : github.com git-tfs git-tfs blob master doc commands branch.md .. . Another answer on stackoverflow on the subject http : stackoverflow.com a 13710811 717372 .. . .. . git-tfs is also perhaps the only tool that permit you to migrate from TFS VC to TFS Git managing workitems if needed or plain git repository .", "possible duplicate of Git to TFS Source Control Migration http : stackoverflow.com questions 1983254 git-to-tfs-source-control-migration", "I am going to migrate my project folder from TFS to git using git-tfs .", "There is a work in progress https : github.com git-tfs git-tfs pull 480 already working quite well that support this case .", "I ve been using git-tfs to clone my TFS projects and upload them to git repos in Visual Studio Online .", "See in git-tfs issues : https : github.com git-tfs git-tfs issues .. . .. . Cloning each branch one by one is not a good idea because it will take you a lot of time and you won t be able to go further than git-tfs will bring you .", "I have read fairly thoroughly the documentation on git-tfs clone git-tfs quick-clone and git-tfs branch but still haven t been able to break into this problem .", "git-tfs parses your commit comments https : github.com git-tfs git-tfs blob master doc special-actions-in-commit-messages.md to provide work item associations with your changesets .", "So basically use git-tf on non-Windows and git-tfs on Windows", "I wrote a lot of documentation : github.com git-tfs git-tfs blob master README.md https : github.com git-tfs git-tfs blob master README.md Especially github.com git-tfs git-tfs blob master doc usecases https : github.com git-tfs git-tfs blob master doc usecases migrate tfs to git.md", "I was using git-tfs rcheckin after cloning the TFVC team project repo from TFS 2015 onto my local machine and using git-rebase --onto master --root otherrepo master .", "git-config --global alias.tc tfs checkin --no-merge .. . .. . git tc", "And some other good features.. . .. . .. . And it is more active https : github.com git-tfs git-tfs graphs contributors and more supported https : github.com git-tfs git-tfs issues", "FYI I made a PR which got merged to fix the issue in the official documentation github.com git-tfs git-tfs pull 903 https : github.com git-tfs git-tfs pull 903", "We are using TFS as main source control and I would like to use git as a frontend together with git-tfs https : github.com git-tfs git-tfs rcheckin https : github.com git-tfs git-tfs blob master doc commands rcheckin.md command but I have problems importing my repositories into git .", "Is there any way to get all the git commits as individual TFS checkins in this situation", "I tried using git-tfs subtree https : github.com git-tfs git-tfs blob master doc commands subtree.md but somehow I cannot figure out workflow with this .", "I m not a git-tfs user but I have done this with git-svn in the past which I believe has a similar approach .", "When checking several Git commits into TFS at once Git-Tfs combines the Git commit messages as the default TFS check-in comment .", "I used git-tfs https : github.com git-tfs git-tfs blob master doc usecases migrate tfs to git.md and a few online blog posts .", "How Do I Use git-tfs Idiomatically", "It just gets the tfs path to git and done .", "You need to be using Git on the TFS side .", "Why wouldn t it work on non-Git TFS", "git-tfs subtree seems to work too .", "In attempting to use Git-Tfs to pull the tip+history of a TFS project into a git-repo I m encountering what I think is an undocumented error .", "One of the issues I was running into was on a rebase git-tfs and git-tf would report that it had tfs changesets that were missing from the TFS server ." ] }
{ "confidence": [ 93.08065032958984, 89.64550018310547, 87.77013397216797, 87.577880859375, 87.3365478515625, 85.15092468261719, 84.7549057006836, 84.60327911376953, 83.32817840576172, 82.45513153076172, 82.19587707519531, 81.79444122314453, 81.6353530883789, 81.53936767578125, 81.47258758544922, 81.27535247802734, 81.18162536621094, 80.93876647949219, 80.5124740600586, 80.49372100830078 ], "content": [ "Question : We are using TFS as main source control and I would like to use git as a frontend together with git-tfs https : github.com git-tfs git-tfs rcheckin https : github.com git-tfs git-tfs blob master doc commands rcheckin.md command but I have problems importing my repositories into git . I have a two projects in my TFS .. . .. . and I would like to manage them in one git repository . How I can clone those two into one git repository so I can commit and push changes to both projects as one TFS changeset I tried using git-tfs subtree https : github.com git-tfs git-tfs blob master doc commands subtree.md but somehow I cannot figure out workflow with this . My approach was to init git-repo like shown below but I got errors I cannot recover from : Comment : Another approach could be the use of SubModules instead . You d end up with 3 Git Repo s one for each project and one that hosts them both as sub modules . Comment : @jessehouwing But than I need to synchronize manually each module . And I think I cannot commit to TFS changes from multiple-projects as one TFS changeset . .. . Answer : If you are using Git on TFS : .. . .. . The easiest way to do this is to simply check out each project and add the files to a single Git repository . If you are using TFVC on TFS : .. . .. . There is no way to do this . You can clone each repo separately and work on them independently . You cant have two different branching structures in a single Git repo . If you are using TFVC with no branches : .. . .. . You can use the GitTF subtree feature to have a single Git repo that contains two independent synched folders from TFVC . I would recommend that you migrate permanently to Git . Comment : I was considering it but I need whole history and I would like to commit from multiple-projects as one TFS changeset . Comment : You can take history with Git-TF for each project and create separate Repositories with the History . You should then be able to merge the repos . Comment : But once I merge repos than it will be not possible to push to TFS again won t it Comment : You need to be using Git on the TFS side . This will not work with TFVC . Comment : Why wouldn t it work on non-Git TFS Wouldn t git-tfs clone work on it I may be wrong but I m pretty sure it just cloned a tfs repo for me and my TFS instance it s not based on Git so it s probably plan MS TFS repo . git-tfs subtree seems to work too . Could you explain what you meant", "Question : The official SCM here at work is TFS . I use git-tfs https : github.com git-tfs git-tfs to be able to work . Other devs here at the local branch of our company use StarTeam http : www.borland.com Products Change-Management StarTeam for local development branches yes there are SCMs out there worse than TFS . Now some of us thinking about migrating from StarTeam to Git for our local development . What is the best way to use git in combination with tfs for multiple users The best idea I had : .. . .. . 1 . One central server holds a 1 : 1 copy of the TFS repository via git-tfs synced per script every hour or so .. . 2 . Dev pull from this server . 3 . Dev creates branch to implement feature . 4 . When done dev commits via TFS and deletes branch . 5 . Dev pulls his changes via step one into his master branch . Might this workflow work Does anyone have experience how something like that can be set up .. . Answer : First TFS is not an SCM it is an ALM platform . It provides two native SCM options TFVC and Git . Your best bet would be to create a new Team Project in your TFS server and when you are asked which SCM provider to use pick Git . This will give you something similar to GitHub or Bitbucket but enterprise ready with enterprise audit . You can then add this new TFS Git repo as an origin and push . If you still have to use TFVC then I would suggest that in addition to the above you can push daily with Git-tfs between this server Git repo and TFVC . 1 . Create a MyProject-Git Team Project with Git as the SCM .. . 2 . Clone your MyProject-TFVC with Git-TF .. . 3 . Add MyProject-Git as an remote for your local Git copy of MyProject-TFVC .. . 4 . Push to MyProject-Git .. . .. . You now have both a Git and TFVC copy of the same code with all of the history intact . Each of your coders can then clone the MyProject-Git and work happily away in Git . You can then setup an automated and scheduled process to sync MyProject-Git and MyProject-TFVC on a regular cadence . All you need notification of is conflicts but as everything is server-side and backed up you can do that at your leisure . Comment : Most blogs I ve read used TFS as synonym for TFVC . It might be not correct but everyone knows what it meant . We have to use the existing TFVC-repo and want to keep the TFVC-history correct . On top of that I want to keep the git history . That will not work in the intended workflow . Comment : Yes it will . You would maintain all history in both Git and TFVC . You just have to push from yourcode-git to yourcode-tfvc on a regular basis hopefully daily . Comment : Doing the commits on a central place once a day would conserve the history per commit but either every dev have to save their passwords on the server or the commiter would get lost . I got an idea how to use git-tfs on the dev-pc . As soon I get this fleshed out I will post it as answer . Nevertheless thanks for your answer and comments .", "Question : null .. . Answer : I was using git-tfs rcheckin after cloning the TFVC team project repo from TFS 2015 onto my local machine and using git-rebase --onto master --root otherrepo master . I merged another Git repo into the TFVC repo and fixed merge conflicts . In the middle of the rcheckin I had to shut my computer down and used Ctrl-C to quit the rcheckin . When I tried to restart I used git-tfs fetch and there weren t any changes and I also verified that in TFS . However when I tried to do an rcheckin again I got the following error : .. . .. . When I used git-tfs pull --rebase from this suggestion git-tfs : How to rcheckin git commits when there is another checkin in tfs http : stackoverflow.com questions 22921465 git-tfs-how-to-rcheckin-git-commits-when-there-is-another-checkin-in-tfs it looked like I needed to commit my changes which seemed a bit odd . Once I committed my changes I tried to use rcheckin and got the same error about new changesets . I looked again and there weren t any new TFS changesets introduced since the first rcheckin that I ran but I m wondering if there could be some incomplete TFS changeset somewhere on the TFS server that s conflicting . If so is there a way to delete it Or do I have to start all over again with a new repo Is there also a better way to pause an rcheckin or check in in pieces rather than one big push Comment : It is worth for you to have a double check to be sure that the git-tfs pull --rebase command works with projectA main path .", "Question : I need to transfert the open-source cms MyPrettyCMS source code from Codeplex to Source forge . MyPrettyCMS sources http : myprettycms.codeplex.com SourceControl latest was handled with Visual Studio 2013 directely connected to the CodePlex TFS . Now I have Visual Studio 2015 and TFS 2015 . I know that the trend is Git ans Sourceforge so I decided to move my project . I would manage source with my TFS AND with Sourceforge . I created a Team Project in my TFS and a Project in sourceforge https : sourceforge.net p myprettycms2016 code ref master for both I selected Git as source code management system . I cloned locally my empty tem project and I copied source code downloaded from Codeplex . My question is How I can Keep source in both TFS and Sourceforge repositories .. . Answer : Are you looking for this : .. . .. . git-tfs is a two-way bridge between TFS Team Foundation Server and git similar to git-svn . It fetches TFS commits into a git repository and lets you push your updates back to TFS . More details about it : https : github.com git-tfs git-tfs", "Question : For the same project I want to use 2 TFS server because I have 2 groups of developers and they can only access their own TFS and I can access both . This is very easy to do with git . Take a look at my .git config file . This project uses both github and bitbucket for remote . Now 2 sets of developers work on both bitbucket and github . I merge their change and push them to both servers . I have a business reason for this . I am wondering if it is possible with TFS or not . BTW I would rather have 2 TFS servers but 1 TFS and 1 git server is also acceptable . Comment : Why do you want to have two TFS servers TFS is designed with this in mind : If you need total isolation between two sets of artifacts builds work items source code etc use two Team Project Collections on one server . There s something fishy going on here though.. . if everything should be isolated why do you want to duplicate code between the two Instead of duplicating code there are several solutions you could use that make a ton more sense . .. . Answer : With TFS 2013 you can choose between classical TFS Version Control TFVC and Git for the source control backend . If you like the git-workflow you re using just setup 2 TFS Servers and choose to use the Git backend . http : blogs.msdn.com b mvpawardprogram archive 2013 11 13 git-for-tfs-2013.aspx Comment : Thanks for the comment . Unfortunately I do not control one of the TFS servers and it is running TFVC . Comment : You can use git-tf to integrate Git and TFVC .", "Question : During the past 24 hours I ve been struggling with the following . As our dev team uses TFS current version 2013 for quite some time we decided to migrate all of the projects to git . But unfortunately this doesn t look to be so easy . First of all I ve tried with git-tfs but every time I try to clone a collection it says : .. . .. . In contrary listing all of the branches runs smoothly . Because of that I was trying to go the way around by trying to convert a TFS repository into a TFS Git repository which would allow me to clone it and push it to our BitBucket repo . Unfortunately I cannot find how to convert a TFS repository to a TFS Git repository - only found how to create an existing . Last but not least I have even tried with git-tf - but every time I try to access my repos it says : Java....Main.class not found . Any tips-and-tricks onto how to successfully migrate from TFS to Git Thanks in advance .. . Answer : Unfortunately I cannot find how to convert a TFS repository to a TFS Git repository .. . .. . Just because there is no way to do it It s a very difficult task due to git and TFVC specificities so Microsoft never even tried to do it In a sense that s what the tools git-tfs and git-tf are trying to do with a lot of difficulties mostly due how horrible TFVC manage and store branches data in it s repository . Your only hope is in one of this 2 tools . Unfortunately git-tf is no more supported since 2 years and do not support branches : - .. . .. . git-tfs try to do a lot better job but some branch patterns still cause big problems : - In this last resort case clone without branch support is your last solution.. . Some doc on how to do it https : github.com git-tfs git-tfs blob master doc usecases working with no branches.md clone-just-the-trunk .. . .. . Feel free to read more doc on git-tfs github site . Access to path x denied . Are you sure that it is not just some rights access problem Because I never heard of such a problem.. . .. . .. . Ps : the way Microsoft see the migration from TFVC to git is to update to tfs 2015 update 2 and to create a git repository into the same project than the existing TFVC project and copy the source code to the git repository . TFVC keeping the history.. . If needed .", "Question : I m busy experimenting with git-tfs do tfs to git conversion . I understand the cmd below will clone everything and convert TFS branches into the git repository : .. . .. . There are a number of branches I don t want moved over - is there a way I can exclude one or more specific branches thanks .. . Answer : You won t be able to exclude any branches during the clone operation . It s an all or nothing operation . Remember that branches in git pointers to commits are different to branches in TFVC folders so if you re not planning on pushing back changes to the TFVC repository afterwards then you can simply delete the branches you don t want by using git-branch -D operation on each of the branches you wish to exclude . After the clone don t forget to do a git-gc and a git-tfs cleanup to minimise the size of your git repository . Comment : Neither gc nor cleanup are needed anymore because done automatically now.. .", "Question : I m testing out git-tfs with an on-premises TFS instance does it work with VSO too and trying to use rcheckin to push my Git commits up to TFVC . However when I try and use rcheckin I get an error that no TFS parents are found . The TFVC repo I m pushing to is empty and I want to push my changes from Git to TFVC . Here s what I ve done : .. . .. . What am I missing Do I run this command for my other branches like feature1 feature2 etc . I m pretty new to Git-TFS but it seems like a very handy tool . .. . Answer : Disclaimer : I m one of the developer of git-tfs.. . .. . .. . does it work with VSO too Yes What am I missing Before being able to work with git-tfs and use the rcheckin command you MUST clone https : github.com git-tfs git-tfs blob master doc commands clone.md your tfs repository . Feel free to read the other docs too . The use of rcheckin is a good idea - .. . .. . How do I use an existing Git repo separate to push changes to the TFS repo I ve cloned the TFS repo and it looks like it goes into a separate folder with it s own .git folder .. . .. . Git-tfs is not intended to do that . But a difficult solution exists using rebase . 1 . Add your existing repo as remote in the new repo cloned from TFS and fetch .. . 2 . Use git-rebase --into to rebase your old existing commits into the one fetched from tfs .. . 3 . Use rcheckin to push the commits .. . 4 . Do that again and again if you have branches with more subtilities . I hope you have not edit : I have written a shell script https : gist.github.com pmiossec 2421ffcc8011e873641b to replace the first 2 steps and make it easier and quicker . Comment : This is awesome thanks How do I use an existing Git repo separate to push changes to the TFS repo I ve cloned the TFS repo and it looks like it goes into a separate folder with it s own .git folder . Comment : Git-tfs is not intended to do that . But a difficult solution exists using rebase . 1 . Add your existing repo as remote in the new repo cloned from TFS and fetch 2 . Use git-rebase --into to rebase your old existing commits into the one fetched from tfs 3 . Use rcheckin to push the commits 4 . Do that again and again if you have branches with more subtilities . I hope you have not Comment : See edited answer.. . Comment : Perfect great answer Luckily didn t have to go this route but now I know :", "Question : In attempting to use Git-Tfs to pull the tip+history of a TFS project into a git-repo I m encountering what I think is an undocumented error . We are using TFS 2010 and Git 2.8.2.windows.1 .. . .. . Detail error message below : Comment : github.com git-tfs git-tfs issues 950 https : github.com git-tfs git-tfs issues 950 .. . Answer : This error is due to you are cloning a large TFS branch . There is a similar issue in Git-Hub for your reference : Object reference not set to an instance of an object https : github.com git-tfs git-tfs issues 300 . Comment : Our team project s are very small compared to that user s but there are several GitHub issues I ve found that I will be watching .", "Question : I m a newbie to Git . I m exploring one-way one-time migration of Git repository to TFS with history . I m looking into plugin git-tfs https : github.com git-tfs git-tfs . I couldn t find any help wiki blog on this particular scenario . Can I use git-tfs checkin or git-tfs clone command in this case Any examples would be great Thank you Comment : Does this help elegantcode.com 2011 03 15 http : elegantcode.com 2011 03 15 git-tfs-where-have-you-been-all-my-life Comment : Thanks KMoraz for the link It didn t cover TFS push part . Comment : FYI Microsoft just released cross-platform plug-in : git-tf . Please see video here - channel9.msdn.com Blogs VisualStudio http : channel9.msdn.com Blogs VisualStudio Announcing-git-tf-Combining-the-local-repository-of-Git-with-the-integrated-ALM-of-TFS .. . Answer : I was able to do it on test repository . Big thanks to Ivan Danilov . Here are exact steps : .. . .. . 1 . Download zip https : github.com git-tfs git-tfs releases .. . 2 . Unblock right-click file- properties- unblock downloaded files win 7 for me .. . 3 . Copy to C : Program Files x86 Git bin .. . 4 . Now you should be able to run Git tfs commands . 5 . Create empty TFS target folder assuming you are migrating to empty folder .. . 6 . Bind TFS to Git repository and then upload Git changes to TFS . Run commands in sequence : .. . .. . Please note rebase is the key . It could be more complicated if you have branches etc and I haven t tried those scenarios . Please see this link http : groups.google.com group git-tfs-dev browse thread thread 929d005ff9cdcc23 and this link https : github.com git-tfs git-tfs issues 91 for more details . Git http : i.stack.imgur.com U2b5d.gif TFS http : i.stack.imgur.com WvcR2.gif Comment : This looks as-if it doesn t preserve history - or if it does you have to do a new git-tfs rcheckin for each changeset from git . Is this correct Also how well does it handle renames and deletes Comment : I did rcheckin only once after rebase . I haven t tried but I see multiple open issues on renames here : github.com git-tfs git-tfs issues https : github.com git-tfs git-tfs issues Comment : I get out-of-memory issues when trying to rebase a large repository - has anyone encountered similar issues", "Question : In TFS 2013 is there any way to create a custom build workflow via a custom .xaml file which uses source from both a TFS-Git project and TFVC project When creating a Build Def in a Git project the Source Settings tab only allows selection of a single Git repo . When creating a Build Def in a TFVC project the Source Settings tab allows several paths from any TFVC projects . What I need is a way to combine the above functionalities into a single build definition . Is this possible If yes how My only requirement is that it must be a Git based Build Definition so ideally I need a TFS Activity which allows me to pass in multiple TFVC paths and copy them to the build folder . But I ll take any suggestions . Thanks in advance .. . Answer : Ultimately I created a new Git TeamProject and set up some triggered automation to keep the TFS project and Git project in sync . The automation is a simple git-tf pull from the TFS project followed by a git-push to the Git project . My custom build workflow pulls in the new Git project s repos as submodules and uses them accordingly .", "Question : Context .. . .. . A GitHub Enterprise installation used for development . Every developer has his own public repo and the organization has the authorative repo . Pull requests are used for code reviews and we loosely follow nvie s git-flow http : nvie.com posts a-successful-git-branching-model branching model . A TFS installation used for issue tracking and deployment the release branch . We mirror the release branch into a TFS repo . Work Items .. . .. . Now the hard part is : How do we associate git commits that may originally be done on the public branches of the developers with TF work items What I did .. . .. . I ve looked at the following projects for help : .. . .. . Git-TFS https : github.com git-tfs git-tfs .. . Git-TF nodirt https : github.com nodirt git-tf .. . Git-TF microsoft http : gittf.codeplex.com .. . .. . I ve read references to associating commits with work item in both Git-TF projects but I am unsure what tool to use and how to go about it exactly . I would be fine if I had to run a script on the release branch commits to extract work item references from the commit-message and associate them with changesets sent to TFS . However a solution that allows the association in metadata instead of commit messages would be preferred . What are my options to associate work items in TFS with git commits .. . Answer : With git-tfs https : github.com git-tfs git-tfs you can associate workitems in a commit-message using metadatas https : github.com git-tfs git-tfs blob master doc special-actions-in-commit-messages.md and even force commit policy . They are automaticaly associated when the commit are done in the TFS server if you use the rcheckin command https : github.com git-tfs git-tfs blob master doc commands rcheckin.md .. . .. . And there is even a git-note created on the git-commit to have the title of the workitem and a link toward the workitem But to use rcheckin in a synchronisation process between git and TFS you should before abolutely understand how it works When you rcheckin git commits in TFS git-tfs for each commit create the corresponding changeset in tfs and fetch the content of this changeset to recreate a git-commit . So even if it s nearly invisible for you in a normal worklow you have the git commits after the rcheckin that are not the same than the original ones there is a modification of the history . That could be a big problem if this git reporitory is supposted to be the central repository because every commiters will have to do a rebase . Otherwise it shouldn t be a problem because it s completly transparent except in special cases but easily solvable . Not a perfect solution.. . Comment : Interesting . More precise than my answer . +1 Comment : Git tfs is fast and more feature comple but very fragile while ms git-tf is limited but it is rock solid . Comment : @regisbsb Wrong I m pretty sure that git-tfs is as reliable as git-tf on the things that git-tf do . The only thing is that git-tfs is trying to support branches which git-tf didn t even think about because TFVC branch support is the worst mess you didn t even could think about . Every time I support an edge case there is another more silly to support If you want to be as reliable just use --ignore-branches option . That s it Comment : Just downloading a single branch failed on most of my TFS repos with any branching that s not orthodox . Git-tf is flawless . It just gets the tfs path to git and done . While I believe that your project is promissing you should have a look on the java source of the ms one .", "Question : I need to merge changes from a remote tfs repository branch into a git repository branch . Cloning would create a whole new git repository which I don t want . I want to merge into an existing git repository . Clarification : .. . .. . A couple of weeks ago a colleague cloned 2 TFS repositories : RepoA RepoB .. . That colleague left the company . We decided we wanted a single repository so I merged RepoA into RepoB as described here : Merge two Git repositories without breaking file history http : stackoverflow.com questions 13040958 merge-two-git-repositories-without-breaking-file-history .. . Since then all development teams have been using RepoB except one . One team continued to develop and commit into the TFS repository . Now we want to get that final team to start using Git we need to merge their work since the original clone tfs-RepoA into the Git repository RepoB Comment : Your question is not enough clear and it s difficult to read between the line : - Could you explain what you did to arrived here and more clearly what you want and why . I explained all I can in the git-tfs documentation about branches https : github.com git-tfs git-tfs blob master doc usecases manage tfs branches.md merge-2-branches-and-checkin-this-merge-in-tfs Comment : You should be able to add the TFS remote to the repo B and use git-tfs fetch to fetch the changes there . If the original commits of TFS repo B were not changed in your merge and if the TFS remote has the same name then git-tfs should pick up from where it s left off so it should only fetch the new changes . Afterwards you can merge the branch in again . Comment : @poke How do I add the TFS remote to RepoB Comment : Try git-tfs bootstrap https : github.com git-tfs git-tfs blob master doc commands bootstrap.md from a branch that contains commits from only . .. . Answer : We decided we wanted a single repository so I merged RepoA into RepoB as described here : Merge two Git repositories without breaking file history .. . .. . I don t understand well what you did here but I will assume that this operation was not too destructive .. . .. . I assume also if I understand well that the team that still use TFVC is committing in a branch that was cloned in the RepoA . The first thing you have to do is to verify that you still have the git-tfs metadata needed by git-tfs in the commits comming from the RepoA . They should look like git-tfs-id : https : yourtfs tfs TFS16 vtccds trunk C26497 .. . .. . Since you found these commits then checkout a branch on the last one retrieved from TFS . If you have version of git-tfs higher than v0.20 update if needed you then just need to do a git-tfs fetch . If you have an old version a git-tfs bootstrap is required before doing the fetch.. . If all works well after a long time you should have all the commits corresponding to the changesets of the team committing on TFS . Then you are able to do what you want with it and merge the branch.. .", "Question : In TFS 2013 is there any way to create a custom build workflow via a custom .xaml file which uses source from both a TFS-Git project and TFVC project When creating a Build Def in a Git project the Source Settings tab only allows selection of a single Git repo . When creating a Build Def in a TFVC project the Source Settings tab allows several paths from any TFVC projects . What I need is a way to combine the above functionalities into a single build definition . Is this possible If yes how My only requirement is that it must be a Git based Build Definition so ideally I need a TFS Activity which allows me to pass in multiple TFVC paths and copy them to the build folder . But I ll take any suggestions . Thanks in advance .. . Answer : No that s not possible to combine TFS-VC and TFS-Git in a single build definition . Microsoft made these 2 things very separated . But you could use a pre-build script in the Gittemplate12.xaml template to run a git-tfs quick-clone https : github.com git-tfs git-tfs blob master doc commands quick-clone.md and then clone your TFS-VC path collection inside a sub-folder . I have just tested and it works you can clone with git-tfs indside an existing git repository.. .", "Question : I have 2 different TFS repositories one using Visual Studio Online and another using my own local on premise TFS instance which I want to keep in sync using git-tfs . How do I need to set things up so that I can work locally in git and push changes up to both repositories Please note both TFS repositories are using TFSVC . Comment : It is hard to understand the scenario and why using git-tfs . Can you elaborate .. . Answer : As the main developer of git-tfs believe me that s not possible.. . .. . .. . Git-tfs can only manage one TFVC repository . Comment : I decided to go with other sync methods since this is not supported . For now I m using a manual ROBOCOPY command will try and hey something better going later", "Question : I faced with problem I can t modify CreationDate of Changeset in TFS 2015 use Microsoft.TeamFoundation.VersionControl.Client.dll .. . .. . After attempting run the changeSet.Update method the result was not good . Only changeset.Comment bla-bla-bla was applied other properties weren t success . So my questions are : .. . .. . 1 . How can I modify properties CreationDate Committer and etc . without the direct intervention into the database .. . 2 . Why this properties are only read 3 . Maybe some policy is prevent me do it .. . Answer : TFS 2015 supports and hosts Git repositories as well as TFVC . If you add a Git repo to your Team Project you can just add it as an additional remote and push . This will bring all history as is with no need to mess with history . If you have to move from Git to TFVC not recommended as Git is far better then you can use Git-TF to push code between the two . http : nkdagility.com migrating-codeplex-github .. . .. . Above is a reverse example but you should be able to : .. . .. . 1 . Clone the correct folder in TFVC .. . 2 . Force push from your existing Git repo unto the TFVC linked one .. . 3 . Push to TFVC .. . .. . As TFVC is auditable there is no way to get around the date issue . Ok so i lied and there is a way . .. . .. . 1 . Create a new empty Collection .. . 2 . Create a Team project and do NOT check in .. . 3 . Use the API to import each changeset and date should be writable . ...this was allowed to support a VSS to TFVC migration and your millage may vary . Comment : Thanks for your advice . I have managed to get the success result . I used TFS API for modify the changeset message . It was more accessible in my situation", "Question : I m using git-tfs and I was wondering if it is possible to merge two TFS branches using git-tfs . I have two branches MyCompany Dev MyCompany Release-3.3 . Release-3.3 originates from the Dev branch . Both are checked out as different git repositories using git-tfs . I d like to re-incorporate the changes back into the Dev branch . Can this be achieved with git-tfs or will I have to resort to trying to do it using TFS tools Comment : Why with git-tfs Comment : I d prefer to use the git-merge algorithm as it seems to resolve more conflicts automatically . .. . Answer : I m not a git-tfs user but I have done this with git-svn in the past which I believe has a similar approach . I think your main issue is that you have two repos . If you add both remote branches to the same git-repo you should then be able to do a local merge do a local commit and then push that commit to TFS . HTH", "Question : I recently have been going through the steps to move our Visual Studio Team Services projects from using TFS to Git . I have done this successfully using git-tfs and was able to get the branches and version history to come along for the ride as well . The issue I m running into now is that some of the TFVC projects to be converted have Sprints Work Items as well as checkins associated with them that I want to be able to migrate over to the new Git project . I m using visual-studio-2015 . I want to be able to migrate the sprints and work items over to the new project which uses git and historically associate all of the check-ins now commits . I know that I can create new work items sprints in Team Services then associate git commits with the work items using the syntax work item number but I don t know how to preserve or re-link the historical associations once I do the conversion . Is this even possible .. . Answer : You should have better read the document page on the git-tfs github about how to migrate from TFVC https : github.com git-tfs git-tfs blob master doc usecases migrate tfs to git.md migrate-toward-tfs2013-git-repository-keeping-workitems - .. . .. . The workitems should have been migrated first to generate a mapping file and being able to export commits with this new association . I have even fixed some bugs in the workitems tools to make it works for me . Here is my repository https : github.com pmiossec TotalTfsMigrationTool .. . .. . If you can t go back and do it again perhaps you could migrate your work items using this tool and write a tool that use the TFS api to read the workitems associated for each changeset use the mapping file to find the new workitem id and use the git-tfs metadata in each commit to associate the work item to the commit here again using the TFS api.. . Boring but not impossible.. . .. . .. . And if you open-source the tool I will be very happy and could even package it with git-tfs - Comment : You are totally right - it occurred to me late last night maybe git-tfs already does this....hmm I should re-read through those docs : I started getting familiar with the TFS API yesterday and will need some more time but this is something that I will likely continue to pursue...I ll let you know if when I have something worth sharing Fortunately I was able to drop the project from VSO and re-create it but not all the check-in work item associations are coming along so I m looking into that . Thanks again", "Question : I m new to git-tfs and was wonder if there was a way to ensure that some version of the .git folder would be sent to TFS for storage Unless I m missing something .. . .. . If our setup is local dev - tfs server then the only copy of the .git would be on the workstation of the developer . Or does this even matter A senerio needs to be covered where we could port all TFS central sources to GIT hub lab . Having the .git folder included would allow for this . Comment : Can you be clearer and better describe your goal Here is a good doc how to migrate from TFVC : github.com git-tfs git-tfs blob master doc usecases https : github.com git-tfs git-tfs blob master doc usecases migrate tfs to git.md Comment : What s the mean of some version of the .get folder would be sent to TFS for storage Did you want to keep different version of the .get folder or just like the normal files in source control keep one version keep covered with changeset . Comment : @Patrick-MSFT It was my lack of understanding with how TFS stores the Git . Just cloning from a local workstation would be fine . Scripts can be created for this . .. . Answer : Git in TFS does not use TFS source control . Its a separate GIT system . You shouldn t need to check-in your .git folder . When you want to move your code to Git hub lab you can do that by cloning the source to your local machine and then pushing it up to the remote Git server .", "Question : For a remote-worker without access to our TFS we cloned a TFS repository using git-tfs . When we got back his repository we saw that he worked on a new feature branch . Before trying to rcheckin his changes we merged his feature branch into the master branch . Since he didn t commit anything to master a fast-forward took place resulting in a single stream git-log . Unfortunately since the initial clone another completely unrelated checkin happened on TFS . When we try to rcheckin we get the following error message : .. . .. . I do not understand how the suggested rebase could help if we need all commits to reflect as checkins on TFS . Is there any way to get all the git commits as individual TFS checkins in this situation Comment : On a side note why are you using the git-tfs plugin Recent versions of TFS come with git support out of the box . Which version of TFS are you using Comment : @Cupcake Use git-tfs is a real gain over pure TFSVC And we can use it even if that s not the choice of all the team sometime or the company often . Comment : @Philippe git-tfs is an un-official plugin that is still on prototype version 0.19.2 https : github.com git-tfs git-tfs tree v0.19.2 . I haven t used the most recent version of TFS but I ve heard that you can choose to use git with it . If TFS supports using git out-of-the-box I would not use git-tfs . I ve personally run into edge cases with git-tfs where it doesn t always work like you would expect like not recording certain file merges additions and or deletions...i.e . it has known bugs https : github.com git-tfs git-tfs issues sort comments state open . Comment : @Cupcake Let me laugh We use git-tfs when we CAN T use pure git . Giving advice to use pure git is a nonesens Saying that git-tfs is a protoype because it s version number is just 0.19.2 is a sophism . Git-tf same tool from Microsoft is at v2 but is far behind in features and TFS support Pointing to the issue list of github is also bullshit when it contains pull request new ideas old bug not reproduced help.. . My team use git-tfs since 2 years without perhaps one problem Git-tfs perhaps need to support some more horrible cases tfs let you do but that s perhaps the only thing lacking.. . Comment : @Philippe ok fair enough . .. . Answer : The answer of @Cupcake is good but I want to add some things.. . If you want to be nearer than the tfs workflow when just checked in and solve your merge conflicts during this step you could use : .. . .. . which is equivalent to : .. . .. . It s not necessarily the better thing to do because normally between the pull --rebase where your changes and the one coming from tfs are merged and the rcheckin where you push your changes to tfs you should at least build your solution and also run your unit tests . But I recognized that sometimes it s a lot easier and my team all old tfs users only want to do that You should also be aware that s during the pull --rebase step that your changes are merged with the ones of your team so that s where merged are done at the file level and like with tfs when you checked in you will have to solve conflicts . In the case of the rcheckin --quick --autorebase if there is conflicts the command will exit . You will have to solve them and lauch the command again ." ] }
[ "yes-answer-long", "yes-answer-short" ]
git-svn
UNK_RELATION
terraform@versioning@47
terraform -- a tool for building changing and @placeholder infrastructure safely and efficiently .
{ "confidence": [ 34.82741165161133, 33.78973388671875, 33.53766632080078, 32.91115951538086, 32.640750885009766, 31.547286987304688, 30.88607406616211, 30.028873443603516, 30.028873443603516, 29.51847267150879, 29.51847267150879, 29.51847267150879, 28.877647399902344, 28.877647399902344, 28.877647399902344, 28.877647399902344, 28.877647399902344, 28.877647399902344, 28.704252243041992, 28.372417449951172, 28.372417449951172, 28.152368545532227, 28.152368545532227, 28.152368545532227, 28.087596893310547, 27.71868133544922, 27.352188110351562, 27.31824493408203, 27.31824493408203, 27.31824493408203, 27.31824493408203, 27.31824493408203, 27.31824493408203, 27.31824493408203, 27.004817962646484, 27.004817962646484, 26.4499568939209, 26.363990783691406, 26.363990783691406, 26.08568572998047, 25.833772659301758, 25.833772659301758, 25.833772659301758, 25.638713836669922, 25.57549285888672, 25.32337188720703, 25.32337188720703, 25.217741012573242, 25.217741012573242, 25.217741012573242, 25.217741012573242, 25.217741012573242, 25.217741012573242, 25.217741012573242, 25.217741012573242, 25.217741012573242, 25.217741012573242, 25.217741012573242, 24.804590225219727, 24.804590225219727, 24.804590225219727, 24.804590225219727, 24.804590225219727, 24.804590225219727, 24.804590225219727, 24.718292236328125, 24.682546615600586, 24.682546615600586, 24.682546615600586, 24.682546615600586, 24.682546615600586, 24.470718383789062, 24.238561630249023, 24.22164535522461, 24.22164535522461, 24.148025512695312, 23.979724884033203, 23.957603454589844, 23.932186126708984, 23.932186126708984, 23.932186126708984, 23.932186126708984, 23.123146057128906, 23.123146057128906, 23.123146057128906, 23.123146057128906, 23.123146057128906, 23.123146057128906, 23.123146057128906, 23.123146057128906, 23.123146057128906, 23.123146057128906, 23.123146057128906, 23.123146057128906, 23.123146057128906, 23.123146057128906, 23.08473777770996, 22.870960235595703, 22.704086303710938, 22.704086303710938 ], "content": [ "I m using Terraform to create my AWS infrastructure .", "I m using Terraform in a modular fashion in order to build out my infrastructure .", "One of the biggest features of terraform is that it can do an intelligent delta of your desired infrastructure and your existing infrastructure and only make the changes needed .", "Is terraform destroy needed before terraform apply", "Terraform destroy is only used in cases where you want to completely wipe your infrastructure .", "You need to run terraform apply then terraform output rendered", "There was no Terraform issue in the end .", "Do you mean a terraform refresh", "The format for the Terraform is correct and it was operating as expected .", "The terraform taint command manually marks a Terraform-managed resource as tainted forcing it to be destroyed and recreated on the next apply .", "Then when you run terraform apply it will create brand new instances without the terraform destroy .", "Running terraform requires that the terraform script can access my username and password for my openstack cloud .", "I need it for using the golden image in Terraform deployment", "Heredocs in Terraform are particularly funny about the surrounding whitespace .", "In the terraform docs it shows how to use a template .", "Hope you run terraform with latest version .", "Terraform really is lacking in good debugging options as of today .", "Terraform is still in develop mode not GA version .", "Now on the other hand the accepted and upvoted answer on Best practices when using Terraform http : stackoverflow.com questions 33157516 best-practices-when-using-terraform states : .. . .. . Terraform config can be used to provision many boxes on different infrastructure each of which could have a different state .", "This is not possible currently in Terraform itself .", "what is the terraform version", "By executing these 3 commands in sequence terraform will only perform the changes necessary in the order required to bring your environments in line with any changes to your terraform file .", "Instead of option apply + destroy you need run terraform with option taint + apply .. . .. . Normally we don t need run terraform destroy at all .", "However the only examples I have found for using hashicorp vault with terraform have been for AWS https : github.com redredgroovy terraform-provider-vault .", "I m comparing salt-cloud and terraform as tools to manage our infrastructure at GCE .", "Using the terraform remote config will store the .tfstate files in a hidden directory .terraform within the directory containing the terraform scripts .", "Here s entire Terraform manifest I use : .. . .. . I run the Terraform manifest .", "I m wondering if there s a more native solution provided by Terraform .", "By performing a refresh plan and apply you can ensure that terraform : .. . .. . 1 .", "This is important in case anything was changed manually outside of your terraform script .", "variables.tf .. . .. . main.tf .. . .. . Output of terraform apply .. . .. . How can we resolve this", "Its really annoying how picky EOF format is in terraform .", "Actually as it turns out the terraform documentation is flat out wrong", "I am using terraform to provision servers in a private openstack cloud .", "Please check - github.com hashicorp terraform issues 1439 https : github.com hashicorp terraform issues 1439", "I have worked with terraform before where terraform can place the tfstate files in S3 .", "terraform plan works as expected but with terraform apply I consistently get this error : .. . .. . If I immediately rerun terraform apply it launches the EC2 instance with no problem .", "Is it possible to add a new VM only using Terraform", "Following is the terraform recipe i am using .", "There are obviously other ways to do this but it is highly recommended that you couple a proper CM tool with Terraform and propagate such changes .", "What is the version of terraform you are running", "I m using compiled version of terraform", "If I run terraform taint node1 .", "The Terraform documentation https : www.terraform.io intro getting-started build.html apply states : .. . .. . Terraform also put some state into the terraform.tfstate file by default .", "Is terraform what I need", "Anyhow I ve raised an issue on Github github.com hashicorp terraform issues 7076 https : github.com hashicorp terraform issues 7076", "azure.microsoft.com en-us marketplace term terraform https : azure.microsoft.com en-us marketplace term terraform", "I ve been using Terraform to build my AWS stack and have been enjoying it .", "Just have to make sure you do a terraform get before each deploy to the non-dev envs .", "If your source is anything other than a file path you ll have to use terraform get to update those modules .", "Before you execute your terraform you need to set up your state .", "plan - Prepares a list for you to review of what terraform intends to modify or delete or leave alone .", "You could always manually destroy your instances after only running your terraform apply .", "I am trying to use a multiline string in the provisioner remote-exec block of my terraform script .", "Whats really terrible how NONE of this is explained on the terraform documentation in the one section that actually mentions EOF .", "Seems terraform gets the value of variable var.zookeeper ips list but the double quotes in double quotes makes the trouble .", "Copying files to remote hosts and executing them with pass variables isn t the most straightforward thing in Terraform .", "Terraform isn t the most robust when it comes to debugging so this was a bit tricky to track down .", "For example Terraform the Network Interface and then reference that when creating the VM .", "Is it just not possible to do this unless the resources were originally created using Terraform", "Whats the easiest way to have terraform interpret my command literally .", "I am running terraform with a private openstack cloud to bootstrap new servers .", "This file must be saved and distributed to anyone who might run Terraform .", "Does terraform also support azure blob storage as a backend", "Hi i am following the link https : github.com hashicorp terraform .", "Here is my current terraform script .", "And more people will enjoy Terraform https : www.terraform.io .", "I tested with Terraform v0.6.15 and its working fine .", "Which terraform version did you run with", "How does terraform deal with this kind of problem", "I am using Terraform to provision emr .", "As of Terraform 0.7 https : github.com hashicorp terraform blob master CHANGELOG.md not currently released but you can compile from source support for Azure blob storage has been added https : github.com hashicorp terraform pull 7064 .", "Why isn t Terraform accepting it", "refresh - Has an up-to-date understanding of your current infrastructure .", "with option plan and apply it is good enough to update the infrastructure with code .", "@PeterKirchner Terraform shouldn t need to publish anything to the marketplace or be in the marketplace to do this--it s a DevOps tool that leverages existing IaaS APIs to create destroy etc .", "The only way to achieve something like this is to use a separate script to interact with the git repository that Terraform clones into a subdirectory of the .terraform modules directory and switch it to a different tag depending on which version you need .", "I want to pass an infrastructure variable which picks up what tagged version of the Github repository the application should be building out .", "What we do is split our env into a module and then have a top level terraform file where we just import that module for each environment .", "As you scale up your terraform usage you will need to share state between devs build processes and different projects support multiple environments and regions .", "There are also edge cases where terraform may fail to understand the correct order-of-operations do I modify a security group first or a security group rule", "So how would I create a terraform script that can read a vault value containing two variables to use them for provisioning openstack instances", "Migrate existing VMs to be managed by Terraform means updating tfstate file .", "If I run a terraform graph it does show that the instance is dependent on the profile .", "Terraform v0.6.15 and yes I tested with boto that this profile does indeed work .", "My guess now is that Terraform doesn t work with multiple entries in the credentials file .", "Can someone please help me to understand the cyclic dependency in this terraform graph .", "refer the bug report : https : github.com hashicorp terraform issues 1885", "It does this by with terraform scripts that are run by consul watches and health checks .", "I want to add an additional backup terraform server for failover .", "How can I correctly sync my terraform files in this way", "In practice using terraform remote config is a 3 step process .", "I m getting started on using Terraform to spin up AWS EC2 machines .", "Terraform doesn t replace configuration-management tools like Ansible Chef and Puppet .", "I see a facility in Terraform for Heroku Add-On declarations but not for Azure marketplace subscriptions .", "Or ask Terraform to publish something to the Azure Marketplace what you can use .", "I m using packer with ansible provisioner to build an ami and terraform to setup the infrastructure with that ami as a source - somewhat similar to this article : http : www.paulstack.co.uk blog 2016 01 02 building-an-elasticsearch-cluster-in-aws-with-packer-and-terraform .. . .. . When command packer build pack.json completes successfully I get the output ami id in this format : .. . .. . In my terraform variables variables.tf I need to specify the source ami id region etc .", "github.com hashicorp terraform issues 539 https : github.com hashicorp terraform issues 539", "My problem is that my terraform config works fine unless I add os profile windows config with any sort of configuration .", "So if you know how it is build you can also like to resource that are not created in terraform ." ] }
{ "confidence": [ 44.56129837036133, 43.67997360229492, 43.23009490966797, 42.16346740722656, 39.20748519897461, 37.51273727416992, 34.59195327758789, 34.409427642822266, 34.09831237792969, 33.9671630859375, 33.96452713012695, 33.495361328125, 33.29296112060547, 33.0478401184082, 32.837921142578125, 32.837921142578125, 32.50731658935547, 31.506017684936523, 31.33312225341797, 31.18639373779297 ], "content": [ "Question : Is terraform destroy needed before terraform apply If not what is a workflow you follow when updating existing infrastructure and how do you decide if destroy is needed .. . Answer : That would be pretty non-standard in my opinion . Terraform destroy is only used in cases where you want to completely wipe your infrastructure . One of the biggest features of terraform is that it can do an intelligent delta of your desired infrastructure and your existing infrastructure and only make the changes needed . By performing a refresh plan and apply you can ensure that terraform : .. . .. . 1 . refresh - Has an up-to-date understanding of your current infrastructure . This is important in case anything was changed manually outside of your terraform script . 2 . plan - Prepares a list for you to review of what terraform intends to modify or delete or leave alone . 3 . apply - Performs the changes laid out in the plan . By executing these 3 commands in sequence terraform will only perform the changes necessary in the order required to bring your environments in line with any changes to your terraform file . Where I find destroy to be useful is in non-production environments or in cases where you are performing a restructure that s so invasive that starting from scratch would ensure a safer build . There are also edge cases where terraform may fail to understand the correct order-of-operations do I modify a security group first or a security group rule or it will find itself in a dependency cycle and will be unable to perform an operation . In those cases however running destroy is a nuclear solution . In general I would perform the problem change manually via command-line or AWS Console if I m in AWS to nudge it along and then run a refresh plan apply sequence to get back on track . Comment : Didn t know about refresh command...Thanks for the nice flow explanation", "Question : Is terraform destroy needed before terraform apply If not what is a workflow you follow when updating existing infrastructure and how do you decide if destroy is needed .. . Answer : More comments after @mwielbut s answer . Instead of option apply + destroy you need run terraform with option taint + apply .. . .. . Normally we don t need run terraform destroy at all . It is really dangerous option especially for production environment . with option plan and apply it is good enough to update the infrastructure with code . But if you do need destroy some resources and re-build something which are already created you can use the option of taint which is the right answer for your question it is so important and missed in @mwielbut s answer . The terraform taint command manually marks a Terraform-managed resource as tainted forcing it to be destroyed and recreated on the next apply . .. . This command will not modify infrastructure but does modify the state file in order to mark a resource as tainted . Once a resource is marked as tainted the next plan will show that the resource will be destroyed and recreated and the next apply will implement this change . Refer : .. . .. . command taint : https : www.terraform.io docs commands taint.html .. . .. . a sample of option taint : https : www.terraform.io docs modules usage.html", "Question : Is terraform destroy needed before terraform apply If not what is a workflow you follow when updating existing infrastructure and how do you decide if destroy is needed .. . Answer : You could always manually destroy your instances after only running your terraform apply . Then when you run terraform apply it will create brand new instances without the terraform destroy .", "Question : I m using Terraform in a modular fashion in order to build out my infrastructure . I do this by having a configuration file that calls in the different modules . I want to pass an infrastructure variable which picks up what tagged version of the Github repository the application should be building out . Most importantly I m trying to figure out how to make a concatenation of a string happen in the source variable of the configuration file . I want it to compile and for the source to look like this for example : git : : https : github.com ORG REPONAME.git ref v1 .. . .. . Anyone have any thoughts on how to make this work Thanks Keren Comment : P.S . sorry for the awful formatting.. . couldn t submit this as a code block bc Stack Overflow was complaining about the formatting.. . Comment : Its not supported yet . Please check - github.com hashicorp terraform issues 1439 https : github.com hashicorp terraform issues 1439 .. . Answer : This is not possible currently in Terraform itself . The only way to achieve something like this is to use a separate script to interact with the git repository that Terraform clones into a subdirectory of the .terraform modules directory and switch it to a different tag depending on which version you need . This is non-ideal since Terraform organizes these into directories based on a hash of the module path but if you can identify the module in question it is safe to run git-checkout within these repositories as long as you do not run terraform get again afterwards . For more details and discussion on this issue see issue 1439 in Terraform s issue tracker https : github.com hashicorp terraform issues 1439 where this feature was requested . Comment : Okay thanks for the info . I ended up running a couple of bash commands to overwrite the end of the source URL with a specific tag based on what I pass in .", "Question : null .. . Answer : I ve started to get into Terraform https : www.terraform.io and am loving it since for cost reasons I have my services across a number of infrastructure providers so it makes it easy to replicate full services without issues across IaaS providers . I use some third-party services through the Azure marketplace similar to Heroku s Add-Ons . I see a facility in Terraform for Heroku Add-On declarations but not for Azure marketplace subscriptions . How can I do this Update : How do I create an Azure marketplace order subscription via Terraform Comment : I m not sure I understand the question but.. . if a service image isn t available in the marketplace it s up to you to spin it up on your own in whichever way is most appropriate for the tool in question . Comment : The question is How do I create an Azure marketplace order subscription via Terraform Comment : As @DavidMakogon mentioned if it is not in the Azure Marketplace you have to create in on your own . Or ask Terraform to publish something to the Azure Marketplace what you can use . I also did a search on the Azure Marketplace and it seems there is no offer from them . azure.microsoft.com en-us marketplace term terraform https : azure.microsoft.com en-us marketplace term terraform Comment : @PeterKirchner Terraform shouldn t need to publish anything to the marketplace or be in the marketplace to do this--it s a DevOps tool that leverages existing IaaS APIs to create destroy etc . instances . I have already used it to create Heroku AddOns for example and Terraform has no need of a published AddOn .", "Question : null .. . Answer : I m using Terraform to create my AWS infrastructure . I ve a module that creates an aws iam role an aws iam role policy and an aws iam instance profile and then launches an EC2 Instance with that aws iam instance profile . terraform plan works as expected but with terraform apply I consistently get this error : .. . .. . If I immediately rerun terraform apply it launches the EC2 instance with no problem . If I run a terraform graph it does show that the instance is dependent on the profile . Since the second apply is successful that implies that the instance policy and all that it entails is getting created correctly doesn t it I ve tried adding a depends on and it doesn t help but since the graph already shows the dependency I m not sure that is the way to go anyway . Anyone have this issue Comment : Can you post up your tf file showing how these are glued together . I ve run into some odd timing issues with terraform but those were SQS related rather than IAM.. .", "Question : In the terraform docs it shows how to use a template . Is there any way to log this rendered output the console https : www.terraform.io docs configuration interpolation.html templates .. . Answer : You need to run terraform apply then terraform output rendered", "Question : I am trying to use a multiline string in the provisioner remote-exec block of my terraform script . Yet whenever I use the EOT syntax as outlined in the documentation and various examples I get an error that complains about having : invalid characters in heredoc anchor . Here is an example of a simple provisioner remote-exec that received this error both types of EOT receive this error when attempted separately : .. . .. . Update : Here is the working solution read carefully if you are having this issue because terraform is very picky when it comes to EOF : .. . .. . Note that if you want to use EOF all the commands you use in a provisioner remote-exec block must be inside the EOF . You cannot have both EOF and non EOF its one or the other . The first line of EOF must begin like this and you cannot have any whitespace in this line after EOF or else it will complain about having invalid characters in heredoc anchor : .. . .. . Your EOF must then end like this with the EOF at the same indentation as the .. . Answer : Heredocs in Terraform are particularly funny about the surrounding whitespace . Changing your example to the following seems to get rid of the heredoc specific errors : .. . .. . You shouldn t need multiple heredocs in here at all though as the inline array is a list of commands that should be ran on the remote host . Using a heredoc with commands across multiple lines should work fine for you : Comment : Yep that worked great . Its really annoying how picky EOF format is in terraform . That if I want to use EOF format then all my commands in the provisioner remote-exec block have to be in EOF . Whats really terrible how NONE of this is explained on the terraform documentation in the one section that actually mentions EOF . Like if you are going to have part of your software be extremely picky you should at least give an example in your documentation to make people aware of this . Comment : Actually as it turns out the terraform documentation is flat out wrong They mention using EOT format which doesn t work . The working format is EOF as @ydaetskcoR working example uses EOF which is not mentioned at all in the documentation : terraform.io docs configuration syntax.html https : www.terraform.io docs configuration syntax.html", "Question : I am a little bit puzzled on the question whether to commit .tfstate files to Git or not . The Terraform documentation https : www.terraform.io intro getting-started build.html apply states : .. . .. . Terraform also put some state into the terraform.tfstate file by default . This state file is extremely important it maps various resource metadata to actual resource IDs so that Terraform knows what it is managing . This file must be saved and distributed to anyone who might run Terraform . We recommend simply putting it into version-control since it generally isn t too large . Now on the other hand the accepted and upvoted answer on Best practices when using Terraform http : stackoverflow.com questions 33157516 best-practices-when-using-terraform states : .. . .. . Terraform config can be used to provision many boxes on different infrastructure each of which could have a different state . As it can also be run by multiple people this state should be in a centralised location like S3 but not git . Emphasis by the original author not by me .. . .. . Who is right and if so why .. . Answer : This is probably going to come down to preference but I would say git or any other source control is not a particularly good option for storing of state files as they are an output of the code you are writing much like a compiled binary or even minimised JS or LESS compiled to CSS . On top of that things may change quite rapidly in the state files as an output to things being run rather than things being actually changed in the code which makes the whole thing rather awkward . However you do need some way of sharing these state files with any remote team members or even other devices if you are developing on different laptops machines . You will also want some way to store and back these up because you re going to have some real pain if you lose a state file as Terraform uses the state files to work out what things it s managing so as not to step on the toes of other tooling . I d say S3 is probably the best place you can put them right now . It s pretty much free durability is excellent as is availability there s very good native support for it in Terraform using the remote state https : www.terraform.io docs state remote s3.html resource . And probably most importantly you only have to create an S3 bucket to get started . Having to build a Consul https : www.consul.io or etcd https : coreos.com etcd cluster first without Terraform otherwise you have a chicken and egg problem of where do you store the state for creating those is a bit of a pain even if you intend to use either of those products . Obviously if you re using OpenStack then Swift http : docs.openstack.org developer swift should make a good alternative although I ve not used it . I ve also not used Hashicorp s Atlas https : www.hashicorp.com atlas.html but if you re happy to pay for that service it might be equally useful .", "Question : null .. . Answer : I am using terraform to provision servers in a private openstack cloud . Running terraform requires that the terraform script can access my username and password for my openstack cloud . So I would like to store this info in a secret file and encrypt this something along the lines of ansible vault . However the only examples I have found for using hashicorp vault with terraform have been for AWS https : github.com redredgroovy terraform-provider-vault . So how would I create a terraform script that can read a vault value containing two variables to use them for provisioning openstack instances For reference here is how I mounted my vault secret backend : .. . .. . vault mount generic .. . .. . Here is what my secret would look like if I didn t write it into a json file : .. . .. . vault write generic logins usernames myUserName psswrds myPassword Comment : What s wrong with what you linked It seems to pull in any form of secrets from the backend . In fact the example in the README has it pull in both AWS creds and also an SSL cert and key .", "Question : I have been using terraform to create a CoreOs Cluster on Digital Ocean just fine . My question was addressed here http : maxenglander.com 2015 06 09 etcd-clusters-with-terraform.html but nearly a year has passed which seems like 10 on a fast pace projects like etcd2 and terraform . IMHO if the master fails terraform will create another instance with the exact same configurantion but according to the free discovery coreos service the cluster will be full and all the slaves will have the wrong ip to connect to the etcd2 master . In the case of a minion failure the master ip wont be an issue but I still wont be able to join a full cluster . How does terraform deal with this kind of problem Is there a solution or am I still binded to a hacky solution like the link above If I run terraform taint node1 . It there a way to notify the dicovery service this change .. . Answer : Terraform doesn t replace configuration-management tools like Ansible Chef and Puppet . This can be solved using a setup where say a Ansible run is triggered to reconfigure the slaves when the master is reprovisioned . The ansible inventory in this case would have been update by terraform with the right ip and the slave ansible role can pick this up and configure appropriately . There are obviously other ways to do this but it is highly recommended that you couple a proper CM tool with Terraform and propagate such changes .", "Question : I ve been using Terraform to build my AWS stack and have been enjoying it . If it was to be used in a commercial setting the configuration would need to be reused for different environments e.g . QA STAGING PROD . How would I be able to achieve this Would I need to create a wrapper script that makes calls to terraform s cli while passing in different state files per environment like below I m wondering if there s a more native solution provided by Terraform . .. . Answer : As you scale up your terraform usage you will need to share state between devs build processes and different projects support multiple environments and regions . For this you need to use remote state . Before you execute your terraform you need to set up your state . Im using powershell .. . .. . Your state is now stored in S3 by region by environment and you can then access this state in other tf projects .", "Question : null .. . Answer : I m using Terraform to create AWS ECS resources . I m planning to deploy 2 applications as Docker containers that share the same ECS Cluster so that I can have multi-tenancy on the ec2 instances . I have 3 separate git repos with respective Terraform files in them : .. . .. . 1 - Underlying ECS resources shared across the 2 apps - i.e . ECS Cluster ec2 instance Security Group ASG Launch Configuration etc . 2 - First application . As well as the source code I have the Terraform configurations that creates the ECS Service Task ELB ELB s security group etc which depend on resources created by repo 1 . 3 - Second application . Similar repo 2 with same set of AWS resources created and leveraging AWS resources created by repo 1 . Repos 2 and 3 depend on repo 1 . To be specific repo 1 creates the ECS Cluster . This is referenced when creating the ECS Service in repos 2 and 3 . Right now I ve hard coded the ARN but I d like to remove the hard coded value . Is this possible Do I need to structure my projects and Terraform separately or differently Further more there s actually a circular dependency as ideally repo 1 would also know about resources created in repos 2 and 3 . Specifically I d like the ec2 Security Groups SG to open ports for the ELB SG . If this is also possible then that would be awesome . Any suggestions or references would be greatly appreciated Comment : To clarify you re storing your applications Terraform configurations in their own repos Terraform seems to expect that all resources with interdependent outputs be in the same directory and thus map to the same statefile . You may need a tool that can somewhat dynamically unfortunately read from the statefile of another application . I ve been wondering how to solve a similar situation . We do use an S3 bucket for all our statefiles which makes it easier but pulling the statefile and extracting from it still feels hack-ish . Comment : Yes that s exactly my use-case . So you ve solved your solution by pulling state files from other Terraform configs Do you parse the state file manually for the arn or output values that you need Or does Terraform read from the state files if they re in the directory and you re then able to reference them in your .tf file as usual i.e . like aws elb.my elb.name Comment : I haven t actually implemented this yet still migrating existing infrastructure to Terraform slowly but hopefully I can add output definitions for the resources I need and then in the wrapper Rakefile I already have pull the tfstate files needed from the S3 bucket use terraform output -state statefile aws elb.my elb.name or parse the tfstate JSON directly put the data in probably a module while terraform configs can get information from a file they cannot yet run a command AFAIK and populate that way . Yeah it s crufty . Comment : I just came across this article and remote state . If you have your state files already in s3 looks like you may be able to refer to it directly : - terraform.io docs providers terraform r remote state.html https : www.terraform.io docs providers terraform r remote state.html - charity.wtf 2016 03 30 https : charity.wtf 2016 03 30 terraform-vpc-and-why-you-want-a-tfstate-file-per-env Comment : Nice Definitely makes it easier . Yeah we have separate VPCs per environment and I want to keep their Terraform configs separate to prevent stupid stuff happening to prod but there is a peered VPC with our admin monitoring stuff that needs to be referred to by each .", "Question : I need to deploy my Java application to AWS EC2 Instance using terraform . The catch here we should not use .pem file to deploy the application . I try to create ELB and associate instances using terraform.I can able to deploy the application using ssh and pem file to ec2 instances Private IPs . But we shouldn t use .pem or .ppk file as it ll not be allowed in production servers . I tried using chef with terraform but that also requires .pem to connect to AWS Instances . Please let me know the detailed steps suggestions of how to deploy the application using terraform without using pem file . .. . Answer : If you can t make any changes to your instance after creating it including deploying the application then you will need to bake any and all changes into the AMI that Terraform deploys . You might want to look into using Packer https : www.packer.io to create AMIs with your intended configuration and then use Terraform to deploy these AMIs . For reference this strategy is known as immutable infrastructure so you might want to do some further reading into this area . If instead it s simply that SSH connectivity is not allowed and you can make changes over other ports then you should be able to use an AMI that has a Chef https : www.chef.io client Puppet https : puppet.com agent or Salt https : saltstack.com minion on it there may well be other tools that work over a non SSH protocol port but this restriction rules out Ansible https : www.ansible.com and then use any of those tools to continue to configure your instance . Obviously you could find a suitable AMI from the AMI marketplace or once again use Packer to set up the relevant configuration-management client .", "Question : I ve been using Terraform to build my AWS stack and have been enjoying it . If it was to be used in a commercial setting the configuration would need to be reused for different environments e.g . QA STAGING PROD . How would I be able to achieve this Would I need to create a wrapper script that makes calls to terraform s cli while passing in different state files per environment like below I m wondering if there s a more native solution provided by Terraform . .. . Answer : No need to make a wrapper script . What we do is split our env into a module and then have a top level terraform file where we just import that module for each environment . As long as you have your module setup to take enough variables generally env name and a few others you re good . As an example Comment : Interesting . How do you keep the .tfstate files separated Do you keep the environment specific modules in separate folders and keep associated .tfstate files in there Comment : Don t need to one tfstate file for the entire aws account : if you check your module into git then you can set versions and branches for the envs . Just have to make sure you do a terraform get before each deploy to the non-dev envs . Comment : Do you mean a terraform refresh Comment : If your source is anything other than a file path you ll have to use terraform get to update those modules . During the first plan if you haven t done that it ll complain even for file path based modules . Comment : @n00b did that end up working for you If so can you mark this as the accepted answer", "Question : I am looking to pass variables to a script on a new created aws instance but I m not sure how . Here is what I have : .. . .. . I have verified that the zookeeper ips list has the correct list of IPs . There error that I get via terraform apply is : .. . .. . So basically I want to create this machine and then kick of my provisioner script that gets passed a list of IPs so it can do it s configuration . Comment : This looks pretty odd to me as you are taking a comma separated string and turning it into an array which you then pass to your provisioner script . I m not 100 sure what the expected behaviour actually is for that as I d expect it to want you to pass it as a string . Are you really meaning to do that Or would you be better off replacing the commas with spaces using replace Comment : We are passing those IP addresses into a bash script that just updates the zookeeper configuration for our cluster . The problem was solved with just some bash formatting . .. . Answer : Hope you run terraform with latest version . Seems terraform gets the value of variable var.zookeeper ips list but the double quotes in double quotes makes the trouble . You may try to escape them by I didn t try the code please let me know the result .. . .. . And you can take it out let me know the result as well . Comment : We removed the double quotes and fixed some bash formatting and was able to solve this . Terraform really is lacking in good debugging options as of today . Copying files to remote hosts and executing them with pass variables isn t the most straightforward thing in Terraform . Comment : Thanks for the updating . Terraform is still in develop mode not GA version . If my answer helps you please vote it . If resolve your problem please accept it .", "Question : I have worked with terraform before where terraform can place the tfstate files in S3 . Does terraform also support azure blob storage as a backend What would be the commands to set the backend to be azure blob storage Comment : Seems to be something you should ask the vendor directly . .. . Answer : As of Terraform 0.7 https : github.com hashicorp terraform blob master CHANGELOG.md not currently released but you can compile from source support for Azure blob storage has been added https : github.com hashicorp terraform pull 7064 .", "Question : null .. . Answer : I have a use-case where i am provisioning a GOMaster and GOServer using terraform and then registering goserver with newly provisioned gomaster . Following is the terraform recipe i am using . Terraform is also installed on docker server itself and i am executing this recipe from there . Remote exec part in goagent resource is not working . My assumption was that it logs in to provisioned goagent and modifies the files in that according to sed commands specified . But instead it is doing ssh to docker host and modifying files . Am i missing something DO we have to specify ipaddress or hostname in connection block for the remote device Comment : what is the terraform version what is the output for the remote exec", "Question : null .. . Answer : How to retrieve block device template group gid in softlayer I need it for using the golden image in Terraform deployment", "Question : I am looking to pass variables to a script on a new created aws instance but I m not sure how . Here is what I have : .. . .. . I have verified that the zookeeper ips list has the correct list of IPs . There error that I get via terraform apply is : .. . .. . So basically I want to create this machine and then kick of my provisioner script that gets passed a list of IPs so it can do it s configuration . Comment : This looks pretty odd to me as you are taking a comma separated string and turning it into an array which you then pass to your provisioner script . I m not 100 sure what the expected behaviour actually is for that as I d expect it to want you to pass it as a string . Are you really meaning to do that Or would you be better off replacing the commas with spaces using replace Comment : We are passing those IP addresses into a bash script that just updates the zookeeper configuration for our cluster . The problem was solved with just some bash formatting . .. . Answer : This was solved via some unrelated bash cleanup . The format for the Terraform is correct and it was operating as expected . We weren t dealing with the incoming IP addresses properly in our bash script and so it was failing . Terraform isn t the most robust when it comes to debugging so this was a bit tricky to track down . Comment : Can you edit your answer to show how you fixed it Comment : The solution came from fixing the underlying shell script . Fixing bash syntax errors and dealing with the array when it comes in . There was no Terraform issue in the end ." ] }
[ "yes-answer-long", "yes-answer-short" ]
versioning
UNK_RELATION
yui-datatable@api@75
yui-datatable -- the yui-datatable control provides a simple yet powerful @placeholder to display screen-reader accessible tabular data on a web page .
{ "confidence": [ 64.56119537353516, 64.56119537353516, 64.4823226928711, 63.56958770751953, 57.59062576293945, 55.7452392578125, 54.73149871826172, 54.3507080078125, 53.596351623535156, 52.50253677368164, 51.93283462524414, 51.6873893737793, 51.6873893737793, 51.60284423828125, 50.47956848144531, 50.42345428466797, 50.290557861328125, 50.15159225463867, 49.939064025878906, 48.94402313232422, 48.627037048339844, 48.627037048339844, 48.25669479370117, 48.15782165527344, 47.506534576416016, 47.140968322753906, 47.140968322753906, 47.140968322753906, 47.140968322753906, 47.140968322753906, 47.140968322753906, 47.140968322753906, 47.140968322753906, 47.111328125, 45.477447509765625, 45.477447509765625, 44.8255615234375, 43.48367691040039, 43.48367691040039, 43.48367691040039, 43.48367691040039, 43.48367691040039, 43.36402130126953, 43.124961853027344, 41.91594314575195, 41.734615325927734, 41.526615142822266, 41.526615142822266, 41.05463790893555, 40.96629333496094, 40.722530364990234, 40.289154052734375, 39.93812561035156, 39.93812561035156, 39.85724639892578, 39.059547424316406, 39.059547424316406, 38.90773391723633, 38.76506042480469, 38.728759765625, 38.64122772216797, 38.64122772216797, 38.64122772216797, 38.62563705444336, 37.42658996582031, 37.42658996582031, 37.39808654785156, 37.396026611328125, 37.101539611816406, 36.915000915527344, 36.47675323486328, 36.47675323486328, 36.47675323486328, 36.47675323486328, 36.47675323486328, 36.46363830566406, 36.46363830566406, 36.19477081298828, 36.19477081298828, 36.19477081298828, 35.795326232910156, 35.795326232910156, 35.76306915283203, 35.40225601196289, 35.386844635009766, 35.10776901245117, 34.813232421875, 34.813232421875, 34.813232421875, 34.813232421875, 34.813232421875, 34.813232421875, 34.813232421875, 34.813232421875, 34.813232421875, 34.48381042480469, 34.131805419921875, 34.131805419921875, 34.131805419921875, 33.75889587402344 ], "content": [ "How to render a YUI datatable", "Why the yui-datatable tag", "Each YAHOO.widget component such as YUI DataTable http : www.developer.yahoo.com yui-datatable uses a YUI DataSource http : www.developer.yahoo.com yui datasource component which provides data needed To populate each rendered YAHOO.widget component .", "I have this problem only at the page with yui-datatable .", "I m trying to display the following JSON object using YUI DataTable .", "i am displaying all of my data in yui-datatable .", "I am using YUI datatable 2.8.2 .", "Following the documentation of the YUI DataTable control http : yuilibrary.com yui docs datatable i ve inferred the following code : .. . .. . The insulting thing is that the documentation says : .. . .. . This code produces this table : .. . .. .", "How do I get column-count of a YUI datatable", "I m working with a UI that has a YUI2 JSON DataSource http : developer.yahoo.com yui datasource that s being used to populate a DataTable http : developer.yahoo.com yui-datatable .", "I ve managed to get the YUI DataTable to work using an HTML table element .", "One example of populating a Datatable with JSON data is provided here : .. . .. . http : developer.yahoo.com yui examples datatable dt xhrjson.html .. . .. . An example of how to send a post request using Ajax and YUI is provided here .", "I m designing one YUI datatable where I fetch the data from database and store it in a js object and wherever required I ll extract it and update the YUI datatable .", "I m setting up a YUI DataTable with filtering by following the steps on the YUI site http : developer.yahoo.com yui examples datatable dt localfilter.html .. . .. . However I am using JSON as the DataSource ResponseType .", ".. . .. . Another page http : yuilibrary.com yui docs datatable datatable-basic.html mentions including a div changing my BODY from empty to : .. . .. . but does not change the look of the control .", "Here http : jsbin.com ideha goes a powerful application when i show YUI datatable funcionality .", "I m using datatable-beta.js for yui-data table and we cannot replace it with a newer version .", "YUI DataTable doesn t display values for dot.notation keys though there seems to be a weird trick that works .", "I am trying to create a YUI 2.8.1 DataTable with a checkbox column .", "I did subscribe an event on data table as follows YUI data table http : developer.yahoo.com yui-datatable cellediting : .. . .. . myDataTable.subscribe cellClickEvent this.myDataTable.onEventShowCellEditor .. . .. . how can I achieve as follows", "This is in reference to this http : stackoverflow.com questions 1293738 yui-datatable-custom-column-definitions-and-data question .", "I am using YUI datatable and datasource to render data in one of my projects .", "So I am trying to adapt this example http : yuilibrary.com yui docs datatable datatable-sort.html : .. . .. . I need to dynamically add the data into this table .", "I am using YUI to display a DataTable within Liferay portlet without issue .", "See this example : http : yuilibrary.com yui docs datatable datatable-dsget.html .. . .. . You should be able to follow those steps replacing Y.DataSource.Get with Y.DataSource.IO", "I have read about the sortOptions and sortFunction at http : developer.yahoo.com yui-datatable but I can t seem to get it to work .", "You can sort the columns definition before passing them to the yui-datatable constructor : .. . .. . myCOlumnDefs.sort function c1 c2 .. . .. .", "I want to set the inline date cell editor s position to tr br with reference to a yui-datatable cell .", "I am sorting a YUI Datatable with a coloum as Date there are some NULL values for the coloumn .", "I m wondering how can I make the order of the columns sortable in a YUI 3 Datatable .", "So i m trying to parse an html-table to the YUI 3 DataTable widget modifiyng the widget HTML PARSER object .", "How can I add a class to the caption element of the Yui datatable apart from the default class i.e .", "Can I filter the rows of a static dataset using multiple drop-down menus and a paginated YUI datatable", "However the best solution is to either generate the table markup and let YUI create a DataTable from markup create a service that provides the data in a specific URL or both .", "I was able to show the lastName firstName startDate employeeCode employeeStatus successfully in YUI DataTable .", "As I said I am a beginner and can t quickly grasp all the methods functions used in YUI datatable .", "Let s say I have following JSON string - .. . .. . @lang : en-US .. . .. . .. . .. . And I m using the following code to create the YUI datatable consuming the above JSON - .. . .. . YUI .use datatable datatable-datasource datasource-local datasource-jsonschema function Y .. . .. . How can create a KnockoutJS template for the above code", "I d recommend posting this to the YUI forums -- http : yuilibrary.com forum -- that s a great place to get support on DataTable issues .", "The example given on this link http : developer.yahoo.com yui examples datatable dt localfilter.html gives the datasource as an array containing the fields .", "It has a piece of JSON consumed by a YUI DataTable which I need to create using KnockoutJS bindings .", "I have an example working here - http : jsfiddle.net BM3kX 5 .. . .. . It has a piece of JSON consumed by a YUI DataTable .", "See its source code To get a good insight how i use YUI datatable .", "What is the correct way to render a YUI data table", "I used the answer at : YUI 3 -Datatable with Paginator + Query Builder + Sort tried http : stackoverflow.com questions 22481461 yui-3-datatable-with-paginator-query-builder-sort .. . .. . to for the samples http : jsbin.com iwijek 10 and http : jsfiddle.net UwjUt which have inline json data .", "But still the data is not puplated in the datatable .", "I am new to YUI and I am using YUI 2 Datatable I would like to alert if the total number of record is more than 4000 and not to render the table .", "I m sorry to don t know the YUI library but I am pretty sure that you can point to the storage for your datatable source .", "I m using a YUI DataTable with a checkbox column like this : .. . .. . How can I iterate over all the rows that have been checked", "I have a YUI datatable and I am putting the following data in the table : .. . .. . Here the name column s width is set to the maximum length of characters entered for that name and the same with group .", "http : developer.yahoo.com yui docs YAHOO.widget.BaseCellEditor.html", "Need YUI 101", "But the above failed to render the data in the YUI table column cells .", "Two pages are exist one of these page uses yui data table while the other one does not .", "If I remove yui data table from the page it works without any problem .", "What I d like to try and do is have the query form at the top of the page the user press Submit and the results show up in a YUI DataTable below the query form .", "I want to use TYPE TEXT responseType for a YUI DataSource .", "Sorry for not mentioning earlier my Yui version is 3.1", "YUI datasource http : developer.yahoo.com yui datasource ds overview.png .. . .. . Notice each YAHOO.widget component internally makes a call To The underlying YUI datasource Through sendRequest http : developer.yahoo.com yui docs YAHOO.util.DataSourceBase.html method sendRequest method See step 1 .", "I haven t read the documentation for Y.DataTable http : yuilibrary.com yui docs api classes DataTable.html but you can sort the columns attribute subscribe to the columnsChange event and then make the datatable re-render .", "PS : I m new to YUI .", "That formatter is a YUI2 DataTable formatter .", "yui3-datatable-caption", "This is simply not possible in the datatable .", "The data returned happens to be NULL and YUI datasource is unable to parse it .", "I am using YUI2 datatable .", "If the datatable works for you keep using it .", "I want to refresh datatable using new data in json format .", "The questions I have deal with the YUI side of things .", "Justin -- There s a dedicated forum for YUI DataTable support -- yuilibrary.com forum viewforum.php f 90 http : yuilibrary.com forum viewforum.php f 90 -- if you don t get an answer here on SO you may want to try there .", "After some digging I am sure yui data table causes a problem about enter key-events of all other components at the page .", "Most of the code is copied from YUI basecelleditor s move function .", "@chittprakash .. . .. . Here is an example : http : yuilibrary.com yui docs api classes DataTable.Sortable.html", "Does someone face with a similar problem about yui library", "Y.DD is Drag and Drop http : yuilibrary.com yui docs dd .", "Maybe i misread the documentation http : yuilibrary.com yui docs widget .", "Take a look at the YUI documentation for more information on this http : yuilibrary.com yui docs api classes DataTable.BodyView.html property CELL TEMPLATE", "Ref : .. . .. . YUI .use node function Y Y.one body .addClass yui-skin-sam .. . .. . http : jsfiddle.net ejx3zex3 1", "My own is akin to yuilibrary.com yui docs model-list the-sync-method http : yuilibrary.com yui docs model-list the-sync-method .", "ERROR DATAINVALID .. . ERROR DATANULL .. . .. . I checked the yui documentation http : developer.yahoo.com yui docs YAHOO.util.DataSourceBase.html method DataSourceBase.parseString and found that the string parser does not parse null values .", "And in the example I linked to above ericmiraglia.com yui demos 2in3dt.php http : ericmiraglia.com yui demos 2in3dt.php I m using subscribe and it works fine there .", "I have a datatable in Grails with several sortable columns .", "I have one datatable in my application .", "Below is the declaration code of datasource and datatable .", "http : developer.yahoo.com yui datasource caching should help .", "I have a YUI datatable and I have a function which is invoked when I click on a row : .. . .. . I d like to invoke the function subscribed to rowClickEvent on the row which is currently highlighted in the datatable the row which was clicked for the last time .", "I have the feeling that what I m asking is beyond the capability of the default YUI DataTable DataSource functionality and that I ll have to write my own setInterval success callback or something along those lines .", "I have just discovered YUI and am trying to get started using it .", "Maybe this is just basic Ajax that the YUI docs don t cover", "I am pretty new to YUI and need some help .", "See LABEL CANCEL and LABEL SAVE in BaseCellEditor http : developer.yahoo.com yui docs YAHOO.widget.BaseCellEditor.html property LABEL CANCEL", "Using DataSchema http : yuilibrary.com yui docs dataschema is the correct way to handle this .", "Are you using your own sync layer or one of the ones provided by YUI", "Eric I ended up getting an answer to this issue on the YUI Library forum .", "on is just an alias to subscribe so you re not switching to a YUI 3 event in that case .", "I ended up getting an answer to this issue on the YUI Library forum .", "Do I implement an onSubmit JavaScript function which then triggers some YUI DataSource to go fetch the data", "In the columnset I tried user.userId and it is displayed as value in the DataTable .", "How can I show the value of user.userId in DataTable", "This time I got an empty DataTable with only the headers .", "Example : .. . .. . For more information see the primefaces showcase link : http : www.primefaces.org showcase ui data datatable summaryRow.xhtml" ] }
{ "confidence": [ 75.79029846191406, 74.36402893066406, 68.88663482666016, 67.2394027709961, 66.52618408203125, 65.04285430908203, 64.65692138671875, 64.24390411376953, 63.983516693115234, 63.713436126708984, 62.780303955078125, 61.71562194824219, 61.67124938964844, 61.458290100097656, 60.844688415527344, 59.562255859375, 59.52540969848633, 59.037349700927734, 58.88437271118164, 58.85838317871094 ], "content": [ "Question : Following the documentation of the YUI DataTable control http : yuilibrary.com yui docs datatable i ve inferred the following code : .. . .. . The insulting thing is that the documentation says : .. . .. . This code produces this table : .. . .. . enter image description here http : i.stack.imgur.com COVBM.png .. . .. . except that this code produces this table : .. . .. . enter image description here http : i.stack.imgur.com 53pUn.png .. . .. . So obviously i m missing something pretty fundamental about how to render a YUI data table . What is the correct way to render a YUI data table Q . How to render a YUI datatable .. . .. . Another page http : yuilibrary.com yui docs datatable datatable-basic.html mentions including a div changing my BODY from empty to : .. . .. . but does not change the look of the control . .. . Answer : Add class yui3-skin-sam in body tag table css is written corresponding to this class .", "Question : Following the documentation of the YUI DataTable control http : yuilibrary.com yui docs datatable i ve inferred the following code : .. . .. . The insulting thing is that the documentation says : .. . .. . This code produces this table : .. . .. . enter image description here http : i.stack.imgur.com COVBM.png .. . .. . except that this code produces this table : .. . .. . enter image description here http : i.stack.imgur.com 53pUn.png .. . .. . So obviously i m missing something pretty fundamental about how to render a YUI data table . What is the correct way to render a YUI data table Q . How to render a YUI datatable .. . .. . Another page http : yuilibrary.com yui docs datatable datatable-basic.html mentions including a div changing my BODY from empty to : .. . .. . but does not change the look of the control . .. . Answer : Move the script s to the bottom of the body or at least after the div that will contain the DataTable . That will avoid a race-condition where the scripts may be loaded before the DOM is set up . render example is telling the DataTable to render into an element with an id of example The markup sample you included has a div with a class of example then two divs with ids simple and labels . You need to make sure you re rendering inside a parent element with class yui3-skin-sam . If you tell a YUI widget to render into an element it can t find it falls back to rendering it inside the body . You can fix this in a few ways : .. . .. . add the class to the body tag instead of a div not a bad idea but you should still fix the render target selector .. . use a render target selector that matches an element on the page such as render .example render simple or render labels . In any case make sure your render target is inside an element with class yui3-skin-sam Comment : i tried to make the changes i think i inferred from your notes . It didn t work . Can you post code with the changes you suggest Comment : jsbin.com 3 ebadiq 1 edit html live http : jsbin.com 3 ebadiq 1 edit html live", "Question : I have a problem with selecting an option from combobox through hitting enter . Two pages are exist one of these page uses yui data table while the other one does not . I have this problem only at the page with yui-datatable . After some digging I am sure yui data table causes a problem about enter key-events of all other components at the page . If I remove yui data table from the page it works without any problem . I m using datatable-beta.js for yui-data table and we cannot replace it with a newer version . There are so many things relates to this library so it is not wanted by the company . I cannot use enter to select an option at a simple html-select tag because of this problem . How do we solve this problem Does someone face with a similar problem about yui library .. . Answer : You can override the method in your page so that you won t need to change the original script . Just override it like below e.keyCode 13 removed and your enter issue for that page will be solved . Comment : Pretty good idea I did not touch anywhere else . I just overrided that page . It works now thanks .", "Question : Can I filter the rows of a static dataset using multiple drop-down menus and a paginated YUI datatable http : www.mappingbahia.org project iguape dataset.html .. . Answer : Each YAHOO.widget component such as YUI DataTable http : www.developer.yahoo.com yui-datatable uses a YUI DataSource http : www.developer.yahoo.com yui datasource component which provides data needed To populate each rendered YAHOO.widget component . Bellow you can see how it works .. . .. . YUI datasource http : developer.yahoo.com yui datasource ds overview.png .. . .. . Notice each YAHOO.widget component internally makes a call To The underlying YUI datasource Through sendRequest http : developer.yahoo.com yui docs YAHOO.util.DataSourceBase.html method sendRequest method See step 1 . Now let s see sendRequest signature .. . .. . request .. . .. . For remote data this request may be a param value string such as id 123 name foo . For local data this request maybe a simpler value such as 123 . Specifying parameters may be irrelevent so this value may be simply be null .. . .. . callback .. . .. . It is just an JavaScript object which can be described as follows Notice each property .. . .. . So when each YAHOO.widget component makes a call To The internally YUI datasource Through sendRequest method It pass a built-in callback object as shown above which Takes care of rendering The YAHOO.widget component itself . So if you want a custom behavior you need To make a call To The underlying YUI datasource and pass your custom callback object To filter The data provided by The YUI datasource as follows .. . .. . To attach each change event To each select you can use .. . .. . Althoug not Tested i am pretty sure it will work fine . Comment : Hey just found this and it was both incredibly helpful and annoyingly time-consuming . Thanks Arthur very much for putting the work into this answer . One minor thing needs to change for this code to work - that is the paginator totalRecords property needs to be set . The initializeTable method zeroes this property and if it is not set again the paginating will break . On the line immediately before this.render include the following : pag this.get paginator if pag pag.set totalRecords filtered.length EDIT : just to note not whinging at you about the time-consuming just at YUI2", "Question : I have a problem with selecting an option from combobox through hitting enter . Two pages are exist one of these page uses yui data table while the other one does not . I have this problem only at the page with yui-datatable . After some digging I am sure yui data table causes a problem about enter key-events of all other components at the page . If I remove yui data table from the page it works without any problem . I m using datatable-beta.js for yui-data table and we cannot replace it with a newer version . There are so many things relates to this library so it is not wanted by the company . I cannot use enter to select an option at a simple html-select tag because of this problem . How do we solve this problem Does someone face with a similar problem about yui library .. . Answer : I commented out some code blocks to find out which code causes this problem . I eliminated lots of code parts by this way and reached this line : .. . .. . This line is at the datatable-beta.js and I don t know why they did something like this . They re handling keydown event of all dom element . That s why I cannot hit the enter to select an option from combobox . Combobox is just a sample I mean we cannot use enter for any component at the page . Handler method s code is below : .. . .. . They re handling escape and enter characters . I do not want to comment out these lines . It may effect other code blocks . I found the problem exactly but you may still suggest a solution . Because even if i found the problem I m still searching the best way to use enter key without changing orginal script .", "Question : I have a YUI datatable and I have a function which is invoked when I click on a row : .. . .. . I d like to invoke the function subscribed to rowClickEvent on the row which is currently highlighted in the datatable the row which was clicked for the last time . I ve tried to do something like this : .. . .. . but getSelectedRows doesn t return any row . How can I get the highlighted row in the datatable and then call the function associated with rowClickEvent Thanks Comment : Javi -- There s a dedicated forum for YUI DataTable discusion -- yuilibrary.com forum viewforum.php f 90 http : yuilibrary.com forum viewforum.php f 90 -- if you don t get a great answer here on SO you may want to try over there . -Eric .. . Answer : Here http : jsbin.com ideha goes a powerful application when i show YUI datatable funcionality . See its source code To get a good insight how i use YUI datatable . I use a helper like .. . .. . And when i want to subscribe some event i do as follows .. . .. . I hope It can be useful", "Question : null .. . Answer : I am trying to do YUI client-side filtering of data that is the resultlist of a query run on the mysql database . The example given on this link http : developer.yahoo.com yui examples datatable dt localfilter.html gives the datasource as an array containing the fields . I tried to make it point to the data coming from the database but with no luck . Could anyone help me out Thanks in advance Comment : How are you providing the client with the information on the database Comment : The data is rendered inside a div tag in the html source . I make the YUI DataSource point to this tag using YUI.util.DOM.get id Comment : You could try to put that in a script-tag instead of a div . Then you d be generating a JavaScript variable that you can reference from the DataTable code . However the best solution is to either generate the table markup and let YUI create a DataTable from markup create a service that provides the data in a specific URL or both . Comment : And as a passing comment YUI2 is no longer under development . It s only getting occasional bug fixes . You should really consider moving to YUI3 which is getting a new DataTable faster and with more features by January .", "Question : I m a Java programmer but not a JavaScript programmer . I have just discovered YUI and am trying to get started using it . What I d like to try and do is have the query form at the top of the page the user press Submit and the results show up in a YUI DataTable below the query form . Normally of course on a HTML form the user presses Submit the request gets sent to the server and I use Struts to process it and then forward the request to a JSP and HTML gets sent back to the browser . That s what I do on a daily basis . With Ajax I understand it s different in that I should return XML instead . Not a problem . Easy to do . The questions I have deal with the YUI side of things . When the Submit button is pressed what happens Not normal form submission right Do I implement an onSubmit JavaScript function which then triggers some YUI DataSource to go fetch the data How do the request params get passed Hopefully I don t have to construct the request manually . I m guessing that I use a YAHOO.util.XHRDataSource and that s the DataSource for the DataTable . I ve managed to get the YUI DataTable to work using an HTML table element . Now I just need to switch it over to real data . Curiously the YUI documentation seems a bit weak here unless I m missing something . Maybe this is just basic Ajax that the YUI docs don t cover .. . Answer : First of all when working with Ajax you don t need to return XML from the server you could return plain text XML JSON strings literally any form of textual data that you want . One example of populating a Datatable with JSON data is provided here : .. . .. . http : developer.yahoo.com yui examples datatable dt xhrjson.html .. . .. . An example of how to send a post request using Ajax and YUI is provided here . http : developer.yahoo.com yui examples connection post.html .. . .. . That should get you started now just link both of them together . To connect to the server you can use the Yahoo.util.Connect.asyncRequest method which takes in the following parameters : .. . .. . See an example here this one uses GET so you can use either GET or POST just make sure you pass in your parameters .. . .. . http : developer.yahoo.com yui examples json json connect.html .. . .. . Once your function returns on your onSuccess do the following to parse the response text to JSON .. . .. . The jsonData object now contains your data so now you can follow this example : .. . .. . http : developer.yahoo.com yui examples datatable dt basic.html .. . .. . It shows you how to initialize a datatable with a local object holding the datasource . basically it would be something like this .. . .. . For this to work you have to have a div container in the HTML code with an id of basic note this matches the first parameter on the DataTable .. . .. . Hope this helps Comment : It s exactly that link both of them together part that I m having difficulty with . I assume that when I do the POST the handleSuccess column will give me the o.responseText and I need to feed that into some DataSource . How", "Question : How can I add a class to the caption element of the Yui datatable apart from the default class i.e . yui3-datatable-caption Thanks .. . Answer : You could change the CAPTION TEMPLATE http : yuilibrary.com yui docs api classes DataTable.TableView.html property CAPTION TEMPLATE property . Comment : Sorry for not mentioning earlier my Yui version is 3.1 Comment : I m afraid that is possibly an earlier version of DataTable that was deprecated long ago . I doubt you will be able to find any support for that one . A generic alternative to your problem is to enclose the text for your caption in a span tag with your desired className before setting it in the DataTable .", "Question : I m trying to display the following JSON object using YUI DataTable . I was able to show the lastName firstName startDate employeeCode employeeStatus successfully in YUI DataTable . But I couldn t show the values in the inner object . In the columnset I tried user.userId and it is displayed as value in the DataTable . Here is the Javascript code : .. . .. . is there anything wrong with this code snippet How can I show the value of user.userId in DataTable Note : The JSON is generated using Jackson and application is developed in GAE J .. . .. . .. . .. . UPDATE : .. . .. . I used DataSource following the suggestion by @Luke . This time I got an empty DataTable with only the headers . Here is the code snippet . .. . Answer : You ll need to use datasource-jsonschema to parse out the nested values . See this example : http : yuilibrary.com yui docs datatable datatable-dsget.html .. . .. . You should be able to follow those steps replacing Y.DataSource.Get with Y.DataSource.IO Comment : I tried using datasource but now it seems YUI is sending the wrong request to the server . Here is the URL I got from the firebug console : localhost : 8080 ExampleApp Employee http : localhost : 8080 ExampleApp Employee AjaxListundefined callback YUI.Env.DataSource.callbacks.yui 3 4 0 1 1316763699238 127 The correct url is localhost : 8080 ExampleApp Employee AjaxList http : localhost : 8080 ExampleApp Employee AjaxList Comment : Please ignore the above comment I solved this issue by appending a at the end of the source url . But still the data is not puplated in the datatable . I can see the JSON data in firebug console . Comment : I have updated the question with the script using datasource-arrayschema . I believe the response I m getting is an array and I couldn t identify resultListLocator for datasource-jsonschema", "Question : I m trying to display the following JSON object using YUI DataTable . I was able to show the lastName firstName startDate employeeCode employeeStatus successfully in YUI DataTable . But I couldn t show the values in the inner object . In the columnset I tried user.userId and it is displayed as value in the DataTable . Here is the Javascript code : .. . .. . is there anything wrong with this code snippet How can I show the value of user.userId in DataTable Note : The JSON is generated using Jackson and application is developed in GAE J .. . .. . .. . .. . UPDATE : .. . .. . I used DataSource following the suggestion by @Luke . This time I got an empty DataTable with only the headers . Here is the code snippet . .. . Answer : I got the solution from YUI Forums following my post in the forum : http : yuilibrary.com forum viewtopic.php f 92 t 8685 http : yuilibrary.com forum viewtopic.php f 92 t 8685 .. . .. . Here is the code which worked for me : .. . .. . Hope this helps somebody else who is struggling with DataTable DataSource .", "Question : I want to templatize the creation of a YUI3 datatable using KnockoutJS data bindings . Let s say I have following JSON string - .. . .. . @lang : en-US .. . .. . .. . .. . And I m using the following code to create the YUI datatable consuming the above JSON - .. . .. . YUI .use datatable datatable-datasource datasource-local datasource-jsonschema function Y .. . .. . How can create a KnockoutJS template for the above code Fiddle at - http : jsfiddle.net pPY7K 6 .. . Answer : Use KnockoutJS custom bindings and then create a template using that binding .", "Question : I m setting up a YUI DataTable with filtering by following the steps on the YUI site http : developer.yahoo.com yui examples datatable dt localfilter.html .. . .. . However I am using JSON as the DataSource ResponseType . When I type in a value to filter the request will be sent to the server again . I find this to be wasteful as all the data has already been retrieved the first time . Is there a way to cache the initial data returned and then filter only according to that data so another AJAX request does not have to be made .. . Answer : http : developer.yahoo.com yui datasource caching should help .", "Question : I am using YUI datatable and datasource to render data in one of my projects . The data returned happens to be NULL and YUI datasource is unable to parse it . Below is the declaration code of datasource and datatable . For readability sake I am seperating each of the declarations . Column Descriptions declaration .. . .. . This columnDescription is set in the function below . DataSource Declaration .. . .. . getDataGrid function makes the call to server-side to get the data from the server . Below is the table definition itself . tableContainerDiv is declared in the html page . This is the container div . The function that gets the JSON data from server . The function is returning json string that has some null values . Datasource constructor is complaining following problems . ERROR DATAINVALID .. . ERROR DATANULL .. . .. . I checked the yui documentation http : developer.yahoo.com yui docs YAHOO.util.DataSourceBase.html method DataSourceBase.parseString and found that the string parser does not parse null values . I am wondering if there is any way to parse this data . Do I have to handleResponse parse the raw data Any suggestions appreciated . .. . Answer : First make sure that you need parser : YAHOO.util.DataSource.parseString for the fields . I haven t seen your JSON structure . So I cannot comment on this . Other option is to use a custom formatter . Something like the following snippet will work .", "Question : I m setting up a YUI DataTable with filtering by following the steps on the YUI site http : developer.yahoo.com yui examples datatable dt localfilter.html .. . .. . However I am using JSON as the DataSource ResponseType . When I type in a value to filter the request will be sent to the server again . I find this to be wasteful as all the data has already been retrieved the first time . Is there a way to cache the initial data returned and then filter only according to that data so another AJAX request does not have to be made .. . Answer : You can use the YUI 3 cache utility to cache the data in javascript memory or HTML5 localstorage object . You can read more about this at http : developer.yahoo.com yui 3 cache", "Question : null .. . Answer : I used the answer at : YUI 3 -Datatable with Paginator + Query Builder + Sort tried http : stackoverflow.com questions 22481461 yui-3-datatable-with-paginator-query-builder-sort .. . .. . to for the samples http : jsbin.com iwijek 10 and http : jsfiddle.net UwjUt which have inline json data . I wanted to parse the remote json file for which I used the .get as per YUI 3 docs . But bit does not do anything . plz check these examples and help me in parsing the remote json file . json-search.txt .. . .. . I also tried to pass the datasource to the ModelList", "Question : I am new to primefaces . I have one datatable in my application . In that for 3 columns i need to merge some rows . That row count will be generated dynamically based on the data . If I tried to use rowspan in that particular column tag-it additionally created blank cells and the total datatable format is changed . How to do merge that datarows in primefaces . For reference I am attaching the design and code . Xhtml code : .. . .. . Need to merge first three columns date Slot and No of Resources Required based on the employee column data . Guide me on this . Thanks in advance . Comment : Why the yui-datatable tag What version of PF are you using .. . Answer : This is simply not possible in the datatable .", "Question : I m wondering how can I make the order of the columns sortable in a YUI 3 Datatable . Following an example where rows are sortable I found that I have to create an instance of Y.DD to each row . Trying to do the same with columns but the function getTbodyEl does not exist . Has anyone accomplished this Help is appreciated .. . Answer : Y.DD is Drag and Drop http : yuilibrary.com yui docs dd . This would help only if you want to drag the columns to sort them . This http : jsfiddle.net ahfHx is one way of programmatically sorting the columns . I haven t read the documentation for Y.DataTable http : yuilibrary.com yui docs api classes DataTable.html but you can sort the columns attribute subscribe to the columnsChange event and then make the datatable re-render .", "Question : I am sorting a YUI Datatable with a coloum as Date there are some NULL values for the coloumn . I need to have those null values remain on top rows of the table irrespective of the sort order . .. . Answer : @chittprakash .. . .. . Here is an example : http : yuilibrary.com yui docs api classes DataTable.Sortable.html", "Question : Does anyone know if there are any known issues subscribing to events fired by a YUI2 DataTable when using with YUI3 2in3 I m trying to do the following and it s not working : .. . .. . Other features of the DataTable seem to be working but I can t seem to tap into any events . Does anyone else have issues with this Any suggestions Thanks .. . Bart .. . Answer : Sanity check : is the YUI2 event module loaded Also try loading the YUI2 logger and make sure you are referencing the debug version of the scripts . The output is verbose but usually shows where the problem is . Comment : Gabe Using YUI 2 in 3 Bart shouldn t have to worry about whether YUI 2 Event or other DT dependencies are loaded -- that should be happening for him automatically . Cf : yuiblog.com blog 2010 03 11 yui-2-in-3-coming-soon http : www.yuiblog.com blog 2010 03 11 yui-2-in-3-coming-soon -Eric" ] }
[ "yes-answer-long", "yes-answer-short" ]
api
UNK_RELATION
drupal-jcarousel@drupal@48
drupal-jcarousel -- jcarousel is the name of a @placeholder module that allows to integrate the jquery plugin jcarousel in drupal .
{ "confidence": [ 72.37223052978516, 65.43618774414062, 60.955223083496094, 59.44898986816406, 57.557861328125, 55.54161834716797, 54.05418014526367, 51.616539001464844, 49.113040924072266, 47.19689178466797, 46.75718307495117, 46.75718307495117, 46.75718307495117, 42.963409423828125, 42.48223114013672, 40.25960922241211, 26.03704833984375, 21.97249984741211, 20.94972801208496, 20.539417266845703, 19.296489715576172, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 17.301742553710938, 16.931941986083984, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855, 13.458842277526855 ], "content": [ "I would like to use the Drupal module JCarousel with a pager .", "If that s the case you can access it with .jcarousel if you change it to jcarousel add jcarousel .. . .", "Are you sure the carousel s id is jcarousel", "I am using JCarousel http : sorgalla.com jcarousel for creating a slider on my site .", "I m using jCarousel to build a slideshow that displays in a block .", "i am using jcarousel in drupal as below : .. . .. . now to ask the question as simple as possible : how can i slide the carousel manually", "something like .. . .. . by the way when i run this script jQuery jcarousel .jcarousel .next in firebug i got this in the console of firebug .. . .. . I have tried this as well in firebug console .. . .. . and got .. . .. . and the result-of alert carousel was the word undefined", "You can always simulate a click on the next button : jQuery .jcarousel-next .click .", "I am a CSS noob and I created a carousel using jCarousel .", "Did you try : .. . .. . EDIT : Calling foo .jcarousel with no arguments returns a jQuery object so calling next on that will return the next sibling of the carousel .", "You can do something like this : .. . .. . Set the class jcarousel-caption on the element where you want the text to go .", "You can also reverse it by simulating a click on the previous button : .jcarousel-prev .click", "Here is where we started : stackoverflow.com questions 18139359 http : stackoverflow.com questions 18139359 jcarousel-autoscroll-in-two-different-directions", "I m trying to make jcarousel work both sides .. . .. . If I use the following it returns the correct alert .. . .. . but if I replace the alert with the actual call it doesn t scroll .", "If so just do a search for that function name within the jCarousel folder...when you find it just make the changes to the already existing function .", "You need to implement jcarousel form views ui add form alter by the looks of it you can either do it in a custom module if you want to keep the code of the jCarousel module clean...if you re not bothered though just put it straight into the jcarousel.module file .", "I m fairly new to drupal and I get an error the function jcarousel form views ui add form alter cannot be declared.. . Do I need to replace it with another kind of function", "The plugin s documentation suggests jcarousel add takes a class name as the first parameter .", "Ok great module", "Yes it is possible with the last version of the module .", "Did you try the Views Slideshow http : drupal.org project views slideshow plugin", "Now it is itself easy to implement I am having hard time showing a description under each image taken from the alt property .", "Now I am hoping there is some way through JS and I ll be grateful if you could assist here .", "Thanks .", "Working example : http : jsfiddle.net alan0xd7 yz1r62jq", "The content-type has image upload fields and those images are going to display in the carousel .", "I want that every node has a different images in the carousel .", "In Views I defined filters by Type .", "But that takes all the images from every node .", "How can I solve this", "Are the images you want on a specific page uploaded via that page", "If so you can use the Node : NID argument .", "Under Action to take if argument is not present : .. . .. . check Provide default argument .. . .. . then Node ID from URL", "Thanks a lot", "That solved my problem .", ": One more thing .", "How can I style the slideshow separately .", "For example on one type of page I want the slideshow to be 960px wide and on another type 600px .", "if your template.php provides body classes and your page.tpl.php calls them in then you have the .node-type- nodetype class to help you theme by node type .", "Here s more info about the template.php comment : .. . .. . In page.tpl.php add .. . .. . body class php print body classes .. . .. . in template.php add", "Inspect the carousel element or check the page source to see the id and classes .", "to view real example of it : albawaba.com somalia-starvation-ramadan-surplus-wastage-387943 http : www.albawaba.com somalia-starvation-ramadan-surplus-wastage-387943 Thanks a lot for your help", "This function : http : api.jquery.com next", "it didn t work : to view real example of it : albawaba.com somalia-starvation-ramadan-surplus-wastage-387943 http : www.albawaba.com somalia-starvation-ramadan-surplus-wastage-387943 Thanks a lot for your help", "I m not sure why that didn t work .", "That worked when I ran it in the Chrome console .", "ok.. . i fixed it by creating global variable and then assigning the value of the carousel to it .. . .. . and then wherever i want to use next manually i use this", "just moves to the next image .. . .. . without bind it doesn t work either .. . .. . Does anyone has an idea why is this happening", "if I don t use any condition inside Timeout and use one of the two calls for example c.next then it would scroll but only from Right to Left .. . .. . Any guideline will be greatly appreciated Sandra", "What do you mean it doesn t scroll just moves to the next image", "Isn t that what your c.next function does", "Your second sample of code looks like the right one the first one doesn t really do anything and the third one is wrong .", "ok . you are right .", "c.next moves to the next .", "But if I use : window.setTimeout function c.next 500 it scrolls to the right until the user moves the mouse out .", "Based on that I ve been trying to use the same function because I can t find another way to scroll to the left if the user hovers over the left button", "Make it easier for yourself and define your functions ahead of time and in a way that saves you the trouble of scope and closure .. . .. . Now .. . .. . 1 .", "If you want to debug a function you can debug it separately to setTimeout .", "2 .", "It s clear which function is being passed into setTimeout .", "Edit Also note how I m not invoking the functions as they re passed as the argument when one uses setTimeout it is because they want something invoked later not immediately .", "This works correctly but without scrolling .", "Either way it will need to be in a .module file once you ve added the function make sure you clear Drupal s caches so the new hook gets picked up", "But apperently there is some kind of bug or error which doesn t allow me to use a pager.. . All I get is this error twice.. .", "It allow to make Carousels in a really powerfull way then just needs to by styled .", "The last version allow to make it far more customizable .", "Do you happen to know if I can use both the pager and the automatic sliding effect", "If so how", ":", "You just have ton configure it properly it is not so hard .", "Short answer is you can t I m afraid the error message is telling the truth", "There s a detailed discussion about why you can t and what you need to do instead on this post http : drupal.org node 1136570 I think this comment http : drupal.org node 1136570 comment-4938972 in particular will tell you everything you need to know .", "Thanks for the link but there is nowhere stated where to edit those files.. .", "Alright makes sense .", "I guess that error would be cannot be re-declared", "It works like it should as a page and with tabbed menus .", "The problem is the theme adds CSS to it when I go to admin config system site-information and make the view the default front page .", "It adds list bullets over each carousel item and changes the displayed item location .", "I want to remove these bullets from the view but not the entire site .", "The development site can be seen at http : delphos.lib.oh.us NewSite .. . .. . If you click on one of the tabs red boxed buttons the display problem goes away .", "Any help would be appreciated .", "TBG", "Try looking for this line : .. . .. . You can remove the whole line or just remove the content attribute .", "Either should work .", "Thanks for the suggestion but wouldn t this remove the bullets from the entire site", "This is part of the theme s style.css .", "I guess I m looking for a way to override them just for the carousel view page ." ] }
{ "confidence": [ 91.60935974121094, 89.14872741699219, 86.87525939941406, 75.78788757324219, 70.39131927490234, 66.21038055419922, 54.60577392578125, 51.05821990966797, 45.728206634521484, 41.967166900634766 ], "content": [ "Question : i am using jcarousel in drupal as below : .. . .. . now to ask the question as simple as possible : how can i slide the carousel manually something like .. . .. . by the way when i run this script jQuery jcarousel .jcarousel .next in firebug i got this in the console of firebug .. . .. . I have tried this as well in firebug console .. . .. . and got .. . .. . and the result-of alert carousel was the word undefined .. . Answer : Are you sure the carousel s id is jcarousel The plugin s documentation suggests jcarousel add takes a class name as the first parameter . If that s the case you can access it with .jcarousel if you change it to jcarousel add jcarousel .. . . Inspect the carousel element or check the page source to see the id and classes . Comment : to view real example of it : albawaba.com somalia-starvation-ramadan-surplus-wastage-387943 http : www.albawaba.com somalia-starvation-ramadan-surplus-wastage-387943 Thanks a lot for your help", "Question : i am using jcarousel in drupal as below : .. . .. . now to ask the question as simple as possible : how can i slide the carousel manually something like .. . .. . by the way when i run this script jQuery jcarousel .jcarousel .next in firebug i got this in the console of firebug .. . .. . I have tried this as well in firebug console .. . .. . and got .. . .. . and the result-of alert carousel was the word undefined .. . Answer : ok.. . i fixed it by creating global variable and then assigning the value of the carousel to it .. . .. . and then wherever i want to use next manually i use this", "Question : i am using jcarousel in drupal as below : .. . .. . now to ask the question as simple as possible : how can i slide the carousel manually something like .. . .. . by the way when i run this script jQuery jcarousel .jcarousel .next in firebug i got this in the console of firebug .. . .. . I have tried this as well in firebug console .. . .. . and got .. . .. . and the result-of alert carousel was the word undefined .. . Answer : Did you try : .. . .. . EDIT : Calling foo .jcarousel with no arguments returns a jQuery object so calling next on that will return the next sibling of the carousel . This function : http : api.jquery.com next Comment : it didn t work : to view real example of it : albawaba.com somalia-starvation-ramadan-surplus-wastage-387943 http : www.albawaba.com somalia-starvation-ramadan-surplus-wastage-387943 Thanks a lot for your help Comment : I m not sure why that didn t work . You can always simulate a click on the next button : jQuery .jcarousel-next .click . That worked when I ran it in the Chrome console . You can also reverse it by simulating a click on the previous button : .jcarousel-prev .click", "Question : I would like to use the Drupal module JCarousel with a pager . But apperently there is some kind of bug or error which doesn t allow me to use a pager.. . All I get is this error twice.. . .. . Answer : Short answer is you can t I m afraid the error message is telling the truth There s a detailed discussion about why you can t and what you need to do instead on this post http : drupal.org node 1136570 I think this comment http : drupal.org node 1136570 comment-4938972 in particular will tell you everything you need to know . Comment : Thanks for the link but there is nowhere stated where to edit those files.. . Comment : You need to implement jcarousel form views ui add form alter by the looks of it you can either do it in a custom module if you want to keep the code of the jCarousel module clean...if you re not bothered though just put it straight into the jcarousel.module file . Either way it will need to be in a .module file once you ve added the function make sure you clear Drupal s caches so the new hook gets picked up Comment : Alright makes sense . I m fairly new to drupal and I get an error the function jcarousel form views ui add form alter cannot be declared.. . Do I need to replace it with another kind of function Comment : I guess that error would be cannot be re-declared If so just do a search for that function name within the jCarousel folder...when you find it just make the changes to the already existing function .", "Question : I would like to use the Drupal module JCarousel with a pager . But apperently there is some kind of bug or error which doesn t allow me to use a pager.. . All I get is this error twice.. . .. . Answer : Did you try the Views Slideshow http : drupal.org project views slideshow plugin It allow to make Carousels in a really powerfull way then just needs to by styled . The last version allow to make it far more customizable . Comment : Ok great module Do you happen to know if I can use both the pager and the automatic sliding effect If so how : Comment : Yes it is possible with the last version of the module . You just have ton configure it properly it is not so hard .", "Question : I am using JCarousel http : sorgalla.com jcarousel for creating a slider on my site . Now it is itself easy to implement I am having hard time showing a description under each image taken from the alt property . Now I am hoping there is some way through JS and I ll be grateful if you could assist here . Thanks . .. . Answer : You can do something like this : .. . .. . Set the class jcarousel-caption on the element where you want the text to go . Working example : http : jsfiddle.net alan0xd7 yz1r62jq", "Question : I m using jCarousel to build a slideshow that displays in a block . The content-type has image upload fields and those images are going to display in the carousel . I want that every node has a different images in the carousel . In Views I defined filters by Type . But that takes all the images from every node . How can I solve this .. . Answer : Here s more info about the template.php comment : .. . .. . In page.tpl.php add .. . .. . body class php print body classes .. . .. . in template.php add", "Question : I m trying to make jcarousel work both sides .. . .. . If I use the following it returns the correct alert .. . .. . but if I replace the alert with the actual call it doesn t scroll . just moves to the next image .. . .. . without bind it doesn t work either .. . .. . Does anyone has an idea why is this happening if I don t use any condition inside Timeout and use one of the two calls for example c.next then it would scroll but only from Right to Left .. . .. . Any guideline will be greatly appreciated Sandra Comment : What do you mean it doesn t scroll just moves to the next image Isn t that what your c.next function does Your second sample of code looks like the right one the first one doesn t really do anything and the third one is wrong . Comment : ok . you are right . c.next moves to the next . But if I use : window.setTimeout function c.next 500 it scrolls to the right until the user moves the mouse out . Based on that I ve been trying to use the same function because I can t find another way to scroll to the left if the user hovers over the left button .. . Answer : Make it easier for yourself and define your functions ahead of time and in a way that saves you the trouble of scope and closure .. . .. . Now .. . .. . 1 . If you want to debug a function you can debug it separately to setTimeout . 2 . It s clear which function is being passed into setTimeout . Edit Also note how I m not invoking the functions as they re passed as the argument when one uses setTimeout it is because they want something invoked later not immediately . Comment : This works correctly but without scrolling . Here is where we started : stackoverflow.com questions 18139359 http : stackoverflow.com questions 18139359 jcarousel-autoscroll-in-two-different-directions", "Question : I m using jCarousel to build a slideshow that displays in a block . The content-type has image upload fields and those images are going to display in the carousel . I want that every node has a different images in the carousel . In Views I defined filters by Type . But that takes all the images from every node . How can I solve this .. . Answer : Are the images you want on a specific page uploaded via that page If so you can use the Node : NID argument . Under Action to take if argument is not present : .. . .. . check Provide default argument .. . .. . then Node ID from URL Comment : Thanks a lot That solved my problem . : One more thing . How can I style the slideshow separately . For example on one type of page I want the slideshow to be 960px wide and on another type 600px . Comment : if your template.php provides body classes and your page.tpl.php calls them in then you have the .node-type- nodetype class to help you theme by node type .", "Question : I am a CSS noob and I created a carousel using jCarousel . It works like it should as a page and with tabbed menus . The problem is the theme adds CSS to it when I go to admin config system site-information and make the view the default front page . It adds list bullets over each carousel item and changes the displayed item location . I want to remove these bullets from the view but not the entire site . The development site can be seen at http : delphos.lib.oh.us NewSite .. . .. . If you click on one of the tabs red boxed buttons the display problem goes away . Any help would be appreciated . TBG .. . Answer : Try looking for this line : .. . .. . You can remove the whole line or just remove the content attribute . Either should work . Comment : Thanks for the suggestion but wouldn t this remove the bullets from the entire site This is part of the theme s style.css . I guess I m looking for a way to override them just for the carousel view page ." ] }
[ "yes-answer-long", "yes-answer-short" ]
drupal
UNK_RELATION
nimbus@look-and-feel@47
nimbus -- nimbus is a polished cross-platform @placeholder introduced in the java se 6 update 10 6u10 release of the java platform .
{ "confidence": [ 45.69324493408203, 42.93644714355469, 42.62736511230469, 42.12761306762695, 41.38717269897461, 40.973854064941406, 40.60049819946289, 39.40940856933594, 38.43230438232422, 38.42789077758789, 38.42789077758789, 38.42789077758789, 38.42789077758789, 38.42789077758789, 38.42789077758789, 38.42789077758789, 38.33390426635742, 38.21906661987305, 37.98756408691406, 37.4340934753418, 37.4340934753418, 37.4340934753418, 37.4340934753418, 36.86183166503906, 36.86183166503906, 36.86183166503906, 36.24300003051758, 36.24300003051758, 36.07303237915039, 36.07303237915039, 36.07303237915039, 35.92935562133789, 35.92935562133789, 35.92935562133789, 35.92935562133789, 35.92935562133789, 35.92935562133789, 35.92935562133789, 35.86803436279297, 35.86803436279297, 35.86803436279297, 35.86803436279297, 35.86803436279297, 35.86803436279297, 35.22508239746094, 34.9355583190918, 34.75859832763672, 34.75859832763672, 34.75859832763672, 34.75859832763672, 34.75859832763672, 34.75859832763672, 34.75859832763672, 34.75859832763672, 34.75859832763672, 34.75859832763672, 34.75859832763672, 34.75859832763672, 34.67694091796875, 34.67694091796875, 34.67694091796875, 34.67694091796875, 34.474266052246094, 33.888145446777344, 33.888145446777344, 33.764801025390625, 33.764801025390625, 33.764801025390625, 33.764801025390625, 33.764801025390625, 33.764801025390625, 33.764801025390625, 33.764801025390625, 33.764801025390625, 33.764801025390625, 33.74446487426758, 33.74446487426758, 33.433555603027344, 33.433555603027344, 32.84925842285156, 32.693904876708984, 32.693904876708984, 32.693904876708984, 32.57371139526367, 32.57371139526367, 32.57371139526367, 32.57371139526367, 32.57371139526367, 32.57371139526367, 32.57371139526367, 32.57371139526367, 32.57371139526367, 32.57371139526367, 32.57371139526367, 32.57371139526367, 32.43975830078125, 32.43975830078125, 32.43975830078125 ], "content": [ "src.zip com sun java swing plaf nimbus", "I have been working to transition a Java application from WindowsLookAndFeel to Nimbus largely successfully despite Nimbus foibles .", "But only as long as I don t use Nimbus UI instead of cross-platform LAF .", "EDIT : This happens only in Nimbus and Dark Nimbus LAF", "This is not working fine but Nimbus nimbusBase Nimbus nimbusBlueGray and Nimbus control are working .", "Nimbus .", "The Nimbus bug is fixed in Java 8 and the fix doesn t work anymore .", "I m using the Nimbus Look Feel within my Java Swing application .", "There is an example that shows the square is missing : Missing check square JCheckBoxMenuItem while using Nimbus java look-and-feel http : stackoverflow.com questions 26404240 missing-check-square-jcheckboxmenuitem-while-using-nimbus-java-look-and-feel", "use Nimbus LnF 2 .", "Here s an example Nimbus JTable .", "This appears to not work for Nimbus only .", "I m new to Nimbus .", "Is this a bug in Nimbus or is it that way by design", "This seems to be a design choice of Nimbus .", "This doesn t seem to be the case in Nimbus .", "And is this a bug in Nimbus", "So did anyone succeeded in having their nimbus-styled Java application look consistent on all platforms by having the Nimbus LAF take care of window decorations", "I m using the network Nimbus Photos http : docs.nimbuskit.info group nimbus photos.html example application in the Nimbus Toolkit for iOS https : github.com jverkoey nimbus .", "Here is the Nimbus JButton look : .. . .. .", "Install the Nimbus PLAF .. . 2 .", "If that is not possible then Nimbus is rubbish", "But the Nimbus bug is fixed .", "I m using Nimbus L F .", "Nimbus respect a ui property for rowHeight :", "Nimbus itself is not monitoring the changes for this table .", "this is NIAttributedLabel from Nimbus Kit. .", "That s a Nimbus bug .", "I am using Java 7 and have implemented Nimbus Look And Feel on my desktop application .", "I m on Java 7 and interestingly Nimbus fully ignores the setting of some properties in the UIManager like PopupMenu.background .", "I am trying to override Nimbus LookandFeel values to my Java Swing application .", "See Nimbus Look and Feel https : docs.oracle.com javase tutorial uiswing lookandfeel nimbus.html Nimbus is based on Synth Look and Feel", "Nimbus reserves these two pixels for the focus highlight and probably this cannot be changed without re-implementing a lot of Nimbus functionality .", "For more information to experiment with there is a good article on configuring Nimbus here http : www.jasperpotts.com blog 2008 08 nimbus-uimanager-uidefaults .", "Force nimbus to create the defaults first by calling getDefaults : .. . .. . UIManager.put won t store the settings in the nimbus defaults if the defaults was not initialized first .", "This is because Nimbus uses an internal painter which computes the color from Nimbus primary colors and ignores the components property .", "I m using Nimbus https : github.com jverkoey nimbus to display a photo album with scrubber and zoomable image view .", "This table is monitored by Nimbus using PropertyChangeListener and Nimbus updates its internal default values .", "I use the Nimbus Look Feel .", "I am using Nimbus LnF .", "basic JButton with Nimbus L F .. . .. .", "Customize the Table.background nimbus property .. . 3 .", "Customize the Table.alternateRowColor nimbus property .. . 4 .", "Nimbus relies heavily on Painter s .", "Take a look at : stackoverflow.com questions 613603 http : stackoverflow.com questions 613603 java-nimbus-laf-with-transparent-text-fields It looks like Nimbus has transparent text fields that you ll need to set to be opaque .", "jverkoey.github.com nimbus http : jverkoey.github.com nimbus interface n i image memory cache.html The global in-memory cache defaults to being unbounded in any sense .", "I m using Netbeans 8.0.2 and the Nimbus Look And Feel .", "If you re using Nimbus can t you just skin it", "Zookeeper Nimbus Supervisors and Storm UI are started .", "Extending BasicTabbedPaneUI causes the Nimbus specific rendering to be lost .", "In order to keep the Nimbus rendering SynthTabbedPaneUI needs to be extended .", "Our applications use the Nimbus L F .", "I am using Nimbus Look and feel .", "Another solution would be to deal with the Nimbus Painters.. .", "Nimbus uses Painter to paint the different Styles .", "I m trying to overrides some of the nimbus properties for JLabel .", "Nimbus default for that is white and I want to change it to black .", "I am considering using Nimbus for a cloud application .", "I don t know if Nimbus supports it or not .", "But all of them are running in the Nimbus only .", "Are all supervisors registered at Nimbus correctly", "it means the nimbus and supervisors are not mapped and connected .", "I am using Nimbus to display photos .", "Copy+paste and have fun .. . .. . Note : for JDK6 change .. . javax.swing.plaf.nimbus to .. . com . sun . java . swing . plaf . nimbus .", "In FontForge both versions otf ttf are really the same and look the same seems to be a Java Swing Nimbus L F bug", "By default it goes into Nimbus global in-memory image cache .", "I just found there is no square for the JCheckBoxMenuItem in Nimbus .", "If you disable the use of Nimbus the square will show up .", "If you switch to Nimbus the square will not show up .", "This is a graphical tool for customizing the Nimbus Swing look-and-feel .", "@Petar this solution doesn t fit really good to nimbus", "this a programmatically view from the Nimbus iOS framework .", "I m effectively theming the Nimbus L F i.e .", "The Nimbus Painters are quite complex and produce beautiful results .", "Nimbus has a lot of auto-generated source code .", "For some reason the only thing that worked was setting the L F to nimbus via -D flag then setting it to nimbus again programmatically", "The nimbus defaults are lazy created so setting defaultFont before the screen is painted will add the font to the parent defaults and not to the nimbus defaults .", "I found a nice Nimbus Theme Creator which can show the effect of changing a Nimbus Default Color to all Components : http : aephyr.googlecode.com svn-trunk", "I sent an e-mail to Nimbus support and the reply to the question was the following : .. . .. . Hi Pedro .. . .. . Sorry but Nimbus does not support Amazon-RDS .", "I ve updated Nimbus to add compile-time checks to ensure this doesn t happen to anyone else : github.com jverkoey nimbus commit https : github.com jverkoey nimbus commit 4134612d643ac50b4d4ed766f501f5a1214b569d", "override getPopupLocation in the JTree http : stackoverflow.com a 8082241 714968 btw works for me on 1.st mouse event in Java 8 and Nimbus L F", "As you know nimbus package http : docs.oracle.com javase 7 docs technotes guides swing enhancements-7.html is change in java-7 .", "EDIT .. . .. . Looking at the source code http : kickjava.com src com sun java swing plaf nimbus ButtonPainter.java.htm the external padding seems to be hard-coded .", "I am using Swing with the Look And Feel Nimbus .", "Nimbus is most likely not running hence the exception in UI .", "+1 Nimbus is more complicated than other LAF .", "I use Nimbus Look and Feel in a project .", "How can JFrame have Nimbus Look And Feel", "This can be one more of Nimbus Synth bugs .", "It seems the Nimbus PLAF is both buggy and neglected .", "did you to check Nimbus Default for JButton", "but for first version for un official Nimbus L F", "i am using Nimbus kit for my app .", "I m talking about Nimbus L F.. .", "@MatthiasJ.Sax Someone else set up the supervisor and nimbus .", "github.com jverkoey nimbus blob master src networkimage src https : github.com jverkoey nimbus blob master src networkimage src NINetworkImageView.h L25", "For Nimbus you can have a look at this example http : stackoverflow.com questions 24379251 change-ui-lookup-for-progressbar-swing-in-nimbus-theme 24379428 24379428", "@user1422004 I m not going to coding that about that is my comment but if you need Nimbus then there are some Custom Look and Feels based on Nimbus with Color themes and or some customizations" ] }
{ "confidence": [ 55.13420486450195, 51.39270782470703, 50.67477798461914, 49.27608871459961, 49.05980682373047, 48.8079719543457, 48.62406539916992, 48.088130950927734, 47.906593322753906, 47.506160736083984, 46.81019592285156, 46.095802307128906, 45.971214294433594, 45.9036865234375, 45.86332702636719, 45.70576858520508, 45.606292724609375, 45.491661071777344, 45.31535720825195, 45.1838493347168 ], "content": [ "Question : Look at this picture : Transparent JFrame http : i.stack.imgur.com 39t12.png .. . .. . here is the code that transparent s the frame : .. . .. . this works good but when trying to enable LookAndFeel by adding .. . .. . it gives me this error .. . .. . Exception in thread AWT-EventQueue-0 java.awt.IllegalComponentStateException : The frame is decorated .. . .. . What s this error and how to solve it Thanks for your answers and suggestions . EDIT .. . .. . Question Asked CrossPosted .. . .. . OTN https : forums.oracle.com forums thread.jspa threadID 2533181 tstart 0 .. . .. . Daniweb http : www.daniweb.com software-development java threads 454088 undecorated-translucent-and-shaped-window-in-java7 .. . .. . CodeRanch http : www.coderanch.com t 611044 GUI java Undecorated-Translucent-Shaped-Window-Java Comment : Change the laf in the main method before ui is created Comment : @Sri Harsha Chilakapati I am sorry but I didn t get you I ll be appreciated if you describe more Comment : The problem is that since you are setting the look n feel after enabling transparency . It gives the exception since nimbus didn t have support for decorated frames . Comment : @Azad Omer you should add an answer to this questin otherwise my 100p bounty go away to the trash I can t attach those points to my answer here no answer here for those points : - Comment : See also stackoverflow.com questions 6259269 http : stackoverflow.com questions 6259269 is-the-java-tutorials-translucent-window-example-giving-trouble-to-those-playing .. . Answer : After some researching I find out that the problem is between JDK7 and com.sun.awt.AWTUtilities I think we v better to not use com.sun packages except as a last resort as they may cause problems with upgrading JDK versions they are not part of JDK API . Read more about this issues Here http : stackoverflow.com questions 1416869 how-to-distribute-awtutilities 1416901 1416901 .. . .. . From Oracle https : blogs.oracle.com henrik entry nimbus look-and-feel in jdk 7 .. . .. . The Nimbus look-and-feel for Swing was introduced in JDK 6u10 as a replacement for the old Metal LoF . With JDK 7 Nimbus will be moved from an Oracle-proprietary extension com.sun.java.swing to a standard API javax.swing so that it becomes a true first class Swing citizen . It seems to be com.sun.awt.AWTUtilities works fine with JDK6 but Nimbus LAF is in JDK7 . Ills of less I find out the answer of my first question What s this error and for the second question How to solve it I must wait till new version of com.sun release . I am grateful for mKorbel http : stackoverflow.com users 714968 mkorbel s efforts thank you .", "Question : I m referring to this Nimbus reference http : jasperpotts.com blogfiles nimbusdefaults nimbus.html . I tried to set global Font to be slightly larger : .. . .. . ...works only for the menu but nothing else buttons labels . I tried to change labels and buttons fonts with .. . .. . but the font remains . The only thing that worked for me was deriving a font : .. . .. . But this is not an option since this must be done for each element manually . Note that deriving a font for UIManager doesn t work either : .. . .. . I tested everything under Linux and Windows : same behavior . I just can t understand how an API can be so messy . If a method is called setFont . . then I expect it to set the font . If this method fails to set the font in any thinkable circumstances then it should be deprecated . .. . .. . EDIT : .. . The problem not only applies to Nimbus but also to the default LAF . Comment : Did you try to call SwingUtilities.updateComponentTreeUI frame after updating UI defaults Comment : That code won t even compile there s no Font constructor that takes a float as the third parameter . Comment : That code was example code which doesn t event need to compile In real code I had usages of static-variables and as I removed them to do this example I was looking at deriveFont . . which takes float . Comment : SwingUtilities.updateComponentTreeUI frame doesn t help either Comment : Actually Nimbus has the Label.font property but it is not working when the user defines a custom value . This can be one more of Nimbus Synth bugs . I had problems like these before that s why I choose Metal Basic has base for a custom LAF . .. . Answer : Java LAF API is a little bit clumsy but there is nothing better than check the source code to get your answers . Note that MetalLookAndFeel and Nimbus are different implementations and the properties for each one doesn t have to be the same . The following examples use the MetalLookAndFeel . This works because the property Label.font exists on Metal and it uses that property correctly . You you can check it this way : Comment : Note : since I m reading the property before I write it by doing UIManager.put Label.font UIManager.getFont Label.font .deriveFont 16f there MUST be such property Label.font . Comment : In deed your example works But only as long as I don t use Nimbus UI instead of cross-platform LAF . Comment : That s a Nimbus bug . Please check jasperpotts.com blog 2008 08 nimbus-uimanager-uidefaults http : www.jasperpotts.com blog 2008 08 nimbus-uimanager-uidefaults comment-1351", "Question : null .. . Answer : As you know nimbus package http : docs.oracle.com javase 7 docs technotes guides swing enhancements-7.html is change in java-7 . I am using AbstractRegionPainter with java6 in my app s server-side and my app s client-side must work both in java-6 and 7 . So how can i import this abstract-class dynamicly depends on client s java version . The import text must change belong to java version . Or another solution i must extend it dynamicly belong to java version . Comment : import for Nimbus was changed from com.sun.java.swing Java6 to standard import in Java7 please where is problem Comment : my application is a client-server swing app . I want compile my code in java-6 but when a java7 client run it interface is not draw correctly .", "Question : Is there a way to have the Nimbus Look Feel render its own windows decorations for a top level JFrame I ve been digging through the Internet and I m starting to suspect it might not be possible at all . Has anyone actually succeeded with and cared about that Nimbus decorations are nice and neat for internal frames but apparently there is no way to have the same effect on JFrame s and JDialog s . I tried nimbusx http : sourceforge.net projects nimbusx Nimbus Extensions a library that subclasses JFrame and JDialog and allegedly applies nimbus-styled decorations to them then you just have to instantiate nimbusx classes instead of JFrame and JDialog but it actually doesn t work and it s been in an inactive alpha stage since 2009 . So did anyone succeeded in having their nimbus-styled Java application look consistent on all platforms by having the Nimbus LAF take care of window decorations Comment : From this bug it seems like Nimbus LAF can t take care of all window decorations yet : bugs.sun.com bugdatabase http : bugs.sun.com bugdatabase view bug.do jsessionid a655306f41e2c17d50e0bf54ea6 bug id 6675399 Comment : It seems the Nimbus PLAF is both buggy and neglected . : Comment : You might also use another look-and-feel . There are plenty good ones out there e.g . Substance LAF . Comment : @Unai Vivi in Substance I never saw that nor bugs 1 fixed in Java5 2 fixed in Java5 3 I using both in Java Swing with older Substance L F 4 last two weeks tested with neewest SwingX and older Substance L F Comment : Can any L F do this .. . Answer : I ve done this with JGoodies Looks http : www.jgoodies.com freeware looks index.html in the past . I don t know if Nimbus supports it or not . It s not only the LAF however it is an option you must programmatically turn on for JFrame and JDialog if you want . See the API Docs http : docs.oracle.com javase 6 docs api javax swing JFrame.html setDefaultLookAndFeelDecorated 28boolean 29 Comment : Nope that doesn t work for Nimbus because it doesn t render its own top-level window decorations its delegated to the O.S . .. .", "Question : I m using the Nimbus L F with a JTable that has a boolean checkbox element as one of its columns . Nimbus JTable with check box http : i.stack.imgur.com cjbyh.png .. . .. . The issue I m having is that the boolean column does not follow the natural row background alternations present in the Nimbus L F . Comment : what is your java version Comment : My Java version is : 1.6.0 25 Comment : +1 neat screenshot . .. . Answer : hmmm and I have opposite problem check that really nobody can hepl you without code example maybe someone can play with unselected AlternateTableColor with usage of TableCellRenderer .. . .. . Nimbus Defaults http : download.oracle.com javase tutorial uiswing lookandfeel nimbusDefaults.html", "Question : null .. . Answer : I just found there is no square for the JCheckBoxMenuItem in Nimbus . If you disable the use of Nimbus the square will show up . If you switch to Nimbus the square will not show up . Is it by design There is an example that shows the square is missing : Missing check square JCheckBoxMenuItem while using Nimbus java look-and-feel http : stackoverflow.com questions 26404240 missing-check-square-jcheckboxmenuitem-while-using-nimbus-java-look-and-feel Comment : Link does not show up . Comment : For better help sooner post a Minimal Complete and Verifiable example http : stackoverflow.com help mcve or Short Self Contained Correct Example http : www.sscce.org . Comment : By design . If you want a square use a different L F .", "Question : I m using the Nimbus L F with a JTable that has a boolean checkbox element as one of its columns . Nimbus JTable with check box http : i.stack.imgur.com cjbyh.png .. . .. . The issue I m having is that the boolean column does not follow the natural row background alternations present in the Nimbus L F . Comment : what is your java version Comment : My Java version is : 1.6.0 25 Comment : +1 neat screenshot . .. . Answer : I know it is old post but for other searchers : I used jxtable and that solved this problem :", "Question : I need help about nimbus behaviour for JTree and JPopupMenu . I am setting a right-click menu to a JTree . If I left click to a node after open the right-click menu with another node clicked node becoming selected . but in nimbus look-and-feel a second click needed for select another node . My code is below you can try it with default look-and-feel with comment the nimbus part . Comment : override getPopupLocation in the JTree http : stackoverflow.com a 8082241 714968 btw works for me on 1.st mouse event in Java 8 and Nimbus L F .. . Answer : There are 2 solutions that you can try without changing nimbus : .. . .. . 1 . Simulate second click using Robot class . Add this to your MouseListener . 2 . Add TreeSelectionLisitener https : docs.oracle.com javase 7 docs api javax swing event TreeSelectionListener.html and same as in the first method use MouseListener to select the proper node with TreeSelectionListener .", "Question : I am trying to override Nimbus LookandFeel values to my Java Swing application . When I try to set nimbusSelectionBackground and Table.background values to change using UIManager.getLookAndFeelDefaults like this . This works for Table.background but It does t work for nimbusSelectionBackground .. . .. . But when I using UIManager.getDefauts to change defaultFont value like this . It works perfectly for both of them . So my question is Why What is the difference between UIManager.getDefauts and UIManager.getLookAndFeelDefaults .. . Answer : Thanks for the question . Having a look at the code this is my understanding : .. . .. . 1 . getLookAndFeelDefaults returns a UIDefaults that is created by NimbusLookAndFeel at the initialisation time . Nimbus itself is not monitoring the changes for this table . But UIManager gives a value from this table whenever requested by a component before looking at the one maintained by it . So all standard component UI defaults can be modified by changing this table . 2 . getUIDefaults returns a UIDefaults that is created by UIManager . This table is monitored by Nimbus using PropertyChangeListener and Nimbus updates its internal default values . Nimbus uses these internal values for UI and doesn t refer back to get the values from UIManager . That said according to the java doc of getLookAndFeelDefaults we are supposed to be using only getUIDefaults and it is consistent with your experience . Comment : It makes sense . Thank you", "Question : I m using the Nimbus L F with a JTable that has a boolean checkbox element as one of its columns . Nimbus JTable with check box http : i.stack.imgur.com cjbyh.png .. . .. . The issue I m having is that the boolean column does not follow the natural row background alternations present in the Nimbus L F . Comment : what is your java version Comment : My Java version is : 1.6.0 25 Comment : +1 neat screenshot . .. . Answer : It s a bug in the synth-installed renderer quick hack is to force the rendering checkbox opacity to true : Comment : Great thanks to you for this solution You saved me an hour of sleeping Comment : Really helpful...I wish if i see this two days ago... . :", "Question : Nimbus often looks great but for certain color combinations the result is non-optimal . In my case the background of a JPopupMenu does not fit which is why I want to set it manually . I m on Java 7 and interestingly Nimbus fully ignores the setting of some properties in the UIManager like PopupMenu.background . So my only option was to create a subclass of JPopupMenu that overrides paintComponent .. . . I know that s nasty but at least it worked . However if you add a JMenu to another menu it embeds it s own instance of JPopupMenu and I could not figure out how to replace it with my own subclass . Even assigning an own PopupMenuUI to the embedded instance didn t bring any results . If inherited directly from JPopupMenu the overriden paint .. . method was called but not matter what I did nothing was drawn . If inherited from javax.swing.plaf.synth.SynthPopupMenuUI paint isn t even called and the result is if I hadn t set an own PopupMenuUI at all . So the simple question is : How do I adjust the background-color of one JPopupMenu or if that s easier all of them on Java 7 using Nimbus as L F Edit : Code example .. . .. . Take a look at the following code and the result : .. . .. . I know some say that you should use UIManager.put key-value or UIManager.getLookAndFeelDefautls .put key-value before setting the L F but for me this does not bring any results meaning : no changes to the default colors at all . The code above at least brings : .. . .. . First screenshot http : i.stack.imgur.com I7GpX.png .. . .. . Same thing meaning nothing happens if you use JPopupMenu.setBackground .. . . This is because Nimbus uses an internal painter which computes the color from Nimbus primary colors and ignores the components property . In this example you can use the following as workaround : .. . .. . Which brings .. . .. . SecondScreen http : i.stack.imgur.com JJFug.png .. . .. . However this workaround does not work if you insert a JMenu which itself wraps a JPopupMenu you can t override : .. . .. . gives as expected : .. . .. . Third screen http : i.stack.imgur.com 56PNg.png .. . .. . You can retrieve this JPopupMenu using JMenu.getPopupMenu but you can t set it . Even overriding this method in an own subclass of JMenu does not bring any results as JMenu seems to access it s enwrapped instance of JPopupMenu without using the getter . Comment : You may get better answers if you outline your actual goal . The UI delegate PopupMenuUI is not trivial . Comment : @aRestless I think that better could be post an SSCCE Nimbus not ignoring its development ended somewhere in the middle sure there are needed add some code lines moreover another option could be or another combinations http : stackoverflow.com questions tagged java+nimbus+colors Comment : @aRestless You should follow mKorbel s advice : post a SSCCE http : sscce.org that people can run as is on their machine and I m sure you will get some answers . Comment : Here you are .. . Answer : One way to do it is to color the background of the individual JMenuItems and make them opaque : .. . .. . Then give the menu itself a green border to fill the rest : .. . .. . There may be an easy more straightforward way out there but this worked for me . Comment : +1 for opacity : - Comment : Adding on to what @kleopatra wrote below not enough rep to even comment on someone else s post : Setting ui.put PopupMenu Enabled .border null makes the border green . Now I m assuming this is because you re blowing away the LaF border painter so I am hesitant to suggest this as a solution . What you probably want to do is set it to a custom Painter JComponent that just always paints it green . Unfortunately there seem to be access restrictions in Java 6 what I m running that prevent me from testing this out . These seem to be changed in Java 7 though so it may be worth a shot . Comment : you should be able to use the painter even in jdk6 by changing the IDE s access restriction rules - might not be feasable for production code just for playing with it", "Question : I am just learning Java and still have not been able to sort this little problem I have .. . .. . My pop-up Calendar uses Nimbus look-and-feel but I have panels and container Jtables that use Java s look-and-feel - I am trying to make every GUI screen window use the nimbus look-and-feel and it was suggested by Merky to put the foolowing code in my main to make every subsequent screen have the Nimbus look-and-feel but I cannot get it to work so can someone tell me where and how I should put this code PLEASE . Would apprciate some help Please Simon .. . Answer : This is what I do in my main method to enable Nimbus L F . You need to be sure to configure the UIManager with the Nimbus L F before you start the swing event-dispatch-thread before calling view.setVisible true . Hope that helps . Comment : @ BenjaminLinus....thank you Like you mentioned it has to be configured before I start the EDT .", "Question : I got a problem which only happens on Nimbus L F . If there are too many items in a JList the thumb of JScrollBar will disappear . But in metal L F the thumb will be always visible because it has a min size . I have also checked the logic in Nimbus L F there does have a same min size . But it not effected . Please see my code below : .. . .. . When I set f.setSize 300 300 the thumb will disappear . enter image description here http : i.stack.imgur.com gHT0M.jpg .. . .. . But if I set f.setSize 300 400 the thumb will be visible . enter image description here http : i.stack.imgur.com oyOel.jpg .. . .. . How can I set the thumb always visible enter image description here http : i.stack.imgur.com 9veJH.jpg Comment : Seems okay to me . What version of Java are you using Have you tried initialising the UI from within the context of the EDT Initial Threads http : docs.oracle.com javase tutorial uiswing concurrency initial.html Do you have a screen shot of the two screens Comment : I m using 1.8.0 60 . Please see the following screenshot 7xlpns.com1.z0.glb.clouddn.com Nimbus 20300.png http : 7xlpns.com1.z0.glb.clouddn.com Nimbus 20300.png 7xlpns.com1.z0.glb.clouddn.com Nimbus 20400.png http : 7xlpns.com1.z0.glb.clouddn.com Nimbus 20400.png 7xlpns.com1.z0.glb.clouddn.com Metal 20300.png http : 7xlpns.com1.z0.glb.clouddn.com Metal 20300.png Comment : I have tried running this demo in EDT thread the problem exists . Thanks Comment : I m running Windows 7 Java 8 and I don t have the problem might be a Windows 8 related issue.. . Comment : It s strange . I have tested on Win7 8 with JDK1.8.0 60 . But they all have this problem . It only happened under Nimbus L F metal is OK . When you reduce the height of the frame the thumb will disappear while there are enough space to display thumb . .. . Answer : You should try this :", "Question : null .. . Answer : I am a newbie in Java I need changing the background Color of a progress-bar but really I don t know how to do this I have a progress-bar called barrita I am using Linux Ubuntu and Java 8 and I am using the palette of Swing Comment : Write a look-and-feel delegate for the progress-bar : P Comment : possible duplicate of How to change JProgressBar color http : stackoverflow.com questions 10773978 how-to-change-jprogressbar-color Comment : Nimbus allows you to customise the look-and-feel although it s a little complicated . Windows and MacOS L F s will ignore the UIManager properties and do there own thing don t know about Linux . Only the Metal L F will honor the UIManager properties . For Nimbus you can have a look at this example http : stackoverflow.com questions 24379251 change-ui-lookup-for-progressbar-swing-in-nimbus-theme 24379428 24379428", "Question : I use a autocomplete feature for comboboxes from Glazed Lists . It s pretty usefull . I also use nibus L F . But it ignores JCombobox.setBackground Color . Is there any way to force backgroundcolor to be for example red using nimbus Examplecode : .. . Answer : ComboBoxes are made up of multiple components . You need to set the background-color on the actual editor component in the combo box : Comment : you are correct but it does not work Comment : Take a look at : stackoverflow.com questions 613603 http : stackoverflow.com questions 613603 java-nimbus-laf-with-transparent-text-fields It looks like Nimbus has transparent text fields that you ll need to set to be opaque .", "Question : I have been working to transition a Java application from WindowsLookAndFeel to Nimbus largely successfully despite Nimbus foibles . My users overall like the Nimbus LaF but didn t like some details some of which I changed by consulting previous questions on this site . Example : I copied the LeafIcon ClosedIcon and OpenIcon from Windows LaF which they liked and use them in the Nimbus version for a nice combination of LaFs . Stuck on one last problem . I have a JTree with a subclassed DefaultCellRenderer to create the appropriate node displays . This works fine under WindowsLookAndFeel . Problem : Under WindowsLaF when a node is selected the text of the node is highlighted and the effect is visually easy to understand . Under Nimbus when a node is selected the highlighting is done with a bar of fairly dark color that runs the width of the tree window not just the width of the text and the effect is disconcerting . So : I simply want WindowsLaF treatment of JTree node highlighting in the Nimbus LaF ie colored background only the width of the text and preferably in a better color that I can choose . I suspect this means I need to assign the right sort Painter to Tree : TreeCell Focused+Selected .backgroundPainter but I don t know how to write it . Suggestions most welcome . .. . .. . EDIT .. . .. . See the strange selected node highlight with Java 7 enter image description here http : i.stack.imgur.com BIwZh.png Comment : Addendum to my posting : of course if there s an easier way than a painter that would be even better . Tried just changing Tree.selectionBackground to a less distracting color but Nimbus seems to ignore the modification . Comment : Further to my comment . You can t set Tree.selectionBackground directly but this color is derived from numbusSelectionBackground so nimbUID.put nimbusSelectionBackground new ColorUIResource 205 208 216 produces some of the desired effect a lighter Tree.selectionBackground . Still getting a row highlighted rather than just the text so help on a painter would still be appreciated . Comment : @oliholz please can you commenting your bounty sure I m never to saw this question because classic Renderers concept overloading Nimbus properties and settings in most of cases Comment : @mKorbel eee Edit . With the a DefaultTreeCellRenderer and Java7 I got the annoying highlight under Nimbus . Comment : The Nimbus bug is fixed in Java 8 and the fix doesn t work anymore . .. . Answer : Edit .. . .. . The Tree.selectionBackground key is what controls the highlight on the JTree - it s done on the tree level not on the TreeCellRenderer level which is why it s a little confusing to manage . This code will get you a Tree where you can control the highlighting : .. . .. . And here s an example of changing the highlighting to Red . Please note that the Icon s background will be highlighted too - this is the default behavior for non-nimbus L F too . If you don t want the icon to be highlighted you re going to have to use something fancier than the default JLabel to render the TreeCell : .. . .. . Original Answer .. . .. . One of the easiest ways to fix this is to set the selected background-color to transparent . The problem is that it s trying to paint the background of the label - which doesn t have the cool Nimbus painter used by the JTree s selection . So add this line to getTreeCellRendererComponent method : .. . .. . Another option is to use the nimbus painter for the background of the TreeCellRenderer - but that seems like overkill in this situation . Comment : hmm .. . not really as I understood the question it s about preventing the background coloring outside of the renderer while keeping it inside Using an invisible color if it has any effect at all would prevent both . Comment : @kleopatra Hehe.. . maybe I ll read the full question next time . Good catch . Comment : OP here just checked back in after a long time delighted to see the question answered and it works . Many thanks for the code and the info about it being handled on the tree level . Comment : works no more with Java 8 . But the Nimbus bug is fixed . Comment : OP here again . @oliholz : Sorry but I don t see that the Nimbus bug is fixed . Tried building a trivial tree selecting gets different highlight behavior in the default L F and in Numbus . Default highlights only the text of the node while Nimbus highlights the width of the tree frame which was my original problem . Borrowed the idea in the last answer at stackoverflow.com questions 28691272 http : stackoverflow.com questions 28691272 jtree-ignoring-laf-overrides and used a painter that simply lightened the color which looks better . Still would like to constrain highlighting to just the node text . Ideas welcome .", "Question : I got a problem which only happens on Nimbus L F . If there are too many items in a JList the thumb of JScrollBar will disappear . But in metal L F the thumb will be always visible because it has a min size . I have also checked the logic in Nimbus L F there does have a same min size . But it not effected . Please see my code below : .. . .. . When I set f.setSize 300 300 the thumb will disappear . enter image description here http : i.stack.imgur.com gHT0M.jpg .. . .. . But if I set f.setSize 300 400 the thumb will be visible . enter image description here http : i.stack.imgur.com oyOel.jpg .. . .. . How can I set the thumb always visible enter image description here http : i.stack.imgur.com 9veJH.jpg Comment : Seems okay to me . What version of Java are you using Have you tried initialising the UI from within the context of the EDT Initial Threads http : docs.oracle.com javase tutorial uiswing concurrency initial.html Do you have a screen shot of the two screens Comment : I m using 1.8.0 60 . Please see the following screenshot 7xlpns.com1.z0.glb.clouddn.com Nimbus 20300.png http : 7xlpns.com1.z0.glb.clouddn.com Nimbus 20300.png 7xlpns.com1.z0.glb.clouddn.com Nimbus 20400.png http : 7xlpns.com1.z0.glb.clouddn.com Nimbus 20400.png 7xlpns.com1.z0.glb.clouddn.com Metal 20300.png http : 7xlpns.com1.z0.glb.clouddn.com Metal 20300.png Comment : I have tried running this demo in EDT thread the problem exists . Thanks Comment : I m running Windows 7 Java 8 and I don t have the problem might be a Windows 8 related issue.. . Comment : It s strange . I have tested on Win7 8 with JDK1.8.0 60 . But they all have this problem . It only happened under Nimbus L F metal is OK . When you reduce the height of the frame the thumb will disappear while there are enough space to display thumb . .. . Answer : Try to set the minimum size of thumb to 1 Comment : Thanks it works . I set new Dimension 29 29 instead of new Dimension 29 1 to make thumb bigger . Comment : I tried it with a table with many rows Comment : Ignore first comment I was just to slow . new Dimension 29 29 is the default size of the thumb look here https : docs.oracle.com javase tutorial uiswing lookandfeel nimbusDefaults.html . I tried it to set it to this size too but the thumb continue to disappeared after I add lot of new data to my test table . I guess because it can not be shrink by java I don t know . But it worked for me when I set the hight to 1 . Comment : I still met some strange thing again . On my another PC with a 1900 1000 screen 1 and 29 are both not work . But when I set the height larger than 35 it works . Maybe this situation is relative with screen-size I m not sure . Anyway it works for me now . Comment : It seems to be a known https : www.google.de search sclient psy-ab biw 983 bih 939 q java+1.8.0 60+nimbus+thumb+issues oq java+1.8.0 60+nimbus+thumb+issues gs l serp.3...145.11029.10.11237.26.24.1.1.1.0.112.1493.23j1.24.0....0...1c.1.64.serp..18.8.426.l 0DBmNr8Cc pbx 1 cad cbv sei h xEVtDiDoX2Pt-qtNgJ bug since 1.8.0 60", "Question : While using the Nimbus L F feel in Java I am having problems with changing the background-color for a JButton more than once . In the code below I have a simple Swing application that displays a JButton and attempts to change the color once per second . However only the first color is being applied . Can anyone provide any suggestions on how to make this change more than once I m running java 6.29 . .. . Answer : for Nimbus you have to call SwingUtilities.updateComponentTreeUI myButton after any of changes for Nimbus Defaults http : docs.oracle.com javase tutorial uiswing lookandfeel nimbusDefaults.html primary .. . .. . more infos about that in this thread about Background and JPanel http : stackoverflow.com questions 8246589 how-to-change-the-background-color-for-jpanels-with-nimbus-look-and-feel .. . .. . read Nimbus Look and Feel http : docs.oracle.com javase tutorial uiswing lookandfeel nimbus.html .. . .. . EDIT : .. . .. . I agreed not possible to change that direct way maybe there is another dirty hacks is possible that with very complicated way development of Nimbus L F ended somewhere on first half another similair issue is in my question about Font http : stackoverflow.com questions 9958004 change-font-at-runtime Comment : Didn t @GregoryPeck already call updateComponentTreeUI Comment : @mKorbel updateComponentTreeUI is already called so it does not solve his issue . But there is not much point in using L F if OP has to use dedicated client properties on all his components . Then Rob I solution is actually a lot simpler and more efficient . Comment : did you to check Nimbus Default for JButton Comment : @mKorbel Thanks for the links but they don t seem to solve the problem of setting the value more than once . Comment : @Gregory Peck see my edit there I searching in the dirty tunels for an alternative s maybe exist but for first version for un official Nimbus L F", "Question : Nimbus often looks great but for certain color combinations the result is non-optimal . In my case the background of a JPopupMenu does not fit which is why I want to set it manually . I m on Java 7 and interestingly Nimbus fully ignores the setting of some properties in the UIManager like PopupMenu.background . So my only option was to create a subclass of JPopupMenu that overrides paintComponent .. . . I know that s nasty but at least it worked . However if you add a JMenu to another menu it embeds it s own instance of JPopupMenu and I could not figure out how to replace it with my own subclass . Even assigning an own PopupMenuUI to the embedded instance didn t bring any results . If inherited directly from JPopupMenu the overriden paint .. . method was called but not matter what I did nothing was drawn . If inherited from javax.swing.plaf.synth.SynthPopupMenuUI paint isn t even called and the result is if I hadn t set an own PopupMenuUI at all . So the simple question is : How do I adjust the background-color of one JPopupMenu or if that s easier all of them on Java 7 using Nimbus as L F Edit : Code example .. . .. . Take a look at the following code and the result : .. . .. . I know some say that you should use UIManager.put key-value or UIManager.getLookAndFeelDefautls .put key-value before setting the L F but for me this does not bring any results meaning : no changes to the default colors at all . The code above at least brings : .. . .. . First screenshot http : i.stack.imgur.com I7GpX.png .. . .. . Same thing meaning nothing happens if you use JPopupMenu.setBackground .. . . This is because Nimbus uses an internal painter which computes the color from Nimbus primary colors and ignores the components property . In this example you can use the following as workaround : .. . .. . Which brings .. . .. . SecondScreen http : i.stack.imgur.com JJFug.png .. . .. . However this workaround does not work if you insert a JMenu which itself wraps a JPopupMenu you can t override : .. . .. . gives as expected : .. . .. . Third screen http : i.stack.imgur.com 56PNg.png .. . .. . You can retrieve this JPopupMenu using JMenu.getPopupMenu but you can t set it . Even overriding this method in an own subclass of JMenu does not bring any results as JMenu seems to access it s enwrapped instance of JPopupMenu without using the getter . Comment : You may get better answers if you outline your actual goal . The UI delegate PopupMenuUI is not trivial . Comment : @aRestless I think that better could be post an SSCCE Nimbus not ignoring its development ended somewhere in the middle sure there are needed add some code lines moreover another option could be or another combinations http : stackoverflow.com questions tagged java+nimbus+colors Comment : @aRestless You should follow mKorbel s advice : post a SSCCE http : sscce.org that people can run as is on their machine and I m sure you will get some answers . Comment : Here you are .. . Answer : there are a few mistakes in both answers .. . .. . and above mentioned way to required to override most UIDeafaults that have got impact to the another JComponents and its Color s .. . .. . Nimbus has own Painter one example for that .. . enter image description here http : i.stack.imgur.com oD1ZK.jpg .. . .. . from code Comment : +1 for the answer there s a ever so slight disadvantage if client code in java6 is not allowed to access the com.sun packages . Just wondering why the default painter doesn t take up the background if set - it doesn t seem to paint anything fancy . Comment : The cleanest approach . A bit more complicated than the other two but simpler than I thought relating to the painters . Comment : this is one of common and confortabe from the possible ways Nimbus has a few another ZOO", "Question : I am just learning Java and still have not been able to sort this little problem I have .. . .. . My pop-up Calendar uses Nimbus look-and-feel but I have panels and container Jtables that use Java s look-and-feel - I am trying to make every GUI screen window use the nimbus look-and-feel and it was suggested by Merky to put the foolowing code in my main to make every subsequent screen have the Nimbus look-and-feel but I cannot get it to work so can someone tell me where and how I should put this code PLEASE . Would apprciate some help Please Simon .. . Answer : I think try with : Comment : Now I can actually see your code please use code-formatting in future it seems it does nothing more than what user347500 demonstrated better more than 2 months ago . :" ] }
[ "yes-answer-long", "yes-answer-short" ]
look-and-feel
UNK_RELATION
canonical-link@rel@55
canonical-link -- is a keyword for the html attribute @placeholder which allows specification of the preferred url for web pages with duplicate content .
{ "confidence": [ 44.232276916503906, 41.582008361816406, 41.321136474609375, 40.84956359863281, 39.65456771850586, 39.32212829589844, 38.65581512451172, 37.29754638671875, 36.781578063964844, 36.59010314941406, 36.35504913330078, 36.05792999267578, 35.14764404296875, 34.87886047363281, 34.87886047363281, 34.83120346069336, 34.82001495361328, 34.67148971557617, 34.668670654296875, 34.66038513183594, 34.646751403808594, 34.229400634765625, 34.03062057495117, 33.99136734008789, 33.9341926574707, 33.69969940185547, 33.69914627075195, 33.64604568481445, 33.49555206298828, 33.39115905761719, 33.26727294921875, 33.261016845703125, 33.258567810058594, 33.258567810058594, 33.258567810058594, 33.18454360961914, 32.835716247558594, 32.835716247558594, 32.79874801635742, 32.79491424560547, 32.76744842529297, 32.75126647949219, 32.138397216796875, 32.05717468261719, 31.948810577392578, 31.550161361694336, 31.49881935119629, 31.378192901611328, 31.378192901611328, 31.378192901611328, 31.37155532836914, 31.28593635559082, 31.09579849243164, 30.99991226196289, 30.994455337524414, 30.946636199951172, 30.946636199951172, 30.82815170288086, 30.763139724731445, 30.734420776367188, 30.734420776367188, 30.734420776367188, 30.734420776367188, 30.699230194091797, 30.699230194091797, 30.675573348999023, 30.675573348999023, 30.590953826904297, 30.530094146728516, 30.377893447875977, 30.27600860595703, 30.206764221191406, 30.050737380981445, 29.87078857421875, 29.726730346679688, 29.673973083496094, 29.671852111816406, 29.59943199157715, 29.59943199157715, 29.55170440673828, 29.184261322021484, 29.184261322021484, 29.160030364990234, 29.137683868408203, 29.137683868408203, 29.064739227294922, 28.8453426361084, 28.8453426361084, 28.70187759399414, 28.70187759399414, 28.641016006469727, 28.641016006469727, 28.59807586669922, 28.582157135009766, 28.513595581054688, 28.4990291595459, 28.4990291595459, 28.488815307617188, 28.415870666503906 ], "content": [ "WordPress adds link rel canonical https : moz.com learn seo duplicate-content for pages so no need to worry over duplicate content .", "We want to avoid to create duplicate content and canonical issues.The content for www .", "if document.querySelector link rel canonical .. . .. . Get current URL .. . var url document.URL .. . .. . If query-string get it and append to current URL .. . if location.search .. . var query location.search .. . else .. . var query .. . .. . .. . Get canonical URL .. . var canonical document.querySelector link rel canonical .href .. . .. . if url canonical + query .. . window.location.replace canonical + query .. . .. . .. .", "The canonical url shouldn t be pointing to other pages unless they share the same content .", "Choose a primary URL for those pages and make that the canonical URL .", "How do I use Canonical Link to remove the duplicate tags", "Google treats the canonical-link as a 301 redirect which means you won t have any duplicate content issues .", "But it gives me the following warning : .. . .. . Mismatch og : url and canonical url og : url tag in the header is not the same URL as rel canonical-link in the html .", "And if they find the filtered pages from incoming links they give credit to the canonical URL which helps its rankings .", "The canonical url link can be placed on every page .", "If no : .. . You must not http : tools.ietf.org html rfc6596 section-3 use the canonical-link type because you news page doesn t identify content that is either duplicative or a superset of the content at the context referring IRI which would be your gallery pages .", "For main domain google is understanding : .. . .. . For english subdomain : .. . .. . What is the best practice to avoid any canonical duplicate content issues", "The backoffice option Canonical url is only used in controllers .", "After modifying the URL the canonical code does not display in the html source code anymore .", "If you want canonical url in your html header you ll have to write or get a module for that as it is not included in Prestashop .", "I have several same pages : .. . .. . When I use canonical configuration - I get domain product-page as canonical .", "I got the warning og : url tag in the header is not the same URL as rel canonical-link in the html .", "Read also : yoast.com duplicate-content https : yoast.com duplicate-content", "thanks but the problem is I dont want to use the permalink for the canonical-link I want to use the content source link.. .", "If yes : .. . You may use the canonical-link type .", "Server discovers that this request is for a canonical URL .", "The canonical URL is always a URL with product-item but other ways might be a URL with search-item even though it has the product-item canonical URL .", "But in order to promote your preferred page you can use the canonical-link .", "The best way to avoid duplicates is to create a unique content for each version if you can t add content now you have to block these pages or sub-domains by robots.txt or by adding a canonical-link to the original page which is en.example.com in your case .", "This canonical url will be set as a link on Facebook sharing .", "I am changing the code so that the canonical URL is always example latestVersion to ensure duplicate content is not indexed .", "Moreover The Canonical Link Relation spec https : tools.ietf.org html rfc6596 confirms that .", "Google say Mark up the canonical page and any other variants with a rel canonical-link element .", "First question : in case the fetched the object URL and canonical og : url URLs differ why the tags are taken from the canonical URL and not from the fetched URL", "First you need to decide which criteria to take into account when defining the canonical URL .", "But I need FULL url domain category subcategory product-page canonical .", "The content is unique on the language subdomains so you should also set the canonical URL to the language version also .", "Pick one or the other and make that the canonical URL .", "Server looks up canonical URL : canonical.html .. . 3 .", "Server issues a 301 redirect to the canonical URL .", "3- What is the measure for the duplicate content", "Trying to achieve a Redirect to the original canonical-link using javascript .", "I found the problem if the visitor visits the page they are redirected to the canonical-link .", "All pages of my joomla site have a menu entry the problem is every page now have tow URLs : .. . .. . I tried this plugin : http : styleware.eu store item 26-styleware-content-canonical-plugin but it only add the current URL in the canonical tag : .. . .. . What I need is to have the code below in the example.com XYZ-article-url where XYZ is the article ID .. . .. . PS : I ve tried this : http : www.aimy-extensions.com joomla canonical.html user-manual .. . but it only adds the current URL to canonical meta tag :", "There are news and some of the news have galleries such as : .. . .. . News URL : .. . .. . Gallery URLs : .. . .. . Should I add canonical tag into the gallery HTML as like below", "Now I still have sets of only 2 pages with a duplicate content .", "Something that might look like link rel canonical href https : and would work for whatever url it was placed upon to simply direct to https version .", "http : m.mysite.com REQUEST URI L R 302 .. . .. . I will use alternate tags in desktop site pages and use canonical tags in mobile site pages .", "You re coming across a classic duplicate-content issue .", "Canonical tags has been supported in Magento since 1.4.0.0 RC1 for both product pages and category pages .", "when I activate canonical tags for the domainname3.ch the tag looks like : .. . .. . link rel canonical href http : dimainname3.ch .. . .. . But I want that domainname2 domainname3 canonicaltag points to domainname1 where the unique content is located", "I m looking to create a dynamic rel canonical tag in my application which pulls in the current URL but want to ensure any query parameters are removed .", "How can i change this Canonical Url XXXX.online.de tester", "Just found this question while searching for info about canonical URL support .", "What s the use in having a fetched and a canonical URL in the first place", ": nervermind the actual content of the second page besides the canonical-link .", "So let s say your domain is example.com www.example.com and example.com are two different URLs and if you don t redirect them to a standard canonical URL for instance example.com search engines treat the two URLs as completely different pages .", "After running my page through a Canonical URL Checker http : www.seoreviewtools.com canonical-url-location-checker it displays the original source link instead of my modified one .", "Because canonical URL is made to prevent from wrong URL to be used by robots .", "The canonical URL can be specified in a HTTP header too .", ": .. . .. . Now I wonder if the same should be done for the link rel canonical tags .", "By default Yoast s plugin adds a link rel canonical href .. . in every page .", "In that page canonical tag is generated automatically and after long time debug we could not find the exact place which generates the canonical tag and appends it to the header .", "How my original url XXXXX.com tester getting changed to that unknown Canonical URL XXXX.online.de tester", "On top of that you can individually select any URL for any chosen product or enter a custom canonical .", "I have modified the prepareLayout function in Mage Catalog Block Category View class to have a customized canonical url .", "I m wondering if there is any validation function that s preventing me to have a customized canonical URL", "I ve heard people mention the Canonical URL tag but I don t know what it means or what its purpose is .", "If you have a site with the same content on a mobile version - regardless of site names - you should use canonical .", "Canonical URLs are used when you would otherwise have different URLs that point to the same content without actually redirecting .", "The problem is for the canonical-link I am using : .. . .. . to echo the page url for indexing purposes .", "I would suggest using a canonical-link in the document head to ensure Google uses the correct URL .", "If in doubt - put in canonical .", "According to my searchs 25 - 30 similarity means duplicate content .", "I know this can be achieved by link rel canonical href https : example.com main.html .", "Yes .. . .. . href attribute on a canonical-link is like all href attribute on link : it supports URIs https : www.w3.org TR html401 struct links.html adef-href .", "link rel canonical will be used by search engines where as og : url will be used by facebook .. . .. . og : url basically tells the FB scraper ignore anything on this page and scrape this url instead .. . .. . More for Canonical link element : http : en.wikipedia.org wiki Canonical link element", "My subpage s URL is : www.example.com subpage.html .. . .. . The code for Facebook : .. . .. . I am also using a canonical url which is : .. . .. . So my question is : Should be property og : url the same with the canonical", "For duplicate content yes .", "Your canonical URL redirection does not .", "Canonical urls for product and category pages are supported by Magento from 1.5 .. . .. . In admin : SYSTEM CONFIG CATALOG SEARCH ENGINE OPTIMIZATION", "It can be either rel canonical in view or 301 302 redirect to canonical URL .", "After a few days Google is indexed my pages with https and http and now I have duplicate content .", "Duplicate content is unavoidable when using GitHub Pages with users and organizations if the repository is public .. . .. . In general this shouldn t be a problem .", "Does the canonical version of the page itself need the canonical meta tag or is it sufficient only to add it to the wrong ones", "So I took a look even to the default-bootsrap theme the last from github but it seems it doesn t implement any canonical url .", "For this I use the following canonical alternate structure : .. . .. . In point 1 should I use alternate href www.sample.us product instead of url with path to product", "You can get it here : .. . .. . https : github.com mattwright URLResolver.php .. . .. . URLResolver.php is a PHP class that attempts to resolve URLs to a final canonical-link : .. . .. . Follows 301 and 302 redirects found in HTTP headers .. . .. . Follows Open Graph URL meta-tags found in web page head .. . .. . Follows Canonical URL link tags found in web page head .. . .. . Aborts download quickly if content-type is not an HTML page .. . .. . I am certainly not an expert on the rules of HTTP redirection so if anyone has suggestions on how to improve this library it would be greatly appreciated .", "I m not interested in show a canonical-link in every single static page whatever its type is but in some type of posts : Pages and Posts not Attatchment Category Archive etc .", "I ve tryed : post type get post type post if post type page post type post add filter wpseo canonical return false And none filter is still affecting to every static page not adding a canonical-link in pages and posts", "Canonical and hreflang tags on the index page are as follows .", "Is this possible or is there some code that can be added so I can set a different canonical URL for categories in Magento", "I don t want likes for each country all disappearing and counting towards the rel canonical URL .", "This is exactly what canonical URLs are for .", "rel canonical .. . .. . 1 .", "My question is what is the best way to handle the duplicate content", "A website I m working on has sub domains with duplicate content on it .", "When using Jump to aka Anchor links to jump to a different part of a webpage should I use canonical URL or a no-follow link for the purposes of SEO", "To get canonical id .. . .. . To get canonical url from canonical id .. . .. . I don t know how to call this and i don t know the terms app link hosts Android App Link Object Example YOUR APP LINK HOST ID here actually means .", "What I want is add canonical tag inside the head tag if canonical tag does not exist using PHP .. . .. . I have tried this but it didn t work", "I also set canonical to desktop url for each mobile site url if its desktop version available .", "Why do you use your homepage URL as canonical URL for your subpage", "I have now a double canonical-link on every page and don t know how to kill the one of the iframe. .", "I opened my index.html file and added the link rel canonical href your-domain.com quot http : your-domain.com quot within the head and re-run the SEO but it still showed I have duplicate title tag and meta description tag why" ] }
{ "confidence": [ 51.413658142089844, 47.520057678222656, 47.309898376464844, 47.29875564575195, 47.275169372558594, 47.18660354614258, 45.8165283203125, 45.273765563964844, 44.9896354675293, 44.46781921386719, 44.35127258300781, 44.073890686035156, 42.957489013671875, 42.948944091796875, 42.94224548339844, 42.92331314086914, 42.670310974121094, 42.65721130371094, 42.6510009765625, 42.395965576171875 ], "content": [ "Question : I have a news site about global sport industry . There are news and some of the news have galleries such as : .. . .. . News URL : .. . .. . Gallery URLs : .. . .. . Should I add canonical tag into the gallery HTML as like below .. . .. . Note : gallery pages have no written content except of the same news headline it s all photographs 1.jpg 2.jpg etc . . .. . Answer : Are all photographs also included on news tiger-woods-win-the-cup If no : .. . You must not http : tools.ietf.org html rfc6596 section-3 use the canonical-link type because you news page doesn t identify content that is either duplicative or a superset of the content at the context referring IRI which would be your gallery pages . If yes : .. . You may use the canonical-link type .", "Question : Our website is targeting several languages and countries . We make the choice to use subdomain to manage our URLs . We want to avoid to create duplicate content and canonical issues.The content for www . and en . is identical but we plan to adapt the content for en . in order to target UK . For main domain google is understanding : .. . .. . For english subdomain : .. . .. . What is the best practice to avoid any canonical duplicate content issues Thanks for your help .. . Answer : The best way to avoid duplicates is to create a unique content for each version if you can t add content now you have to block these pages or sub-domains by robots.txt or by adding a canonical-link to the original page which is en.example.com in your case . when you have content for each version remove all these changes and make google able to index them .", "Question : I have an eCommerce site that I am working on . The primary way customers find products is by filtering down results with a search menu options include department brand color size etc . . The problem is that the menu creates a lot of duplicate content which I am afraid will cause problems with search engines like Google and Bing . A product can be found of multiple pages depending on what combination of filters are used . My question is what is the best way to handle the duplicate content As far as I can tell I have a few options : 1 Do nothing and let search engines cache everything 2 use a canonical-link tag in the header so search engines only cache departments 3 put rel nofollow in the filter links-- though to be honest I m not sure how that works internally 4 put noindex in the header of filtered pages . Any light that can be shed on this would be great . Comment : This question appears to be off-topic because it is about SEO Comment : Where should it go I couldn t seem to find a better place for it . Comment : @Jason : As the seo http : stackoverflow.com questions tagged seo tag description says probably Webmasters http : webmasters.stackexchange.com . .. . Answer : This is exactly what canonical URLs are for . Choose a primary URL for those pages and make that the canonical URL . This is usually one that isn t found using filters . This way the search engines know to display that URL in the search results . And if they find the filtered pages from incoming links they give credit to the canonical URL which helps its rankings . Comment : How do you deal with pagination though Suppose the user is on . search dep department brand someBrand page 2 there isn t really a good way to map that back to . search dep department is there", "Question : Our website is targeting several languages and countries . We make the choice to use subdomain to manage our URLs . We want to avoid to create duplicate content and canonical issues.The content for www . and en . is identical but we plan to adapt the content for en . in order to target UK . For main domain google is understanding : .. . .. . For english subdomain : .. . .. . What is the best practice to avoid any canonical duplicate content issues Thanks for your help .. . Answer : Common Mistakes Important : Make sure that your provided hreflang value is actually valid . Take special care in regard to the two most common mistakes : .. . .. . Missing confirmation links : If page A links to page B page B must link back to page A . If this is not the case for all pages that use hreflang annotations those annotations may be ignored or not interpreted correctly . Incorrect language codes : Make sure that all language codes you use identify the language in ISO 639-1 format and optionally the region in ISO 3166-1 Alpha 2 format of an alternate URL . Specifying the region alone is not valid . Via Read : https : support.google.com webmasters answer 189077 hl en Comment : Read also : yoast.com duplicate-content https : yoast.com duplicate-content", "Question : So basically I have a site where occasionally I setup a vanity url for web campaigns or product literature : .. . .. . i.e . http : www.example.com campaign-URL .. . .. . links to the same page as .. . .. . http : www.example.com normal-site-URL .. . .. . I set this up with a rewrite in IIS7 and as such it s difficult to grab the real URL from the underlying ASP.NET code since Context.Request.Url returns the rewritten URL instead of the URL the user visited . This makes it difficult to inject the link rel canonical tag into the page at render time . Instead what I ve done is to check the URL through JavaScript and inject the link rel canonical tag that way . Honestly I don t think it ultimately will make much of a difference since the preferred URL is already submitted through the Google Sitemap but since I have some SEO folks that are demanding it I m wondering if this will be picked up by Google or if I m just wasting my time adding that code . Thanks .. . Answer : Google is shakey when rendering JavaScript for it s crawler . It s not 100 that it ll read things written after . It s easier to make sure that the rel canonical is in the template . Make sure it goes onto all of the pages including the original . That way if it s caught on only one and Google sees duplicate content you won t eat a penalty . There appears to be a smart filter that will attempt to file duplicates together if even one of them has a working canonical-link . Again however it s not something to rely on Comment : Thanks I don t know why I didn t just think of putting it in the actual page template regardless . For some reason I was thinking I should only add it on pages that weren t the canonical but obviously it won t hurt if it s also on the page that are the canonical .", "Question : I m having trouble understanding canonical URLs with regards to how search engines and Facebook seem to handle them . My Google maps powered site allows visitors to use social media to request a gig in their country . One of the pages in question can be found at : http : izzy.nogig.in .. . .. . When a user clicks on their countries marker it gives them sharing options twitter facebook etc which when shared will share the URL specifically for that country eg : izzy.nogig.in usa or izzy.nogig.in spain etc . All of these countries in the URL amount to a lot of duplicate content so I use the following to point search engines to the page I want ranked : - .. . .. . For Facebook Likes to count towards each individual country I ve set my Open Graph og : url as follows eg : .. . .. . Now when I run a country-specific URL through the Facebook Object Debugger eg . http : developers.facebook.com tools debug og object q http 3A 2F 2Fizzy.nogig.in 2Faustralia 3F it shows the following : - .. . .. . The above error is what s confusing me . I know they re mismatched but I thought this was the correct way to do this . Everything in the debugger looks good to me correct link description image etc for each country and I can t change the rel canonical value to match my og : url as I need it pointing to a single page country-less for search engines . I believe it is all working correctly . Should I just ignore the error from the debugger or have I set this up incorrectly I don t want likes for each country all disappearing and counting towards the rel canonical URL . Many Thanks - Will .. . Answer : link rel canonical will be used by search engines where as og : url will be used by facebook .. . .. . og : url basically tells the FB scraper ignore anything on this page and scrape this url instead .. . .. . More for Canonical link element : http : en.wikipedia.org wiki Canonical link element", "Question : I m having trouble understanding canonical URLs with regards to how search engines and Facebook seem to handle them . My Google maps powered site allows visitors to use social media to request a gig in their country . One of the pages in question can be found at : http : izzy.nogig.in .. . .. . When a user clicks on their countries marker it gives them sharing options twitter facebook etc which when shared will share the URL specifically for that country eg : izzy.nogig.in usa or izzy.nogig.in spain etc . All of these countries in the URL amount to a lot of duplicate content so I use the following to point search engines to the page I want ranked : - .. . .. . For Facebook Likes to count towards each individual country I ve set my Open Graph og : url as follows eg : .. . .. . Now when I run a country-specific URL through the Facebook Object Debugger eg . http : developers.facebook.com tools debug og object q http 3A 2F 2Fizzy.nogig.in 2Faustralia 3F it shows the following : - .. . .. . The above error is what s confusing me . I know they re mismatched but I thought this was the correct way to do this . Everything in the debugger looks good to me correct link description image etc for each country and I can t change the rel canonical value to match my og : url as I need it pointing to a single page country-less for search engines . I believe it is all working correctly . Should I just ignore the error from the debugger or have I set this up incorrectly I don t want likes for each country all disappearing and counting towards the rel canonical URL . Many Thanks - Will .. . Answer : On one of the sites I ve developed I serve the page in more than one language and provide links to allow the user to switch between one language and the other . So my rel canonical will have the URL http : www.example.com whereas within the code I update the og : url so that it is either http : en.example.com or http : fr.example.com . That way when the user shares the page on Facebook everything will appear on Facebook in the language they were viewing the page which makes sense since most of the visitor s friends will likely speak the same language . Regards . Comment : sounds exactly the purpose canonical urls should serve. . or am I mistaken here Comment : The content is unique on the language subdomains so you should also set the canonical URL to the language version also . What you ve done is say to the search-engine that fr.example.com http : fr.example.com is the same content as example.com http : www.example.com but it s not .", "Question : I m looking at using GitHub Pages to host my blog and Jekyll to present it . Presumably whatever I commit will appear at yourname .github.io through Jekyll and at https : github.com yourname yourname .github.io in rawer form . See this page showing links to live sites and to the source repos used to construct them http : jekyllrb.com docs sites . Advice on SEO suggests that duplicating content within and across domains is bad SEO practice . See this Google support page on duplication https : support.google.com webmasters answer 66359 and this Moz page on issues with duplication https : moz.com learn seo duplicate-content both of which also offer possible solutions . My question is two-fold : .. . .. . Is content duplication actually a problem for GitHub Pages in practice If so how does one apply solutions like canonical linking or noindex to the GitHub repo so that search engines know that your Jekyll site is the canonical one .. . .. . Update : .. . .. . Might be worth noting that I uploaded a hello world index file to my GitHub Pages repo and then checked the source for the page on GitHub . The GitHub source already contains a canonical-link .. . .. . I assume it s this that would need changing for each file to point to the Jekyll version of the site but I can t see a setting in GitHub to handle it . .. . Answer : Duplicate content is unavoidable when using GitHub Pages with users and organizations if the repository is public .. . .. . In general this shouldn t be a problem . See a previous answer http : webmasters.stackexchange.com questions 76924 will-google-penalize-me-for-duplicate-content-on-github-from-my-knowledge-base . You do have a couple of options : .. . .. . Google and other search engines can t obviously access private repository which requires a paid plan . Switch to a project page https : help.github.com articles user-organization-and-project-pages project-pages . This will use a gh-pages branch instead of the master branch . Since GitHub s robots.txt only allows search-engine crawling of the master branch and disallows other branches . So if the site is in gh-pages branch this will prevent Google from seeing the repository . Comment : Thanks for your response . I have a paid plan so your first option might work for me but I don t know how it works with the github.io URL i.e . whether it ll work when private . I m going to read the previous answer more carefully this evening and try these options out . If I can get this to work I ll mark this answer correct . Comment : Switching my repo to private doesn t seem to have affected the serving of my pages so that ll work for me If I go public again with the repo I ll consider switching the branches or switching to a project page as you suggest . Thanks for your help", "Question : I am trying to set up og tags in order to share my sub-page on Facebook . My subpage s URL is : www.example.com subpage.html .. . .. . The code for Facebook : .. . .. . I am also using a canonical url which is : .. . .. . So my question is : Should be property og : url the same with the canonical If I test it on Facebook URL debugger as it is above then it will fetch the correct information . But it gives me the following warning : .. . .. . Mismatch og : url and canonical url og : url tag in the header is not the same URL as rel canonical-link in the html . .. . .. . If I change it and make it the same with the canonical then instead of information that was intended for the subpage it will fetch info that was intended for my homepage which is something that I don t want . So do I have to leave it as it is Comment : Why do you use your homepage URL as canonical URL for your subpage .. . Answer : The debugger is simply following the conventions . The canonical url shouldn t be pointing to other pages unless they share the same content . Well I m oversimplifying it . .. . .. . There are many sources online you can read about this . For example this https : zadroweb.com a-beginners-guide-to-canonical-tag article .", "Question : I ve heard people mention the Canonical URL tag but I don t know what it means or what its purpose is . What is it and how does it affect SEO .. . Answer : Canonical URLs are used when you would otherwise have different URLs that point to the same content without actually redirecting . So let s say your domain is example.com www.example.com and example.com are two different URLs and if you don t redirect them to a standard canonical URL for instance example.com search engines treat the two URLs as completely different pages . This causes the link popularity of the two URLs to be split which is obviously very bad for SEO . Comment : @musicfreak if you can incorporate some of the info from those URLs into your answer it would be for the best . External links die decay and we are attempting to have a comprehensive knowledge base here . Comment : One of the huge reasons for wanting to use Canonical URL s is if you have 2 different URLs pointing to the same content then their search value weight can be split up between them . Because it is split up between the two URLs it can lower the position your results are shown . Comment : @musicfreak +1 good edits .", "Question : I m having trouble understanding canonical URLs with regards to how search engines and Facebook seem to handle them . My Google maps powered site allows visitors to use social media to request a gig in their country . One of the pages in question can be found at : http : izzy.nogig.in .. . .. . When a user clicks on their countries marker it gives them sharing options twitter facebook etc which when shared will share the URL specifically for that country eg : izzy.nogig.in usa or izzy.nogig.in spain etc . All of these countries in the URL amount to a lot of duplicate content so I use the following to point search engines to the page I want ranked : - .. . .. . For Facebook Likes to count towards each individual country I ve set my Open Graph og : url as follows eg : .. . .. . Now when I run a country-specific URL through the Facebook Object Debugger eg . http : developers.facebook.com tools debug og object q http 3A 2F 2Fizzy.nogig.in 2Faustralia 3F it shows the following : - .. . .. . The above error is what s confusing me . I know they re mismatched but I thought this was the correct way to do this . Everything in the debugger looks good to me correct link description image etc for each country and I can t change the rel canonical value to match my og : url as I need it pointing to a single page country-less for search engines . I believe it is all working correctly . Should I just ignore the error from the debugger or have I set this up incorrectly I don t want likes for each country all disappearing and counting towards the rel canonical URL . Many Thanks - Will .. . Answer : I see no reason why og : url and canonical should be different . In both circumstances you re saying to either the search-engine or Facebook what page you want to index or be displayed . Comment : If you only have a few properties you just add the basic og : meta-tags to your page but if you have a lot of properties describing an Open Graph object in detail e.g . your OG object is a venue where you can eat drink dance etc . and you set up OG actions to interact with that venue it s nice to have those tags on a separate page so your users don t have to download them - the information is only useful to Facebook after all . The special Open Graph pages load normally if the user-agent is facebookexternalhit and redirect to your real pages for any other user-agent .", "Question : canonical urls are currently activated on the shop but the won t be written in frontend source code . So I took a look even to the default-bootsrap theme the last from github but it seems it doesn t implement any canonical url . I also checked all the controllers but it seems no one sets a canonical url something like. . smarty var so what the hell is the related backoffice option I searched the web but found nothing really useful . .. . Answer : The backoffice option Canonical url is only used in controllers . If you have activated the url-rewriting option and try to access this link : .. . .. . You will be redirected to for example : .. . .. . Here is an extract from the canonicalRedirection method from FrontController class : .. . .. . In this method we get the canonical redirect option you selected in the BackOffice with this line Configuration : : get PS CANONICAL REDIRECT . If you want canonical url in your html header you ll have to write or get a module for that as it is not included in Prestashop .", "Question : In my website I have the following categories url structure : .. . .. . category.php id 6 id 6 is for internet category .. . .. . My SEO friendly-url is like : .. . .. . The problem is it can be accessed in any of those forms and because of that I m getting duplicate content on google . So I m wondering how can I fix that . Should I disallow on robots.txt any urls with on it If so how can I properly set it up Should I make a redirection Permanently Moved on .htaccess If so how can I properly set it up My actual .htaccess for categories is like this : Comment : Out of curiosity why have you chosen category 6 internet as your SEO-friendly URL instead of category internet Comment : @msanford Probably because he needs the category id without having to do a lookup based on name . Comment : @OmarJackman I agree but it should be possible to do the latter especially in light of SEO Perhaps it doesn t matter . Comment : @msanford im using a pre-made script as base and this script im using as base works that way . Im am trying to figure out how can i remove this id from urls.. . My posts urls are like siteurl.com 12 slug-post-title and im working on how to remove the ids from url . If you have any idea.. . .. . Answer : I would suggest using a canonical-link in the document head to ensure Google uses the correct URL . Google on Rel Canonical http : support.google.com webmasters bin answer.py hl en answer 139394 . It s really easy to implement just post this into the HEAD section of the page . Google treats the canonical-link as a 301 redirect which means you won t have any duplicate content issues . It also means most of the link juice gets passed on between 90 and 99 . If you used robots.txt or .htaccess the page that you re blocking off would lose all its SEO value . Just make sure you do this for every page as it s a page specific rule . Linking to the domain root will effectively mean all your pages are 301 redirecting to the home page . Comment : you mean using canonical links will always be better than using htaccess or robotx.txt Comment : For duplicate content yes . Comment : can i use both solutions the canonial link and htaccess redirection", "Question : null .. . Answer : Trying to achieve a Redirect to the original canonical-link using javascript . I have encountered a weird bug .. . .. . The script works in this URL ending : .. . .. . index.php topic 000.0 wap2.html .. . .. . But FAILS to work with this one : .. . .. . index.php topic 000.0.html wap2 .. . .. . What s weird is I can see the script in the HTML source.. . it SHOULD be working but it s NOT Any ideas or some guidence to get thy old brain juices flowing would be great . Help if document.querySelector link rel canonical .. . .. . Get current URL .. . var url document.URL .. . .. . If query-string get it and append to current URL .. . if location.search .. . var query location.search .. . else .. . var query .. . .. . .. . Get canonical URL .. . var canonical document.querySelector link rel canonical .href .. . .. . if url canonical + query .. . window.location.replace canonical + query .. . .. . .. . Comment : What is the failure Do you get an exception Comment : The javascript does not execute with wap2 url ending . I don t understand why . I can even see the script in the HTML source code . : S Comment : How do you include the script- a script-tag an external js file do you get any js error on the console try to debug your code or maybe use console.log in your code to see where you get to . It s impossible to guess what is the problem without a working example that reproduces the issue . Comment : I just use the script tags . Thanks for the advise I will look it over . Comment : I found the problem if the visitor visits the page they are redirected to the canonical-link . The problem is if they already have a cached version of the URL ending with wap2 and they hit refresh the script does not execute . Any help", "Question : I m trying to clear up a grey area about this much talked about topic.. . .. . .. . Like most devs I ve made some pretty URLs with mod-rewrite . My sites internal links point to the pretty URLs and things are working nicely . But I can still access the old URL if I point to it directly . Now this is most certainly going to cause duplicate content issues so after doing some research http : stackoverflow.com questions 588911 seo-and-duplicate-urls it seems that 301 redirects are the way to go . But... . and here s the grey bit.. . If you are working on a site with thousands of URLs what s best practice to achieve this I don t wantto list 1k+ lines in .htaccess I thought of a regexp in my rewrite rule but my pretty URLs have names from the database in them.. . and I can t access that from .htaccess : .. . .. . Have I hit a dead end Is there a way around this Would Google s http : www.google.com support webmasters bin answer.py hl en answer 139394 canonical tag http : googlewebmastercentral.blogspot.com 2009 02 specify-your-canonical.html be a possibility Comment : RE : this is most certainly going to cause duplicate content issues . I m now looking for confirmation that this is the case . From what @FlipScript said below I m now not sure . Would duplicate content be a problem under the same domain Can anyone provide clarification From what Google sort of say here it seems like it wouldn t be a problem and I we don t have to bother with 301s for the same domain... . googlewebmastercentral.blogspot.com 2008 09 http : googlewebmastercentral.blogspot.com 2008 09 demystifying-duplicate-content-penalty.html .. . Answer : Well I don t know if this is the definitive answer but I have a bunch of functional URLS like : .. . .. . but I remap the URLs link-to them and list them in my site map as : .. . .. . I haven t seen ANY evidence that identical URLS pointing to the same content within the same domain has any negative impact on SEO . In fact over the past year I have climbed to the 1 position on Google with this in-place for my primary keyword . My theory about why this should be so is that Google applies the duplicate content penalty for entire clone sites not for just linking with different URLs to the same content within a single site . Comment : Hi FlipScript you re first link doesn t work but I get the idea . I ve done a bit more research on this today and found this good post by the masters themselves.. . googlewebmastercentral.blogspot.com 2008 09 http : googlewebmastercentral.blogspot.com 2008 09 demystifying-duplicate-content-penalty.html So it seems that this whole duplicate content issue maybe just a misunderstanding : Google don t penalise your site for duplicating content they just group the duplicate pages together in their results which may hide your preferred page . But in order to promote your preferred page you can use the canonical-link .", "Question : SEO wise is it okay to use an protocol free URL like this I redirect all users to HTTPS anyway . With protocol free I mean not using either http : or https : but instead . .. . Answer : Yes .. . .. . href attribute on a canonical-link is like all href attribute on link : it supports URIs https : www.w3.org TR html401 struct links.html adef-href . And URIs can be full URIs or relative URIs https : www.w3.org TR html401 types.html type-uri . Moreover The Canonical Link Relation spec https : tools.ietf.org html rfc6596 confirms that . Then : of course you can use a relative URL like a protocol free one . But don t .. . .. . I will recommend anyway to always use full URLs : scheme host path.. . .. . .. . Why Because canonical URL is made to prevent from wrong URL to be used by robots . Then using a relative URL might let some wrong URLs used by bots contrary to a full URL which you can be certain it is the right one . Comment : Thank you . Does it matter when I am already redirecting all users to HTTPS What I think is that if I sometime move away from HTTPS again it would be much easier not needing to change all canonical URLs . Comment : Doesn t really matter but not the best solution . Maybe you can simplify your future modification by using a variable with protocol or protocol+host and use it on all pages . Would be easier to admin . Comment : Sounds like a great idea - thanks", "Question : null .. . Answer : I have a desktop and mobile site . www.mysite.com .. . .. . m.mysite.com .. . .. . And I put the following .htaccess file on desktop site root : It Works . But is it enough for every devices RewriteEngine On RewriteCond HTTP USER AGENT android blackberry ipad iphone ipod iemobile opera mobile palmos webos googlebot-mobile NC RewriteRule . http : m.mysite.com REQUEST URI L R 302 .. . .. . I will use alternate tags in desktop site pages and use canonical tags in mobile site pages . I searched the net but I couldn t find some answers : .. . .. . 1- If my mobile site file names are different from the desktop site files but if the pages have the same content should I use these tags 2- If my mobile site file names and desktop site file names are the same but if the pages don t have the same content should I use these tags 3- What is the measure for the duplicate content What is the similarity ratio According to my searchs 25 - 30 similarity means duplicate content . Is it right Thank you Comment : If you have a site with the same content on a mobile version - regardless of site names - you should use canonical . Rules of thumb for duplicated content are just rules of thumbs . If in doubt - put in canonical . Comment : Do search engines control alternate tags for mobile search to display the mobile pages on mobile-devices Because mobile version of the pages are mobile friendly . And I want them to be displayed on mobile search . Comment : mobile results are more likely to display on mobile searches yes", "Question : null .. . Answer : All pages of my joomla site have a menu entry the problem is every page now have tow URLs : .. . .. . I tried this plugin : http : styleware.eu store item 26-styleware-content-canonical-plugin but it only add the current URL in the canonical tag : .. . .. . What I need is to have the code below in the example.com XYZ-article-url where XYZ is the article ID .. . .. . PS : I ve tried this : http : www.aimy-extensions.com joomla canonical.html user-manual .. . but it only adds the current URL to canonical meta tag :", "Question : I inherited an older website with a separate mobile and tablet directory . Both of them have duplicate content of the desktop version . Both the mobile and tablet versions are using JQuery Mobile and are one pagers with data roles for pages . A desktop page named awards.html will look like this on the mobile and tablet version : .. . .. . On the desktop pages I m adding to the head tag : .. . .. . My question is on the mobile and tablet version how do I add the canonical tag since the the whole site is on one index and they share the head tags Where would I put this Comment : Are there two different URLs Comment : Yes so for example : desktop awards.html tablet tablet awards.html mobile mobile awards.html . the desktop pages have a redirect to the tablet or mobile based on screen-size . .. . Answer : The canonical url link can be placed on every page . Having it self-referential http : stackoverflow.com a 13222380 1647538 on the desktop page is fine . Just add that canonical in the shared head template for mobile tablet and desktop . For more info Use canonical URLs https : support.google.com webmasters answer 139066", "Question : I have run SEO tool for my website it showed that I have a duplicate title tag and meta description tag both are in domain.com and index.html they are the same file . How do I use Canonical Link to remove the duplicate tags Please help . Thanks . .. . Answer : You re coming across a classic duplicate-content issue . The quickest way to get around this is to edit your index.html page markup and include a canonical-link http : googlewebmastercentral.blogspot.co.uk 2009 02 specify-your-canonical.html within the head of your page . Try this : .. . .. . What this does is tell the search engines that the two URLs the domain root and index.html are the same page and that it should only index the domain.com version . This won t stop people being able to still access the same page via index.html and just domain.com but it should remove the index.html version from the search-engine indexes fairly quickly . One very important thing to bear in mind : you need to ensure that you don t drop this link into a common shared page template ensure it only appears in your index.html file - otherwise you ll end up telling the search engines that all pages should be considered duplicates of the home page Note : although this will resolve the issue for you it may well take some time before the changes are reflected in your SEO software or Google Webmasters . You have to wait until the search engines next index your website and recognize the changes which could be up-to several weeks . Comment : Thank you so much for your clear explanation . I opened my index.html file and added the link rel canonical href your-domain.com quot http : your-domain.com quot within the head and re-run the SEO but it still showed I have duplicate title tag and meta description tag why Comment : It takes time for Google to re-crawl your site . Was it resolved" ] }
[ "yes-answer-long", "yes-answer-short" ]
rel
UNK_RELATION
rapache@server@140
rapache -- rapache is a project supporting web application development using the r statistical language and environment and the apache web @placeholder .
{ "confidence": [ 67.44230651855469, 56.910255432128906, 48.81039047241211, 48.44514846801758, 48.406585693359375, 48.367347717285156, 46.67357635498047, 46.62849426269531, 46.56611251831055, 46.19427490234375, 45.460506439208984, 45.231204986572266, 45.001251220703125, 44.183067321777344, 44.060882568359375, 43.97941589355469, 43.744834899902344, 43.594085693359375, 43.48318099975586, 43.20256423950195, 42.88831329345703, 42.6663818359375, 42.455902099609375, 42.455902099609375, 42.455902099609375, 42.26219940185547, 41.83778381347656, 41.61183166503906, 41.48689270019531, 40.95071029663086, 40.95071029663086, 40.95071029663086, 40.52931594848633, 40.52931594848633, 40.12253952026367, 39.812522888183594, 39.72218704223633, 39.2729606628418, 39.2729606628418, 39.2729606628418, 38.43264389038086, 38.41313552856445, 38.41313552856445, 38.010074615478516, 37.557289123535156, 37.557289123535156, 37.557289123535156, 37.47796630859375, 37.20777893066406, 37.1397705078125, 36.83544158935547, 36.83544158935547, 36.419105529785156, 36.24945831298828, 35.76229476928711, 35.05495834350586, 34.96153259277344, 34.91668701171875, 34.7745361328125, 34.729339599609375, 34.729339599609375, 34.70204544067383, 34.70204544067383, 34.53378677368164, 34.263816833496094, 33.591156005859375, 32.98637390136719, 32.98637390136719, 32.98637390136719, 32.98637390136719, 32.96664047241211, 32.808719635009766, 32.03145217895508, 31.848186492919922, 31.848186492919922, 31.848186492919922, 31.848186492919922, 31.757312774658203, 31.542030334472656, 31.000537872314453, 30.68103790283203, 30.34368133544922, 30.18887710571289, 30.18887710571289, 29.542850494384766, 29.069133758544922, 29.0618953704834, 29.050689697265625, 28.845136642456055, 28.637855529785156, 28.565147399902344, 28.29064178466797, 28.02260398864746, 27.403060913085938, 27.05557632446289, 27.05557632446289, 27.01187515258789, 25.985309600830078, 25.917388916015625, 25.211700439453125 ], "content": [ "I m developing an R web application using RApache .", "I m working on a web application that uses R enviroment with RApache .", "I m using RApache and brew package .", "You need to install RApache : http : rapache.net .. . .. . RApache is an Apache module with R that interpret your brew code on the server and renders a proper html page .", "I m not tied to Apache or RApache is Rook a standalone http server", "rApache is specifically a handler for the apache http server .", "rApache was not necessary .", "I m trying to make a webpage with Rapache and Leaflet for R .", "i m trying to using R and RApache to download pdf file with no success .", "Rapache and Rook : Use Rapache and Rook package in R to setup a server for processing requests .", "If you want to display an image in a web page using RApache then this approach is not what you want .", "I m guessing that RApache is not making the ap rflush call .", "I install R packages in R libs and when running .libPaths from an R session I get : .. . .. . However if I configure RApache to show me RApacheInfo by using .. . .. . in .libPaths RApache only reports .. . .. . How do I tell RApache to go looking in R libs", "And don t forget to restart RApache", "I know that opencpu uses rApache and rApache uses preforking but want to know how this will scale as the number of concurrent users increases .", "I m using ubuntu-13.10 with Apache2 PHP5 and MySQL I m trying to add rApache module in Apache to work as a server R . .. . .. . I configured my rapache exactly how this turorial shows .", "Note : I am using RApache as my web server and I have installed the Brew package .", "If you install rApache you can just launch your R script .", "Make sure you read the RApache documentation and configure it so as R scripts can be run from locations in your web root .", "Well it is working using command-line R. . but it is not displaying any graph using rapache on browser", "I am trying to generate a pie-chart on my browser using rApache .. . .. . my R code is this .. . .. . when i run this on browser .. . i am getting this error .. . .. . rApache has something to tell you .", "These questions are best answered on the rapache google group .", "rapache need to be recompiled after R has been upgraded", "Mark that it is important to install the package at the library location of R which is used by RApache .", "How can I get R and RApache installed in XAMPP for Windows", "When running R inside rApache the locale is inherited from the Apache webserver and therefore Sys.getlocale is always equal to C .", "So my question is : is there a way to get RApache to behave like that", "I am building an application with RApache and my code in R is receiving POST data .", "Another issue causing your DLL problems might be that you are using a package which is not loaded or installed in the R RApache is using .", "I cannot create pngs through rApache .", "I have tried to set up RApache on Ubuntu .", "Is the RApache module installed and enabled on the university server", "I have a problem connecting to an MSSQL server using rApache .", "I am using a fedora 15 and I have Rapache-1.2.0 installed .", "I have a R script that fetches results from a SQL query from R studio on windows but not Rapache on linux .", "rApache http : rapache.net or RPy2 http : rpy2.bitbucket.org .", "I m testing using RApache as an SSE Server Sent Events and similar long poll comet etc .", "However as of this time it seems that RApache only runs on Debian Ubuntu Mac .", "Also - does anyone have RApache running on Redhat Solaris", "You have to tell RApache what you want it to do .", "The issue is that a number of the R web interfaces that are listed in CRAN seem to have been last updated 5-6 yrs back .. . and the most recent up-to-date implementation seems to be RApache .", "If that s the case then you will most likely need these set when apache rApache is run .", "The apache error.log says that the cairo DLL failed to load...Does anybody know why this doesnt happen outside from rApache", "I had the same issue and determined the cause to be that rApache was not setting the LD LIBRARY PATH environment variable .", "hi i spend the whole night with installing ubuntu and rApache .", "its been a long time that I m trying to install rapache on debian .", "http : rapache.net manual.html rapache Cookbook .. . .. . So far I have installed Rapache .", "I have to install rApache 1.2.0 but when I write on the terminal : .. . .. . it gives me many errors such as : .. . .. . or .. . .. . Here is the Makefile.am link https : github.com jeffreyhorner rapache blob master Makefile.am : .. . .. . Any help would be greatly appreciated .", "The base installation works fine but I m stuck at passing variables with exec because I don t have R or RApache installed in my XAMPP environment although I have R in my Windows environment .", "this is the information when RApache is started .. . .. . notice Apache 2.2.15 Unix DAV 2 mod R 1.2.5 R 3.2 .2 PHP 5.3.3 mod apreq2-20090110 2.8.0 configured -- resuming normal operations .. . .. . environment centos - 6.7", "The main reason I did install Rapache is to use R inside of a html page with brew .", "Yes this is what i tried and and it work when I tape the code on R but on Rapache it doesn t show anything blank page", "I have tried the rApache installation instructions http : rapache.net manual.html .", "I m working with rApache for displaying encapsulated plots that were created in R . Right now there s only one problem that I have to face .", "So I need to get access to an MSSQL server in my Rapache program and when I try to load RJDBC as a library in my Rapache code I get server error .", "Or would you recommend to go with rserve or rapache as they might require less overhead", "UPDATE : Looking at this with fresh eyes after 5 months I think I could have described the problem more clearly : the problem is that RApache appears to be buffering all the output and not sending anything until the R script exits .", "In the apache error-log all I get is .. . .. . Tue Jun 26 12 : 55 : 32 2012 error client 10.21.2.79 rApache Notice", "R module can be used as an API for further application development using web frameworks other than python .", "I am trying to create a web application using R and Rook .", "This is not the case however when using the R script through a web application .", "From the site of Jeffrey Oons a number of good examples of how to use RApache with JSON was available that looked quite impressive .", "Look in the test directory which was created when you unpacked the RApache source code .", "lets say i have these files .. . .. . normal.R .. . .. . controller.php .. . .. . ajax.js .. . .. . As you can see i need no interaction with R in the html in the way offered in rApache .", "There must be a configuration the in the web server both the R internal and Apache that buffer the data flows .", "I am Using R integrated with PHP web application .", "Per the RApache Configuration Documentation http : rapache.net manual.html Configuring rapache you could try the REvalOnStartup directive to set .libPaths directly .", "So is this a problem with some Java configuration or is this a problem with rApache not being able to run the library because of the warning message", "You can find it on this post : https : groups.google.com forum topic rapache axLb5PsS9LY So happy : Resolved", "I m trying to figure out how the get the example from the official RApache website working .", "RApache seems not to work properly in combination with ggplot2 while working properly with plot on my Linux SuSE 12.2 server .. . .. . When one does http : claree.univ-lille1.fr R brew rapacheggplot which executes : .. . .. . This source in brew produces an empty png file while when replacing the two ggplot2 commands with a simple plot the png file is correctly generated see http : claree.univ-lille1.fr R brew rapacheplot .. . .. . in apache2 error-log I get : .. . .. . ggplot2 was compiled from source with R CMD INSTALL and RApache too When executing that program with R 1.15.1 and not RApache everything works well .", "The design of Rapache heavily influenced our much smaller littler r and r runs just fine on my Ubuntu box after installing R 3.0.0 from Michael s builds based on my packages .", "One of the issues I have is that most of the solutions I have seen such as rApache http : rapache.net invoke R to run a script and take back the output .", "Can your question be rephrased as : How does opencpu.org compare to rApache or Rstudio server", "To see which .libPaths are used by RApache you can go to localhost RApacheInfo in your browser the following screenshot shows mine .", "If you installed RApache in the default way the libpaths are probably not the path of your own user e.g .", "we are working on RApache .. . .. . we are sending the form argument from .html file which configured to brew .", "I faced a similar problem in an R-backed web application that I developed .", "I m able to display in the browser a plotted image by R with that script for example : .. . .. . And the other script that sends a variable and returns text strings : .. . .. . With GET variables of RApache I can work with autini in the R-script .", "Normally apache http server just sends back a file when a request for foo.html comes in but it can be configured to run a program via a handler which is what rApache is .", "In the R-Console I can connect fine and access the server but when I try to connect trough rApache on my test website it fails and I get an error .", "However I am unable to use rJava from an R script invoked by an R web application .", "Two extra questions : 1 . do you know if the discrepancy is normal or is RApache supposed to see also my custom library path", "Remember that your user id is typically not the one RApache runs at---so one is better of with R HOME etc Rprofile.site et al rather than HOME .Rprofile .", "RApache rpy2 that defines a framework and protocol for interacting with R . It handles stuff like object serialization security resource control reproducibility etc while abstracting away technicalities .", "var www R plot.R your chart should appear on the web page .", "questions 1395174 how-to-call-r-from-within-a-web-server-like-apache 1 answer .. . .. . Overview : Need to integrate R library with a web server written in python .", "But I cant figure out how to return my map inside the html page without saving it as a html extern file which Rapache is useless .", "This question already has an answer here : .. . .. . How to call R from within a web server like Apache", "Given the cost of web-hosting I imagine a workable real-time analytics system is the following : .. . .. . create R statistical models on demand on a specialized analytical server as often as needed e.g .", "Web server configuration .. . 2 .", "As it says in Section 3.6.6 http : rapache.net manual.html Configuring rapache of the online Rapache manual http : rapache.net manual.html Any file under var www R-files usr local apache2 htdocs R in your example is passed through the function sys.source .", "Is there any way using R with web PHP to have R session active with library loaded for each user active session .", "There is an entire section in the R FAQ devoted on web interfaces http : cran.r-project.org doc FAQ R-FAQ.html R-Web-Interfaces to R . .. . .. . Also consider the relatively new Rook http : cran.r-project.org package Rook package which utilizes the web server embedded in R itself since release 2.13.0 which R uses for its help system .", "This problem seems to be specific to the SuSE distribution as with equivalent rapache and ggplot2 version everything works correctly from localhost on my Mountain Lion Os X Mac Air computer .", "My two connection strings are : .. . .. . I construct some SQL and pass it to this function : .. . .. . I look in SQL profile and see a BatchStarting and BatchCompleted event for the query from Rapache http : rapache.net .", "You do end up using an ajax call from the web page back to an R function .", "Instead you need to do the following : .. . .. . Note the following was done on a 64-bit RHEL5 Server .. . .. . Add a file to etc ld.so.conf.d called rApache rJava.conf with the following contents : .. . .. . the above line was the path to the parent directory of libjvm.so on my server .. . .. . As root : .. . .. . followed by restarting Apache .. . .. . After Apache restarts you should be able to run R-scripts via rApache that depend on rJava e.g .", "I m looking for a more detailed explanation of what OpenCPU is how it is intended to be used and how this compares with existing tools such as rApache http : rapache.net and RPy2 http : rpy2.bitbucket.org .", "every day or hour using cron .. . transfer the results of the models to a directory on the opencpu servers using ftp as native R objects .. . on the opencpu server go to the directory and grab the R objects representing the statistical models and then make predictions or do simulations using it ." ] }
{ "confidence": [ 65.94561004638672, 65.72257995605469, 65.14109802246094, 64.11249542236328, 60.8275146484375, 60.37882995605469, 60.136009216308594, 59.47761154174805, 59.13526916503906, 58.974517822265625, 58.22401809692383, 58.06208801269531, 57.22160339355469, 57.04338836669922, 55.687538146972656, 53.97337341308594, 53.66854476928711, 52.821449279785156, 52.698577880859375, 52.18999481201172 ], "content": [ "Question : I am trying to generate a pie-chart on my browser using rApache .. . .. . my R code is this .. . .. . when i run this on browser .. . i am getting this error .. . .. . rApache has something to tell you . View source and read the HTML comments at the end . .. . Error in function file ifelse onefile Rplots.pdf Rplot 03d.pdf : cannot open file Rplots.pdf .. . .. . any idea why i am getting this error Comment : It seems you are not dumping the pdf . See pdf for more information . Comment : Like Paul says at the start of your code there should be a command pdf .. . replace .. . with file name etc see pdf which tells R that all subsequent graphics go to the pdf file and then at the end there should be dev.off which writes the file so it can be opened . Comment : Well it is working using command-line R. . but it is not displaying any graph using rapache on browser .. . Answer : pie and other plotting commands will try to write to a PDF by default . If you want to display an image in a web page using RApache then this approach is not what you want . You have to tell RApache what you want it to do . Look in the test directory which was created when you unpacked the RApache source code . There you will find several scripts which illustrate how to render a PNG image on the web page . For example in sendBin.R you will find this code : .. . .. . If you replace the line plot rnorm 10 with your pie school.freq then save this file in the right place e.g . var www R plot.R your chart should appear on the web page . Make sure you read the RApache documentation and configure it so as R scripts can be run from locations in your web root .", "Question : I have been exploring some options for implementing an R Web interface where users will have the option of selecting certain criteria for eg . date ranges plot type etc . The issue is that a number of the R web interfaces that are listed in CRAN seem to have been last updated 5-6 yrs back .. . and the most recent up-to-date implementation seems to be RApache . From the site of Jeffrey Oons a number of good examples of how to use RApache with JSON was available that looked quite impressive . However as of this time it seems that RApache only runs on Debian Ubuntu Mac . I wanted to ask if anyone is aware of other R web-based implementation that can produce nice looking webpages eg . display a dataframe within a scrollable widget display ggplot2 objects etc . Also - does anyone have RApache running on Redhat Solaris .. . Answer : There is an entire section in the R FAQ devoted on web interfaces http : cran.r-project.org doc FAQ R-FAQ.html R-Web-Interfaces to R . .. . .. . Also consider the relatively new Rook http : cran.r-project.org package Rook package which utilizes the web server embedded in R itself since release 2.13.0 which R uses for its help system .", "Question : I m using ubuntu-13.10 with Apache2 PHP5 and MySQL I m trying to add rApache module in Apache to work as a server R . .. . .. . I configured my rapache exactly how this turorial shows . http : binfalse.de 2011 05 r-for-the-web .. . .. . One file is created etc apache2 mods-available r.conf .. . .. . In this file and put .. . .. . I add another location .. . .. . in brew directory I created a file called plot.R with the code : .. . .. . localhost brew plot.R if I try to access the page is loading endlessly and program files var log apache2 error.log displays the error : .. . .. . I ve tried to install R in the brew package .. . .. . but my error keeps appearing and I can not run the script plot.R .. . Answer : You need to install package brew http : cran.r-project.org web packages brew index.html and restart Apache . Mark that it is important to install the package at the library location of R which is used by RApache . To see which .libPaths are used by RApache you can go to localhost RApacheInfo in your browser the following screenshot shows mine . If you installed RApache in the default way the libpaths are probably not the path of your own user e.g . in my case this is home janw R x86 64-pc-linux-gnu-library 3.0 but of the system wide library probably usr lib R library . So make sure you install the package there : install.packages brew lib usr lib R library . Or log in as root and install the package . And don t forget to restart RApache enter image description here http : i.stack.imgur.com 0KFzZ.png", "Question : null .. . Answer : lets say i have these files .. . .. . normal.R .. . .. . controller.php .. . .. . ajax.js .. . .. . As you can see i need no interaction with R in the html in the way offered in rApache . I simply want to give json to R and get json from R . Exec scripts ist not supported by webhoster . I also looked into http : cran.r-project.org doc FAQ R-FAQ.html R-Web-Interfaces but it seems to much for my needs . Can anybody offer a simple solution Comment : You might want to check out Shiny : rstudio.com shiny http : www.rstudio.com shiny Comment : Why do you need php . If you install rApache you can just launch your R script . An example here : stackoverflow.com questions 20851208 http : stackoverflow.com questions 20851208 whats-the-easiest-way-to-deploy-an-api-incorporating-r-functions . If you really are using php and want to launch an R process . Look at stackoverflow.com questions 4818641 using-r-through-php http : stackoverflow.com questions 4818641 using-r-through-php Comment : hi i spend the whole night with installing ubuntu and rApache . This works exactly as i wanted . But i get one strange error . I cannot create pngs through rApache . Exactly the same code works in r studio and in terminal . The apache error.log says that the cairo DLL failed to load...Does anybody know why this doesnt happen outside from rApache Comment : Yes you need to use a different device-driver to create the plots . The best is to create plots with the CairoPNG function from package Cairo instead of using png . Another issue causing your DLL problems might be that you are using a package which is not loaded or installed in the R RApache is using . Make sure you load the package and installed the package correctly probably using the R installed as root .", "Question : So I need to get access to an MSSQL server in my Rapache program and when I try to load RJDBC as a library in my Rapache code I get server error . In the logs it looks like this : .. . .. . Also I checked and rJava.so exists in that directory . Is it something with libjvm.so The thing is when I run this library RJDBC in just R it says this : .. . .. . and then all my RJDBC code aftewards works fine . So is this a problem with some Java configuration or is this a problem with rApache not being able to run the library because of the warning message .. . Answer : I had the same issue and determined the cause to be that rApache was not setting the LD LIBRARY PATH environment variable . This needs to be set before an R environment is created for rJava or any packages that depend on it to initialize correctly i.e . be able to find the path to libjvm.so . You can check this with a simple test script : .. . .. . Unfortunately the simple fix using a SetEnv directive to Apache doesn t work . Instead you need to do the following : .. . .. . Note the following was done on a 64-bit RHEL5 Server .. . .. . Add a file to etc ld.so.conf.d called rApache rJava.conf with the following contents : .. . .. . the above line was the path to the parent directory of libjvm.so on my server .. . .. . As root : .. . .. . followed by restarting Apache .. . .. . After Apache restarts you should be able to run R-scripts via rApache that depend on rJava e.g . anything with lines like : .. . .. . The process above with additional reference links is also outlined here on my blog : http : oddhypothesis.blogspot.com 2012 06 making-rapache-load-rjava.html .. . .. . EDIT : Full Disclosure .. . .. . The blog linked to above is my own Comment : I edited your post just to add a quick disclosure that the blog you were linking to was your own . This is a decent answer and it s not inappropriate to post a link like this now and again when it s related and you have provided an extensive answer you just need to include a disclosure that it s your site you are linking to is all . : Comment : Here s the FAQ on Self-Promotion http : stackoverflow.com faq promotion where the requirement for disclosure is mentioned just FYI . Comment : Thanks . I happened to refresh the page which seems to have removed your edit .. . re-edited to add disclosure", "Question : So I need to get access to an MSSQL server in my Rapache program and when I try to load RJDBC as a library in my Rapache code I get server error . In the logs it looks like this : .. . .. . Also I checked and rJava.so exists in that directory . Is it something with libjvm.so The thing is when I run this library RJDBC in just R it says this : .. . .. . and then all my RJDBC code aftewards works fine . So is this a problem with some Java configuration or is this a problem with rApache not being able to run the library because of the warning message .. . Answer : Yes it is something with libjvm.so rjava.so cannot find it Various linux distros I presume you re running linux will start apache in a restricted environment thus limiting where the process can find shared-libraries . I recommend looking through the shell scripts to see if this is happening . I d also investigate your dynamic linker run-time binding configuration e.g . the etc ld.so . files along with the ldconfig command . Try running your code from your personal R session . If it doesn t run there then you need to fix your java rJava install first . If it does run there then explore the topics I discussed above . Oh and I just remembered : rJava may source in some java specific environment-variables located in the rJava package installation . See if that s happening in your local session . If that s the case then you will most likely need these set when apache rApache is run . And as I mentioned above if your distro is restricting apache s environment then you ll have to shim those Java envirnment variables into that restriction process . Cheers Jeff Comment : Sorry I am really new to this . Can you go more in depth on how I would find these java environment-variables and allow them in Apache", "Question : I m developing an R web application using RApache . I have finished all the application and it runs correctly in my local server . But I have a problem when I port it to the university s server : the .rhtml files where are the R-scripts are downloaded by the browser when I tryed to open directly with a link . I think that I need to add some handler to the configuration file in order to execute this files instead of downloading in my local server I didn t need it but I have searched with no success . Anybody can tell me the handler or what to do THANKS Comment : Is the RApache module installed and enabled on the university server If not the Apache there will not know how to serve the request . .. . Answer : You need to set a Directory directive which indicates that your R scripts which are located at the specified directory will be passed on to brew and the result will be shown in your browser instead of the html file itself . This is done by adding in apache2.conf the following directive where you change var www brew with the directory where your R scripts are located at your server", "Question : This question already has an answer here : .. . .. . How to call R from within a web server like Apache questions 1395174 how-to-call-r-from-within-a-web-server-like-apache 1 answer .. . .. . Overview : Need to integrate R library with a web server written in python . I have explored some of the options commonly mentioned on different blogs and stack-overflow threads . The threads I have come across compare libraries like Rpy2 and pypeR and provide specific answers to integrate R and python . What I am looking for is a general solution so that the R code can be accessed by a multitude of programming-languages clients for future extensibility . Requirements : .. . .. . 1 . R code should run separately to handle heavy-computation and not be embedded into the application server . 2 . R module should be scalable and easily maintainable . ex- any change to the application server written in python should not trigger changes in the R code . 3 . R module can be used as an API for further application development using web frameworks other than python . Options already explored : .. . .. . 1 . rpy2 pypeR : One option is to write a separate python server and let that server handle R code using rpy2 . The app server can send requests to the second server . 2 . Rserve and pyRserve : Use Rserve and pyRserve client to communicate between R and python . 3 . Apache Thrift and Protocol Buffer : rprotobuf is an interface for R to make it work with Protocol Buffer but I could not find any support for R in Apache Thrift . Will something like Thrift or protocol buffer be better than creating an R server . 4 . Rapache and Rook : Use Rapache and Rook package in R to setup a server for processing requests . 5 . deployR : Created by Revolution Analytics . Which among these would be an ideal choice or any other option which is not in the list Comment : Write an R script and run it using call Any language can do that . Comment : Modified the first line to clarify the problem . Its not just 1 R script but an entire library that I need to integrate with the web server . And I don t want to call R scripts specifically from the app server . A general solution which allows me use the library like an API is required . Comment : If we talk about a .lib or similar which can be included into C or C++ this would be the way to go . Could that work for your case If not why not R code should run separately to handle heavy-computation and not be embedded into the application server I don t see an issue with having a thin host application around it . .. . Answer : Regarding Apache Thrift bindings : .. . .. . First Apache Thrift does not have native bindings for R1 . Second from what I read so far I am not an R user there are plenty of options to integrate R into other host languages . Thrift offers support for C++ C Java Python and a plethora of other targets and languages 20+ in total . So it seems possible to create a host application offering the Thrift API and housing the R stuff . .. . .. . 1 Today . I can t look into the future and things change quickly sometimes . Comment : Will creating a host application housing R and then using Thrift to connect it to other languages scale up Also is there any specific benefit of using this kind of a setup over the others Protocol Buffer has an interface for R . How does Protocol Buffer compare against Apache Thrift", "Question : How can I get R and RApache installed in XAMPP for Windows I m new to XAMPP unix and server environments . I ve googled around but can t find much on putting this PHP XAMPP Windows and R combination together . I m trying to write a webpage that passes variables to R via the PHP exec function . The eventual user wants ggvis plots on the arguments so R is necessary . I m running XAMPP on Windows 8.1 . The base installation works fine but I m stuck at passing variables with exec because I don t have R or RApache installed in my XAMPP environment although I have R in my Windows environment . I have tried the rApache installation instructions http : rapache.net manual.html . Running sudo apt-get install devscripts git on the shell returns the error .. . .. . sudo is not recognized as an internal or external command operable program or batch-file . Comment : Resolved it . rApache was not necessary . a reference to my local copy of R installed outside the XAMPP environment suffices for now . Calling this worked : exec C : Program Files R R-3.2.2 bin Rscript.exe C : xampp htdocs my rscript.R threeb .. . Answer : The error sudo is not recognized as an internal or external command operable program or batch-file is because you are trying to run Linux command on window shell command-prompt . I don t think it is possible to integrate R Apache MySQL PHP on XAMPP . I am curious myself to learn more if someone have new solutions . However as you mentioned in the comment the path to the R script is all that is needed to use exec . Here is a working R script .. . .. . php html script .. . .. . R-Script .. . .. . However I am interested to know if there are any updated packages from R or modules from php to integrate R and PHP . Any experts who can update on this topic", "Question : I am trying to configure Apache on my Linux system but it does not find the correct paths to R packages and so it does not find the brew package . I install R packages in R libs and when running .libPaths from an R session I get : .. . .. . However if I configure RApache to show me RApacheInfo by using .. . .. . in .libPaths RApache only reports .. . .. . How do I tell RApache to go looking in R libs .. . Answer : Per the RApache Configuration Documentation http : rapache.net manual.html Configuring rapache you could try the REvalOnStartup directive to set .libPaths directly . Comment : Good idea did not think about it I ll let you know if it works . Two extra questions : 1 . do you know if the discrepancy is normal or is RApache supposed to see also my custom library path 2 . have you specifically seen this pointed out in the docs I can t seem to find it any mention of libpaths in the docs . Comment : If you have a custom path you have to tell R somewhere and somehow about it . Remember that your user id is typically not the one RApache runs at---so one is better of with R HOME etc Rprofile.site et al rather than HOME .Rprofile . And I put local packages etc into usr local R site-library rather than in my HOME for the same reason . Comment : right.. . now it makes sense and it works I like to put packages in home so that I don t have to reinstall them when I update the system . Comment : Well I still feel my approach is preferable : usr local lib R site-library is visible to all users on the system and not affected by R upgrades via the package manager as I rely on .deb packages given that I am maintainer of those for Debian .", "Question : This question already has an answer here : .. . .. . How to call R from within a web server like Apache questions 1395174 how-to-call-r-from-within-a-web-server-like-apache 1 answer .. . .. . Overview : Need to integrate R library with a web server written in python . I have explored some of the options commonly mentioned on different blogs and stack-overflow threads . The threads I have come across compare libraries like Rpy2 and pypeR and provide specific answers to integrate R and python . What I am looking for is a general solution so that the R code can be accessed by a multitude of programming-languages clients for future extensibility . Requirements : .. . .. . 1 . R code should run separately to handle heavy-computation and not be embedded into the application server . 2 . R module should be scalable and easily maintainable . ex- any change to the application server written in python should not trigger changes in the R code . 3 . R module can be used as an API for further application development using web frameworks other than python . Options already explored : .. . .. . 1 . rpy2 pypeR : One option is to write a separate python server and let that server handle R code using rpy2 . The app server can send requests to the second server . 2 . Rserve and pyRserve : Use Rserve and pyRserve client to communicate between R and python . 3 . Apache Thrift and Protocol Buffer : rprotobuf is an interface for R to make it work with Protocol Buffer but I could not find any support for R in Apache Thrift . Will something like Thrift or protocol buffer be better than creating an R server . 4 . Rapache and Rook : Use Rapache and Rook package in R to setup a server for processing requests . 5 . deployR : Created by Revolution Analytics . Which among these would be an ideal choice or any other option which is not in the list Comment : Write an R script and run it using call Any language can do that . Comment : Modified the first line to clarify the problem . Its not just 1 R script but an entire library that I need to integrate with the web server . And I don t want to call R scripts specifically from the app server . A general solution which allows me use the library like an API is required . Comment : If we talk about a .lib or similar which can be included into C or C++ this would be the way to go . Could that work for your case If not why not R code should run separately to handle heavy-computation and not be embedded into the application server I don t see an issue with having a thin host application around it . .. . Answer : Did you consider the following Python has a package to interface with Thrift create thrift servers . Rpy2 is an interface to R and arguably the fastest one . web server --- Thrift server Python Python + rpy2", "Question : I m testing using RApache as an SSE Server Sent Events and similar long poll comet etc . back-end . I seem to be stuck on how to flush my output . Is it possible Here is my test R script : .. . .. . My Rapache.conf entry is : .. . .. . And I test it using either wget or curl : .. . .. . Both just sit there meaning nothing is being sent . Using sendBin made no change and neither did using flush . If I change repeat to for i in 1 : 5 then it sits there for 5 seconds and then shows 5 timestamps spaced one second apart . So I believe everything else is working fine and this is purely a buffering issue . UPDATE : Looking at this with fresh eyes after 5 months I think I could have described the problem more clearly : the problem is that RApache appears to be buffering all the output and not sending anything until the R script exits . To be useful for streaming it has to send data out of Apache and on to the client each time flush is called i.e . while the R script is still running . So my question is : is there a way to get RApache to behave like that UPDATE 2 I tried adding flush.console before or after the flush stdout but no difference . I also tried setStatus status 200L at the top . And I tried SERVER no cache T SERVER no local copy T at the top of the script . Again it made no difference . Yes none of those should have helped but it never hurts to try Here is a link-to how PHP implements flush when it is running as an Apache module : http : git.php.net p php-src.git a blob f sapi apache2handler sapi apache2.c l290 I think the key point is that there is a call to ap rflush r . I m guessing that RApache is not making the ap rflush call . Comment : Thanks for the update . Can you please post the javascript calling the .rhtml file Comment : @Michele There is no rhtml page I was testing using wget and curl as shown above . I don t want a browser confusing the issue . Comment : ohh I see . Sorry then I m trying to help but I m probably confusing you.. . Comment : Hi again in the next message of the link https : stat.ethz.ch pipermail r-sig-mac 2007-August 004074.html about flush.console Simon Urbanek mention something about TERM dumb . I don t know if this can help . .. . Answer : You are passing the wrong MIME type . Try changing with .. . .. . EDIT1 : .. . .. . this is the attempt still unsuccessful I mentioned in the comment below to implement SSE in Rook . the while-loop condition was supposed to be always TRUE but I m having your same problem so I had to do a finite loop.. . The good new is I DO have data reaching the browser . I can tell by looking in developer tools at the Content-Length in the Response Header section . it says 114 for the above code and you change say Hello in Hello it ll say 118 . The js code is : you ll need JQuery as well .. . .. . So in essence .. . .. . 1 The connection is open readyState 1 .. . .. . 2 Buffering is still there .. . .. . 3 Data after buffering reaches the browser but an error happens in receiving them properly . EIDT2 : .. . .. . it s interesting to note that brew ing the above .Rhtml file the output is not buffered . There must be a configuration the in the web server both the R internal and Apache that buffer the data flows . As a side note flush is not even needed cat s output defaults to stout . So the options are : .. . .. . 1 . Web server configuration .. . 2 . The R equivalent of the PHP ob flush which is always used in any PHP implementation I ve seen . this http : stackoverflow.com questions 9070995 html5-server-sent-events-prototyping-ambiguous-error-and-repeated-polling is example Comment : Thanks Michele . text event-stream for SSE text plain for all the fallback alternatives . As I m testing from wget and curl and not sending SSE formatted output the mime type won t matter anyway . The issue is that the whole response is being buffered : it doesn t send anything until the R script exits . Comment : @DarrenCook I see . Sorry for the claim . Maybe I m wrong again I ve just started pushing Rook to its limits : but can you just try what happens without repeat Comment : Hello @Michele without repeat it works fine see the section about using for i in 1 : 5 : it sits there for 5 seconds then spits all the data out . Comment : @Darren I see but what I meant was without repeat and for . I m testing some SSE with Rook and I managed to have a continuous flow of data with just cat and flush . Comment : It d be great to see your example code setup . I m writing a book on SSE and wanted to add a brief section on how to use it with R but so far cannot get it to work I m not tied to Apache or RApache is Rook a standalone http server", "Question : null .. . Answer : I have a problem connecting to an MSSQL server using rApache . I use the addon-package RJDBC to connect to this server . In the R-Console I can connect fine and access the server but when I try to connect trough rApache on my test website it fails and I get an error . This is the line when it fails . This is the error displayed in the browser : Error 324 net : : ERR EMPTY RESPONSE : The server closed the connection without sending any data . In the apache error-log all I get is .. . .. . Tue Jun 26 12 : 55 : 32 2012 error client 10.21.2.79 rApache Notice Thanks for your help Comment : you need additional parameters check out this post to get the connection going : stackoverflow.com questions 28326879 https : stackoverflow.com questions 28326879", "Question : its been a long time that I m trying to install rapache on debian . I did follow this tutorial : http : blog.binfalse.de 2011 05 28 r-for-the-web and I made it work but with a old R 1.2.5 and I did repeat the installation exactly the same way but with R 3.1.2 and I have Internal Server Error when I type localhost R myfile.R . But when I type localhost RApacheInfo it works This is my file r.conf .. . .. . And when I m trying to put some php html code it does work as long as its not in localhost R . Every code I put here give me this Internal Server Error . I ve tried already to install it from 0 twice and same result . Hope you can help me : Comment : Any info in apache error-log My crystal is in maintenance I can t guess what your server tells you . .. . Answer : I finnaly found how to make it work You can find it on this post : https : groups.google.com forum topic rapache axLb5PsS9LY So happy : Resolved", "Question : we are working on RApache .. . .. . we are sending the form argument from .html file which configured to brew . one.html .. . .. . .. . html .. . .. . form name one method POST action . brew one result.html .. . .. . input type text name one .. . input type submit .. . .. . html .. . .. . one result.html .. . .. . .. . .. . print post one .. . .. . .. . passing of arguments from one.html to one result.html will work some times and argument value is printing on browser but some times saying POST pname : object of type closure is not subsettable in error-log . could any body help us to resolve the issue . thanks in advance Mallik . .. . Answer : this is the information when RApache is started .. . .. . notice Apache 2.2.15 Unix DAV 2 mod R 1.2.5 R 3.2 .2 PHP 5.3.3 mod apreq2-20090110 2.8.0 configured -- resuming normal operations .. . .. . environment centos - 6.7", "Question : null .. . Answer : RApache seems not to work properly in combination with ggplot2 while working properly with plot on my Linux SuSE 12.2 server .. . .. . When one does http : claree.univ-lille1.fr R brew rapacheggplot which executes : .. . .. . This source in brew produces an empty png file while when replacing the two ggplot2 commands with a simple plot the png file is correctly generated see http : claree.univ-lille1.fr R brew rapacheplot .. . .. . in apache2 error-log I get : .. . .. . ggplot2 was compiled from source with R CMD INSTALL and RApache too When executing that program with R 1.15.1 and not RApache everything works well . This problem seems to be specific to the SuSE distribution as with equivalent rapache and ggplot2 version everything works correctly from localhost on my Mountain Lion Os X Mac Air computer . Does anyone have a clue how to solve this problem Comment : You access the img file twice : first with png then with ggsave . Remove the latter and print qp . Comment : I tried that but it didn t work I still get the segfault error", "Question : What is the minimal size server we need to run opencpu if we expect 100 000 hits a month .. . .. . I think opencpu is an exciting project but need to know about memory usage when opencpu is deployed since a cloud-hosting service such as rackspace charges about 40 per month for 1 GB of RAM . I know that if I load R without doing anything or without loading any data or package in RAM it uses almost 700m of RAM virtual and 50 megabytes of RAM in residence . I know that opencpu uses rApache and rApache uses preforking but want to know how this will scale as the number of concurrent users increases . Thanks . Thanks for the responses .. . .. . I talked with Jeroen Ooms when visiting LA and am partly convinced that opencpu will work in high concurrency environments if used correctly and that he is available to fix issues if they arrise . Opencpu related to his dissertation after all In particular what I find useful about opencpu is its integration with unbuntu s AppArmor which can restrict processes from using too much RAM and CPU . I think apache might also be able to do this but RAppArmor can do this and much more . Brilliant If AppArmor were the only advantage I would just use that and json as a backend but it seems like opencpu can also streamline the installation of all this stuff and provides a built-in API system . Given the cost of web-hosting I imagine a workable real-time analytics system is the following : .. . .. . create R statistical models on demand on a specialized analytical server as often as needed e.g . every day or hour using cron .. . transfer the results of the models to a directory on the opencpu servers using ftp as native R objects .. . on the opencpu server go to the directory and grab the R objects representing the statistical models and then make predictions or do simulations using it . For example use the predict function to provide estimates based on user supplied variables . Does anybody else see this as a viable way to make R a backend for real-time analytics Comment : But Sasha it also depends on what the requests are -- if you just return a constant 42 it is very different from running cross-validated bootstraps over hierarchical model fits with millions of observations . I think the SO police will close this unless you add more beef . .. . Answer : Dirk is right it all depends on the R functions that you are calling the overhead of the OpenCPU architecture should be quite minimal . OpenCPU itself will run on a small server but as we all know some functionality in R requires much more memory cpu than others . If you really want to know how much resources are needed just to run opencpu you could do some benchmarking . As you noted prefork is used to branch sessions of the main process so in most cases the copy-on-write principle of forking should make it pretty cheap . Also there is some other stuff that you can tweak e.g . preloading of frequently used packages .", "Question : null .. . Answer : I m trying to make a webpage with Rapache and Leaflet for R . The main reason I did install Rapache is to use R inside of a html page with brew . But I cant figure out how to return my map inside the html page without saving it as a html extern file which Rapache is useless . Lets take a exemple : .. . .. . This is what I have in my html file and I would like to be able to return this map m and add it somewhere on my current page . The main reason I would like to do this is because I m going to use this on a website and i would like it to be dynamic and not creating plenty of htmlfile . This is not really proper . Hope you can help me : Thanks you Comment : what do you mean by work but not proper Comment : On the website I will have alot of different data to add-on the map raster-map and this data can be added at anytime . So I think its better to not save plenty of html files Comment : have you tried m - leaflet addTiles addMarkers data m lng 174.768 lat -36.852 popup The birthplace of R m m should open in your browser Comment : Yes this is what i tried and and it work when I tape the code on R but on Rapache it doesn t show anything blank page", "Question : I am building an application with RApache and my code in R is receiving POST data . One of the post datas is POST f which is a string- say sin x . Is there any way to put this into the plot function successfully Thanks .. . Answer : But it is not something I would recommend . eval parse .. . is already dangerous and then to do it with arbitrary user input from a web site is just a gaping security hole . Or even using system to do even more bad things . Comment : For security issues : sandboxR https : github.com daroczig sandboxR might be handy . E.g . your function above would not harm the system on my demo page : sandboxr.no-ip.org http : sandboxr.no-ip.org", "Question : null .. . Answer : I m trying to use my own function in html template . I m using RApache and brew package . Here is my web template .. . .. . As result Internal Server Error . How should I source function through template" ] }
[ "yes-answer-long", "yes-answer-short" ]
server
UNK_RELATION
sitemapprovider@sitemap@279
sitemapprovider -- asp.net system.web.sitemapprovider class that provides a common base-class for all site map data providers and a way for developers to implement custom site map data providers that can be used with the asp.net site map infrastructure as persistent stores for @placeholder objects .
{ "confidence": [ 57.462493896484375, 57.22133255004883, 52.347557067871094, 47.12395477294922, 46.30470275878906, 45.98115539550781, 44.69974899291992, 44.41417694091797, 43.50715637207031, 42.158660888671875, 41.033363342285156, 40.235069274902344, 39.93830108642578, 39.93830108642578, 39.93830108642578, 39.583251953125, 38.81300354003906, 38.81300354003906, 38.81300354003906, 38.02090835571289, 35.52827835083008, 33.92918014526367, 33.75498580932617, 33.554046630859375, 33.26517868041992, 33.209228515625, 33.12744140625, 32.04493713378906, 31.891036987304688, 31.509048461914062, 31.364166259765625, 30.797710418701172, 30.651782989501953, 30.08055877685547, 30.08055877685547, 30.038360595703125, 29.836673736572266, 29.600418090820312, 29.397994995117188, 28.830341339111328, 28.427892684936523, 28.11437225341797, 28.11437225341797, 27.847793579101562, 27.83144760131836, 27.674644470214844, 27.507591247558594, 27.487205505371094, 27.481637954711914, 26.98907470703125, 26.536527633666992, 26.500314712524414, 26.500314712524414, 26.387718200683594, 26.340747833251953, 26.15888786315918, 25.77060317993164, 25.641239166259766, 25.375015258789062, 25.293643951416016, 24.744224548339844, 24.744224548339844, 24.644500732421875, 24.037704467773438, 23.913715362548828, 23.722400665283203, 23.55663299560547, 23.55218505859375, 23.440000534057617, 23.35670280456543, 23.052444458007812, 22.92759132385254, 22.795272827148438, 22.689001083374023, 22.3787841796875, 22.17049789428711, 22.028533935546875, 21.907012939453125, 21.703489303588867, 21.269113540649414, 21.253482818603516, 21.253482818603516, 21.106910705566406, 20.931081771850586, 20.786893844604492, 20.718257904052734, 20.692584991455078, 20.208282470703125, 20.166545867919922, 20.12779998779297, 19.904781341552734, 19.866901397705078, 19.84067153930664, 19.8223934173584, 19.805782318115234, 19.702903747558594, 19.507295608520508, 19.45200538635254, 19.45200538635254, 19.025794982910156 ], "content": [ "What I d like to do is combine this site map with a dynamically created SiteMapProvider and populate the sub-trees of this map .", "We are using securityTrimming in our ASP.NET web site and using site map to show-hide menus .", "I was able to test my site map provider by referencing it from a site map datasource and binding it to a treeview .", "Can someone provide me with a super-minimalistic SiteMapProvider subclass which populates the map using only static data i.e .", "The first argument to CreateNode is a SiteMapNode object that points to the site map but what I have here only points to the default map .", "Go do Admin Site settings Marketing section and you will see the URL of your site map .", "Example 1 http : www.asp.net web-forms overview data-access database-driven-site-maps building-a-custom-database-driven-site-map-provider-cs Example 2 http : www.codeproject.com Articles 16860 Building-a-dynamic-SiteMap-in-ASP-NET-for-a-la Example 3 http : stackoverflow.com questions 1716573 asp-net-custom-dynamically-populated-site-map-sitemapprovider 1716613 1716613 .. . .. . I ve tried : Sitemap Web.sitemap sitemap.txt", "For more information about how to localize the Title Description and any custom properties of a SiteMapNode object see How to : Localize Site-Map Data .", "This is working great however for a portion of the site that lists news articles it was decided to not put the news article detail pages in the site map .", "The purpose of a site map is to provide search engines with the list of the pages hosted by your web site so you are right about SEO .", "So far I ve only managed to programmatically walk through the site structure and print out a simple site map to a page using the default CombinedNavSiteMapProvider PortalSiteMapProvider .", "Your first line .. . .. . Will return you all pages that are not hidden in your site map .", "As of now and as I understand this method automatically get executed from site map and the menu .", "But my original concern is why the site map keep calling this method IsAccessibleToUser each and every time", "I m trying to build an ASP site map dynamically to provide to Google Webmaster Tools .", "In MOSS this was only possible by creating a custom SiteMapProvider traversing the site collections and manually building the navigation tree .", "Normally to localize a static site map you would use a resource expression like the following : Resources : ClassName KeyName DefaultValue .", "That worked but was throwing site map off because it expected StockItem Category 1 and since there was no one it was returning the first node. .", "Once the user is authenticated I want to dynamically change the site map from code-behind c .", "These Site Map Node is in Web.Config .. . .. . Is there anyway to made some sub sitemapnode in hotel setup can be accessed only by administrator but not hotel admin", "What I think I need but am not sure how to do is : .. . .. . Get build a partial site map data structure where root node is the parent Semester of the current page .", "We ve had this site for years and have recently upgraded to ASP.NET 4.0 on IIS 7.5 on Windows 2008 R2 .", "I m not quite clear on what you are trying to achieve however you cannot access any nodes of a site map provider without referencing that provider .", "SiteMapProvider can be tottaly dynamic .", "My site is dynamically creating the sitemap from both database and xml data .", "You can look at the XmlSiteMapProvider this is good example of static map provider .", "The C code from that site .", "The ASP.NET SiteMap is generally used in conjuncton with one or other of the Site navigation controls http : msdn.microsoft.com en-us library vstudio e468hxky v vs.100 .aspx SiteNavigationControls .", "I m assuming I could either create one custom SiteMapProvider that can perform the logic to determine which web.sitemap file to load or I have multiple providers each one with the SiteMapFile property set to a specific .sitemap file and then switch providers programmatically before I access SiteMap.RootNode .", "NB : I am not prepared to write a custom SiteMapProvider that reads from a static XML .sitemap file as the regular site contributors may not have access to files on the file system .", "My understanding is every instance of SiteMapProvider must be Initialized before it can be used .", "not the current site collection in SharePoint 2010", "I have added the MVC SiteMapProvider to the ASP.NET MVC4 App through nuget .. . .. . Added the sitemap menu sitemap path html-helper in the layout .", "Is it possible to get an OOTB PortalSiteMapProvider to provide a site heirarchy from a specified site collection or URL i.e .", "Ideally I d like the My Sites to show the site heirarchy from the main portal site .", "Before today I have never used a SiteMapProvider .", "It is a very simple scenario : .. . .. . Sample routes : .. . .. . StockItem categoryId 1 should be Beverages StockItem categoryId 1 should be Shoes .. . .. . Here is the abbreviated site map : .. . .. . and the part of the class : .. . .. . What this all does is generates the site menu correctly with @Html.MvcSiteMap .Menu but the problem is that @Html.MvcSiteMap .SiteMapPath breadcrumb always shows the very first dynamic node no matter what the route is.. .", "applicable site map snippet : .. . .. . applicable controller action result snippet : .. . .. . applicable route snippet : .. . .. . the only error i get is the mostly useless resource cannot be found error .", "Duh had the siteMap providers in the wrong section of web.config .", "I have a custom sitemapprovider which loads pages from the database .", "Calling base will apply the default asp.net access-control rules .", ".. . .. . Provider is registered in the web-config and in other site collections working properly .", "And another detail : different faces of site collection displayed in different ways .", "According to MSDN http : msdn.microsoft.com en-us library system.web.sitemapprovider.initialize.aspx it appears that an instance of SiteMapProvider must be initialized before it can be used .", "It shows up both in my site menu and breadcrumbs .", "By the design of SiteMapProvider IsAccessibleToUser will always be called .", "The SiteMapProvider MemberSitemap cannot be found .", "Here are my two first questions : .. . .. . Why is StaticSiteMapProvider used in virtually everyone s project instead of SiteMapProvider", "I m building a custom SiteMapProvider for the Customer Portal for Dynamics CRM 2011 .", "Here is a simplified version of the site structure : .. . .. . The UserControl will be placed on the classes .aspx pages .", "I have a link query that collect data from db : .. . .. . Please write to me how to parse this data using SiteMapProvider and make the updatable result .", "If you are using an ASP.NET ScriptManager switch to the ToolkitScriptManager in AjaxControlToolkit.dll .", "I m using VWD 2010 ASP.Net C .", "In summary - I d like to point the leaf siteMapNodes to a SiteMapProvider .", "I m trying to write my first very own SiteMapProvider subclass .", "Need a help with MVC SiteMapProvider .", "If you already know the users of your site and it is not a very huge number to speed it up you could pre load the Cache for all users .", "I ve been asked to create an asp.net UserControl that allows custom navigation between subsites of a SharePoint 2007 website .", "I m using VWD 2010 ASP.NET with C .", "I want to be able to bind a treeview with a sitemap data provider in asp.net and when a user clicks on a node it not navigate to that page but to update a textbox .", "This is the ASP.NET snippet : .. . .. . And this is the C code-behind it : .. . .. . The CreateNode is our internal method .", "JavaScript runtime-error : AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts .", "A SiteMapProvider cannot decide if in your case it is correct to cache the results or not .", "On the other side i am also keep to learn how to do it as shown in the example on MSDN site .", "I roll my own SiteMapProvider inheriting System.Web.XmlSiteMapProvider .", "I want to do this using the SiteMapNode Constructor SiteMapProvider String constructor but I have no idea how to get a SiteMapProvider from a string that s the location of the XML file .", "I have custom SiteMapProvider and RoleProvider that works together properly : IsAccessibleToUser returns false if current user s role isn t mentioned in SiteMapNode.Roles for page requested .", "i.e . the standard one that MSDN states... . so the output will be something like this : http : msdn.microsoft.com en-us library aa581782.aspx .. . .. . I know I can probably write an xml otuput using xslt or xmldoc but is there a way to do this using sitemapprovider and sitemapnode classes that .net framework provides", "I have System.Web.SiteMapProvider and I get all tree nodes using providerSiteMap.RootNode.ChildNodes .. . .. . For childnodes from RootNode I want move the last node to the top as first item .", "I believe this is your main issue - you must only have one root node in your XML file usually it is the home page of the site .", "I am working on a multilingual Dynamic Website I need to generate sitemap Breadcrumb navigation for each pages and i have done my research worked of few example for last two days unfortunately i am not able programmatically generate site navigation based on site url .", "It might be that you need to load the child objects if they are all null .", "Linq to Objects is fine for that .", "A simple reason for this is that the sitemap may have a totally different structure to that of your SharePoint site collection .", "I have an ASP.NET web app in which the sitemap is displayed on the site.master file through the web.sitemap .", "Is your asp : sitemapdatasource then like asp : SiteMapDataSource ID SiteMapDataSource1 runat server SiteMapProvider XmlSiteMapProvider", "However the usual way to handle this is to handle the events of the data bound control not the events from the data source control .", "Web.config : .. . .. . Class file. .", "Obviously this wouldn t work if : .. . .. . the user blocks cookies .. . the user visits the site for the very first time .. . .. . so you would need a default view for first visits i don t think you can avoid this problem .", "Additionally I d like the root menu item to have custom text like Change Class instead of Semester1 .", "I ended up binding an asp.net menu to the CombinedNavSiteMapProvider then in the DataBound event handler I modify the menu items in code .", "In reference to your question here : How to use Bootstrap style of BreadCrumb with my ASP.NET menu", "My problem is that I am integrating orchard into an existing site so need to provide the same menus .", "I m working on an ASP.NET C application that has three roles defined for various user levels within the application : User Manager and Admin .", "To verify that I have included the following pseudo implementation : .. . .. . But I can use the site and navigate as much as I want to no Exception comes up and the Debug console shows no Hello World at all .", "As an aside two extension-methods I like to make to extend the base-class of User System.Security.Principal.IPrincipal are IsInAnyRole string and IsInAllRoles string to check if a user is in ALL the roles or ANY of the roles in the passed in array .", "Example of UserControl s menu if I am on Semester1 Class Group 1 Class 1 Page2.aspx : .. . .. . How can I accomplish the bulleted item above", "To achieve this behaviour I wrote my own web service which goes off and traverses another site collection s hierarchy using it s own PortalSiteMapProvider and returns that structure as an XML document .", "the problem is that I have an override BuildSiteMap function in a class called EditableSiteMapProvider which is used to edit the Sitemap by removing or adding new nodes .", "This can be my own data structure built-in code if necessary .", "Requested URL : Home TestActionResult .. . .. . .. . .. . Version Information : Microsoft .NET Framework Version : 4.0.30319 ASP.NET Version : 4.0.30319.225 .. . .. . suggestions", "I have a single web application with 2x site collections : .. . .. . 1 for my intranet portal at http : intranet publishing enabled .. . 1 for the My Sites at http : intranet my publishing not enabled .. . .. . We have no plans to facilitate multiple portals therefore I would like a consistant global navigation bar across both site collections .", "Let s say I m on Semester1 Class Group 1 Class 1 Page2.aspx .", "Yes its : asp : SiteMapDataSource runat server ID MainSiteMapDataSource ShowStartingNode False SiteMapProvider XmlSiteMapProvider", "Please add there relevant code that shows the config a little bit of the provider implementation and the control which uses it ASP.NET navigation control : breadcrumb menu tree.. . .", "Since the class contains the name static I m getting the impression that it s not as...well dynamic as I want it .", "First you need to specify all of your sitemap files in your web.config as such : .. . .. . Then in your code-behind you can dynamically assign your SiteMapDataSource which is bound to your menu to one of the providers you specified in your web.config : .. . .. . .aspx .. . .. . .cs", "Just the ul class menu ul generated without any nodes .", "xD .. . .. . I ve built a class that extends StaticSiteMapProvider and referenced it in my web-config .", "When you create your SiteMapNode objects use the constructor that allows you to specify implicit explicit resource keys ." ] }
{ "confidence": [ 72.17903900146484, 70.20906829833984, 69.17520904541016, 67.28228759765625, 63.26214599609375, 63.062923431396484, 57.75166702270508, 51.58526611328125, 49.20582962036133, 48.459693908691406, 45.891387939453125, 44.51475524902344, 43.81297302246094, 43.47810745239258, 41.41161346435547, 40.5609130859375, 39.49542236328125, 38.113189697265625, 37.888206481933594, 37.83272933959961 ], "content": [ "Question : I ve been asked to create an asp.net UserControl that allows custom navigation between subsites of a SharePoint 2007 website . The sites mimics a school structure with semesters that have different groups of classes . Here is a simplified version of the site structure : .. . .. . The UserControl will be placed on the classes .aspx pages . It s purpose is to allow a user to navigate to identical pages between the different Class Groups . E.G . Let s say I m on Semester1 Class Group 1 Class 1 Page2.aspx . The UserControl would allow me to choose any of the other classes under Semester1 . When chosen it would automatically navigate to the selected class Page2.aspx because I am currently on Page2.aspx . Before today I have never used a SiteMapProvider . So far I ve only managed to programmatically walk through the site structure and print out a simple site map to a page using the default CombinedNavSiteMapProvider PortalSiteMapProvider . What I think I need but am not sure how to do is : .. . .. . Get build a partial site map data structure where root node is the parent Semester of the current page . This can be my own data structure built-in code if necessary . I want to bind this to a menu control . Additionally I d like the root menu item to have custom text like Change Class instead of Semester1 . From there I think I can use the menu events to handle navigation . Example of UserControl s menu if I am on Semester1 Class Group 1 Class 1 Page2.aspx : .. . .. . How can I accomplish the bulleted item above .. . Answer : I didn t find anything elegant . I ended up binding an asp.net menu to the CombinedNavSiteMapProvider then in the DataBound event handler I modify the menu items in code . I insert a root Change Class item then use a little recursive method to set IsSelectable to false for any menu items that have children .", "Question : I m trying to build an ASP site map dynamically to provide to Google Webmaster Tools . I believe I have it finished and am trying to test it...but I can t for the life of me figure out how to navigate to my sitemap . xD .. . .. . I ve built a class that extends StaticSiteMapProvider and referenced it in my web-config . Web.Config : .. . .. . How can I see this in xml form Is there another step that isn t mentioned in all of my examples Example 1 http : www.asp.net web-forms overview data-access database-driven-site-maps building-a-custom-database-driven-site-map-provider-cs Example 2 http : www.codeproject.com Articles 16860 Building-a-dynamic-SiteMap-in-ASP-NET-for-a-la Example 3 http : stackoverflow.com questions 1716573 asp-net-custom-dynamically-populated-site-map-sitemapprovider 1716613 1716613 .. . .. . I ve tried : Sitemap Web.sitemap sitemap.txt .. . Answer : I was able to test my site map provider by referencing it from a site map datasource and binding it to a treeview . However this wasn t an acceptable format for Google . Ultimately I decided to scrap the above code and go with a different approach for creating a dynamic sitemap xml : .. . .. . SiteMap.aspx .. . .. . SiteMap.aspx.cs", "Question : We are using securityTrimming in our ASP.NET web site and using site map to show-hide menus . But the problem is for every post back it keeps coming to this class and go through IsAccessibleToUser method . Since we are using active-directory groups it s really a performance issue . I m already caching the groups a user is belongs-to when the first call comes when get the groups from AD but still its taking time to execute this method . It would be great if some body suggest me other ways to improve performance of this method or not to call this method for each post back . As of now and as I understand this method automatically get executed from site map and the menu . Web.config : .. . .. . Class file. . This is how we get the Roles from AD and cache them . I got the base of this code is from another article .. . .. . And finally I call following method from IsAccessibleToUser method . Comment : when I remove this security checking just return true from IsAccessibleToUser page loads in 1-2 seconds depend on data load but if it goes through everything get slower including post back like 5-6 seconds Comment : you can use any cache pattern for IsAccessibleToUser is called always .. . Answer : By the design of SiteMapProvider IsAccessibleToUser will always be called . If it were not to call it it would have to cache the results of the previous call . A SiteMapProvider cannot decide if in your case it is correct to cache the results or not . That is your decision . Any caching you need will have to be inside your implementation . I believe the function where you are fetching data from Active Directory is in SecurityHelpler2 .GetRolesForUser .. . .. . Any call to this function would be quite slow . The rest of the code where you are fetching from cache should be quite fast . Since your cache is valid only for 1 hour every hour one hit by the user would be very slow . If you already know the users of your site and it is not a very huge number to speed it up you could pre load the Cache for all users . For active users sliding expiration would be better . That way user would have the same roles till they are active . On next logon newer roles would be loaded from Active directory . Comment : Thanks nunespascal agree about the cache duration - yes we can increment it but we don t know about the exact users they are added from different team place . But my original concern is why the site map keep calling this method IsAccessibleToUser each and every time any idea about that. .", "Question : null .. . Answer : This is the ASP.NET snippet : .. . .. . And this is the C code-behind it : .. . .. . The CreateNode is our internal method . What I d like to do is to load different sitemaps depending on user setting like this : .. . .. . I have the sitemaps in XML in Web.sitemap 1 and Web.sitemap 2 files . The first argument to CreateNode is a SiteMapNode object that points to the site map but what I have here only points to the default map . I want to do this using the SiteMapNode Constructor SiteMapProvider String constructor but I have no idea how to get a SiteMapProvider from a string that s the location of the XML file . Comment : Maybe the following example can help see examples.ext.net TreePanel Basic SiteMap http : examples.ext.net TreePanel Basic SiteMap", "Question : So here s what I m working on . I have an ASP.NET web app in which the sitemap is displayed on the site.master file through the web.sitemap . Here s the site.master : .. . .. . And here s the web.sitemap : .. . .. . Now here s where I m running into a problem . What I d like to do is combine this site map with a dynamically created SiteMapProvider and populate the sub-trees of this map . For example the Projects Experiments Cell Line and Drug Recipe nodes would each have a sub-tree populated from a datebase . Anyone have input or a suggestion as to where to start looking In summary - I d like to point the leaf siteMapNodes to a SiteMapProvider . .. . Answer : Solution : .. . .. . I added a file DrugListProvider.cs in the root directory . That holds the code for dynamically generating the sub-tree . I placed the following node in the Web.sitemap where I wanted the sub-tree to appear : .. . .. . siteMapNode provider DrugListProvider .. . .. . Finally I include this in the web.config file :", "Question : It s driving me nuts . I ve searched and tried and searched and tried .. . now I ask for your help I have an asp : menu control that uses a sitemap . Once the user is authenticated I want to dynamically change the site map from code-behind c . Here s the pertinent lines-of-code : .. . .. . After a successful build VS 2010 4.0 framework I get the following error after a login : .. . .. . Server Error in Application . The SiteMapProvider MemberSitemap cannot be found . What am I doing wrong Thanks ... . Bob .. . Answer : Duh had the siteMap providers in the wrong section of web.config . I don t recommend web.config on sleep deprivation .", "Question : I have a custom sitemapprovider which loads pages from the database . Pages pageid fk pageid parent title url show in menu .. . .. . I would like to globalize localize the title of the page . What s the best method .. . Answer : When you create your SiteMapNode objects use the constructor that allows you to specify implicit explicit resource keys . I d recommend going with explicit resource keys . http : msdn.microsoft.com en-us library ms150104.aspx .. . .. . To programmatically specify resources for localization either set the value of implicitResourceKey to a unique name that will be used to identify localized resources for the node or set explicitResourceKeys to a NameValueCollection collection of name value pairs where name is the node property or custom attribute to localize and value contains localization values for the node property or custom attribute . The localized values can then be set in the appropriate .resx files . For more information about how to localize the Title Description and any custom properties of a SiteMapNode object see How to : Localize Site-Map Data . For the syntax requirements of the explicitResourceKeys collection see NameValueCollection . Normally to localize a static site map you would use a resource expression like the following : Resources : ClassName KeyName DefaultValue . Instead add the ClassName KeyName and DefaultValue values to the explicitResourceKey NameValueCollection in the order they appear in the expression all added using the same key . So if your expression would have been Resources : SiteMapResourceFileOrClass RootNode.Title My Root Node instead do the following : .. . .. . You can do the same for Description . Comment : Lol better late then never Thanks for explaining", "Question : I m trying to write my first very own SiteMapProvider subclass . It is meant to be populated dynamically using a bunch of different database lookups much like all of the examples I ve found on the web . However there are a whole bunch of things that are quite unclear to me . Here are my two first questions : .. . .. . Why is StaticSiteMapProvider used in virtually everyone s project instead of SiteMapProvider Since the class contains the name static I m getting the impression that it s not as...well dynamic as I want it . Can someone provide me with a super-minimalistic SiteMapProvider subclass which populates the map using only static data i.e . no database access etc . Comment : do you have links to the resources and examples that you have read .. . Answer : SiteMapProvider can be tottaly dynamic . For example it can make dynamic lookup just for nodes . In contrast with StaticSiteMapProvider you should know whole structure . So this for you to decide what to choose . You can look at the XmlSiteMapProvider this is good example of static map provider . I did not checked this but should work . Comment : This all looks very nice but could you give me an example of how I would add subnodes to test Comment : FWIW I had to override GetRootDoneCore as well for it to work . Comment : Answer updated you have to use base.AddNode . Refarding GetRootDoneCore I did this ages before so cannot remember everything sorry. . Comment : Funny there is full example on MSDN - msdn.microsoft.com en-us library http : msdn.microsoft.com en-us library system.web.staticsitemapprovider.aspx take a look .", "Question : Please forgive any naivety I m brand new to the world of C . Let me know if I ve left out helpful information . I m building a custom SiteMapProvider for the Customer Portal for Dynamics CRM 2011 . First I initialize an array : .. . .. . which gets populated thusly : .. . .. . Later I try to query WebPages like so : .. . .. . When I run this through the debugger I get a NullReferenceException which points at the condition in my WHERE clause saying that p.adx parentpageid.Id is null which is true for the home page of the site . Which leads to the question : .. . .. . Why would this query turn up the home page as a p in my query What am I misunderstanding Comment : Are you lazy-loading your entities It might be that you need to load the child objects if they are all null . Comment : Is the homepage hidden from the sitemap Comment : What is the data type of p.adx parentpageid.Id I am thinking that its actually p.adx parentpageid that is null and it throws with you try to access the Id property . If p.adx parentpageid can be null then you need to code for that condition . Comment : @JonC - I don t know what lazy-loading is . Comment : @saturdayplace Sorry I didn t add more info . before . Here s an article talking about this specifically for CRM 2011 msdn.microsoft.com en-us library gg695791.aspx http : msdn.microsoft.com en-us library gg695791.aspx .. . Answer : Your first line .. . .. . Will return you all pages that are not hidden in your site map . But this is also including your home page which has no parent id . So when your second query enumerates over this collection it is going to attempt to access this property which is null and throw a null reference exception . You just need to cater for this in your query .", "Question : It is a very simple scenario : .. . .. . Sample routes : .. . .. . StockItem categoryId 1 should be Beverages StockItem categoryId 1 should be Shoes .. . .. . Here is the abbreviated site map : .. . .. . and the part of the class : .. . .. . What this all does is generates the site menu correctly with @Html.MvcSiteMap .Menu but the problem is that @Html.MvcSiteMap .SiteMapPath breadcrumb always shows the very first dynamic node no matter what the route is.. . I don t know what I am missing here and there isn t enough documentation on this. . Does anyone has a sample or can point out what I am doing wrong Thanks .. . .. . -Stan .. . Answer : I figured it out . There was no route with the categoryId parameter and the links were StockItem categoryId 1 . That worked but was throwing site map off because it expected StockItem Category 1 and since there was no one it was returning the first node. . I simply changed public ActionResult Index int categoryId to public ActionResult Index int id and everything began working.. . .. . .. . -Stan Comment : I am also struggling this issue if you only have one or two custom routes it s fine to make that change but I had more than 10 custom routes which makes me crazy .", "Question : I found sitemap.xml located in portals 0 sitemap folder . As per my knowledge sitemap.xml is generated automatically by DNN . But in my case sitemap.xml was neither got updated when I added a new page to DNN nor it was created again when removed . Is sitemap.xml used by DNN for SEO purpose When is the file created .. . Answer : The purpose of a site map is to provide search engines with the list of the pages hosted by your web site so you are right about SEO . For DNN there is not no longer such a static site.xml file AFAIK maybe this file has been generated by any third party module . You can use instead this dynamic URL : http : www.yourdnnsite.com SiteMap.aspx and I advise you to submit it to Google Webmaster Tools as soon as you can . Go do Admin Site settings Marketing section and you will see the URL of your site map .", "Question : It is a very simple scenario : .. . .. . Sample routes : .. . .. . StockItem categoryId 1 should be Beverages StockItem categoryId 1 should be Shoes .. . .. . Here is the abbreviated site map : .. . .. . and the part of the class : .. . .. . What this all does is generates the site menu correctly with @Html.MvcSiteMap .Menu but the problem is that @Html.MvcSiteMap .SiteMapPath breadcrumb always shows the very first dynamic node no matter what the route is.. . I don t know what I am missing here and there isn t enough documentation on this. . Does anyone has a sample or can point out what I am doing wrong Thanks .. . .. . -Stan .. . Answer : in father preservedRouteParameters id", "Question : A very simple question for experienced sharepoint developers I think . Inside a PortalSiteMapProvider I can access the RootNode this way : .. . .. . My Question is how can I access this node from other places without a reference to the provider Is there something like .. . .. . Thank you very much .. . Answer : I m not quite clear on what you are trying to achieve however you cannot access any nodes of a site map provider without referencing that provider . A simple reason for this is that the sitemap may have a totally different structure to that of your SharePoint site collection .", "Question : Is it possible to get an OOTB PortalSiteMapProvider to provide a site heirarchy from a specified site collection or URL i.e . not the current site collection in SharePoint 2010 In MOSS this was only possible by creating a custom SiteMapProvider traversing the site collections and manually building the navigation tree . NB : I am not prepared to write a custom SiteMapProvider that reads from a static XML .sitemap file as the regular site contributors may not have access to files on the file system . A little bit of background.. . I have a single web application with 2x site collections : .. . .. . 1 for my intranet portal at http : intranet publishing enabled .. . 1 for the My Sites at http : intranet my publishing not enabled .. . .. . We have no plans to facilitate multiple portals therefore I would like a consistant global navigation bar across both site collections . Ideally I d like the My Sites to show the site heirarchy from the main portal site . So is it possible to set the PortalSiteMapProvider.CurrentSite property to http : intranet instead of http : intranet my .. . Answer : To achieve this behaviour I wrote my own web service which goes off and traverses another site collection s hierarchy using it s own PortalSiteMapProvider and returns that structure as an XML document . I obviously then bound my global navigation navigation menu to that . I got the concept from here : PortalSiteMapProvider http : stackoverflow.com questions 518747 portalsitemapprovider .. . .. . There is a similar approach describes here which uses HttpHandlers instead : http : blog.symprogress.com 2011 03 sharepoint2010-custom-navigation-provider-cross-sitecollection", "Question : These Site Map Node is in Web.Config .. . .. . Is there anyway to made some sub sitemapnode in hotel setup can be accessed only by administrator but not hotel admin .. . Answer : Problem solved it need to be set in location path", "Question : I ve got a custom menu navigation built from a web.sitemap file the first line of this would be something like : .. . .. . This works - it gets all the top level nodes from the web.sitemap file and allows me to look through each SiteMapNode and do stuff . However now I want to be able to create multiple web.sitemap files and then programmatically determine which web.sitemap file to use but I can t seem to find out how to do this . I m assuming I could either create one custom SiteMapProvider that can perform the logic to determine which web.sitemap file to load or I have multiple providers each one with the SiteMapFile property set to a specific .sitemap file and then switch providers programmatically before I access SiteMap.RootNode . I think it s probably easier to have one custom provider and then override the part where it looks for the actual physical sitemap file location but I m unclear how I would do this .. . .. . I ve googled a lot but most answers seem to be regarding the standard sitemappath controls and so on and how to set a SiteMapDataSource which I don t think is relevant to my approach . Comment : You shouldn t switch change anything.. . instead you need to access the RootNode like this all the time SiteMap.Providers someProvider .RootNode and the someProvider should then be resolved at runtime . Comment : ooh never thought of that I will try that tomorrow that sounds like it would work . .. . Answer : First you need to specify all of your sitemap files in your web.config as such : .. . .. . Then in your code-behind you can dynamically assign your SiteMapDataSource which is bound to your menu to one of the providers you specified in your web.config : .. . .. . .aspx .. . .. . .cs Comment : yeah this a good approach to this particular question Comment : this would be ideal if I was using an Asp : menu control which had a SiteMapDataSource property but this is custom code that isn t using an asp : menu control . What you re suggesting sounds like I would need to convert my code into an custom control that extends asp : menu I m going to try Pauli s suggestion in his comment above first .", "Question : My site is dynamically creating the sitemap from both database and xml data . This is working great however for a portion of the site that lists news articles it was decided to not put the news article detail pages in the site map . So if you were to click on the title of a news article from the listing page that is in the sitemap it would take you to the page with the article but that page url is not in the sitemap . I have controls and logic in the master-pages that use .. . .. . Essentially on page load I would like to change SiteMap.CurrentNode to the node of the news article listing page which is in the sitemap . So essentially all of the logic running on this page will treat the page as-if it was the listing page . I can t find anyway to do this . This code will get me the node that I want as I know its key . So basically I wish I could do this : .. . .. . But CurrentNode can t be set . Any suggestions on how I could do this I appreciate the help . .. . Answer : Here is the solution I came up with though it s a little too complexed for my liking . Remember the issue is the currently viewed page is not in the sitemap and navigation controls and other logic is expecting to use the sitemap provider . Since the page isn t in the sitemap the sitemap provider is not available thus the reason I have to manually set the sitemap and the current node . We choose not to have the news pages in the sitemap as it would significantly increase the overall size of the sitemap . First I use a custom ThisNode property of the dynamic sitemap provider rather than the SiteMap.CurrentNode property . On the News detail page news-and-events-detail.aspx I call a utility method created in the dynamic provider . This is the utility method : .. . .. . Now in the base master page I have to reset the DynamicSiteMapProviders.ThisNode property since its static and I don t want the next page I visit to still use the manually set node . I do this when the page is done running logic and rendering by utilizing the OnUnload event of the page life cycle . Look at the logic of Get Set of the ThisNode property above .", "Question : Please forgive any naivety I m brand new to the world of C . Let me know if I ve left out helpful information . I m building a custom SiteMapProvider for the Customer Portal for Dynamics CRM 2011 . First I initialize an array : .. . .. . which gets populated thusly : .. . .. . Later I try to query WebPages like so : .. . .. . When I run this through the debugger I get a NullReferenceException which points at the condition in my WHERE clause saying that p.adx parentpageid.Id is null which is true for the home page of the site . Which leads to the question : .. . .. . Why would this query turn up the home page as a p in my query What am I misunderstanding Comment : Are you lazy-loading your entities It might be that you need to load the child objects if they are all null . Comment : Is the homepage hidden from the sitemap Comment : What is the data type of p.adx parentpageid.Id I am thinking that its actually p.adx parentpageid that is null and it throws with you try to access the Id property . If p.adx parentpageid can be null then you need to code for that condition . Comment : @JonC - I don t know what lazy-loading is . Comment : @saturdayplace Sorry I didn t add more info . before . Here s an article talking about this specifically for CRM 2011 msdn.microsoft.com en-us library gg695791.aspx http : msdn.microsoft.com en-us library gg695791.aspx .. . Answer : The issue is the .ToArray on you first query . This linq query is creating a native query to your CrmContext provider : .. . .. . The .ToArray is causing the linq query to be run immediatly and returns a plain old array of objects . The array is not attached to your CrmContext object . However this query is using Linq to Objects to iterate over the array returned in the first call . It is not generateing a native query to your CrmContext provider . Its effectively the same as using a foreach loop to iterate over each element in the array so you have to worry about checking for possible null values that were returned by your first query . Comment : OK that makes sense . I d like to hit the database only once which is why I m doing the first query to get ALL the pages in the DB and then querying the resulting array thereafter LINQ seems to make a lot of sense for that . Is there a better way of doing it Comment : Linq to Objects is fine for that . You just have to remember that it is just running .net code underneath and you are not shielded from null references like you would be for a native query . If an object has no relationship its not going to be simply excluded its going to throw a null reference exception .", "Question : I am currently trying to implement a Custom SiteMap Provider . I have read several tutorials about it and followed their lead . I have created a subclass of XmlSiteMapProvider named MySiteMapProvider which is located in MyProject.Security . I have added the following code to the system.web section of my Web.config : .. . .. . But I am sure that my Provider is not used correctly . I couldn t even start with the implementation . To verify that I have included the following pseudo implementation : .. . .. . But I can use the site and navigate as much as I want to no Exception comes up and the Debug console shows no Hello World at all . Did I forget something important .. . Answer : Instead of implementing my own Provider I went along with the MvcSiteMapProvider https : github.com maartenba MvcSiteMapProvider . The customization of the behaviour that I needed to implement was realized in one day with dynamic sitemaps and a custom SiteMapNodeVisibilityProvider . I also considered implementing the whole SiteMapProvider maybe on SQL basis and I am glad that I did not have to do it .", "Question : My site is dynamically creating the sitemap from both database and xml data . This is working great however for a portion of the site that lists news articles it was decided to not put the news article detail pages in the site map . So if you were to click on the title of a news article from the listing page that is in the sitemap it would take you to the page with the article but that page url is not in the sitemap . I have controls and logic in the master-pages that use .. . .. . Essentially on page load I would like to change SiteMap.CurrentNode to the node of the news article listing page which is in the sitemap . So essentially all of the logic running on this page will treat the page as-if it was the listing page . I can t find anyway to do this . This code will get me the node that I want as I know its key . So basically I wish I could do this : .. . .. . But CurrentNode can t be set . Any suggestions on how I could do this I appreciate the help . .. . Answer : According to this article http : msdn.microsoft.com en-us library ms178425.aspx you can create a custom handler for the SiteMapResolve event and presumably you could return a custom node from that . Comment : Thanks Chris I think this would definitely work in most cases . Unfortunately I didn t see your reply until after I had come up with a suitable yet probably not the best solution . I need to change my notification settings.. . I may try this out as well as some future projects will probably use the same sitemap architecture as this one and will need to use such a solution ." ] }
[ "yes-answer-long", "yes-answer-short" ]
sitemap
UNK_RELATION
http-1.1@http@51
http-1 .1 -- http-1 .1 is the latest version of the @placeholder protocol .
{ "confidence": [ 46.50098419189453, 40.631004333496094, 39.38399887084961, 37.91524887084961, 37.61629867553711, 37.05257034301758, 36.28536605834961, 36.01242446899414, 35.81565475463867, 35.59357452392578, 34.12409591674805, 33.7073974609375, 33.7073974609375, 33.64961242675781, 33.273956298828125, 33.077728271484375, 32.821556091308594, 32.573944091796875, 32.573944091796875, 32.573944091796875, 32.573944091796875, 32.08628463745117, 32.015769958496094, 31.65172576904297, 31.411209106445312, 30.831401824951172, 30.662620544433594, 30.64279556274414, 30.541751861572266, 30.374469757080078, 30.374469757080078, 30.2096004486084, 30.059646606445312, 30.059646606445312, 30.059646606445312, 30.059646606445312, 30.059646606445312, 30.035043716430664, 29.752193450927734, 29.56646728515625, 29.522472381591797, 29.51266860961914, 29.372407913208008, 29.372407913208008, 29.372407913208008, 29.262069702148438, 28.82526397705078, 27.63424301147461, 27.623764038085938, 27.261455535888672, 27.16683006286621, 27.094097137451172, 26.936899185180664, 26.409713745117188, 25.653797149658203, 25.572521209716797, 25.55003547668457, 25.51280975341797, 25.4779052734375, 25.4779052734375, 25.4779052734375, 25.115589141845703, 24.595233917236328, 24.307586669921875, 24.307586669921875, 24.266616821289062, 23.941606521606445, 23.602556228637695, 23.46156883239746, 23.29421043395996, 23.29421043395996, 23.29421043395996, 23.13918685913086, 22.916419982910156, 22.892066955566406, 22.892066955566406, 22.347652435302734, 22.173912048339844, 22.06601905822754, 21.47958755493164, 21.47958755493164, 21.45409393310547, 21.45409393310547, 21.45409393310547, 21.212135314941406, 21.212135314941406, 21.212135314941406, 21.212135314941406, 21.212135314941406, 21.212135314941406, 21.212135314941406, 21.097225189208984, 21.067359924316406, 21.02897834777832, 20.908344268798828, 20.908344268798828, 20.908344268798828, 20.908344268798828 ], "content": [ "For example if the server supports HTTP 2 their communicating protocol will switch to HTTP 2 otherwise HTTP 1.x is used .", "http : stackoverflow.com questions 2769371 404-header-http-1-0-or-1-1 2769402 2769402", "How to I get the HTTP Protocol version of the http-request", "But HTTP 2 is so new that there are browsers that only support HTTP 1.x and there are many servers that only support HTTP 1.x .", "I ve been reading up about the difference between http 1.0 and 1.1 http : stackoverflow.com questions 246859 http-1-0-vs-1-1 and it seems to me that http 1.0 supports everything I need .", "This was reposted from dba.stackexchange http : dba.stackexchange.com questions 98457 sql-insert-with-http1-1 noredirect 1 comment177644 98457 .", "HTTP 2 is definitely the future trend because it is now the standard of HTTP protocol .", "As realized the problem isn t specific to http protocol but works so on each protocol .", "1 .", "The Sabre response is : .. . .. . And the HTTP 1 1 request header reads as : .. . .. . Any ideas what could be the problem with the header", "--Edit 1 : version info-- .. . .. . --Edit 2 : nginx gzip config--", "But this only applies to the situdation where the browser the clients used supports both HTTP 2 and HTTP 1.x right", "But what if a user on a browser that only supports HTTP 1.x wants to communicate with HTTP 2 only server", "It s important to take in consideration that the most implementations of HTTP 2 uses it over TLS 1.2 with ALPN protocol Application Layer Protocol Negotiation .", "How does this relate to stackoverflow.com questions 18477975 http : stackoverflow.com questions 18477975 servicepoint-httpconnectionhttp-1-1-httppipelining-responons-stream-close-inter", "HTTP 1.1 Protocol http : www.w3.org Protocols rfc2616 rfc2616.html", "Or am I getting somewhere wrong with my understanding of HTTP protocol", "1 Not purposefully omitting data .", ".. . .. . Additional documentation : .. . .. . 1 .", "Additionally +1 from me .", "Added EDIT 1 in question .", "I was using the format in the book http : guide.couchdb.org editions 1 en api.html .", ".. . 1 .", "The sending of status code and message along with protocol version no longer occurs .", "If you are only interested in knowing the HTTP protocol I would recommend you starting with HTTP 1.1 instead of 1.0 .", "I knew that a client can use HTTP upgrade mechanism to negotiate a proper protocol to communicate with the server .", "Accept : application json profiles http : profiles.acme.com user v 1 .. . .. . Using the content-type header the server can respond alike : .. . .. . Content-Type : application json profiles http : profiles.acme.com user v 1", "http : stackoverflow.com questions 35200216 remove-transfer-encodingchunked-in-the-post-request .. . .. . avoiding chunked-encoding of HTTP 1.1 response http : stackoverflow.com questions 18174435 avoiding-chunked-encoding-of-http-1-1-response .. . .. . Hope it Helps", "My output of Wget with netcat https : en.wikipedia.org wiki Netcat : .. . .. . As it is clear that Wget uses the HTTP 1.0 protocol version how can it have a host header in it", "Is this ACK message call right according to protocol standard", "They start the main communication after the protocol negotiation .", "Instead pseudo-headers are used basically just headers with a : in front to ensure no clash with HTTP 1.X headers .", "The following lists the four major improvements : .. . .. . 1 .", "1 What happens if you respond to the second request", "I am not sure to understand this statement.. . .. . .. . 1 .", "EDIT 1 : Thank you St.Woland for your answer .", "Point 1-C is still invalid right", "Scenario 1 .. . .. . Client A : I need http : example.com foo bar .", "+1 for the link-to that presentation if nothing else .", "Thus there are two options : .. . .. . 1 . transfer encoding chunked .. . 2 .", "Please seee this wireshark dump : http : tinyurl.com c7m37b9 Frame 116 117 .. . .. . IPad 1 Infos : Version 5.1.1 9B206 Model MB2292FD Safari 5.1", "Alternatively downgrade the protocol to 1.0 .", "Expect a 3 to 5-fold increase in code-size for dealing with the intricacies of the more complex HTTP 1.1 protocol .", "See RFC 7230 Hypertext Transfer Protocol HTTP 1.1 : Message Syntax and Routing section 3 .", "So why is that Wget which uses the HTTP 1.0 protocol has a host header in it", "Saikyr is right HTTP 2 is a binary protocol this means that we ll be using a new library to write HTTP 2 directly from PHP .", "And even if HTTP 1.0 can has Host Header in its HTTP request what can be the reason behind wget using HTTP 1.0 protocol while HTTP 1.1 can also be used in-place of that", "HTTP 1.0 does not officially require a Host header but it doesn t hurt to add one and many applications proxies expect to see the Host header regardless of the protocol version .", "The client is using HTTP 1.1 protocol incorrectly you should not try to work around that on the server-side .", "Now if you want to develop a browser then yes you will have to know the complete protocol as well as-if you are trying to develop a HTTP server .", "Leave the protocol implementation up to the web server .", "I heard today that soon the http2 protocol will be implemented in modern browsers .", "Maybe a better question is do browsers even .. . .. . 1 . leverage the optional headers in the last chunk", "stackoverflow.com questions 35456122 http : stackoverflow.com questions 35456122 apache-modules-implementing-100-continue lq 1", "If 1 is incorrect and HTTP 1.0 is still in use then sure it seems plausible to keep using keep-alive despite follow-up questions on HTTP 1.0-1.1 interop .", "I ve an assignment to implement http-1.1 protocol and develop a custom body parser in node.js for GET and POST .", ".. . .. . Here are my working hypotheses : .. . .. . 1 HTTP 1.0 is no longer in use b c that was many years ago .. . .. . 2 Given 1 keep-alive shouldn t be used anymore but is purely for vestigial reasons that is certain technologies haven t bothered to remove it or keep it around as voodoo code etc .", "SERVER SERVER PROTOCOL as at SERVER Docs http : www.php.net reserved.variables.server : .. . .. . SERVER PROTOCOL .. . Name and revision of the information protocol via which the page was requested i.e .", "Well I notice two things off the bat that may point you in the right direction : .. . .. . 1 .", "I promise I will follow your profile and +1 every so professional answer : .", "Can you or anyone else tell me if I m correct on these 6 points : .. . .. . 1 .", "This interceptor is recommended for server-side protocol processors .", "the packets must not be stopped if wrong http version is used .", "I have three questions : .. . .. . 1 will the code below work for continuous case or not", "I m not sure if this is possible so I have two questions : .. . .. . 1 .", "You cannot force the XMLHttpRequest.setRequestHeader method to add the Expect header for security reasons as you can read in the W3C XMLHttpRequest specification http : www.w3.org TR XMLHttpRequest the-setrequestheader 28 29-method : .. . .. . The setRequestHeader header value method must run these steps : .. . .. . 1 .", "That means that even in the non-typical scenario where a browser has reason to believe a server supports HTTP 2 before connecting we re talking maybe an intranet environment with service advertisement via other protocols for instance the HTTP 2 client would open a connection with PRI HTTP 2.0 r n r nSM r n r n and be immediately rejected with a HTTP 1.1 400 Bad Request by any HTTP 1.X server .", "There was a security assessment done on the website we developed and the recommendations were as below : HTTP 1.0 Pragma Header was not used HTTP : 1.1 Cache - Control header was set to private and lastly BackDated expires-header was not used or set to -1 .", "I think it s fair to say that it is a client error to request this upgrade for HTTP 1.0 since there can be no valid protocol implementation which would accept this request .", "Therefore in accordance with the protocol the server does not transfer the entity in its response .", "Therefore in accordance with the protocol the server does transfer the entity in its response .", "@RemyLebeau The protocol does not require that a successful response to PUT include an ETag .", "The server protocol should be available through SERVER PROTOCOL from the server environment usually exposed through SERVER SERVER PROTOCOL inside your application .", "Also in the Server hello h2 was the protocol selected but then no http2 packets appear when I filter to ip.addr server hello google ip and tcp.port 443 .. . .. . thanks Dean", "And what happens if one of the two servers does not support HTTP1.1 and the other tries to communicate with this protocol", "The code works like this but you should patch the protocol mod-proxy wstunnel file as well and make everything more generic .", "A browser that only supports HTTP 2 does not exist if they support HTTP 2 they also support HTTP 1.1 .", "HTTP is not dependent on TCP you could implement HTTP on other protocols .", "Worst when checking Content-Range response header Section 14.16 only a single range may be returned so I wonder how would a server response to example in Section 14.35.1 bytes 0-0 -1", "Wikipedia says this : .. . .. . HTTP 1.1 1997-1999 .. . .. . Current version persistent connections enabled by default and works well with proxies .", "but Paul The server will make every attempt to conform to the most compatible version of HTTP that the client is using .", "Unsafe header http : i.stack.imgur.com eL8oW.png", "How does this work in http 2", "HTTP 1.1 requests are pipelined by default .", "Here is view-source : .. . .. . More data from http : www.whatsmyip.org http-headers : .. . .. . Can you help me or owner of this site", "When HTTP runs on top of TCP which it usually does you can t send HTTP messages without TCP traffic .", "As we can see in Can I use http : caniuse.com search HTTP2 70.15 percent of browsers support the HTTP 2 .", "And what if a user on a brower that only supports HTTP 2 wants to communicate with HTTP 1.1 only server", "If a browser only supports HTTP 1.1 and the server only supports HTTP 2 they cannot communicate .", "I am not implementing HTTP 2 server I am curious HTTP 2 backward compatibility .", "Requests that were taking 0.15s on HTTP 1.0 were taking at least 5s on HTTP 1.1 .", "I have been testing a crawler programme and I need to test an internet site which work on http protocol 1.0 .. . .. . Right now I have an example internet site run on nodejs server .", "The main difference between HTTP 1.0 and HTTP 1.1 is that HTTP 1.1 has a mandatory Host header in it source : HTTP Pocket Reference - O reilly .", "add.php .. . .. . connect.php .. . .. . I use a simple HTTP 1.1 protocol : .. . .. . GET add.php ID1 1int ID2 2char ID3 3char ID4 4int ID5 2015-04-13 01 : 00 : 00 HTTP 1.1 r nmyhost r nContent-Type : application x-www-form-urlencoded r nConnection : close r n r n r n .. . .. . where ID1 ID4 is int ID2 ID3 char ID5 Datetime SQL .. . .. . The host throw me this error : .. . .. . If anyone have any idea for me to try out I would be grateful", "The link you pointed at is not the WebDAV specfication but the HTTP specification .", "http : www.webdav.org specs rfc4918.html METHOD PROPFIND", "Because you sent the data via HTTP GET .", "Or is there any browser that supports only HTTP 2" ] }
{ "confidence": [ 38.90228271484375, 38.56505584716797, 32.951881408691406, 32.431373596191406, 32.04332733154297, 30.29818344116211, 29.83817481994629, 29.691282272338867, 29.320329666137695, 28.418289184570312, 27.57744598388672, 27.25222396850586, 27.196413040161133, 26.281124114990234, 25.977174758911133, 25.901687622070312, 25.880924224853516, 25.52924346923828, 25.315982818603516, 25.116132736206055 ], "content": [ "Question : HTTP 2 is definitely the future trend because it is now the standard of HTTP protocol . As we can see in Can I use http : caniuse.com search HTTP2 70.15 percent of browsers support the HTTP 2 . But HTTP 2 is so new that there are browsers that only support HTTP 1.x and there are many servers that only support HTTP 1.x . I knew that a client can use HTTP upgrade mechanism to negotiate a proper protocol to communicate with the server . For example if the server supports HTTP 2 their communicating protocol will switch to HTTP 2 otherwise HTTP 1.x is used . But this only applies to the situdation where the browser the clients used supports both HTTP 2 and HTTP 1.x right But what if a user on a browser that only supports HTTP 1.x wants to communicate with HTTP 2 only server Will the server ignore the request or send an error back to the user And what if a user on a brower that only supports HTTP 2 wants to communicate with HTTP 1.1 only server I am thinking the process might go like this : The user sends a connecion preface to the server the server cannot recognize the request so the user might receive a connection error message . Is this right Or is there any browser that supports only HTTP 2 .. . Answer : If a browser only supports HTTP 1.1 and the server only supports HTTP 2 they cannot communicate . The server will not recognize what the client sends in particular there will be no connection preface which the server treats - following the specification - as a connection error and will close the connection . A browser that only supports HTTP 2 does not exist if they support HTTP 2 they also support HTTP 1.1 . But let s assume that such browser exist . In this latter case the server will see the connection preface and will not recognize the PRI method . What exactly the server does in this case depends on the server . It may return a 400 Bad Request or perhaps just close the connection or it may trigger an internal server error .", "Question : HTTP 2 is definitely the future trend because it is now the standard of HTTP protocol . As we can see in Can I use http : caniuse.com search HTTP2 70.15 percent of browsers support the HTTP 2 . But HTTP 2 is so new that there are browsers that only support HTTP 1.x and there are many servers that only support HTTP 1.x . I knew that a client can use HTTP upgrade mechanism to negotiate a proper protocol to communicate with the server . For example if the server supports HTTP 2 their communicating protocol will switch to HTTP 2 otherwise HTTP 1.x is used . But this only applies to the situdation where the browser the clients used supports both HTTP 2 and HTTP 1.x right But what if a user on a browser that only supports HTTP 1.x wants to communicate with HTTP 2 only server Will the server ignore the request or send an error back to the user And what if a user on a brower that only supports HTTP 2 wants to communicate with HTTP 1.1 only server I am thinking the process might go like this : The user sends a connecion preface to the server the server cannot recognize the request so the user might receive a connection error message . Is this right Or is there any browser that supports only HTTP 2 .. . Answer : It s important to take in consideration that the most implementations of HTTP 2 uses it over TLS 1.2 with ALPN protocol Application Layer Protocol Negotiation . Thus the client just start the standard TLS connection . As the part of such communication the client sends Client Hello to the server with some information : .. . .. . enter image description here http : i.stack.imgur.com JJ7vf.png .. . .. . It s like : Hi Tom It s Bob . I speak German Russian and English . Let s talk a little . And the server send Server Hello : .. . .. . enter image description here http : i.stack.imgur.com zeNIq.png .. . .. . Hi Bob I suggest to speak German or English . Then the client send one more short message OK then let s speak German and he start to speak German without waiting of any response from the server : .. . .. . enter image description here http : i.stack.imgur.com vR3gw.png .. . .. . The whole communication looks like on the picture below .. . .. . enter image description here http : i.stack.imgur.com xEyYl.png .. . .. . Because both the client and the server start the communication just using TLS 1.2 which the both know . They start the main communication after the protocol negotiation . Thus the problem which you describe could not exist in the practice . Comment : To work as you described does the server need to support https What if the server does not support https Comment : @user3744927 : Adding support of HTTPS and tuning it - it s the first step of implementation of HTTP 2 . One can get now SSL TLS certificate for free for example from letsencrypt.org https : letsencrypt.org startssl.com https : startssl.com or other . The solution of letsencrypt.org https : letsencrypt.org is the most simple and powerful . Which operation system you use and which web server I d recommend you to install OpenSSL and get Let s encrypt certificate . Then to configure you server based on the suggestions https : mozilla.github.io server-side-tls ssl-config-generator Comment : I am not implementing HTTP 2 server I am curious HTTP 2 backward compatibility . Most browsers only support HTTP 2 over TLS but there are still a great number of servers that do not support encryption . And what if some servers still prefer non encryption in HTTP 2 Comment : @user3744927 : Such servers without update to HTTP 2 will stay slowly . One see currently that the roll-out of HTTP 2 and TLS run very quickly . One can see here http : w3techs.com technologies details ce-http2 all all that it s about 0.1 in the week . I find it very quickly if one think about all server", "Question : The main difference between HTTP 1.0 and HTTP 1.1 is that HTTP 1.1 has a mandatory Host header in it source : HTTP Pocket Reference - O reilly . So why is that Wget which uses the HTTP 1.0 protocol has a host header in it My output of Wget with netcat https : en.wikipedia.org wiki Netcat : .. . .. . As it is clear that Wget uses the HTTP 1.0 protocol version how can it have a host header in it Or am I getting somewhere wrong with my understanding of HTTP protocol And even if HTTP 1.0 can has Host Header in its HTTP request what can be the reason behind wget using HTTP 1.0 protocol while HTTP 1.1 can also be used in-place of that .. . Answer : In HTTP 1.0 the Host header was optional . The difference is that HTTP 1.1 changed it from optional to mandatory . In particular if the GET line doesn t include the hostname like in your example you need to include it in the headers because otherwise virtual domains would not be possible if the server cannot determine which host your request was for .", "Question : Until now my php application assumed HTTP 1.1 everywhere . So I defined all headers like so : .. . .. . But now my server also supports HTTP 2 and I want to update all header responses with the right HTTP status code . How to I get the HTTP Protocol version of the http-request My webserver is nginx but I guess it is irrelevant if I am using nginx or apache . .. . Answer : The server protocol should be available through SERVER PROTOCOL from the server environment usually exposed through SERVER SERVER PROTOCOL inside your application . From phpinfo under Apache 2.4 :", "Question : The main difference between HTTP 1.0 and HTTP 1.1 is that HTTP 1.1 has a mandatory Host header in it source : HTTP Pocket Reference - O reilly . So why is that Wget which uses the HTTP 1.0 protocol has a host header in it My output of Wget with netcat https : en.wikipedia.org wiki Netcat : .. . .. . As it is clear that Wget uses the HTTP 1.0 protocol version how can it have a host header in it Or am I getting somewhere wrong with my understanding of HTTP protocol And even if HTTP 1.0 can has Host Header in its HTTP request what can be the reason behind wget using HTTP 1.0 protocol while HTTP 1.1 can also be used in-place of that .. . Answer : The Host header was added as an optional addition to HTTP 1.0 very early on when it was realized this was the only way to allow one server to serve up pages for multiple-domains . wget uses HTTP 1.0 with Host as the way to be compatible with the maximum number of sites some of which don t respond to HTTP 1.1 even though they require Host . Comment : but Paul The server will make every attempt to conform to the most compatible version of HTTP that the client is using . so even if wget uses 1.1 server will use the most compatible one . either it be 1.1 or 1.0 why will it not respond to the request Comment : If the server doesn t understand 1.1 it won t respond to a 1.1 request . I know the number of servers that don t do 1.1 is probably miniscule these days but since wget doesn t require anything that 1.1 can provide that 1.0 doesn t why would it choose to cut out any 1.0 servers", "Question : Until now my php application assumed HTTP 1.1 everywhere . So I defined all headers like so : .. . .. . But now my server also supports HTTP 2 and I want to update all header responses with the right HTTP status code . How to I get the HTTP Protocol version of the http-request My webserver is nginx but I guess it is irrelevant if I am using nginx or apache . .. . Answer : changing etc nginx factcgi params : .. . .. . Header should be : -", "Question : I have an embedded system that makes a HTTP POST request however I know that the headers must have a format . In this case I have this request : .. . .. . I want to avoid any kind of error while I send this request . 1 . Strictly talking is it correct use n to tell new line or should be r n 2 . Any suggestion about this request format Thanks for your help . .. . Answer : You must use r n to separate headers also to separate the body from the header section . See RFC 7230 Hypertext Transfer Protocol HTTP 1.1 : Message Syntax and Routing section 3 . Message Format https : tools.ietf.org html rfc7230 section-3 : .. . .. . .. . HTTP-message start-line .. . header-field CRLF .. . CRLF .. . message-body .. . .. . .. . CRLF being r n . Whether the rest of the request is valid especially the body depends on the server you send it to . Comment : Thanks for your answer .", "Question : null .. . Answer : I ve an assignment to implement http-1.1 protocol and develop a custom body parser in node.js for GET and POST . My outline is as follows please review if I m missing something here . 1 . Parse HTTP Headers node.js does this automatically .. . 2 . Parse Body check content-type headers for json or text urlencoded .. . .. . Any suggestions or guidelines if I m missing something in here . Where can I find more details on http-1.1 and what s the difference between 1.0 and 1.1 and most importantly it has to be pipeable stream based body parser unlike the ones available on NPM . Body Parser", "Question : I heard today that soon the http2 protocol will be implemented in modern browsers . More information : https : en.wikipedia.org wiki HTTP 2 I know wikipedia is not the best resource but it will give a little clue about what is going on . The question is : .. . .. . .. . .. . How will old browsers respond to http2 headers .. . .. . I mean on php http : php.net there is still 26.02.2015 a link in header function http : php.net manual en function.header.php to the http1.1 specification http : www.faqs.org rfcs rfc2616 . I understand that in http2 all I must do is change header from for example HTTP 1.1 404 Not Found to something similar to HTTP 2.0 404 Not Found . But how will older browsers respond to it Is this transparent for webdevelopers and php coders and implemented on browser server-side or there are some important things clues about compatibility Is using http2 headers right after they are ready a good idea .. . .. . I don t want to hurt anyone but I know such a browser that it first name starts on the leter I and second with the letter E that can always mess up a little . I m afraid that the new specification will totally ruined all older version of this browser and that this http2 . And we - developers must write websites that just work no matter where and the magic http2 will come true after milions tons of patches upgrades months of compatibility problems with older machines . .. . .. . There must be some code in well formed question so here it is : : .. . .. . What about old browsers in this case Is this a good idea to use it right after http2 is alive .. . .. . Additional documentation : .. . .. . 1 . Draft http2 specification : https : tools.ietf.org html draft-ietf-httpbis-http2-17 .. . 2 . Wikipedia few words : https : en.wikipedia.org wiki HTTP 2 .. . 3 . PHP header function : http : php.net manual en function.header.php .. . 4 . W3.org about http2 : http : www.w3.org Protocols HTTP HTTP2.html Comment : PS . Second part of my question is a little opinion based but I hope there exist an answer that s why I asked it . I mean if there are huge pros or cons please write them if this depends second part is not that important . I dont want to make a discussion here but check if this really can be used right after official approval of http2 . Comment : http2.0 is binary based doubt it d be the same as before .. . Answer : In a typical scenario a HTTP 2-capable client contacting a server does so using a HTTP 1.1 connection initially using the Upgrade : header to indicate the availability of HTTP 2 support . This looks something like this : .. . .. . Source : HTTP 2 draft 17 Sec 3.2 https : tools.ietf.org html draft-ietf-httpbis-http2-17 section-3.2 .. . .. . I m quoting the specs directly there so a real request from a real client would look slightly more complex it would include the usual HTTP 1.1 headers as well such that a server not wishing to upgrade to HTTP 2 could simply continue with the request . A server not supporting HTTP 2 simply ignores the Upgrade : h2c and HTTP2-Settings : .. . headers . Servers upgrading the connection to HTTP 2 respond with : .. . .. . Source : HTTP 2 draft 17 Sec 3.2 .. . .. . That section starting PRI is called the client connection preface and is sent at the start of any HTTP 2 connection . It is designed to be a string that no HTTP 1.0 or 1.1 server would respond to . That means that even in the non-typical scenario where a browser has reason to believe a server supports HTTP 2 before connecting we re talking maybe an intranet environment with service advertisement via other protocols for instance the HTTP 2 client would open a connection with PRI HTTP 2.0 r n r nSM r n r n and be immediately rejected with a HTTP 1.1 400 Bad Request by any HTTP 1.X server . A client might then downgrade the request to HTTP 1.1 and continue for instance . Rewriting PHP applications to directly use HTTP 2 is going to take a fair bit more work than changing header HTTP X.X.. . numbers . Saikyr is right HTTP 2 is a binary protocol this means that we ll be using a new library to write HTTP 2 directly from PHP . The sending of status code and message along with protocol version no longer occurs . Instead pseudo-headers are used basically just headers with a : in front to ensure no clash with HTTP 1.X headers . However headers aren t going to be sent in cleartext a compression scheme has been drawn up for converting headers to binary codes . HPACK draft 12 . https : tools.ietf.org html draft-ietf-httpbis-header-compression-12 I haven t read it it s less of a page-turner than HTTP 2 . So instead of header HTTP 2 404 Not Found you ll do something like this : .. . .. . or instead of header Location : PROTO : HOST PATH .. . .. . I m not aware of such support in PHP yet so I m guessing a bit there . I m not certain whether PHP could gain enough control of an Apache connection to upgrade from HTTP 2 and manage the connection itself . As support is added to Apache there might be opportunity for PHP to link in at the library level . Whatever the new library it might still be capable of writing the headers of a HTTP 1.1 connection depending on the client but it is going to require rewriting software unless they decide to have header re-parse each argument for HTTP 2 output which is not inconceivable but seems to me like it would cause more problems than it would solve . One way in which HTTP 2 support could be added would be at the server transport level with some translation of HTTP 1.1 headers into HTTP 2 . An Apache module could conceivably parse HTML output and detect linked stylesheets scripts and images generating PUSH PROMISEs to the client when responding to a GET request . The primary advantage to supporting HTTP 2 directly in PHP would be allowing the resources linked to to be pushed to willing clients who support the feature . Many PHP-based CMS environments would be able to supply a list of stylesheets scripts and images without having to re-parse output intended for the client . I m looking forward to seeing what we can do Comment : I m accepting your answer right now . I m pretty sure no one will post a better answer : . Additionally +1 from me . Thanks for your time and great resource . I m totally impressed . I promise I will follow your profile and +1 every so professional answer : . Comment : Thanks I ve been enjoying reading the spec so I m happy to share my thoughts . Your question was perfectly timed really .", "Question : I wanted to know if all the servers could already communicate with HTTP1.1 . And what happens if one of the two servers does not support HTTP1.1 and the other tries to communicate with this protocol Thanks for your explanations : .. . Answer : Every server that you will use supports and makes use of HTTP 1.1 . It came out before the year 2000 so you are pretty safe . HTTP 1.1 Protocol http : www.w3.org Protocols rfc2616 rfc2616.html", "Question : I m implementing a basic http client for communicating with a web service and am wondering if I should go with http 1.0 or 1.1 . The data section will consist of binary-data and the remote-server will always be controlled by me running IIS7.5 . The firewalls proxies inbetween is nothing I m controlling ie . the packets must not be stopped if wrong http version is used . I ve been reading up about the difference between http 1.0 and 1.1 http : stackoverflow.com questions 246859 http-1-0-vs-1-1 and it seems to me that http 1.0 supports everything I need . Will I encounter problems if i choose http 1.0 over 1.1 or can I assume that everything will work just as good What makes me wonder is that if I connect via raw-sockets to IIS7.5 and send a http 1.0 get request the response is always http-1.1 . http : stackoverflow.com questions 2769371 404-header-http-1-0-or-1-1 2769402 2769402 .. . Answer : I don t think there s anything wrong using 1.0 as a client most web servers are backward compatible . If you re really have concerns send 1.1 and only deal with stuff you want to handle I don t think there s anything possibly go wrong choose either case .", "Question : This was reposted from dba.stackexchange http : dba.stackexchange.com questions 98457 sql-insert-with-http1-1 noredirect 1 comment177644 98457 . Sorry for such an amateur question but I have no idea why this does not work . I have a add.php to connect to the MySQL server . add.php .. . .. . connect.php .. . .. . I use a simple HTTP 1.1 protocol : .. . .. . GET add.php ID1 1int ID2 2char ID3 3char ID4 4int ID5 2015-04-13 01 : 00 : 00 HTTP 1.1 r nmyhost r nContent-Type : application x-www-form-urlencoded r nConnection : close r n r n r n .. . .. . where ID1 ID4 is int ID2 ID3 char ID5 Datetime SQL .. . .. . The host throw me this error : .. . .. . If anyone have any idea for me to try out I would be grateful I m really clueless.. . Fixed : moskito-x . ID3 . to . ID3 . .. . .. . UPDATE : 2015.04.22 13 : 56 .. . .. . Ok I tried this and it works on my Main page : Index.php just copy the whole add.php code into index.php .. . .. . But if I replace it into the add.php no row is inserted . I changed add.php as other have suggested : .. . .. . add.php Comment : Please be aware that the mysql functions are now no longer just discouraged as it was over the last years but officially deprecated http : php.net manual en migration55.deprecated.php . You should really use MySQLi http : php.net manual en book.mysqli.php or PDO http : php.net manual en ref.pdo-mysql.php as this code will stop working very soon . Comment : DO NOT use msql query and append values from the webpage this is known as SQL Injection and it s how your site database server gets hacked . You must use parameterized queries by using PDO instead . Comment : @NhanLe See Why shouldn t I use mysql functions in PHP http : stackoverflow.com questions 12859942 why-shouldnt-i-use-mysql-functions-in-php for more information . Comment : @NhanLe Another thing is that you are accessing to POST variables but you sends data via GET GET add.php ID1 1int ID2 2char ID3 3char ID4 4int ID5 2015-04-13 01 : 00 : 00 You can change POST var by GET var . Comment : Hi @NhanLe POST Therefore you need change the way to test your add.php .. . Answer : Important part link Connection .. . .. . We can not see code of Connection .. . your query is wrong .. . mentioned in comments - you using a http GET so ID1 POST ID1 is wrong to . .. . .. . EDIT .. . .. . Now we can see in your Edited question .. . .. . where ID1 ID4 is int ID2 ID3 char ID5 TimeStamp .. . .. . Query should be assume TimeStamp 20150421225300 string format . Comment : @NhanLe The request is bad too . Comment : @moskito-x Just update the Connection function Comment : @NhanLe : First solve your invalid query . Comment : @NhanLe change too POST var by GET var . Because you sent the data via HTTP GET . Comment : Hi Moskito i read somewhere that if I add Content-Type : application x-www-form-urlencoded POST is ok too So it s not correct", "Question : This was reposted from dba.stackexchange http : dba.stackexchange.com questions 98457 sql-insert-with-http1-1 noredirect 1 comment177644 98457 . Sorry for such an amateur question but I have no idea why this does not work . I have a add.php to connect to the MySQL server . add.php .. . .. . connect.php .. . .. . I use a simple HTTP 1.1 protocol : .. . .. . GET add.php ID1 1int ID2 2char ID3 3char ID4 4int ID5 2015-04-13 01 : 00 : 00 HTTP 1.1 r nmyhost r nContent-Type : application x-www-form-urlencoded r nConnection : close r n r n r n .. . .. . where ID1 ID4 is int ID2 ID3 char ID5 Datetime SQL .. . .. . The host throw me this error : .. . .. . If anyone have any idea for me to try out I would be grateful I m really clueless.. . Fixed : moskito-x . ID3 . to . ID3 . .. . .. . UPDATE : 2015.04.22 13 : 56 .. . .. . Ok I tried this and it works on my Main page : Index.php just copy the whole add.php code into index.php .. . .. . But if I replace it into the add.php no row is inserted . I changed add.php as other have suggested : .. . .. . add.php Comment : Please be aware that the mysql functions are now no longer just discouraged as it was over the last years but officially deprecated http : php.net manual en migration55.deprecated.php . You should really use MySQLi http : php.net manual en book.mysqli.php or PDO http : php.net manual en ref.pdo-mysql.php as this code will stop working very soon . Comment : DO NOT use msql query and append values from the webpage this is known as SQL Injection and it s how your site database server gets hacked . You must use parameterized queries by using PDO instead . Comment : @NhanLe See Why shouldn t I use mysql functions in PHP http : stackoverflow.com questions 12859942 why-shouldnt-i-use-mysql-functions-in-php for more information . Comment : @NhanLe Another thing is that you are accessing to POST variables but you sends data via GET GET add.php ID1 1int ID2 2char ID3 3char ID4 4int ID5 2015-04-13 01 : 00 : 00 You can change POST var by GET var . Comment : Hi @NhanLe POST Therefore you need change the way to test your add.php .. . Answer : Your http-request as you shown in your post stands for an empty line : .. . .. . It is indeed a bad request because a you have unescaped white space characters in the URI and b the second line reads just myhost when you probably meant Host : myhost c you have extra r n not likely to cause troubles though so something like that : .. . .. . And of course what other said about SQL injections applies . Comment : hey thanks for your answer I have yet to make the PHP to insert to SQL table correctly . Please have a look at my update do you have any suggestion", "Question : When i send a POST request through Jersey ReST client it s automatically using Header transfer-encoding : chunked . Is there any way to force use of content-length : instead of transfer-encoding . After adding Content-Length property too the behavior is same .. . Answer : HTTP 1.1 version onwards chunked transfer encoding is default for POST in this data is sent as chunks and hence the senders can begin transmitting dynamically-generated content before knowing the total size of that content . The size of each chunk is sent right before the chunk itself so that the receiver can tell when it has finished receiving data for that chunk . The data-transfer is terminated by a final chunk of length zero . Is there any way to force use of content-length : instead of transfer-encoding .. . .. . Set the Content-Length header before sending your POST request . But this will work only in http 1.0 and when you set the content-length and if the post request data size is more than the content-length then the data received will be truncated . In the version 1.1 of the HTTP protocol the chunked transfer mechanism is considered to be always and anyways acceptable even if not listed in the TE transfer encoding request header field and when used with other transfer mechanisms should always be applied last to the transferred data and never more than one time . Source Wikipedia - Chunked Transfer Encoding https : en.wikipedia.org wiki Chunked transfer encoding .. . .. . .. . .. . Whereas in the response we can avoid Transfer-Encoding by setting the BufferSize on response using response.setBufferSize . But if our response size goes beyond the bufferSize it would fallback to Transfer-Encoding : Chunked . .. . .. . Different Transfer Mechanisms http : www.tutorialspoint.com internet technologies internet protocols.htm .. . .. . More Info : .. . .. . Content-Length header versus chunked-encoding http : stackoverflow.com questions 2419281 content-length-header-versus-chunked-encoding .. . .. . Remove Transfer-Encoding : chunked in the POST request http : stackoverflow.com questions 35200216 remove-transfer-encodingchunked-in-the-post-request .. . .. . avoiding chunked-encoding of HTTP 1.1 response http : stackoverflow.com questions 18174435 avoiding-chunked-encoding-of-http-1-1-response .. . .. . Hope it Helps Comment : @Amarnath Even after adding the Content-Length header too jersey picking the chunked transfer encoding . Comment : @Amarnath - Thanks for the replies The issue i am facing is in the request side . Comment : @Rohit - Added more info hope you will be clarified now . Comment : @Amarnath when used with other transfer mechanisms should always be applied last to the transferred data and never more than one time Can you please elaborate this line . Comment : @Rohit - Added some more info : -", "Question : I am exploring HTTP 1.1 persistent connection over single TCP socket for multiple HTTP request from client-side . One thing I observed in wireshark is that after each request-response my client sends an ACK to server . Is this ACK message call right according to protocol standard Is there any way I can skip this ACK call . I compared the communication behaviour of my client with browser s communication pattern . I think browser does not send any tcp messages to server once tcp handshake is completed to establish connection . Comment : I think browser does not send any tcp messages to server once tcp handshake is completed to establish connection - I think you re wrong . When HTTP runs on top of TCP which it usually does you can t send HTTP messages without TCP traffic . Comment : Why on earth would you want to get rid of an ACK .. . Answer : ACK is part of TCP . You can t have a TCP connection without ACK that s how it works . Data that is received is ACK ed so the sender does not retransmit it . HTTP is not dependent on TCP you could implement HTTP on other protocols . The two protocols should be seen as separate layers and should not influence each others .", "Question : null .. . Answer : This is regarding the website http : zumbl.com . We realized today that the pages are not being served at some places . On doing some experiments we further realized that the pages with small output size are being displayed ok but if we increase the size of the content to be served then the receiving browser complains of header issues . We are using nginx and web2py . Any ideas what can be the potential problem Can the problem be because of HTTP 1.0 vs . 1.1 headers As realized the problem isn t specific to http protocol but works so on each protocol . I created a new question as the description is quite different for both these scenarios . Packets of length 1400 not being received from a specific server http : stackoverflow.com questions 20812137 packets-of-length-1400-not-being-received-from-a-specific-server Comment : the receiving browser complains of header issues Care to elaborate Comment : It says - Following server is down . Couldn t read headers . Most of the time though it keeps on loading and nothing happens and sometimes this error message comes up . Comment : I see a X-Page-Speed header in your responses . Are you using the ngx page speed module Comment : @DaSourcerer Yes Comment : I d try with regular nginx for a while . Not sure that s the culprit but it s a good chance .", "Question : I m implementing a basic http client for communicating with a web service and am wondering if I should go with http 1.0 or 1.1 . The data section will consist of binary-data and the remote-server will always be controlled by me running IIS7.5 . The firewalls proxies inbetween is nothing I m controlling ie . the packets must not be stopped if wrong http version is used . I ve been reading up about the difference between http 1.0 and 1.1 http : stackoverflow.com questions 246859 http-1-0-vs-1-1 and it seems to me that http 1.0 supports everything I need . Will I encounter problems if i choose http 1.0 over 1.1 or can I assume that everything will work just as good What makes me wonder is that if I connect via raw-sockets to IIS7.5 and send a http 1.0 get request the response is always http-1.1 . http : stackoverflow.com questions 2769371 404-header-http-1-0-or-1-1 2769402 2769402 .. . Answer : A firewall certainly will not block it and a router will route it . I would suggest using http-1.1 . Chances are nothing will be affected if you use http 1.0 . However you never know who else might use your http client in the future and what horrible server implementation it will be used with . You also need to ask yourself why you are implementing an http client in the first place . Why not just use a standard-library I do not know what lanuage you are using but libcurl has bindings for many lanugages . You can see more about libcurl here http : curl.haxx.se libcurl . Comment : I will use it in an embedded environment in c so the more lightweight it gets the better . Do you know any library that is a little less generalized than libcurl since its just the http part I need Comment : When you build curl you can tell it which protocols to include . Is that good enough for your situation Comment : I will take a look into it until I know something better I will accept your answer . Thanks for the help.. . Comment : What about http tiny library http : www.demailly.com dl wwwtools.html It lacks in recommendations which makes wonder if it is the right choice . Comment : I don t know . I have never used it . I have only used cURL . However I did come up with another option . Depending on what you are doing it may be easier to use a command-line utility like wget . You can call it from your script and receive the webpage from the program s standard out . I normally do this with shell scripts but it should work for a C program as well . There is a windows binary that is only half a megabyte in size .", "Question : I m trying to make a SSL proxy using Apache 2 that listens on port 443 and forwards the requests on different IPs ports based on context : .. . .. . Scenario : .. . .. . Make a jBoss https-remoting request it uses HTTP1.1 Upgraded to jboss-remoting in Wildfly 8.2 from : .. . .. . and forward it to : .. . .. . I ve found the following RewriteCond that works : .. . .. . But i can t figure out what RewriteRule I should apply in order the request to go on http-remoting not http . Apache Input : .. . .. . Apache Output : .. . .. . As you can see the Upgrade and Connection headers are stripped out . Is there a way I can forward everything .. . Answer : Found the solution . It consists of hacking the mod-proxy wstunnel from Apache 2.4+ in order to support the jboss-remoting Upgrade . As quick hack you need to edit the following file : .. . .. . Mandatory changes : .. . .. . The upgrade header needs to be patched from : .. . .. . to .. . .. . and the following line : .. . .. . to .. . .. . Now a simple rewrite rule would make the trick : .. . .. . Notice the ws protocol . It needs it in order to trigger the upgrade . The code works like this but you should patch the protocol mod-proxy wstunnel file as well and make everything more generic .", "Question : In chunked downloading there are extensions on each chunk that can be leveraged when coming to a browser . the last chunk can also contain optional headers defining stuff like content-length if we streamed a big file through we can provide that information at the very end in the form of a http header . How does this work in http 2 Are there even extensions or headers in last piece . I see there is Data payload but there is no extensions nor optional headers AFAICT . I only see padding . Maybe a better question is do browsers even .. . .. . 1 . leverage the optional headers in the last chunk 2 . leverage extensions in each chunk Perhaps programs may care but if it is a progam I believe in http 2 the server just defines the api better perhaps and uses a push mechanism after response+data has been sent maybe How would one send optional headers in this new http 2 world though if I was a server defining an api for clients I was trying to use wireshark to capture a download trace but chrome seems to use QUICK and I can t seem to decrypt the SSL with wireshark for this use-case when I use firefox and drive.google.com to download a file it stays encrypted while in the same trace I actually saw some http2 traffic in TLS for some other service working just fine . Using the Pre -Master-Secret log filename seems to only work half the time and I am not quite sure why . I end up having to restart everything and re-run my cases . Also in the Server hello h2 was the protocol selected but then no http2 packets appear when I filter to ip.addr server hello google ip and tcp.port 443 .. . .. . thanks Dean .. . Answer : In chunked downloading there are extensions on each chunk that can be leveraged when coming to a browser . the last chunk can also contain optional headers defining stuff like content-length if we streamed a big file through we can provide that information at the very end in the form of a http header . In theory i.e . standard you have the extensions and the possibility to add non-essential headers at the end . In practice these feature are not used . I m not aware of any chunk extensions which are defined which means that browsers simply ignore them . And the example trailer defining a content-length makes no sense because with chunked-encoding any content-length header should be ignored . There might be some third party libraries which make use of trailers . But since support for trailers would need to be declared up-front by the client using TE : trailers header browsers don t use it . If I understand HTTP 2 correctly chunk extensions are simply gone nothing lost they were never used . Trailers are still possible i.e . you could add headers after all data are sent see RFC7540 : 8.1 HTTP Request Response Exchange http : httpwg.org specs rfc7540.html HttpSequence . Comment : odd it is not letting me mark this correct . Comment : there we go...that was weird .", "Question : I need to determine whether an HTTP request was an HTTP 1.0 or an HTTP 1.1 request in my PHP script which is running under Apache . Is there a way to query this information .. . Answer : SERVER SERVER PROTOCOL as at SERVER Docs http : www.php.net reserved.variables.server : .. . .. . SERVER PROTOCOL .. . Name and revision of the information protocol via which the page was requested i.e . HTTP 1.0 .. . .. . See as well : .. . .. . Find out HTTP method in PHP http : stackoverflow.com questions 1538065 find-out-http-method-in-php Comment : This may not be reliable . See stackoverflow.com q 17640877 632951 http : stackoverflow.com q 17640877 632951" ] }
[ "yes-answer-long", "yes-answer-short" ]
http
UNK_RELATION
dgrid@dojo@73
dgrid -- dgrid is a component for creating lists and grids based on the @placeholder toolkit .
{ "confidence": [ 45.268524169921875, 42.856971740722656, 42.38121795654297, 41.275630950927734, 41.275630950927734, 41.275630950927734, 41.275630950927734, 41.275630950927734, 41.25643539428711, 41.16489791870117, 41.16489791870117, 41.16489791870117, 40.2265625, 40.157386779785156, 39.75080490112305, 39.75080490112305, 39.58355712890625, 39.58355712890625, 39.58355712890625, 39.58355712890625, 38.892425537109375, 38.892425537109375, 38.892425537109375, 38.892425537109375, 38.892425537109375, 38.892425537109375, 38.892425537109375, 38.86266326904297, 38.576045989990234, 38.576045989990234, 38.576045989990234, 38.576045989990234, 38.576045989990234, 38.576045989990234, 38.21732711791992, 38.178245544433594, 38.178245544433594, 37.60880661010742, 37.5269775390625, 37.5269775390625, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.31108474731445, 37.27714538574219, 37.16825485229492, 37.02402114868164, 37.02402114868164, 37.02402114868164, 36.54999542236328, 36.26201629638672, 36.26201629638672, 36.26201629638672, 36.21382522583008, 35.951839447021484, 35.879417419433594, 35.879417419433594, 35.879417419433594, 35.879417419433594, 35.879417419433594, 35.81423568725586, 35.81423568725586, 35.81423568725586, 35.81423568725586, 35.81423568725586, 35.81423568725586, 35.81423568725586, 35.81423568725586, 35.81423568725586, 35.81423568725586, 35.81423568725586, 35.290496826171875, 35.004676818847656, 35.004676818847656, 35.004676818847656, 34.77811813354492, 34.37049865722656, 34.23289489746094, 34.23289489746094, 34.23289489746094, 34.23289489746094, 34.23289489746094, 34.23289489746094, 34.23289489746094, 34.23289489746094, 34.23289489746094, 34.23289489746094 ], "content": [ "dojofoundation.org packages dgrid js dgrid test extensions http : dojofoundation.org packages dgrid js dgrid test extensions DnD.html", "@Himanshu - This is not a dojoxGrid rather a dgrid .", "I haven t been able to find any documentation on events on the dgrid store other than dgrid-refresh-complete and dgrid-error. . Is there any others", "Yes that was dgrid Editor .", "dgrid switched to dstore in 0.4 .", "I have a problem with dgrid... .", "New to dojo and dgrid .", "I have an dgrid OnDemandGrid .", "I have implemented dgrid in imy projects .", "I m using a dgrid and not a dojox TreeGrid .", ".dgrid-content .field-column1 : click", "dgrid queries its store e.g .", "What version of dgrid", "Well since it s a dgrid and you can see that the image used for background-image has all the images that are required in a dgrid .", "Dgrid 0.3 to 0.4 conversion notes https : github.com SitePen dgrid blob master doc migrating 0.4-Migration.md dgrid-04-1 .", "The dgrid comes up nicely but when I move the splitter between the left column and the leading column that the dgrid is within the dgrid does not properly resize .", "Is something simelar possible with dgrid dstore .", "Seems like it was changed to dgrid editor .", "there is grid.refreshCell in the latest dgrid version 1.0.0", "The myDGrid block contains a Dojo DGrid .", "I define a Rest DSTORE and a DGRID using it .", "Are you using the dgrid and claro css files", "Why add dojox grid s CSS to a dgrid example", "dgrid Grid is lightweight grid used to load data .", "How does dgrid handle stores for example json .", "I am very much new to dojo and dgrid .", "There is dgrid Grid : : edit cell method to start with .", ".. . .. . I am creating an ondemand grid using dojo s dgrid .", "I think these errors has to do with having dgrid inside layouts dgrid inside ContentPane inside AccordionContainer .", "I m trying to override the sort logic in dgrid as suggested by kfranqueiro in this link - https : github.com SitePen dgrid issues 276 .", "I went through this link github.com SitePen dgrid issues 1251 https : github.com SitePen dgrid issues 1251 .", "I have a dgrid tree used in my code and would like to display the tooltip for each cell in the dgrid .", "The dgrid will be filled from a REST service and I had the idea to not only fill the dgrid but also customize it with textbox buttons and checkbox .", "Here is my dgrid code : .. . .. . Is there a simple way to tell dgrid to draw from that subrow array", "Is there a way with either dGrid or GridX to accomplish this or is there a way to dynamically build tables grids using the Dojo store", "I have a dgrid version 1.10 that on startup sorts on two properties .", "I d like to create a PropertyGrid alike using dgrid and dojo .", "You are attempting to use Selector like a mixin as it exists in dgrid 0.4+ but ArcGIS includes dgrid 0.3 where it is not a mixin but a column plugin a concept which was retired in dgrid 0.4 .", "Dgrid 0.3 works best with Dojo store - Dgrid 0.4 works best with dstore .", "I am using dgrid http : dojofoundation.org packages dgrid and i am attempting to set the dataStore externally .", "Previously I had 1.7 installed with an old dgrid .", "Trying to use dgrid 0.4.0 to display a tree structure .", "My dgrid components were downloaded via Bower .", "I need dGrid to re-render the row .", "You seem to be trying to use dstore with dgrid 0.3 .", "But now the issue updating dgrid values persists... .", "I m using Dojo 1.10 dgrid and dstore .", "In the dgrid Selection.js module there s a function called fireSelectionEvent .", "I am using dgrid dstore and dojo 1.10 .", "Have you looked into using a the dgrid tree plugin", "we have a dgrid that uses compound columns .", "Where are dojo and dgrid located on your server", "Is there a simple way to update a specific dgrid cell", "However it adds the row at the end as the last row of the dgrid .", "I have a dgrid that has editable date fields .", "Is it possible to edit multiple cells of the dgrid at the same time", "We have created tree dgrid .", "The Using Grids and Stores http : dgrid.io tutorials 0.4 grids and stores tutorial was also updated for dgrid 0.4 and dstore .", "Here s a stripped down example : .. . .. . .. . console.clear .. . .. . require .. . packages : .. . .. . name : dgrid .. . location : cdn.rawgit.com SitePen dgrid v1.1.0 .. . .. . .. . name : dstore .. . location : cdn.rawgit.com SitePen dstore v1.1.1 .. . .. . .. . .. . dojo base declare .. . dojo keys .. . dojo on .. . .. . dgrid Editor .. . dgrid Keyboard .. . dgrid OnDemandGrid .. . dgrid Selection .. . .. . dijit WidgetBase .. . dijit TemplatedMixin .. . dijit FocusMixin .. . .. . dstore Memory .. . dstore Trackable .. . .. . dojo domReady", "The startup method is part of dojo widgets life-cycle .. . .. . .. . console.clear .. . .. . require .. . packages : .. . .. . name : dgrid .. . location : cdn.rawgit.com SitePen dgrid v1.1.0 .. . .. . .. . name : dstore .. . location : cdn.rawgit.com SitePen dstore v1.1.1 .. . .. . .. . .. . dojo base declare .. . dojo keys .. . dojo on .. . .. . dgrid Editor .. . dgrid Keyboard .. . dgrid OnDemandGrid .. . dgrid Selection .. . .. . dijit WidgetBase .. . dijit TemplatedMixin .. . dijit FocusMixin .. . .. . dstore Memory .. . dstore Trackable .. . .. . dojo domReady", "Then hit TAB . p .. . div id gridDiv div .. . body .. . html .. . .. . With a plain textbox : .. . .. . .. . console.clear .. . .. . require .. . packages : .. . .. . name : dgrid .. . location : cdn.rawgit.com SitePen dgrid v1.1.0 .. . .. . .. . name : dstore .. . location : cdn.rawgit.com SitePen dstore v1.1.1 .. . .. . .. . .. . dojo base declare .. . dojo keys .. . dojo on .. . .. . dgrid Editor .. . dgrid Keyboard .. . dgrid OnDemandGrid .. . dgrid Selection .. . .. . dstore Memory .. . dstore Trackable .. . .. . dojo domReady", "If you look at this dgrid.io js dgrid test extensions CompoundColumns.html http : dgrid.io js dgrid test extensions CompoundColumns.html the 3rd grid has both compoundcolumns and both ColumnHider and ColumnResizer with ColumnSet .", "Firstly I m using dojo 1.1.0 and dgrid 0.4.0 .", "Note the dgrid is also sitting within a dijit BorderContainer .", "I have dgrid set to 100 width in CSS .", "I m trying to get started with some grids using dgrid http : dgrid.io - 0.4 http : dgrid.io and having trouble getting them to talk to a store .", "dojo 1.10 - dstore - dgrid 0.4 -server based store is the Django Rest Framework which pulls from a MySQL database .", "In dgrid 0.3 the grid had a much more active role in managing the query state of the store - with dgrid 0.4 this is no longer the case hence the removal of the setQuery method .", "There is a demo https : github.com SitePen dgrid blob master demos dTuned dTuned.js L83 in dgrid dTuned which shows how to customize rendering .", "DOjo Dgrid Sellect All functionality http : dgrid.io js dgrid test Selector.html .. . .. . Please help me to resolve this issue Thanks in advance .", "I m working on a small project in which I will work with dgrid dojo the dgrid must be customized according to the profile of the person if he s administrator or simple user .", "What I did with YUI that I cannot figure out how to do with dgrid is to tell it to use the contents of the visitors array to populate the dgrid .", "UPDATE 6.17.15 - Changing server-side settings to match dojo dgrid parameters -", "My problem is that when dgrid is first loaded it is calling rest service twice .", "I place dgrid table into widget but grid overlapped my toolbar .", "Also I was able to remove the borders with .claro .dgrid-cell border : none", "We are using dojo dgrid for tables in our web app .", "Are you sure you re looking at the tutorial for the same version of dgrid you re using", "I ve got a dgrid with headings that will not appear unless I resize the browser window .", "So my problem was : I programmatically add dgrid into dijit layout ContentPane .", "It didn t show dgrid unti I resize browsers window .", "Also included a workaround the text selection bug in older version of dgrid .", "I have not found any examples of how to do it with the dgrid .", "When the dgrid loads it queries the server component without a Range header and the server component returns a default range of data .", "i have this as my dgrid constructor .. . .. . and the partial config opts are .. . .. . .", "I m trying to get dgrid to work with JsonRest .", "Then dgrid queries again with Range : items 0-24 .", "I am using dgrid Grid and dstore RequestMemory for creating grid and storing data .", "Im using dgrid 0.4 and dstore 0.4 but maybe the tutorial is based on a older version .", "Own resarch : .. . .. . Dgrid tutorial stands on the fact that all depends on the dojo-store .", "I used an older version of dgrid onDemandGrid toghether with a dojo JsonRestStore .", "Are there any docs on what interface that dgrid expects to see for editor widgets", "For starters it doesn t make any sense for Editor is that dgrid editor", "If I create the dgrid to view itself in a normal div it works .", "Yeah either the doc is wrong or the dgrid code has a bug.. .", "Well dgrid 0.4 wouldn t attempt to call the store s query method .", "I have an AccordionContainer and in each ContentPane of it I place a dgrid .", "I have no way to catch the update event on dstore dgrid... .", "In the fiddle and in the actual project the dgrid-datachange didn t work for me ." ] }
{ "confidence": [ 57.64451599121094, 57.59234619140625, 57.08488464355469, 51.82679748535156, 50.45185089111328, 50.167640686035156, 49.391788482666016, 49.028114318847656, 49.01548385620117, 48.90630340576172, 48.37334442138672, 48.32744216918945, 48.27928161621094, 48.24979782104492, 47.84213638305664, 47.530426025390625, 47.481475830078125, 47.47544860839844, 47.417152404785156, 47.391075134277344 ], "content": [ "Question : I am working on application that requires Dojo grids to be used but I want to write the HTML for the table layout myself and use Dojo to insert the store data . Is there a way with either dGrid or GridX to accomplish this or is there a way to dynamically build tables grids using the Dojo store .. . Answer : If you re asking if dgrid or gridx can literally just shove data into an existing table element in-place the answer is no . You could do that directly with a dojo store by calling the query method and adding a row for each result . Here s the general idea : .. . .. . The closest you can get to this idea with dgrid is dgrid GridFromHtml https : github.com SitePen dgrid blob v0.3.16 doc components core-components GridFromHtml.md which will let you define the grid s structure using a table with thead and header cells . Combine that with OnDemandGrid https : github.com SitePen dgrid blob v0.3.16 doc components core-components OnDemandList-and-OnDemandGrid.md or Pagination https : github.com SitePen dgrid blob v0.3.16 doc components extensions Pagination.md for store support . As far as I know gridx does not have something similar to this at all .", "Question : I m trying to get started with some grids using dgrid http : dgrid.io - 0.4 http : dgrid.io and having trouble getting them to talk to a store . My project already uses dstore http : dstorejs.io - 1.1 https : github.com SitePen dstore releases tag v1.1.0 and I was hoping to wire it up to this however bower informs me that it wants 1.0.x as a dependency . I don t know if my woes are through some other ineptitude or because it really does need the older version . Should it work ever with the current dstore release .. . Answer : At the time dgrid 0.4 was released 1.0 was listed as its dstore dependency in bower.json to safeguard against any potential breaking changes in 1.1+ . However in our testing with dgrid 0.4 and dstore 1.1 it should be safe to use and we ll be updating the dependency listed in dgrid s bower.json for future releases . If bower presents you with a conflict it should give you the option of choosing between the dependency dgrid lists or the other dependency you want 1.1.0 . It should be safe to choose the latter . You can also store this decision in your bower.json with the resolutions property https : github.com bower bower.json-spec resolutions .", "Question : I m a new developer and im trying the framework Dojo-Toolkit and especially d-grid . So i follow the tutorial http : dgrid.io tutorials 1.0 hello dgrid here is my index : .. . .. . So when i run on localhost DOJO index.html i get this error : .. . .. . http : localhost DOJO dgrid Grid.js Failed to load resource : the server responded with a status of 404 Not Found .. . .. . I dont understand why it search on this location .. . and also i get 2 : .. . .. . Error : scriptError .. . .. . If someone can tell me how that work that ll be lovely : Comment : Where are dojo and dgrid located on your server Did you follow dgrid s installation instructions https : github.com SitePen dgrid installation Also if you re defining dojoConfig in dojoconfig.js that needs to be loaded before dojo.js . Comment : They are located at C : wamp www DOJO and C : wamp www DOJO what should i have on my dojoconfig.js i replace it before dojo.js btw thanks Comment : If I m interpreting you correctly then you have www DOJO dojo and www DOJO dgrid but the 404 you re getting would suggest that your dgrid folder isn t at that location . If your dojo and dgrid packages are siblings that should just work.. . Comment : Thank you : so yes i did not have the right directory structure on my server ...rookie mistake .. . Answer : Even if the problem seems solved hope this answer will clarify Ken s comments . Your code require a dgrid Grid module the same way it require the dojo domReady .. . .. . so your dgrid folder have to be at the same level as your dojo folder . DOJO .. . .. . app .. . dgrid .. . dijit .. . dojo .. . dojox .. . .. . In your dojoConfig.js you should have a line like :", "Question : null .. . Answer : when I double click on dgrid cells for edit and want to set the max length of element where characters are entered . Below is My dgrid : .. . .. . and again below is how columns and editor args are creating : .. . .. . Now I want to set max length of my editors also when in browser when we inspects the dgrid cells we get the div not any html element Thanks in edvance", "Question : I m trying to extend modify an example from the dojo website but running into an error with Firebug and don t know why . This is the original tutorial which runs properly on my local server : http : dojotoolkit.org documentation tutorials 1.6 realtime stores demo demo.html .. . .. . Now I m trying to add a RequestMemory store : .. . .. . .. . following as in the original example . After inserting the RequestMemory Store I m getting the following error : .. . .. . Why Comment : What is marketStore where is this line Comment : It is definied in the original tutorial : dojotoolkit.org documentation tutorials 1.6 realtime stores http : dojotoolkit.org documentation tutorials 1.6 realtime stores demo demo.html . I ve just added the code to a external store RequestMemory .. . Answer : You seem to be trying to use dstore with dgrid 0.3 . That isn t going to work and is why you re getting that error dgrid is trying to call the dojo store query API which doesn t exist in dstore . dgrid switched to dstore in 0.4 . You have 3 options : .. . .. . Use dgrid 0.4 with dstore .. . Use dgrid 0.3 with dstore using DstoreAdapter https : github.com SitePen dstore blob v1.0.2 docs Adapters.md dstoreadapter to convert the store to the dojo store API .. . Use the original RequestMemory store from dojo-smore https : github.com kfranqueiro dojo-smore which is based on the dojo store API instead .. . .. . EDIT : Based on reading more into the question and the related tutorial it s evident that perhaps the call to query isn t coming from dgrid but rather from code that was copy-pasted from the tutorial which wasn t included in the question above . Given that the tutorial in question uses dojo store but dgrid 0.4 uses dstore you won t be able to simply copy-paste the information there but dgrid 0.4 has a store tutorial http : dgrid.io tutorials 0.4 grids and stores and dstore has tutorials http : dstorejs.io tutorials of its own including its own version of the realtime stores tutorial . Comment : Im using dgrid 0.4 and dstore 0.4 but maybe the tutorial is based on a older version . I think this is confusing with this versions and moduls . I will try it again asap . thank you Comment : Well dgrid 0.4 wouldn t attempt to call the store s query method . If you were copying that tutorial s source verbatim then yes you d be calling the wrong methods since that tutorial uses dojo store . You might want to look at the dgrid 0.4 stores tutorial http : dgrid.io tutorials 0.4 grids and stores and dstore s tutorials http : dstorejs.io tutorials instead .", "Question : I m trying to get dgrid to work with JsonRest . I ve implemented a Perl based server-side component that issues the JSON data back . The response data looks like this : .. . .. . Each of those hash rows is within an array . When the dgrid loads it queries the server component without a Range header and the server component returns a default range of data . Then dgrid queries again with Range : items 0-24 . In response the server provides entries 1-25 in the format listed and with the response header Content-Range : items 0-24 470 . The problem emerges when the dgrid requests the next 40 items . It requests Range : items 23-63 and the server successfully fulfills the request I can see it using the WebKit developer tools which show the data has been retrieved . However when I scroll through the dgrid itself I see rows 1-25 and then it jumps to row 40 . If I keep scrolling it continues to work towards loading all 470 entries but the grid starts shifting around and the rows get dramatically out of order for example the grid starts with row 8 and row 1 shows up after row 75 . I thought it was perhaps because my JSON data didn t include a definitely unique ID so I added one id with the idProperty setting . No go . I also tried adding 10 rows of overlap to see if that would help but that seemed to only make things worse . Here s my Dojo code : .. . Answer : As it turns out I had a typo in my JSON data . I had it output id : in the JSON rather than id and that was preventing the grid from seeing it as the unique id . Apparently dgrid does require a unique id to work and it seems to be working happily now that a unique ID is being provided .", "Question : I am using dgrid Grid and dstore RequestMemory for creating grid and storing data . Now I want to filter data according to values in the fields see img . I am not sure how to filter data when using simple Dgrid and dstore . Dgrid Page http : i.stack.imgur.com X2yTe.png Any help would be appreciated or suggest if I use some diffrent store or grid . Comment : It looks like you have the beginning of the idea here already and just need to put multiple filters together . If you haven t seen dstore s Filtering docs https : github.com SitePen dstore blob 1.1 docs Collection.md filtering yet they might help . .. . Answer : I got the solution for my question . On filter button click I have written all my filtering logic and the final store will set to dgrid :", "Question : null .. . Answer : New to DOJO and DGRID but this isn t a coding issue it s a method of doing things that I need help with.. . I m using an OnDemandGrid and a RequestMemory store object and the current retrieve is set to 250 records.. . I would like to retrieve another 250 records when I get to the bottom of the grid and cache it adding it to the collection I have . I m wondering about the proper way to go about this or if dgrid isn t my answer .. . I d like to listen and when the scroll hits the bottom retrieve more data . I haven t been able to find any documentation on events on the dgrid store other than dgrid-refresh-complete and dgrid-error. . Is there any others Should I just use the native onscroll event Any advice would be appreciated .", "Question : null .. . Answer : So here is my code : .. . .. . What is wrong with this code Previously I had 1.7 installed with an old dgrid . I just updated everything . What is broken now I can t see anything.. . I have some declarative dojo code as well : Comment : What s the error message you got And btw you have trailing commas in your column definition . Comment : Unfortunately I got no error message . Yep thanks for pointing that out I have to check it without the commas.. . Comment : For starters it doesn t make any sense for Editor is that dgrid editor can t tell without the require define call and ObjectStore to be in the inheritance chain of a dgrid extension so start by taking those out.. . honestly I wouldn t expect that to work regardless of Dojo or dgrid version . Comment : Hi Ken Yes that was dgrid Editor . Seems like it was changed to dgrid editor . I have to modify someone else s code and he used an old dgrid and in that one the first letter of Editor was capitalized . I had no idea about that . : I tried to debug the rest of the code as well and noticed that something should be with the assigment of the dgrid to the ContentPane . If I create the dgrid to view itself in a normal div it works . I will submit the rest of the code later .", "Question : I have tried implementing a class for a grid-layout using dgrid using their sample but I get this error when loading my grid subRows is undefined . My code looks something like this : .. . .. . And calling creating it like this .. . Answer : Place your constructor code into postCreate method : .. . .. . Also note dgrid is not dijit to minimize its dependencies and therefore it has not placeAt method . You have two options here : .. . .. . 1 . Provide DOM node or id string of a placeholder to the contructor as a 2nd parameter : .. . .. . var gridLayout new GridLayout placeholder .. . .. . .. . 2 . Make dgrid to be a dijit via subclassing dijit WidgetBase to use gridLayout.placeAt placeholder : .. . .. . declare WidgetBase Grid Keyboard Selection Comment : what is the difference between a constructor and a postCreate method.. . and even postMixInPropertie . Looks like from what I have read postCreate handles the last minute changes on a widget a constructor gets sets attributes parameters so most of the time using mixin . What about postMixInPropertie Set again last minute change properties on the widget before rendering. . I m kind of confuse . Comment : How does dgrid handle stores for example json . I tried something with JsonRest and ObjectStore but I m kind of confuse on what this.renderArray does for store looking at documentation .. . I bet I can just scracth that .", "Question : I used an older version of dgrid onDemandGrid toghether with a dojo JsonRestStore . My web page has some input fields e.g . date name etc . After changing one of these fields I change the query of the grid : .. . .. . grid.setQuery y : year m : month l : name1 d : flag e : name2 .. . .. . and the Json request was somthing like y 2015 m 5 l test1 ... . .. . .. . I learned that with the actual version of dgrid this isn t longer possible . Is something simelar possible with dgrid dstore . Filtering seems not to be an option as far as I understood this is only on client-side and I m not able to load all my data . What I need are some dynamic parameters to filter the data on the server . .. . Answer : dstore s equivalent to dojo store JsonRest is dstore Rest however if you don t have a compliant REST API on the server you may want to use dstore Request . dstore s filter method allows you to make arbitrary queries . It returns a collection with any applied filters stored so that they can be included whenever fetch or fetchRange is called . would result in the following HTTP request : .. . .. . To use this functionality with dgrid 0.4 you would assign the filtered collection to the grid instance and dgrid will handle calling fetch fetchRange as necessary : .. . .. . dgrid 0.4 and dstore introduce a significant shift in the way the grid interacts with the store . In dgrid 0.3 the grid had a much more active role in managing the query state of the store - with dgrid 0.4 this is no longer the case hence the removal of the setQuery method . In dgrid 0.4 it is up to code external to the grid to implement logic related to filtering store data . Whereas in dgrid 0.3 you typically set the grid s store property a single time and call setQuery whenever you need to filter the data with dgrid 0.4 you set the collection property any time you need to update the filtering . dstore s Request https : github.com SitePen dstore blob master docs Stores.md request store allows you to configure the parameter names for range and sort filtering .", "Question : I m working on a small project in which I will work with dgrid dojo the dgrid must be customized according to the profile of the person if he s administrator or simple user . The dgrid will be filled from a REST service and I had the idea to not only fill the dgrid but also customize it with textbox buttons and checkbox . For example here is the code of a dgrid with 2 columns whose fields can not be changed : .. . .. . the service must verify if the person is an administrator and if so send in JSON Format the settings to add more features to dgrid by changing columns with : .. . .. . I want to send this configuration code in json format . I want to know if this is workable and if so how Thank you .. . Answer : I m not sure regarding Dojo . But if you want to convert a JS Object to JSON then simply : Comment : I presume the question is more focused around the fact that functions aren t a thing in JSON . Comment : I believe that the parameterization of the grid is not an object", "Question : I have defined dgrid and a button for removing row : .. . .. . .. . DOCTYPE html .. . html .. . head .. . meta charset utf-8 .. . link rel stylesheet href http : cdn.rawgit.com SitePen dgrid v1.1.0 css dgrid.css media screen .. . head .. . body class claro .. . .. . .. . div id container div .. . button id remove Remove button .. . .. . script type text javascript .. . var dojoConfig .. . async : true .. . packages : .. . name : dgrid location : cdn.rawgit.com SitePen dgrid v1.1.0 .. . name : dstore location : cdn.rawgit.com SitePen dstore v1.1.1 .. . .. . .. . script .. . script src ajax.googleapis.com ajax libs dojo 1.10.4 dojo dojo.js script .. . script type text javascript .. . require .. . dojo base declare .. . dojo on .. . dojo dom .. . dstore Memory .. . dstore Trackable .. . dstore SimpleQuery .. . dgrid Grid .. . dgrid extensions Pagination .. . dgrid extensions DijitRegistry .. . dojo domReady .. . function declare on dom Memory Trackable SimpleQuery Grid Pagination DijitRegistry .. . var data .. . for var i 1 i 500 i++ .. . data.push id : i name : Name +i value : i .. . .. . .. . var Store declare Memory SimpleQuery Trackable .. . var myStore new Store data : data .. . .. . var MyGrid declare Grid Pagination .. . var grid new MyGrid .. . collection : myStore .. . columns : .. . id : Id .. . name : Name .. . value : Value .. . .. . className : dgrid-autoheight .. . showLoadingMessage : false .. . noDataMessage : No data found . container .. . grid.startup .. . on dom.byId remove click function .. . myStore.remove 10 .. . .. . .. . script .. . body .. . html .. . .. . The dgrid shows up you can sort it edit name or value . The problem is that when you click on the remove button row is deleted but then at the end of the gird is 9x written : No data found and the dgrid stops to work you cant delete any other row . If you set showLoadingMessage : to true then everything works without a problem . Edit : I have simplified the example . Problem persists . .. . Answer : The grid may have been encountering error while updating the row data after the row has been removed . As the editor tries to update the row after the button loses focus . Try using the grid.removeRow method to remove the row . It might still encounter some other issues but worth a try . Editor might not be the best solution to achieve what your are trying to do . User renderCell to add button to the grid to remove the row record . This might be a better solution . Update : Just refresh the grid that should solve the problem . DOCTYPE html .. . html .. . head .. . meta charset utf-8 .. . link rel stylesheet href http : cdn.rawgit.com SitePen dgrid v1.1.0 css dgrid.css media screen .. . head .. . body class claro .. . .. . .. . div id container div .. . button id remove Remove button .. . .. . script type text javascript .. . var dojoConfig .. . async : true .. . packages : .. . name : dgrid location : cdn.rawgit.com SitePen dgrid v1.1.0 .. . name : dstore location : cdn.rawgit.com SitePen dstore v1.1.1 .. . .. . .. . script .. . script src ajax.googleapis.com ajax libs dojo 1.10.4 dojo dojo.js script .. . script type text javascript .. . require .. . dojo base declare .. . dojo on .. . dojo dom .. . dstore Memory .. . dstore Trackable .. . dstore SimpleQuery .. . dgrid Grid .. . dgrid extensions Pagination .. . dgrid extensions DijitRegistry .. . dojo domReady .. . function declare on dom Memory Trackable SimpleQuery Grid Pagination DijitRegistry .. . var data .. . for var i 1 i 500 i++ .. . data.push id : i name : Name +i value : i .. . .. . .. . var Store declare Memory SimpleQuery Trackable .. . var myStore new Store data : data .. . .. . var MyGrid declare Grid Pagination .. . var grid new MyGrid .. . collection : myStore .. . columns : .. . id : Id .. . name : Name .. . value : Value .. . .. . className : dgrid-autoheight .. . showLoadingMessage : false .. . noDataMessage : No data found . container .. . grid.startup .. . on dom.byId remove click function .. . myStore.remove 10 .. . grid.refresh .. . .. . .. . script .. . body .. . html Comment : Unfortunatelly I cant use this . First If I use Editor and change value by it the result is again meny No data found results . Also store should be independent on the grid so when I use store . remove I shoud not know about grid . And the third problem is that I want to use async store instead of memory so this solution would means that the grid will refresh before the results is returned and rendered . And It also blinks with the Editor like If I used showLoadingMessage : true . : Comment : In that case you need to use OnDemandGrid instead of just Grid . dgrid Grid is lightweight grid used to load data . It does not have functionality to update itself . you would need to refresh it if you updated the data within the store . I have tested it jsbin.com neyemujeza edit html output http : jsbin.com neyemujeza edit html output however the showLoadingMessage must be set to true . for some reason its messed up when you set it to false . I shall investigate it later . Comment : According to the documentation you should not use OnDemandGird and Pagination together . With showLoadingMessage : true my example works so I do not need OnDemandGrid anyway . But I do not want to use showLoadingMessage : true because then every change in the store causes blinking the grid especially if you do not use Memory but some kind of Rest store .", "Question : As you know dgrid 0.4 now uses the dstore package instead of dojo s store . Using the Rest.js in dstore I simply want to add a new row to the dgrid using a rest call . This works fine . However it adds the row at the end as the last row of the dgrid . I need to add the row at the beginning making the newly added row the first row of the dgrid . Inside Rest.js there is a variable called defaultNewToStart which I figured would do the trick but even when set to true dgrid still adds the row at the end . Any advice on how to get Rest.js in dstore to add a row to the beginning of the dgrid . Comment : Can you show your code particularly how you are creating your store and grid so we can see if there might be a commonly-overlooked mistake Comment : Yeah it turns out I made a basic mistake that I bet someone would have caught . I m never posting another question without relevant code again . .. . Answer : I figured out what I did wrong . In dgrid OnDemandGrid I set the property sort which was causing the queryExecutor in Trackable.js to put the newly added row at the end instead of the beginning . So all I had to do was remove the sort property and now it works fine . Comment : In your defense this is not quite as common of a mistake as I suspected and is a good one to note for future reference so thanks for reporting on the results .", "Question : I m working on a small project in which I will work with dgrid dojo the dgrid must be customized according to the profile of the person if he s administrator or simple user . The dgrid will be filled from a REST service and I had the idea to not only fill the dgrid but also customize it with textbox buttons and checkbox . For example here is the code of a dgrid with 2 columns whose fields can not be changed : .. . .. . the service must verify if the person is an administrator and if so send in JSON Format the settings to add more features to dgrid by changing columns with : .. . .. . I want to send this configuration code in json format . I want to know if this is workable and if so how Thank you .. . Answer : Since functions aren t a valid part of JSON you d need to do some amount of processing to go between JSON and dgrid column plugins . For example in the case of editor you could just test each object for presence of the editor property and if found apply the editor function around it when you actually create the column structure from your JSON . Comment : I thought for this solution but I wonder if there will be no worries security side in so doing Comment : There shouldn t be any more risk than without invoking a column plugin . So long as you re still using JSON.parse up-front of course which dojo request with handleAs : json will try to do if possible via dojo json .", "Question : I ve got a dgrid with headings that will not appear unless I resize the browser window . As soon as I resize the browser window the headings appear . How can I get the headings to show up without resizing the browser Am I not calling startup correctly Is there an event I can fire to make the dgrid think the browser has been resized .. . Answer : Just solved issue . So my problem was : I programmatically add dgrid into dijit layout ContentPane . Across other browsers its work fine except IE 6 . It didn t show dgrid unti I resize browsers window . I have used many solutions from the StackOverflow and other sites . Until I didn t replace css rule for my grid found in one Stacks solution . Somewhere I found the next css rule : .. . .. . Its ok but not in IE6 . I was changed to : .. . .. . And its ok now across all my testing browsers . Hope I help you : Totally adding working dgrid Dojo 1.9 : .. . .. . Also I removed CSS for my centerPanel with width height declarations . CU .", "Question : null .. . Answer : I m trying to render the dgrid without the vertical scrollbar showing up but for some reason it always renders larger than the space it s in . When the grid loads it renders at 400x300 even though the space is only 300x200 which then causes vertical-scrolling . How do I prevent that addGrid : function .. . this.grid declare OnDemandGrid Selection .. . id : tgrid + this.reportId .. . loadingMessage : Loading data.. . .. . noDataMessage : No results found . .. . allowTextSelection : true .. . scroller : true .. . collection : new Memory .. . idProperty : id .. . .. . columns : .. . trackName : Name .. . urn : .. . label : URN .. . renderCell : function object value cell .. . if typeof value undefined .. . cell.bgColor red .. . else .. . cell.innerHTML value .. . .. . .. . .. . location : Location .. . affiliation : Affiliation .. . eta : ETA .. . lta : LTA .. . .. . this.gridId .. . next get the tracks using this call .. . this.getTracks .. . .. . .. . .. . .dgrid .. . height : auto .. . .. . .. . .dgrid-row .. . padding : 3px 0 2px 9px .. . .. . .. . .dgrid-scroller .. . position : relative .. . overflow : auto .. . max-height : 95 .. . Comment : Are you using the dgrid and claro css files If so can you point to an example maybe a fiddle where this is happening Comment : Yes as well as a few others . Unfortunately there are too many moving parts to post on fiddle . link rel stylesheet href dojoContextRoot dijit themes claro claro.css media screen link rel stylesheet href dojoContextRoot dojox grid resources Grid.css link rel stylesheet href dojoContextRoot dojox grid resources claroGrid.css link rel stylesheet href dojoContextRoot dojox widget Toaster Toaster.css link rel stylesheet href dojoContextRoot dojox layout resources ExpandoPane.css Comment : Why add dojox grid s CSS to a dgrid example See this fiddle http : jsfiddle.net devpaul 3bxsxpvm for a possible starting point to create a runnable dgrid example . If you re using 0.4 update dgrid s version and add dstore to packages .", "Question : null .. . Answer : I m having troubles getting a custom widget inherits from WidgetBase TemplatedMixin FocusMixin to work properly as an editor widget with dgrid . Are there any docs on what interface that dgrid expects to see for editor widgets Specifically I m having troubles managing the focus between columns . When I edit a widget in one column and try to move to another column the editor widget in the new column does not focus . Here s a stripped down example : .. . .. . .. . console.clear .. . .. . require .. . packages : .. . .. . name : dgrid .. . location : cdn.rawgit.com SitePen dgrid v1.1.0 .. . .. . .. . name : dstore .. . location : cdn.rawgit.com SitePen dstore v1.1.1 .. . .. . .. . .. . dojo base declare .. . dojo keys .. . dojo on .. . .. . dgrid Editor .. . dgrid Keyboard .. . dgrid OnDemandGrid .. . dgrid Selection .. . .. . dijit WidgetBase .. . dijit TemplatedMixin .. . dijit FocusMixin .. . .. . dstore Memory .. . dstore Trackable .. . .. . dojo domReady function .. . declare .. . keys .. . on .. . .. . Editor .. . Keyboard .. . OnDemandGrid .. . Selection .. . .. . WidgetBase .. . TemplatedMixin .. . FocusMixin .. . .. . Memory .. . Trackable .. . .. . var EditWidget declare WidgetBase TemplatedMixin FocusMixin .. . templateString : div input data-dojo-attach-point textBox type text div .. . focus : function .. . this.textBox.focus .. . .. . getValueAttr : function .. . return this.textBox.value .. . .. . setValueAttr : function newValue .. . this.textBox.value newValue .. . .. . postCreate : function .. . var that this .. . .. . on this.textBox blur function .. . that.emit blur .. . .. . .. . this.inherited arguments .. . .. . .. . .. . .. . var grid new declare OnDemandGrid Keyboard Selection Editor .. . selectionMode : single .. . noDataMessage : no data .. . columns : field : ID sortable : false .. . autoSave : true .. . field : LENGTH .. . editor : EditWidget .. . sortable : false .. . editOn : dgrid-cellfocusin .. . .. . autoSave : true .. . field : WEIGHT .. . editor : EditWidget .. . sortable : false .. . editOn : dgrid-cellfocusin .. . .. . autoSave : true .. . field : HEIGHT .. . editor : EditWidget .. . sortable : false .. . editOn : dgrid-cellfocusin .. . .. . deselectOnRefresh : false .. . document.getElementById gridDiv .. . .. . var store new declare Trackable Memory .. . data : ID : 1 LENGTH : WEIGHT : HEIGHT : .. . ID : 2 LENGTH : WEIGHT : HEIGHT : .. . ID : 3 LENGTH : WEIGHT : HEIGHT : .. . idProperty : ID .. . .. . .. . grid.set collection store .. . grid.startup .. . .. . var onGridKeydown function e .. . var modifierKeys .. . keys.TAB .. . keys.LEFT ARROW .. . keys.UP ARROW .. . keys.RIGHT ARROW .. . keys.DOWN ARROW .. . .. . .. . var advance function .. . Keyboard.moveFocusRight.call grid e .. . .. . var retreat function .. . Keyboard.moveFocusLeft.call grid e .. . .. . .. . if modifierKeys.indexOf e.keyCode -1 .. . switch e.keyCode .. . case keys.TAB : .. . if e.shiftKey .. . advance .. . else .. . retreat .. . .. . break .. . case keys.LEFT ARROW : .. . retreat .. . break .. . case keys.RIGHT ARROW : .. . advance .. . break .. . case keys.UP ARROW : .. . Keyboard.moveFocusUp.call grid e .. . break .. . case keys.DOWN ARROW : .. . Keyboard.moveFocusDown.call grid e .. . break .. . .. . .. . .. . .. . grid.on keydown onGridKeydown .. . .. . .. . .. . .dgrid .. . height : 300px .. . .. . .dgrid-row .. . height : 25px .. . .. . .. . .. . DOCTYPE html .. . html .. . head .. . meta charset utf-8 .. . meta name viewport content width device-width .. . title Custom dgrid editor widget title .. . script src ajax.googleapis.com ajax libs dojo 1.11.2 dojo dojo.js script .. . link rel stylesheet href cdn.rawgit.com SitePen dgrid v1.1.0 css dgrid.css .. . head .. . body .. . p Click in a cell in the LENGTH column and type in a character . Then hit TAB . Why doesn t the next cell s textbox focus p .. . div id gridDiv div .. . body .. . html .. . .. . Thanks in advance for any advice .", "Question : I have a dgrid within a BorderContainer with liveSplitters enabled using Dojo 1.8 . The dgrid comes up nicely but when I move the splitter between the left column and the leading column that the dgrid is within the dgrid does not properly resize . However if I resize the window a tad then the dgrid snaps back into a proper size i.e . filling 100 of the leading pane of the BorderContainer . I have dgrid set to 100 width in CSS . Is there some way I need to tell dgrid to refresh its size after the splitter moves .. . Answer : As noted in the comments to @phusick s answer Dgrid resizes properly if I use the DijitRegistry mixin . I had some other resizing problems too but they had to do with having a set relative width on the element in my css e.g . 100 . If I remove the size which wasn t required by ContentPanel anyway all elements resize OK . The CSS had been carried over from Dojo 1.5 which apparently did not react the same way to a ContentPanel having a size set in the CSS . Comment : Could you post a code smaple of what fixed the problem Comment : It would be nice if you elaborated a bit more than if I use the DijitRegistry mixin . As Simon suggested a code sample would be helpful .", "Question : I have a dgrid within a BorderContainer with liveSplitters enabled using Dojo 1.8 . The dgrid comes up nicely but when I move the splitter between the left column and the leading column that the dgrid is within the dgrid does not properly resize . However if I resize the window a tad then the dgrid snaps back into a proper size i.e . filling 100 of the leading pane of the BorderContainer . I have dgrid set to 100 width in CSS . Is there some way I need to tell dgrid to refresh its size after the splitter moves .. . Answer : Look at this example I wrote answering another dgrid related question : http : jsfiddle.net phusick VjJBT .. . .. . The CSS rule you are looking for is : .. . .. . EDIT : I thought it might have been a problem of dgrid version so I updated my dgrid to the latest version 0.3.3 and created a test for the issue of yours : http : jsfiddle.net phusick 5mHTS . Well it was not the issue of versions and both 0.3.1 and 0.3.3 works fine when resizing BorderContainer but only in Chrome and Firefox . I reproduced the issue in IE9 and Opera 12.10 : .. . .. . enter image description here http : i.stack.imgur.com 1aEox.png .. . .. . The grid needs to invoke grid.resize to resize properly which does not happen in IE9 Opera when resizing BorderContainer but happens always when you resize the window . DijitRegistry fixes the issue because layout components like BorderContainer and ContentPane call resize on all their dijit children when resized . So either subclass DijitRegistry or dojo aspect listen for resize on parent ContentPane of the grid and invoke grid : : resize : Comment : Thanks for the tip @phusick . I added that but the problem seems to have remained . When I look at Chrome s inspector view of the code in your JSFiddle sample I notice that the dgrid-header class row does not have a set width . However in my code Dojo seems to add a style width : XXXpx to that div tag-it is not hardcoded by me . When the window resizes this fixed width is updated but when the splitter is moved the fixed width is not updated . Any idea why it is setting a fixed width Comment : Actually as I look Dijit or dojo.parser is adding these fixed styles all over the page . And they don t properly resize all the time . Is there some general setting I need to set If I use important on .dgrid-header-row in my CSS I can override the fixed width inline style but these feels like a hack . Comment : To keep replying to myself it seems that if I tell dgrid to mix in DijitRegistry it works better though I m unclear why your example didn t mix it in and worked OK -- thoughts . However my headline ContentPanel doesn t dynamically resize to the page width once dgrid is rendered and I can t figure out why . Any suggestions" ] }
[ "yes-answer-long", "yes-answer-short" ]
dojo
UNK_RELATION
teamcity-7.1@continuous-integration@75
teamcity-7 .1 -- version 7.1 of teamcity a java-based build management and @placeholder server from jetbrains .
{ "confidence": [ 48.378597259521484, 47.21662139892578, 47.081817626953125, 46.34064483642578, 45.25958251953125, 45.11661148071289, 44.677913665771484, 44.048057556152344, 44.048057556152344, 44.048057556152344, 43.98114776611328, 43.6013298034668, 43.40824890136719, 42.95634841918945, 42.431304931640625, 41.83705139160156, 41.538612365722656, 41.065269470214844, 40.94261169433594, 40.94261169433594, 40.94261169433594, 40.52484893798828, 40.15721130371094, 40.121498107910156, 40.066680908203125, 40.066680908203125, 40.066680908203125, 39.92071533203125, 39.405548095703125, 39.26673126220703, 39.26673126220703, 39.24397277832031, 39.23701095581055, 39.071956634521484, 39.054443359375, 38.863922119140625, 38.76152038574219, 38.670345306396484, 38.609031677246094, 38.42246627807617, 38.262367248535156, 38.262367248535156, 37.900291442871094, 37.83563995361328, 37.83563995361328, 37.56113052368164, 37.433616638183594, 37.19280242919922, 37.19280242919922, 37.10982894897461, 36.878089904785156, 36.82929229736328, 36.75959777832031, 36.75959777832031, 36.556766510009766, 36.556766510009766, 36.556766510009766, 36.40216064453125, 36.31783676147461, 36.0966796875, 36.08123779296875, 36.005393981933594, 35.98943328857422, 35.818321228027344, 35.818321228027344, 35.818321228027344, 35.818321228027344, 35.818321228027344, 35.818321228027344, 35.818321228027344, 35.818321228027344, 35.818321228027344, 35.818321228027344, 35.818321228027344, 35.818321228027344, 35.818321228027344, 35.818321228027344, 35.818321228027344, 35.72684860229492, 35.600074768066406, 35.44129180908203, 35.341068267822266, 35.29655456542969, 35.26240539550781, 35.26240539550781, 35.05399703979492, 35.05399703979492, 35.05399703979492, 34.821048736572266, 34.821048736572266, 34.5255126953125, 34.51255798339844, 34.51255798339844, 34.51255798339844, 34.37563705444336, 34.19950485229492, 34.19950485229492, 34.19950485229492, 34.19950485229492, 34.19950485229492 ], "content": [ "Teamcity version is TeamCity Enterprise 7.1.2 build 24170 .. . .. . Thanks .", "I have Teamcity 7.1 and around 1000 tests .", "Luke .. . .. . The snippet from the updated question had a link in the original pointing to the instructions on Java update for TeamCity server http : confluence.jetbrains.com display TCD8 Installing+and+Configuring+the+TeamCity+Server InstallingandConfiguringtheTeamCityServer-java in TeamCity online doc .", "How to get the changes of a teamcity build", "UPDATE : After upgrading to TeamCity 7.1 the problem still exists .", "Using 64 bit Java to Run TeamCity Server TeamCity can run under both 32 and 64 bit JVM .", "We use TeamCity 7.1 for continuous-integration and we produce build logs and artifacts for each build .", "Is there a way to do this via TeamCity build configuration", "I am trying to create a Build Configuration in TeamCity .", "Go to your build configuration in the TeamCity UI .. . 2 .", "This is by design feature in TeamCity .", "Basically the instructions vary based on the TeamCity distribution used and way of launching the server .", "I have the same TeamCity version as yours .", "My Teamcity version is 7.1.5 build 24400 .. . .. . Anyone know how to recover from this failure", "I m trying to integrate my UI testing for iOS app-code in Java using Appium 0.16 into TeamCity 7.1 for automation but I get a MalformedUrlException on TeamCity build log .", "Renaming the old TeamCity jre folder and replacing it with a copy from a newly-installed JRE folder worked and was the process JetBrains recommends .", "I m trying to run my karma version v0.10.2 unit tests on teamcity version 7.1 . .. . .. . When I run karma start --reporters teamcity --single-run I get the following error : .. . .. . I have installed the karma-teamcity-reporter module but that hasn t helped .", "In teamcity 7 its simply vcsroot.branch that returns develop .", "How do developers reproduce a local build when the dependencies are defined in TeamCity", "Is there a way to fetch the dependencies of a TeamCity build to update the dependencies locally", "I have a TeamCity build which uses msbuildbootstrap to run msbuild .", "I want to build my .net application in teamcity using new version of the framework .", "I have added StyleCop Plugin at following path C : ProgramData JetBrains TeamCity plugins and re-started the Team City Server I got StyleCop option in the build runner .", "TeamCity has support for server-side and agent-side source control checkout .", "I am using TeamCity v7.1", "Currently TeamCity does not support this feature .", "Howerever in Teamcity it will be shown as deleted and added .", "We have teamCity on it s own internal build-server and TFS on another internal Build server .", "Our co-op posted to the jetbrains the authors of TeamCity message board about adding trigger logging .", "Otherwise I think its : .. . .. . Which TeamCity will fill in teamcity.build.checkoutDir with like C : TeamCity buildAgent work 94fc00f485df5f29", "Looking at documentation for TeamCity the configuration of this project seems to be the expected way to setup dependent projects a feature of TeamCity .", "The answer to this question came from TeamCity support : .. . .. . The reason of the described behaviour is the way TeamCity controller returns data requested in downloadAll query .", "I need one way to run build in command-line and on teamcity .", "Question : Do I need to set up vpn on the teamcity server or it is needed only on teamcity agent .", "I want to see all compilation error on overview tab of TeamCity build both java and .net .", "Current revision and changes data retrieving logic is executed by the TeamCity server and thus TeamCity server should have access to VCS server in any mode .", "As I understand the guid from url is not static and I couldn t hardcode it in teamcity .", "Would you consider allowing TeamCity to set the assembly version for you", "I would like to have two teamcity build procedures one each for client and server code changes .", "You could install Visual studio on build-server and run devenv.exe from a commandline build runner in TeamCity .", "I notice that is documentation for Teamcity 9.X .", "We implemented authenticated feed support in TeamCity plugin .", "I am having trouble with my build for TeamCity .", "Cleaning agent sources from TeamCity admin pages .", "It works perfectly from command-line without TeamCity .", "I am afraid this is one for the teamcity people http : blog.jetbrains.com teamcity tag partcover - partcover should work for .NET 4 .", "Eg case : My Java class name is ValidateTxtFiles.java I would like to rename it to ValidateTxtAndShFiles.java .. . .. . Is there any way to achieve this with any teamcity upgrade or using another thirdparty tool on top of teamcity .", "I am trying to trigger a single teamcity build for a single merge in VCS .", "I m trying to integrate the sonar analysis into by TeamCity build-process .", "You are correct you ll need to either edit the Tomcat configuration or add the additional entires into TeamCity Data Directory config internal.properties documentation http : confluence.jetbrains.com display TCD7 Configuring+TeamCity+Server+Startup+Properties .", "The build is already underway before VCS is checked for changes and TeamCity has no way to un-start a build .", "If your intent is to increase the memory for the TeamCity server please make sure to read through the corresponding section http : confluence.jetbrains.com display TCD8 Installing+and+Configuring+the+TeamCity+Server InstallingandConfiguringtheTeamCityServer-SettingUpMemorysettingsforTeamCityServer on the same doc page .", "You can find the defined environment parameters in the Parameter s section of your build configuration in TeamCity .", "I guess it would be nice if TeamCity just had an option against a build configuration i.e .", "Same issue here on TeamCity Enterprise 9.1.7 .", "Is there any way to efficiently set this up in TeamCity", "There may be a way to fight TeamCity on this I don t know .", "So what is the best way to get msbuild compilation errors on teamcity build page in case of msbuild is called from Ant build script .", "The dependencies are defined in TeamCity configuration which takes parts of build artifacts from other builds and extracts them to a lib subdirectory of the project being built .", "The new server has the latest TeamCity version but the agents are the same machines and artifact uploads appear to work just fine .", "It seems that the index for the TeamCity NuGet Server got corrupted somehow the packages were fine so clearing the cache was the solution .", "From the machine or via VNC login as the user you want to run TeamCity and run that script from Terminal .", "I m trying to pass a standard teamcity build parameter vcsroot.url as the parameter of a rake-task using Teamcity s built-in Rake build step .", "The problem is when TeamCity executes the script some Modules aren t available .", "I ve been having problems with my teamcity nuget repository since a day .", "I am starting work with a new codebase that has the automated builds in TeamCity .", "If the rules are defined in TeamCity how do I use them locally", "It would be nice if the dependencies in TeamCity and the Project were defined in one place DRY .", "teamcity screenshot http : i.stack.imgur.com trW3K.png And this is only one of my projects .", "You can use the TeamCity REST API to determine if there are any changes left .", "We are running TeamCity v 7.1.3 and I just tested this .", "Teamcity does indeed show two file changes a Delete then an Add .", "Or is there an escape sequence required I ve scoured the teamcity docs in vain.. .", "I am running TeamCity 7.1.3 yeah I know it s an oldie .", "How can I exactly replicate the parameters TeamCity passes to msbuild", "We use too many system-properties today only specified in TeamCity .", "The second one is TeamCity.SharedResources http : confluence.jetbrains.net display TW TeamCity+Shared+Resources .", "I want to use PowerShell with Psake and TeamCity to configure my CI .", "Be warned clearing the nuget-package cache removes all packages from the TeamCity NuGet Server so you start with a clean slate.. .", "Using teamcity i can add build parameters and force to ask a question every time i click on Run button this call Run custom build dialog .", "The coverage report from the nunit dotcover build step is stored in the teamcity hidden artifacts directory .", "Cancel build by calling : .. . .. . How to trigger build with dependencies set to rebuild : .. . .. . Is it possible to force a TeamCity build to rebuild dependencies when triggered over HTTP", "I am using TeamCity Enterprise 7.1 and when trying to run a build using SVN as VCS root I get below errors - I have completed successful builds earlier also .", "Not too familiar with TeamCity .", "Is there a way to bypass this with TeamCity", "It looks like there are a couple of options outlined here : TeamCity Build Trigger Logging http : devnet.jetbrains.com message 5492840 5492840 .", "So I would like to be able to configure Teamcity to rerun failed tests within the same build a specific number of time .", "So the key element here is hidden artefacts also known as those that appear under .teamcity part of the build artifacts .", "Need to install Java 1.7 64-bit and then copy the Program Files jre7 folder to an empty TeamCity jre folder .", "Just install Java 64-bit using the installer and then overwrite the contents of the TeamCity jre folder", "To add insult to injury the teamcity logfile teamcity-javaLogging-2013-07-17.log grows unbounded +3GB in the time to type this where 10 MB a day is normal with the stacktraces like the ones below .", "I am trying to run msbuild with teamcity .", "TeamCity should really clarify this in their documentation or rename the option .", "TeamCity can now connect the the vcs root .", "confluence.jetbrains.com display TCD7 http : confluence.jetbrains.com display TCD7 Installing+and+Configuring+the+TeamCity+Server InstallingandConfiguringtheTeamCityServer-Using64bitJavatoRunTeamCityServer", "I found the answer on the Overview tab of my build configuration in the Permalink section at the bottom : .. . .. . http : teamcity viewLog.html buildId lastSuccessful buildTypeId bt16 tab report TODO items", "So the question is how access the build folder something like C : TeamCity buildAgent work 94fc00f485df5f29 Solution Service bin environment to run that script", "All that I found in official documentaion is that support of the Microsoft Build Tools 2013 availible since teamcity 8.1 http : confluence.jetbrains.com display TCD8 MSBuild .", "You can use Teamcity REST https : confluence.jetbrains.com display TCD9 REST+API RESTAPI-TriggeringaBuild to trigger the build and put on top of the queue .", "I ended up working around the problem and moving this build to another practically dedicated teamcity agent which means this executes promptly ." ] }
{ "confidence": [ 63.44471740722656, 59.05878829956055, 56.92726516723633, 55.957679748535156, 55.673439025878906, 54.06267166137695, 53.79932403564453, 52.85277557373047, 52.74160385131836, 52.41598892211914, 52.345130920410156, 51.72384262084961, 51.508907318115234, 50.74723434448242, 50.43877029418945, 50.14017868041992, 49.87824249267578, 49.368038177490234, 49.20806884765625, 48.860862731933594 ], "content": [ "Question : We use TeamCity 7.1 for continuous-integration and we produce build logs and artifacts for each build . We created a special build trigger of our own . It runs several times a day on several different configurations . But every now and then it fails to initiate a build and we are trying to determine why . We want to log the output of the trigger itself . Is it possible to generate a log from the build trigger even if a build doesn t run as a result-of the trigger .. . Answer : Our co-op posted to the jetbrains the authors of TeamCity message board about adding trigger logging . It looks like there are a couple of options outlined here : TeamCity Build Trigger Logging http : devnet.jetbrains.com message 5492840 5492840 . Option 1 is to use log4j logging within the plugin itself .. . Option 2 is to create our own logger Comment : Thanks for taking time to post the solution .", "Question : null .. . Answer : I am using TeamCity 7.1 with MsBuild build step running the following task : .. . .. . And I configured PartCover for this step set path to PartCover 4.0.2 libraries used proper XSLT files also copied just in case PartCover.dll and renamed it to PartCover.CorDriver.dll however once tests are executed code-coverage results are not available and Code Coverage tab is not displayed in TeamCity . What is wrong with this configuration Comment : What .NET version are you using 2 4 4.5 Comment : I am using .net-4.0 . Comment : I am afraid this is one for the teamcity people http : blog.jetbrains.com teamcity tag partcover - partcover should work for .NET 4 . Personally I d use OpenCover http : scubamunki.blogspot.com.au 2011 10 adding-opencover-to-teamcity.html as that is more flexible and is being actively supported and developed it also has 32 and 64 bit support whereas PartCover only works for 32-bit applications which may be your problem it s hard to tell Comment : Thanks I temporary switched to JetBrains dotCover .", "Question : null .. . Answer : I m trying to integrate my UI testing for iOS app-code in Java using Appium 0.16 into TeamCity 7.1 for automation but I get a MalformedUrlException on TeamCity build log . It works perfectly from command-line without TeamCity . I m running Appium on 127.0.0.1 local address and give an appropriate parameter to the WebDriver : .. . .. . I tried several other configurations : .. . .. . replacing the local IP with the agent s IP address .. . setting Maven goals on TeamCity UI to test to surefire : test or clean install . Nothing solves this .", "Question : I ve just found out that TeamCity runs on the 32-bit JVM on Windows for some reason . I m seeing memory errors logged when checking out a large not that large Git repo and am already at the max heap size for the JVM . I know nothing about Java or the JVM or TomCat . How can I run TeamCity on a modern 64-bit JVM I sense its going to be a pain else it would be the default . We re a tiny team and if something doesn t have Apple levels of it just works then we skip it . We can live with this one project not be on the CI server but it would be nice to know what s involved and weigh up the investment . Any advice appreciated . Edit .. . .. . Okay so Markus pointed to this snippet which I had read but I can t see any information there explaining what to do . Using 64 bit Java to Run TeamCity Server TeamCity can run under both 32 and 64 bit JVM . It is recommended to use 32-bit JVM unless you need to dedicate more than 1.3Gb of memory to the TeamCity process . .. . If you choose to use x64 JVM please note that the memory usage is almost doubled when switching from 32 to 64 bit JVM so please make sure you specify at least twice as much memory as for 32-bit JVM see Setting Up Memory settings for TeamCity Server . .. . If you run TeamCity as a service and switch to x64 bit you will also need to use x64 Tomcat executables see more . Did I miss something Edit 2 .. . .. . Ah okay buried in some paragraphs above that link is this : .. . .. . if you run as Windows service and want to upgrade JRE to 64 bit version you will need to replace jre with appropriate JRE .. . .. . So I guess I need to copy some files into the jre folder Comment : confluence.jetbrains.com display TCD7 http : confluence.jetbrains.com display TCD7 Installing+and+Configuring+the+TeamCity+Server InstallingandConfiguringtheTeamCityServer-Using64bitJavatoRunTeamCityServer .. . Answer : So I guess I need to copy some files into the jre folder No . You install a 64 bit JRE and update the relevant setting to point at the 64-bit install s JRE . Don t copy stuff from one JRE installation into another . You will break things Comment : Hi Stephen it did actually include copying files . I m not a Java guy but I get the feeling TeamCity on Windows doesn t do things like how a normal Windows Java app does . Renaming the old TeamCity jre folder and replacing it with a copy from a newly-installed JRE folder worked and was the process JetBrains recommends .", "Question : I have setup the trigger to listen to the last pinned build artifacts : .. . .. . However the trigger keeps firing every 30 seconds which is the default Polling interval . Am I missing something here The url always gives me the same file . UPDATE : After upgrading to TeamCity 7.1 the problem still exists . .. . Answer : The answer to this question came from TeamCity support : .. . .. . The reason of the described behaviour is the way TeamCity controller returns data requested in downloadAll query . The .zip containing the artifacts is actually different on each request and build is triggered . To workaround this issue try using .. . .. . this one worked for me .", "Question : I ve just found out that TeamCity runs on the 32-bit JVM on Windows for some reason . I m seeing memory errors logged when checking out a large not that large Git repo and am already at the max heap size for the JVM . I know nothing about Java or the JVM or TomCat . How can I run TeamCity on a modern 64-bit JVM I sense its going to be a pain else it would be the default . We re a tiny team and if something doesn t have Apple levels of it just works then we skip it . We can live with this one project not be on the CI server but it would be nice to know what s involved and weigh up the investment . Any advice appreciated . Edit .. . .. . Okay so Markus pointed to this snippet which I had read but I can t see any information there explaining what to do . Using 64 bit Java to Run TeamCity Server TeamCity can run under both 32 and 64 bit JVM . It is recommended to use 32-bit JVM unless you need to dedicate more than 1.3Gb of memory to the TeamCity process . .. . If you choose to use x64 JVM please note that the memory usage is almost doubled when switching from 32 to 64 bit JVM so please make sure you specify at least twice as much memory as for 32-bit JVM see Setting Up Memory settings for TeamCity Server . .. . If you run TeamCity as a service and switch to x64 bit you will also need to use x64 Tomcat executables see more . Did I miss something Edit 2 .. . .. . Ah okay buried in some paragraphs above that link is this : .. . .. . if you run as Windows service and want to upgrade JRE to 64 bit version you will need to replace jre with appropriate JRE .. . .. . So I guess I need to copy some files into the jre folder Comment : confluence.jetbrains.com display TCD7 http : confluence.jetbrains.com display TCD7 Installing+and+Configuring+the+TeamCity+Server InstallingandConfiguringtheTeamCityServer-Using64bitJavatoRunTeamCityServer .. . Answer : Luke .. . .. . The snippet from the updated question had a link in the original pointing to the instructions on Java update for TeamCity server http : confluence.jetbrains.com display TCD8 Installing+and+Configuring+the+TeamCity+Server InstallingandConfiguringtheTeamCityServer-java in TeamCity online doc . Basically the instructions vary based on the TeamCity distribution used and way of launching the server . If your intent is to increase the memory for the TeamCity server please make sure to read through the corresponding section http : confluence.jetbrains.com display TCD8 Installing+and+Configuring+the+TeamCity+Server InstallingandConfiguringtheTeamCityServer-SettingUpMemorysettingsforTeamCityServer on the same doc page . Yet one more note : recent TeamCity versions perform Git fetch in a separate process and Git-related memory issues during fetch might require fine-tuning of the corresponding options http : confluence.jetbrains.com display TCD8 Git+ 28JetBrains 29 Git 28JetBrains 29-InternalProperties . Comment : Note to self : Had to check back after installing 8.1 since it overwrote the JRE . Need to install Java 1.7 64-bit and then copy the Program Files jre7 folder to an empty TeamCity jre folder . Comment : That s a helpful note . I landed here because my MSSQL connection was failing after a TeamCity upgrade and it turned out it was due to the upgrade reverting the JRE to a 32-bit version . Comment : @LukePuplett is there nothing else to it Just install Java 64-bit using the installer and then overwrite the contents of the TeamCity jre folder It seems too easy to be true.. .", "Question : Is it possible to add memory performance profiling of unit tests as a team city build step I am specifically interested in doing it for our .Net apps test cases are written in NUnit . Any elaboration on this will be highly appreciated . Teamcity version is TeamCity Enterprise 7.1.2 build 24170 .. . .. . Thanks . .. . Answer : As far as I know TeamCity does not support profiling .Net apps yet . At least not in a direct way . There is an open feature request TW-20190 http : youtrack.jetbrains.com issue TW-20190 planning to integrate dotTrace http : www.jetbrains.com profiler a .Net profiler made also by JetBrains in Teamcity . But dotTrace can be called from command-line http : blog.jetbrains.com dotnet 2012 09 25 profiling-from-the-command-line-using-dottrace-performance so you can write MSBuild NAnt script to execute dotTrace . The problem is about how to display the profiling results . In General Settings page of your build config you can point artifacts path http : confluence.jetbrains.com display TCD7 Configuring+General+Settings ConfiguringGeneralSettings-ArtifactPaths to the dotTrace result folder so that teamcity will publish the profiling results as artifacts for you to download . Comment : Thanks Jifeng for your answer and the links . I will try your suggestions .", "Question : So my google-fu is weak.. . I could not find another instance of my errors . I ve been having problems with my teamcity nuget repository since a day . NuGet downloads from the repo fail with unexpected EOF s or corrupt package warnings . As far as I can tell this is not a hardware failure the vm and vm-host do not report disk errors . To add insult to injury the teamcity logfile teamcity-javaLogging-2013-07-17.log grows unbounded +3GB in the time to type this where 10 MB a day is normal with the stacktraces like the ones below . My Teamcity version is 7.1.5 build 24400 .. . .. . Anyone know how to recover from this failure I ve not yet summoned up enough courage to just clear all the caches I can find on the teamcity admin page Administration Diagnostics Caches because there is a warning in scary yellow on that page not to do that . Below is a sample of the stacktraces I m getting . .. . Answer : It seems that the index for the TeamCity NuGet Server got corrupted somehow the packages were fine so clearing the cache was the solution . However I didn t figure out how the index could be repopulated . Be warned clearing the nuget-package cache removes all packages from the TeamCity NuGet Server so you start with a clean slate.. .", "Question : I m trying to run my karma version v0.10.2 unit tests on teamcity version 7.1 . .. . .. . When I run karma start --reporters teamcity --single-run I get the following error : .. . .. . I have installed the karma-teamcity-reporter module but that hasn t helped . The following are installed in my local node-modules folder : .. . .. . Here is my karma.conf.js : .. . .. . If I run karma start karma.conf.js it runs correctly . What am I doing wrong .. . Answer : Turned out I needed to add karma-teamcity-reporter to the plugins section to get this to work : Comment : You may also need to npm-install karma-teamcity-reporter Comment : Brilliant . Was wondering why it wasn t working for me . Thanks .", "Question : I am starting work with a new codebase that has the automated builds in TeamCity . The dependencies are defined in TeamCity configuration which takes parts of build artifacts from other builds and extracts them to a lib subdirectory of the project being built . How do developers reproduce a local build when the dependencies are defined in TeamCity Is there a way to fetch the dependencies of a TeamCity build to update the dependencies locally Looking at documentation for TeamCity the configuration of this project seems to be the expected way to setup dependent projects a feature of TeamCity . However the output of the project is an MSI . Is this normally broken up into two separate builds one the creates the build output which includes the build dependencies and the output of the build and a second that takes these artifacts and generates an MSI What I want to do is correctly updates my build area of my local machine to have the correct dependencies . What is the expected way to do this If the rules are defined in TeamCity how do I use them locally Update : I am considering using TeamCity as a nuget-server and have the local builds install the dependent libraries using nuget client . It would be nice if the dependencies in TeamCity and the Project were defined in one place DRY . .. . Answer : My advice is : don t . Avoid unnecessarily coupling yourself to TeamCity unless it offers real value for that specific task . If you are building genuine software packages i.e . independent reusable libraries of code then you are better off just building them as separate build configurations and uploading them to a Nuget server TC can function as a simple one . Then your local builds are going to be the same as CI builds as its using nugets infrastructure . TC dependencies are a useful tool but can also be misused and overused . Remember TC functions a CI server for many platforms some of which don t have packages or didn t historically .", "Question : I m getting an OutOfMemoryException during git-clone fetch . I might need to tweak the following settings : .. . .. . But how I can use the TomCat configuration editor tool thing tomcat7w.exe ES TeamCity but I d have assumed these settings are part of the build agent so applying them via TomCat seems weird . Thanks .. . .. . Luke .. . Answer : TeamCity has support for server-side and agent-side source control checkout . If you are getting JVM out-of-memory errors during checkout then you must have your build configuration configured for server-side checkout because agent-side checkout requires git to be installed on the agent rather than TeamCity using its own jgit based process server-side . You are correct you ll need to either edit the Tomcat configuration or add the additional entires into TeamCity Data Directory config internal.properties documentation http : confluence.jetbrains.com display TCD7 Configuring+TeamCity+Server+Startup+Properties .", "Question : null .. . Answer : I am using TeamCity Enterprise 7.1 and when trying to run a build using SVN as VCS root I get below errors - I have completed successful builds earlier also . I just copy the configuration from previous build configuration and rename it with pointing to new branch . Can someone please help me what can be the issue How to fix this Comment : Did you end up finding the solution Comment : ping.. . Trying to fix this at 5pm on a Friday.. . Comment : Same issue here on TeamCity Enterprise 9.1.7 .", "Question : null .. . Answer : I have added StyleCop Plugin at following path C : ProgramData JetBrains TeamCity plugins and re-started the Team City Server I got StyleCop option in the build runner . But on clicking the same got the following error : .. . .. . I have downloaded the StyleCop Plugin files in stylecop.1.1.1.zip from following link : https : bitbucket.org metaman teamcitydotnetcontrib downloads .. . .. . I am not able to proceed further Comment : It seems no one knows about the same . Comment : Just checking - did you put the entire stylecop.zip file into the plugins directory", "Question : I have Teamcity 7.1 and around 1000 tests . Many tests are unstable and fail randomly . Even a single test fails the whole build fails and to run a new build takes 1 hour . So I would like to be able to configure Teamcity to rerun failed tests within the same build a specific number of time . Any success for a test should be considered as success not a failure . Is it possible Also now is tests in some module fail Teamcity does not proceed to the next module . How to fix it .. . Answer : With respect I think you might have this problem by the wrong end . A test that randomly fails is not providing you any value as a metric of deterministic behavior . Either fix the randomness through use of mocks etc . or ignore the tests . Comment : It involves a lot of asynchronous complex staff . Fail probability is very low and almost never fails locally . But with high number of tests failing probability of the whole build gets much higher .", "Question : I have Teamcity 7.1 and around 1000 tests . Many tests are unstable and fail randomly . Even a single test fails the whole build fails and to run a new build takes 1 hour . So I would like to be able to configure Teamcity to rerun failed tests within the same build a specific number of time . Any success for a test should be considered as success not a failure . Is it possible Also now is tests in some module fail Teamcity does not proceed to the next module . How to fix it .. . Answer : If you absolutely have to I d put loops round some of your test code and catch say 5 failures before throwing the exception as a genuine failure . Something like this C example would do.. . While I appreciate the problems that can arise with testing asych code I m with @JohnHoerr on this one you really need to fix the tests . Comment : It is ugly then I would need to make a list of frequently failing tests and patch the code of them . Comment : There s no denying its ugliness I can t think of a way you can get failing tests to be re-run by TC this may be the easiest way to accomplish your goal .", "Question : So my google-fu is weak.. . I could not find another instance of my errors . I ve been having problems with my teamcity nuget repository since a day . NuGet downloads from the repo fail with unexpected EOF s or corrupt package warnings . As far as I can tell this is not a hardware failure the vm and vm-host do not report disk errors . To add insult to injury the teamcity logfile teamcity-javaLogging-2013-07-17.log grows unbounded +3GB in the time to type this where 10 MB a day is normal with the stacktraces like the ones below . My Teamcity version is 7.1.5 build 24400 .. . .. . Anyone know how to recover from this failure I ve not yet summoned up enough courage to just clear all the caches I can find on the teamcity admin page Administration Diagnostics Caches because there is a warning in scary yellow on that page not to do that . Below is a sample of the stacktraces I m getting . .. . Answer : As far as I know TeamCity NuGet Server is subject to the artifact cleanup policy defined in Administration Project-related Settings Build History Clean-up so make sure your package is still there My personal advise is ALWAYS setup a dedicated nuget-server . You can setup one for free simply cloning the official NugetGallery project on GitHub https : github.com NuGet NuGetGallery : that s the same codebase used by nuget.org so you ll have a familiar UI and increased performances NugetGallery leverage Lucene.NET indexing capabilities .", "Question : I ve just found out that TeamCity runs on the 32-bit JVM on Windows for some reason . I m seeing memory errors logged when checking out a large not that large Git repo and am already at the max heap size for the JVM . I know nothing about Java or the JVM or TomCat . How can I run TeamCity on a modern 64-bit JVM I sense its going to be a pain else it would be the default . We re a tiny team and if something doesn t have Apple levels of it just works then we skip it . We can live with this one project not be on the CI server but it would be nice to know what s involved and weigh up the investment . Any advice appreciated . Edit .. . .. . Okay so Markus pointed to this snippet which I had read but I can t see any information there explaining what to do . Using 64 bit Java to Run TeamCity Server TeamCity can run under both 32 and 64 bit JVM . It is recommended to use 32-bit JVM unless you need to dedicate more than 1.3Gb of memory to the TeamCity process . .. . If you choose to use x64 JVM please note that the memory usage is almost doubled when switching from 32 to 64 bit JVM so please make sure you specify at least twice as much memory as for 32-bit JVM see Setting Up Memory settings for TeamCity Server . .. . If you run TeamCity as a service and switch to x64 bit you will also need to use x64 Tomcat executables see more . Did I miss something Edit 2 .. . .. . Ah okay buried in some paragraphs above that link is this : .. . .. . if you run as Windows service and want to upgrade JRE to 64 bit version you will need to replace jre with appropriate JRE .. . .. . So I guess I need to copy some files into the jre folder Comment : confluence.jetbrains.com display TCD7 http : confluence.jetbrains.com display TCD7 Installing+and+Configuring+the+TeamCity+Server InstallingandConfiguringtheTeamCityServer-Using64bitJavatoRunTeamCityServer .. . Answer : The way I made it work TeamCity 8 Windows server 2008 r2 : .. . .. . Install the 64-bit JRE on the target machine now there are two ways to do this .. . .. . A - If you are using the Teamcity bundled JRE replace the JRE folder TC Server folder JRE with the JRE folder in the newly installed JRE x64 - You have to shut down the TC server service along with all java.exe 32 services that might also use this JRE .. . .. . B - Change the TeamCity Internal properties to point to newly installed JRE x64 see documentation for TC version 8 https : confluence.jetbrains.com display TCD8 Configuring+TeamCity+Server+Startup+Properties TC version 9 can be found here https : confluence.jetbrains.com display TCD9 Configuring+TeamCity+Server+Startup+Properties : .. . .. . java.home C : JRE x64 install folder jre .. . java.ext.dirs C : JRE x64 install folder jre lib ext C : Windows Sun Java lib ext .. . java.library.path C : JRE x64 install folder jre bin C : Windows Sun Java bin C : Windows system32 C : Windows C : local Oracle clients 112 64 bin C : local Oracle .. . .. . .. . An alternative to point B would be to change Environment variable JAVA HOME it s more simple but it requires a Windows server restart after that .. . .. . If you run the TC Server service now it should run as a 64-bit Java process chceck via PID in task manager : .. . .. . Resource Monitor http : i.stack.imgur.com 08R0g.jpg Task Manager http : i.stack.imgur.com Rx4yn.jpg .. . .. . Don t be alarmed if the server does not start up throwing an error : .. . .. . Error : SQL error when doing : Connecting to MSSQL : I O Error : SSO Failed : Native SSPI library not loaded . Check the java.library.path system property .. . .. . .. . Download JTDS - 1.3.1 http : sourceforge.net projects jtds files jtds 1.3.1 and install it .. . .. . Take the ntlmauth.dll file from JTDS-1.3.1 install folder x64 SSO folder and replace the one in TC Server folder bin .. . .. . The TC server should now run fine as 64 bit Java process .. . .. . You can increase the memory allocation as that is the whole point of the upgrade now on the server as described here : https : confluence.jetbrains.com display TCD8 Installing+and+Configuring+the+TeamCity+Server InstallingandConfiguringtheTeamCityServer-SettingUpMemorysettingsforTeamCityServer", "Question : We have an ASP.NET MVC 4.5 project . For months it has been compiling and all unit tests passing locally on our development machines and on the TeamCity 7.1.5 machine . Monday we updated to newer versions of some of our dependencies specifically to get OData 5.0.0-rc1 for select-expand . The project compiles fine on our development machines and the build machine . It runs fine on our development machines and on both QA environments it s deployed to . All the unit tests pass on our development machines . However about half 300 of the unit tests now fail when run from TeamCity using the MSTest build runner all with the same useless error : .. . .. . I ve tried everything imaginable . At first I figured there was a legitimate problem . Since there s no way to retrieve the LoaderExceptions property from TeamCity why doesn t MSTest just display more information I logged in to the machine TeamCity is running on opened up the console changed into the work directory that our build is running from and ran the tests manually so that I could retrieve the property . ALL OF THE TESTS PASSED There goes that theory.. . .. . .. . After an entire day of Googling and reading other answers on StackOverflow I ve tried about two dozen different combinations of the following steps : .. . .. . Changing the build from Rebuild to Clean running it without tests so that it just cleans changing it back and running it again . Changing the build from Debug to Release running it and changing it back again . Cleaning agent sources from TeamCity admin pages . Manually deleting entire work directory off of the agents skipping the recycle-bin and going straight to the netherworlds . Deleting all source control TFS caches off the build machine and agents . Telling TeamCity to clean the work directory before getting latest from source control . I ve reached the end of my troubleshooting capabilities . The tests just won t run anymore on the build machine for apparently no reason at all . What can I do What the heck is going on Comment : Nick Williams did you found already a solution . I m facing the same problem at the moment on our TeamCity instance Comment : See my answer below which I just posted . .. . Answer : The short answer to this is It s a bug http : youtrack.jetbrains.com issue TW-32321 . I reported the bug to JetBrains http : youtrack.jetbrains.com issue TW-32321 . It appears that though there might be some underlying problem with my project it s only a problem when run from Teamcity and it s impossible to retrieve the actual error message so there s no way to know what that problem is . The runner should be catching the exception and printing out the LoaderExceptions property but it isn t . Instead it s just calling ToString on the exception . The runner will have to be updated to look for this specific exception and print the LoaderExceptions property . Once that happens then we can see the underlying problem which may result in changing something in the project or it may result in filing another bug with JetBrains .", "Question : I have I multilanguage project using Java C C++ . And I using ant script for building and running test . Currently I exec msbuild from ant script and redirect the msbuild output to log files . If build fails on msbuild .net compilation errors I should go to Artifacts and look for log file and search error in this file . I want to see all compilation error on overview tab of TeamCity build both java and .net . Teamcity has MSBuild Task for NAnt http : confluence.jetbrains.com display TCD7 NAnt out of the box but has no support for MSBuild on Ant . Of course I can split all build-process in 2 parts : Ant script for Java ant NAnt for .NET but it s undesirable . So what is the best way to get msbuild compilation errors on teamcity build page in case of msbuild is called from Ant build script . Comment : Why don t you use build steps Comment : I need one way to run build in command-line and on teamcity . Comment : If multiple build steps are not the option so do not redirect MsBuild output to file . It should write directly to stdout . .. . Answer : I found answer in this topoc : How to get TeamCity to recognize msbuild compilation errors using the Rake runner http : stackoverflow.com questions 1883753 how-to-get-teamcity-to-recognize-msbuild-compilation-errors-using-the-rake-runn . I need to run msbuild like this : .. . .. . msbuild l : JetBrains.BuildServer.MSBuildLoggers.MSBuildLogger path to dll", "Question : I have two build configurations : .. . .. . Build solution and run tests .. . Deploy ASP.NET site using msbuild .. . .. . That article http : www.troyhunt.com 2010 11 you-deploying-it-wrong-teamcity.html was used as manual . Currently I want to add the third build configuration to install a windows service . There is a powershell script that should be run from bin folder release debug etc . So the question is how access the build folder something like C : TeamCity buildAgent work 94fc00f485df5f29 Solution Service bin environment to run that script As I understand the guid from url is not static and I couldn t hardcode it in teamcity . Thanks in advance . .. . Answer : When you set the path to your build script just set it so its like : .. . .. . Which will do it relatively to the build directory for your build agent . Otherwise I think its : .. . .. . Which TeamCity will fill in teamcity.build.checkoutDir with like C : TeamCity buildAgent work 94fc00f485df5f29" ] }
[ "yes-answer-long", "yes-answer-short" ]
continuous-integration
UNK_RELATION
qcheckbox@toolkit@53
qcheckbox -- a qcheckbox is a gui class from the qt @placeholder which provides a checkbox with a text label .
{ "confidence": [ 50.7571907043457, 49.30543518066406, 48.71061706542969, 47.937774658203125, 47.351966857910156, 47.23518753051758, 46.742767333984375, 46.36368179321289, 46.10590362548828, 45.607025146484375, 45.432960510253906, 44.20244598388672, 43.47295379638672, 43.329776763916016, 43.32807540893555, 43.175018310546875, 42.63861083984375, 42.38154602050781, 42.38154602050781, 42.38154602050781, 42.15199279785156, 41.492027282714844, 41.492027282714844, 41.297332763671875, 40.211769104003906, 39.936065673828125, 39.936065673828125, 39.936065673828125, 39.20650100708008, 38.82891082763672, 38.82891082763672, 38.275604248046875, 37.405250549316406, 37.28824234008789, 37.28824234008789, 36.62351989746094, 36.62351989746094, 36.62351989746094, 36.62351989746094, 36.62351989746094, 36.62351989746094, 36.540191650390625, 35.51636505126953, 35.51636505126953, 35.39971160888672, 35.05431365966797, 34.818275451660156, 34.40471649169922, 34.189414978027344, 32.63283920288086, 32.63283920288086, 32.38417053222656, 32.161537170410156, 32.161537170410156, 32.161537170410156, 32.161537170410156, 32.161537170410156, 32.161537170410156, 32.161537170410156, 31.054386138916016, 31.054386138916016, 31.054386138916016, 30.707284927368164, 30.707284927368164, 30.67198944091797, 29.727434158325195, 29.727434158325195, 29.727434158325195, 29.727434158325195, 29.430709838867188, 28.323558807373047, 28.06805992126465, 26.874113082885742, 26.372085571289062, 26.03167724609375, 25.9471378326416, 25.009857177734375, 24.873497009277344, 24.100013732910156, 23.830284118652344, 23.169082641601562, 23.169082641601562, 22.929080963134766, 22.784656524658203, 22.304616928100586, 21.98821449279785, 21.944190979003906, 21.944190979003906, 21.819887161254883, 21.793546676635742, 21.787208557128906, 21.778066635131836, 21.778066635131836, 21.729503631591797, 21.7155818939209, 21.605976104736328, 21.519208908081055, 21.43604278564453 ], "content": [ "QCheckBox checkbox new QCheckBox filt this - I have the text set as filt but the object name is just checkbox for more than 1 checkbox", "I need to customize the QCheckbox like this : add a square between the checkbox and the text", "I couldn t find any properties for TEXT of QCheckBox in QT documentation .", "I have tried these 2 questions : .. . .. . how to change QCheckBox text label color in Qt", "http : stackoverflow.com questions 11153945 how-to-change-qcheckbox-text-label-color-in-qt .. . .. . Changing QCheckBox text color http : stackoverflow.com questions 22761517 changing-qcheckbox-text-color lq 1 .. . .. . None of those solutions seem to be working for me .", "But the problem is it doesn t show the text of the QCheckbox .", "Is there any way to detect if the user clicked on the label on a QCheckBox or not", "The class generates QCheckbox es in a QVBox .", "From the document http : doc.qt.io qt-5 QCheckBox.html : .. . .. . QCheckBox optionally provides a third state to indicate no change .", "But if I click on another QCheckBox it is the event of the first QCheckBox selected who is received .", "I want to change the color of the text next to a QCheckBox .", "Set the QCheckBox to the buddy of the QLabel .", "I m trying to have a multi-line checkbox radiobutton with Qt using standard QCheckbox QRadioButton .", "I use QCheckBox in QTableWidgetCell .. . .. . The result-of this code is a cell with checkbox in the center .", "However I wanted to detect a click on that text from QCheckBox .", "I m unable to change the color of Qcheckbox in QT can somebody help me with code to change color of check box text label .", "I have a QCheckbox in a grid-layout defined as such : .. . .. . By default the checkbox is to the left of the Is subfactor text .", "You are trying to use a QCheckBox for searching", "I have a problem on the behavior of QCheckBox .", "However their children are only QHBoxLayout and QCheckBox .", "I do use the one from QCheckBox .", "Is it possible to specify some style sheet properties for text of QCheckBox", "several text-specific style sheet properties are supported by QCheckBox e.g .", "If now I apply event filter on my QCheckbox : .. . .. . I receive the event of the first one QCheckBox selected .", "I have a problem with QCheckBox .", "Assuming chk is your QCheckBox object just do :", "forgot astersisk in QVector QCheckBox Value was only for example .", "in the list of properties you ll find the properties supported by QCheckbox .", ".. . .. . PS : Related but no answer here .. . .. . Disabling a QCheckbox in a tricky way http : stackoverflow.com q 8542123 356726 .. . Qt - How to disable QCheckBox while retaining checked state", "I ve already knew that QtTableWidget has QCheckbox .", "You can add a QCheckBox to the QGraphicsView in a layout :", "I read source code of QCheckBox Qt4 C++ here https : qt.gitorious.org qt qt source e7f7d1f20ed691a274dcf07801baa17f7a8aabf9 : src gui widgets qcheckbox.cpp L170 and here https : qt.gitorious.org qt qt source e7f7d1f20ed691a274dcf07801baa17f7a8aabf9 : src gui widgets qcheckbox.cpp L299 .", "I have a QWidget that contains a QGroupBox which contains QComboBox QLineEdit and QCheckBox .", "My goal now is to send this line to the QTableWidget in the last tab of my QtableTab when I click on the qCheckBox and to delete this line when I uncheck the qCheckBox .", "I m getting the error variable-sized object may not be initialized on this line QCheckBox typecheckbox i new QCheckBox filt this .. . .. . Any ideas to a solution alternate approach", "I m trying to change only the color of QCheckBox indicator rectangle .", "Why do you cast to QPushButton instead of casting to QCheckBox", "I use QCheckBox in QTableWidgetCell .. . .. . How can I change cell background", "QCheckBox object has no attribute SetStyleSheet is thrown when I try that .", "I have an issue getting the values of a QTableWidget based on whether a QCheckBox is checked .", "For example to add QVector QCheckBox checkBoxes to your widget and then append this pointers to vector .", "Your just create your own widget just like QCheckBox and disable icon in QCheckBox and make your own QLabel ot show your icon and set it with same QLayout .", "EDIT : Here s the code of my function creating the qCheckBox and associated it dynamically :", "I add a lot of qCheckBox so it s a lot of pointers .", "------- Edit ------- .. . .. . Following the stylesheet examples http : doc.qt.io qt-5 stylesheet-examples.html customizing-qcheckbox I was hoping I could set the style of a disabled checkbox like the one of an enabled .", "I m storing QCheckBox in QTableWidget in following way : .. . .. . Then I catch stateChanged of the checkBox : .. . .. . Now I can get to QTableWidget it is box- parent - parent - parent .", "I have a QCheckbox and which I m trying to change the state using a keyboard press of return enter rather than space .", "I am trying to connect a boolean variable to a QCheckBox so that when I change the boolean variable the QCheckBox will be automatically checked or unchecked .", "I need to go around all the controls and if the control is a QCheckBox ask if it is checked or not .", "In this case once I set ILCheck to True QCheckBox will be checked .", "I am not sure if I can set a model to a single QCheckBox .", "I have to check which checkboxes are selected so I should create new QCheckBox variables for each line", "I am under Qt5.3.2 MinGW .. . .. . I create a QGraphicsScene where i add severals QCheckBox via QGraphicsProxyWidget .", "QCheckBox status are not modified too and I need to change status into QMainWindows : : eventfilter : .. . .. . MainWindow.cpp : .. . .. . What is it that I m doing wrong", "Luckily for you the position of the icon in a QCheckBox is exactly in the position you illustrated in your picture .", "I am wondering if there is anyway to disable setCheckState on a check box QCheckBox in pyqt WITHOUT triggering an event", "You can simply block signals just before disabling the QCheckBox and re-enabling them just after .", "For other things such as QPushbuttons QLineEdit I ve used returnPressed in the signal however this doesnt work for QCheckbox and none of the options seem suitable .", "How do I change the state of the QCheckbox on return enter press when it has focus .", "Well you have to call findChildren QCheckBox without vbox- if you parent to this or you parent to vbox .", "If you dont want the fullblown functionality of QCheckBox but just the checkmark You can use a simple QTableWidgetItem and modify his checkstate .", "I m trying to change the background-color of a QAbstractButton either a QPushButton or QCheckBox in Qt5 and having zero luck .", "for example in this link http : stackoverflow.com questions 25038075 trouble-adding-checkboxes-dynamically-in-qt we can create add QCheckBox es dynamically but I can t access them out of their definition scope for .", "More specific : Changing the icon like in the examples http : doc.qt.io qt-5 stylesheet-examples.html customizing-qcheckbox does not work for me maybe because I am using Windows and the icons are not available under the path as in the examples .", "To be able to do drag-and-drop zoom in out I reimplemented the virtual method eventFilter QObject QEvent into QMainWindows and I apply it to my scene : scene- installEventFilter this .. . .. . But I can t catch QCheckBox signal with QObject : : connect : .. . .. . If I don t apply event filter on my scene my QCheckBox work perfectly .", "for QCheckBox also you may pass it using the partial functions the same way we did for QComboBox .", "I need to know how all the QCheckBox are checked - the idea could be something like this :", "So I thought I can do that with QCheckBox user could choose 1 or more .", "I need to use combinations of QRadioButton and QComboBox in first Window and QCheckBox and QComboBox in second Window .", "So all you need to do for your customised QCheckBox is define what the icon should be and the default paintEvent will take care of the rest .", "myTab http : image.noelshack.com fichiers 2014 25 1402988641-checkbox.png .. . .. . As you may see when I create a line I add a qCheckBox at the end .", "question : Python3 PyQt4 Creating a simple QCheckBox and changing a Boolean variable http : stackoverflow.com questions 12736825 python3-pyqt4-creating-a-simple-qcheckbox-and-changing-a-boolean-variable .. . .. . I just copy one solution from that question to here .", "I have built a group checkbox by : .. . .. . How can I get the checkbox text which is are clicked", "Example http : i.stack.imgur.com KFrB2.png : .. . .. . So to do this I inherit QCheckBox and override paintEvent QPaintEvent : .. . .. . I have a problem that I don t know how the position to place the QRectF rec .", "I want to enable a combobox - which is disabled from the properties editor in Qt Designer - but only if the user checks the checkbox .", "Did you try to use keyPressEvent for your checkbox with Qt : : Key Enter Qt : : Key Return filter", "i don t store this pointers because i have too many class member and i don t want to add this check box to them i make mistake i cast to QCheckBox but i get segmentation-fault again", "If you are extending the QItemDelegate class it has a drawCheck http : qt-project.org doc qt-4.8 qitemdelegate.html drawCheck function what will draw you a nince centered checkbox .", "The QCheckBox class inherits QAbstractButton so you can use the toggled http : doc.qt.io qt-4.8 qabstractbutton.html checked-prop signal to do what you want : .. . .. . Or connect to the combo-box directly : .. . .. . You can also set up these kinds of direct connections in Qt Designer by using the Signals and Slots Editing Mode http : doc.qt.io qt-4.8 designer-connection-mode.html", "Get the checkbox with cellWidget https : qt-project.org doc qt-4.8 qtablewidget.html cellWidget and then use isChecked https : qt-project.org doc qt-4.8 qabstractbutton.html checked-prop :", "Hi your solution is partially worked : It does create the rectangle between the checkbox and the text but the text is halved .", "This moves the checkbox to the right it s still on the left of the text but it pushes the text to the right and out of the window s edge .", "If I need to re-implement a checkbox then what class do I inherit", "The checkbox is generated by : .. . .. . 1 . returning Qt : : ItemIsUserCheckable in overridden flags member function .. . 2 . in overridden data function I return a Qt : : CheckState for role Qt : : CheckStateRole according to data .. . .. . Works see screenshot .", "Then the checkbox is readonly which is not what I want .", "Examples which I tried work while checkbox is checked .", "So every time I create a line dynamically I try to associate to my qCheckBox a signal : .. . .. . But it won t work I ve got the error : .. . .. . But this slot exist I declare it in my header file and my cpp like this : .. . .. . Is my way to procced for solving this problem is good", "SOLUTION 1 : Creating a callBack function does the trick : .. . .. . Then I connect the QCheckbox .stateChanged signal this way : .. . .. . SOLUTION 2 : using the partial module : .. . .. . First we import the module : .. . .. . Then the signal connection is done this way : .. . .. . However I would like to use lambda expression in one line .", "CheckBox for what", "So in effect the checkbox would be called checkbox 0 checkbox 1 etc", "I d still prefer to use only a QLabel but how would I switch the checkbox to the right of the text without the text getting pushed out .", "You could use stylesheets http : doc.qt.io qt-5 stylesheet-examples.html in order to change the color of the checkbox or any othe widget as you wish .", "For a binary check box you can use isChecked http : doc.qt.io qt-5 qabstractbutton.html checked-prop to query whether or not a checkbox is checked .", "Add the whole text to the QLabel and set the label as the radio buttons buddy .", "I m doing an implementation of a CheckBox that inherits from QitemDelegate to put it into a QTableView .", "That indeed is really annoying and cannot be solved without reimplementation : the label uses Qt : : PlainText if I m not mistaken .", "To be precise there is no Qt : : ItemsIsEditable and Qt : : ItemIEnabled in PyQt .", "but I think I can t use it because I have many different cells with text with checkBox with svg graphic.. . ." ] }
{ "confidence": [ 67.90876770019531, 66.51416778564453, 66.5073471069336, 64.88462829589844, 64.24437713623047, 63.71419906616211, 60.55874252319336, 60.55874252319336, 60.28905487060547, 58.2987060546875, 57.96527099609375, 57.96527099609375, 57.59364700317383, 57.156612396240234, 56.602020263671875, 56.44316864013672, 56.310829162597656, 55.07316589355469 ], "content": [ "Question : I need to customize the QCheckbox like this : add a square between the checkbox and the text Example http : i.stack.imgur.com KFrB2.png : .. . .. . So to do this I inherit QCheckBox and override paintEvent QPaintEvent : .. . .. . I have a problem that I don t know how the position to place the QRectF rec . And I can t set the size too small eg : it will disappear when size of rec QSize 10 10 . Any ideas are appreciated . PS : I use OpenSUSE 13.1 with Qt 4.8.5 .. . Answer : The main idea is to copy default implementation of checkbox drawing and modify it according to your needs . We get label rectangle in default implementation so we just need to draw new element in this place and shift label to the right . Also we need to adjust size hint so that both new element and default content fit in minimal size . Note that this solution may be not portable because checkboxes are drawn with drastic differences on different platforms . I tested it on Windows only . I used default implementation provided by QCommonStyle . Comment : Hi your solution is partially worked : It does create the rectangle between the checkbox and the text but the text is halved . My guess is we need to recalculate the boundingrect of the text How to Comment : Okay silly me . I just need to resize it on the GUI .", "Question : Is it possible to specify some style sheet properties for text of QCheckBox I m interested in padding first of all.. . I see that we can customize : : indicator of check box but I couldn t find any information about text . Comment : look here : doc.qt.io qt-5 stylesheet-reference.html http : doc.qt.io qt-5 stylesheet-reference.html . in the list of properties you ll find the properties supported by QCheckbox . here some working examples : checkbox.setStyleSheet border : 2px solid black padding : 10px color : red spacing : 50px font : 14pt Comment : I couldn t find any properties for TEXT of QCheckBox in QT documentation . .. . Answer : several text-specific style sheet properties are supported by QCheckBox e.g . color font font-family font-size font-style font-weight text-decoration . padding is supported too as padding in the whole widget and by spacing you can set the distance between the checkbox and the text .", "Question : I want to change the color of the text next to a QCheckBox . I have tried these 2 questions : .. . .. . how to change QCheckBox text label color in Qt http : stackoverflow.com questions 11153945 how-to-change-qcheckbox-text-label-color-in-qt .. . .. . Changing QCheckBox text color http : stackoverflow.com questions 22761517 changing-qcheckbox-text-color lq 1 .. . .. . None of those solutions seem to be working for me . Edit 1 : Here is the minimal working code : .. . .. . When I do this the color of the ToolTip changes to red but the text next to the checkbox remains black . Edit 2 : If I add the line .. . .. . It works . The default style is sgi where for some reason the text color doesn t change . It worked with all the other styles . Comment : Minimal code seems to work fine . Comment : @SaileshSriram The color of the text doesn t change for me . Only the ToolTip becomes red . Comment : The palette example is incomplete : you must also do self.chkbox i .setPalette p . Comment : @Tanay . What platform are you testing this on Comment : @ekhumoro I added the setPalette line but it still didn t show . I m using Ubuntu 12.04 . .. . Answer : You could do this by using style sheet : Comment : QCheckBox object has no attribute SetStyleSheet is thrown when I try that . Comment : The first letter of all the methods should be lower case Comment : Sorry I should have noticed that It still doesn t work . The text color doesn t change . Comment : Post the minimal working example so that I can debug it Comment : I have added it to the question", "Question : I need to customize the QCheckbox like this : add a square between the checkbox and the text Example http : i.stack.imgur.com KFrB2.png : .. . .. . So to do this I inherit QCheckBox and override paintEvent QPaintEvent : .. . .. . I have a problem that I don t know how the position to place the QRectF rec . And I can t set the size too small eg : it will disappear when size of rec QSize 10 10 . Any ideas are appreciated . PS : I use OpenSUSE 13.1 with Qt 4.8.5 .. . Answer : QAbstractButton has a property called icon which is drawn differently depending on what subclass is instantiated . Luckily for you the position of the icon in a QCheckBox is exactly in the position you illustrated in your picture . So all you need to do for your customised QCheckBox is define what the icon should be and the default paintEvent will take care of the rest . For simplicity s sake I m assuming the icon size should be the same size as the check box itself : .. . .. . I have tested this on a Windows 8.1 machine with Qt 5.2.1 and it works . Comment : Hi your solution is partially worked : It does create the rectangle between the checkbox and the text but the text is halved . My guess is we need to recalculate the boundingrect of the text", "Question : I generate checkboxes as follows : .. . .. . I need to get access to these checkboxes by name but they are all called the same I need to read the text they display . How can I go about this Is it possible to run a for-loop and attach the value of i onto the end of the checkbox . So in effect the checkbox would be called checkbox 0 checkbox 1 etc EDIT : .. . .. . I ve changed the code to the following : .. . .. . I thought this was a way to dynamically name the checkboxes so I can loop through them to get the text value from them . I m getting the error variable-sized object may not be initialized on this line QCheckBox typecheckbox i new QCheckBox filt this .. . .. . Any ideas to a solution alternate approach .. . Answer : If you want to access the checkboxes later you can just use the find children method http : qt-project.org doc qt-5 qobject.html findChild as follows : Comment : Perfect I was hoping there was a way such as this . Using your method how would I go about looping through the checkboxes and getting the text for each . The idea is that I want to pass it into a QStringList . Comment : Text or actual object name which you do not seem to have set Comment : QCheckBox checkbox new QCheckBox filt this - I have the text set as filt but the object name is just checkbox for more than 1 checkbox Comment : Why do you care about the object name especially if you do not set it Comment : Well you have to call findChildren QCheckBox without vbox- if you parent to this or you parent to vbox .", "Question : I have a gridlayout that holds a bunch of check boxes . I wanted to add an image to the check boxes as well as some text . The problem I am having is that the layout of a check box is left to right check box icon text . Is there a way to put the text above the icon Not sure if using a style sheet would work for this or not or even how that would look . Thank you . .. . Answer : Answer : In PyQt4 . No your can t do it . Why I read source code of QCheckBox Qt4 C++ here https : qt.gitorious.org qt qt source e7f7d1f20ed691a274dcf07801baa17f7a8aabf9 : src gui widgets qcheckbox.cpp L170 and here https : qt.gitorious.org qt qt source e7f7d1f20ed691a274dcf07801baa17f7a8aabf9 : src gui widgets qcheckbox.cpp L299 . I saw it use default QStyleOptionButton to show check box text and icon . It s use drawControl to draw all element in QStyleOptionButton by specified config in QStyleOptionButton . Also it have LayoutDirection . And layout direction in QStyleOptionButton . I don t know in Qt4 C++ and inheritance it and swap direction icon . But in PyQt4 It s impossible to do it . Another way : Yes It have another way to solve but not directly . Your just create your own widget just like QCheckBox and disable icon in QCheckBox and make your own QLabel ot show your icon and set it with same QLayout . Example", "Question : Any good way to make a checkbox readonly but also not grayed-out hardly visible . 1 . I have used setEnabled bool which works but the checkbox then is grayed-out and hardly readable .. . 2 . I can react on a toggle signal and reset the state . But I would need a kind of flag to determine if the box is read-only and then reset the check state means I need to create my own CheckBox class . 3 . setCheckable does not work either it does not allow me to set a checked state at all : .. . .. . cb this- ui- cb RealWorld- isCheckable .. . this- ui- cb RealWorld- setCheckable true .. . this- ui- cb RealWorld- setChecked someValue .. . this- ui- cb RealWorld- setCheckable cb .. . .. . .. . So the best thing I have is to use enable disable and accept the grayed out style . ------- Edit ------- .. . .. . Following the stylesheet examples http : doc.qt.io qt-5 stylesheet-examples.html customizing-qcheckbox I was hoping I could set the style of a disabled checkbox like the one of an enabled . Failed so far to do so . More specific : Changing the icon like in the examples http : doc.qt.io qt-5 stylesheet-examples.html customizing-qcheckbox does not work for me maybe because I am using Windows and the icons are not available under the path as in the examples . .. . .. . PS : Related but no answer here .. . .. . Disabling a QCheckbox in a tricky way http : stackoverflow.com q 8542123 356726 .. . Qt - How to disable QCheckBox while retaining checked state http : stackoverflow.com q 24016264 356726 Comment : What do you mean by read-only A check box doesn t record information but only the state of something . Comment : Readonly : User can not change the checkbox state like in QLineEdit where the use cannot change a readonly text Comment : Btw I do not understand the downvote . But never mind . Comment : This doesn t really make sense at all . If you have a check box that will always be checked and the user cannot modify it then what s the point in displaying a check box or even having an option to modify the state anyway It s a taste but don t touch situation here your reasoning here is flawed imo . Provide us with some context to prove otherwise . Comment : It is not useless . I have a form which is either editable or readonly . The checkbox either displays true checked or false unchecked . Where have I said it will always be checked pls . let me know so I can fix that part . Only authenticated users can modify the checkbox but in readonly mode anonymous users still I want to display true or false . And I want to use a checkbox to display true false only I do not want it to be modified . .. . Answer : Following the below my code :", "Question : Any good way to make a checkbox readonly but also not grayed-out hardly visible . 1 . I have used setEnabled bool which works but the checkbox then is grayed-out and hardly readable .. . 2 . I can react on a toggle signal and reset the state . But I would need a kind of flag to determine if the box is read-only and then reset the check state means I need to create my own CheckBox class . 3 . setCheckable does not work either it does not allow me to set a checked state at all : .. . .. . cb this- ui- cb RealWorld- isCheckable .. . this- ui- cb RealWorld- setCheckable true .. . this- ui- cb RealWorld- setChecked someValue .. . this- ui- cb RealWorld- setCheckable cb .. . .. . .. . So the best thing I have is to use enable disable and accept the grayed out style . ------- Edit ------- .. . .. . Following the stylesheet examples http : doc.qt.io qt-5 stylesheet-examples.html customizing-qcheckbox I was hoping I could set the style of a disabled checkbox like the one of an enabled . Failed so far to do so . More specific : Changing the icon like in the examples http : doc.qt.io qt-5 stylesheet-examples.html customizing-qcheckbox does not work for me maybe because I am using Windows and the icons are not available under the path as in the examples . .. . .. . PS : Related but no answer here .. . .. . Disabling a QCheckbox in a tricky way http : stackoverflow.com q 8542123 356726 .. . Qt - How to disable QCheckBox while retaining checked state http : stackoverflow.com q 24016264 356726 Comment : What do you mean by read-only A check box doesn t record information but only the state of something . Comment : Readonly : User can not change the checkbox state like in QLineEdit where the use cannot change a readonly text Comment : Btw I do not understand the downvote . But never mind . Comment : This doesn t really make sense at all . If you have a check box that will always be checked and the user cannot modify it then what s the point in displaying a check box or even having an option to modify the state anyway It s a taste but don t touch situation here your reasoning here is flawed imo . Provide us with some context to prove otherwise . Comment : It is not useless . I have a form which is either editable or readonly . The checkbox either displays true checked or false unchecked . Where have I said it will always be checked pls . let me know so I can fix that part . Only authenticated users can modify the checkbox but in readonly mode anonymous users still I want to display true or false . And I want to use a checkbox to display true false only I do not want it to be modified . .. . Answer : This is Devopia s solution as a function :", "Question : I m unable to change the color of Qcheckbox in QT can somebody help me with code to change color of check box text label . I have tried Qpalette . . And im using QT4.7.4 version. . .. . Answer : Looks like for some widgets you have to force using non-system widget-engine . For checkbox it can be done by setting borders to none . So checkbox s style looks like : .. . .. . Similar behavior is required by other widgets . Some style-properties do not disable native look . For example QPushButton http : doc.qt.io qt-4.8 stylesheet-reference.html", "Question : I have a QCheckbox in a grid-layout defined as such : .. . .. . By default the checkbox is to the left of the Is subfactor text . I wish to move it to the right of the text . I ve tried playing around with subcontrol-position but to no avail . This moves the checkbox to the right it s still on the left of the text but it pushes the text to the right and out of the window s edge . This didn t help to move the text to the right : .. . .. . A solution would be creating a QLabel and adding the checkbox on its right but I don t haven t found a way to underline letters in a QLabel so that the user will know which is the shortcut key . I ve tried prefixing letters with or wrapping them in u u tags . I d still prefer to use only a QLabel but how would I switch the checkbox to the right of the text without the text getting pushed out . .. . Answer : Use the buddy mechanism . Set the QCheckBox to the buddy of the QLabel . After that prefix will underline the shortcut character in the label . See the documentation of the QLabel s setBuddy http : doc.trolltech.com 4.6 qlabel.html setBuddy . Comment : That worked great . Thank you", "Question : I m trying to have a multi-line checkbox radiobutton with Qt using standard QCheckbox QRadioButton . I didn t find the direct solution since QRadioButton wrap : true has no effect . The only thing possible would be to access to the QRadioButton- label- setLineWrap true but .. . .. . 1 . I d like to do that from the designer .. . 2 . not having to rewrite a widget .. . .. . Any idea beside putting a QRadioButton and a QLabel next to each others Thx Boris . .. . Answer : The only way I know but it s not layoutable is putting n sign into a string .", "Question : I m trying to have a multi-line checkbox radiobutton with Qt using standard QCheckbox QRadioButton . I didn t find the direct solution since QRadioButton wrap : true has no effect . The only thing possible would be to access to the QRadioButton- label- setLineWrap true but .. . .. . 1 . I d like to do that from the designer .. . 2 . not having to rewrite a widget .. . .. . Any idea beside putting a QRadioButton and a QLabel next to each others Thx Boris . .. . Answer : My solution :", "Question : I m unable to change the color of Qcheckbox in QT can somebody help me with code to change color of check box text label . I have tried Qpalette . . And im using QT4.7.4 version. . .. . Answer : This works for me :", "Question : null .. . Answer : I have a problem on the behavior of QCheckBox . I am under Qt5.3.2 MinGW .. . .. . I create a QGraphicsScene where i add severals QCheckBox via QGraphicsProxyWidget . To be able to do drag-and-drop zoom in out I reimplemented the virtual method eventFilter QObject QEvent into QMainWindows and I apply it to my scene : scene- installEventFilter this .. . .. . But I can t catch QCheckBox signal with QObject : : connect : .. . .. . If I don t apply event filter on my scene my QCheckBox work perfectly . If now I apply event filter on my QCheckbox : .. . .. . I receive the event of the first one QCheckBox selected . But if I click on another QCheckBox it is the event of the first QCheckBox selected who is received . QCheckBox status are not modified too and I need to change status into QMainWindows : : eventfilter : .. . .. . MainWindow.cpp : .. . .. . What is it that I m doing wrong Thank you . Comment : Are you returning false when you aren t filtering doc.qt.io qt-5 eventsandfilters.html event-filters http : doc.qt.io qt-5 eventsandfilters.html event-filters Comment : when i am not filtering i return this : else return QObject : : eventFilter object event Comment : OK I put some time to understand xD . Actually was needed return false . thank you @phyatt Comment : No problem . Glad I could help .", "Question : Is there any way to detect if the user clicked on the label on a QCheckBox or not If so I want to execute something and the checkstate should not be changed . . to checked or unchecked . So far I can not find any signals ways for that . . .. . Answer : Event filter is the answer . First install event filter on a check box for which you want to change behavior during construction : .. . .. . and then reject mouse press event when mouse is over the label note how label is localized in code : .. . .. . I ve test it on Qt 4.8.1 for Linux and it works as you want mouse clicks on a label are ignored and on check box it toggles state of check box . Comment : I don t use an extra QLabel . I do use the one from QCheckBox . However I wanted to detect a click on that text from QCheckBox . Comment : so what is wrong with those signals http : qt-project.org doc qt-5.0 qtwidgets qabstractbutton.html signals : clicked bool pressed released Why did you accept answer with subclassing QLabel this suggest that you use separate QLabel Comment : Cause : I want to execute something and the checkstate should not be changed . . to checked or unchecked . and thats not possible Comment : it is possible event filter allows to lots of stuff without subclassing . I gave you a scratch of it I m pretty sure it requires improvement . Without details it is hard to tell what exactly you suppose to do . Comment : Thanks I ll have a look at it .", "Question : null .. . Answer : I have a QCheckbox and which I m trying to change the state using a keyboard press of return enter rather than space . For other things such as QPushbuttons QLineEdit I ve used returnPressed in the signal however this doesnt work for QCheckbox and none of the options seem suitable . How do I change the state of the QCheckbox on return enter press when it has focus . The code I ve tried is Comment : Did you try to use keyPressEvent for your checkbox with Qt : : Key Enter Qt : : Key Return filter Comment : First and foremost : does this agree with the platform human interface guidelines for your system If it doesn t then adding such behaviors will be at the very least confusing to your users and possibly lead to disastrous unintended consequences . Comment : @demonplus - hadn t thought of that thanks Comment : @KubaOber - yeah pressing enter return to select is more intuitive for the user than pressing space Comment : How does every other piece of software behave on your platform though", "Question : I have a problem with QCheckBox . I am trying to connect a boolean variable to a QCheckBox so that when I change the boolean variable the QCheckBox will be automatically checked or unchecked . .. . .. . My Question is similar to the Question below but in opposite way . question : Python3 PyQt4 Creating a simple QCheckBox and changing a Boolean variable http : stackoverflow.com questions 12736825 python3-pyqt4-creating-a-simple-qcheckbox-and-changing-a-boolean-variable .. . .. . I just copy one solution from that question to here . In this case once I set ILCheck to True QCheckBox will be checked . Any help would be appreciated Thanks .. . .. . Update : .. . .. . I am using MVC on my project the code above just a example show what I need . The bool value ILCheck will be use in other place and I don t want call ILCheckBox in my model . I expect that if I modify the value of ILCheck ILCheckBox will react correctlly . .. . .. . Update : .. . .. . Thanks for all your reply and help . All your solution is great The way I need is more like a Modeling-View solution so that I can separate modeling part from gui part . When I want to update something I just need update modeling and don t need pay attention to what gui looks like . I can t set this Bool property in View Class so that I can t use this solution . I am not sure MVC is suitable in PyQT . I have a close solution like below with a problem . There is a problem comes with this solution and I can t solve . I think only a view can set a Model . I am not sure if I can set a model to a single QCheckBox . . Comment : You can do that with @property but I don t see why you would need that . Just expose the checkbox and use setChecked instead of assigning to a variable . Comment : @Avaris Thanks for your help . I am using MVC so I don t want expose checkBox to Model Comment : I ll write up an answer but I still think this not the right way . However I can t suggest anything else maybe QDataWidgetMapper without understanding your use-case . .. . Answer : As Avaris shows in his her answer emulating the overload of operator is a good start for solving the question . But yet still the problem of the code being added to the SelectionWindow class . But since we are using Qt lets implement a custom QObject that represents our smart boolean variable which will emit a signal when change its value . Now your code needs only a couple of changes : .. . .. . replace the line : .. . .. . by : .. . .. . and connect the signal and the slot add the line to the init some where after the line above . IMPORTANT you are not bind to make the connection from within the SelectionWindow class .. . .. . for testing the result just add : .. . .. . to your main and you will see the checkbox checked next time you run the example . The full code example was added to the end for stetical reasons Comment : Thanks This is exactly what I want", "Question : I ve got a very specific problem so I m going to try to be as clear as possible . I ve got a QTabWidget which contains QTableWidget every line of my QTableWidget is create dynamically by reading a file . myTab http : image.noelshack.com fichiers 2014 25 1402988641-checkbox.png .. . .. . As you may see when I create a line I add a qCheckBox at the end . My goal now is to send this line to the QTableWidget in the last tab of my QtableTab when I click on the qCheckBox and to delete this line when I uncheck the qCheckBox . So every time I create a line dynamically I try to associate to my qCheckBox a signal : .. . .. . But it won t work I ve got the error : .. . .. . But this slot exist I declare it in my header file and my cpp like this : .. . .. . Is my way to procced for solving this problem is good If yes how to correctly associate the signal to a slot and if no how to proceed Thank you . EDIT : Here s the code of my function creating the qCheckBox and associated it dynamically : Comment : What is supervision Namespace or a class Comment : Supervision is a class . Comment : And can you confirm you re in a member function of this class when you connect the slot Comment : I add the function where i do this in edit Comment : @EvansBelloeil there are several solutions . But signatures of connected signal and slot must be suitable . JBL has answered . .. . Answer : From Qt documentation http : qt-project.org doc qt-4.8 signalsandslots.html : .. . .. . All classes that contain signals or slots must mention Q OBJECT at the top of their declaration . They must also derive directly or indirectly from QObject . You must declare slots in your class declaration : .. . .. . The rule about whether to include arguments or not in the SIGNAL and SLOT macros if the arguments have default values is that the signature passed to the SIGNAL macro must not have fewer arguments than the signature passed to the SLOT macro" ] }
[ "yes-answer-long", "yes-answer-short" ]
toolkit
UNK_RELATION