Posts

c - About vfork() system call? -

#include <stdio.h> #include<unistd.h> #include<sys/types.h> #include<sys/wait.h> #include<stdio.h> #include<stdlib.h> int main() { pid_t child_pid = vfork(); if(child_pid < 0) { printf("vfork() error\n"); exit(-1); } if(child_pid != 0) { printf("hey parent %d\nmy child %d\n",getpid(),child_pid); wait(null); } else { printf("hey child %d\nmy parent %d\n",getpid(),getppid()); execl("/bin/echo","echo","hello",null); exit(0); } return 0; } output: hey child 4 parent 3 hey parent 3 child 4 hello my question : why "hello" printed after execution of parent process? have started learning vfork(). please me this? after parent process executed, goes wait(null); blocks parent process until child process calls execl() or exit . therefore child process when parent blocked calling...

html - Uploading files with AJAX to PHP -

i'm seding data - including files php, if throuh html , post everyting works alright, not while trying upload ajax , wonder why. $scope.aceptar = function() { var form = $('form'); var formdata = new formdata(form); var file_1 = document.getelementbyid('file_1').files[0]; var file_2 = document.getelementbyid('file_2').files[0]; var file_3 = document.getelementbyid('file_3').files[0]; formdata.append(file_1.name, file_1); formdata.append(file_2.name, file_2); formdata.append(file_3.name, file_3); $.ajax({ method: "post", url: "http:dsfs43r4.php", data: formdata, processdata: false, async: false, success: function(data) { console.log(data); }, error: function(data) { alert("error...

c# - Sorting IEnumerable<string> -

this question has answer here: natural sort order in c# 12 answers i've got ienumerable<string> values like: pp pp.10.0 pp.6.0 pp.6.1 pp.8.3 kp.10.1 kp kp.3.20 ... etc i'd organize them alphabetically, keeping values double digits (in example above ones 10.0 , 10.1) below ones single digits. in other words, after sorting should this: kp kp.3.20 kp.10.1 pp pp.6.0 pp.6.1 pp.8.3 pp.10.0 i tried simple ienumerable<string>.orderby(x => x, stringcomparer.currentcultureignorecase) doesn't quite work in case. also bear in mind pp , kp parts could have dots in them well, if you're thinking of splitting string. just create own comparer , pass overload of orderby : https://msdn.microsoft.com/de-de/library/bb549422(v=vs.110).aspx for example: ienumerable<string>.orderby(x => x, new mycomparer...

jquery - Trigger click of an element on the basis of a button using JavaScript code in HTML markup and/or attribute(s) -

i want trigger click on icon(image) specific class/id using onclick (or using other way) of button. please see image reference. clicking "1" should trigger "2". calling javascript function "launchtopwm" use following code trigger click: $(".custom_toggle_menu_default").trigger("click"); but wondering if can call code or perform fucntionality using click etc, href='javascript:$(".custom_toggle_menu_default").trigger("click");' following code: html 1: <img class="custom_toggle_menu_default" src="cc/tt/uu/images/launchtopwm.png"> html 2: <a id="tsp" class="sp" href="launchtopwm()">cnw</a> give id element , show second anchor through pure javascript. <!doctpe html> <html> <head> <title> button style </title> <style> </style> </head> <body...

c# - How do I handle the whitespaces of a registry path? -

i'm creating process in application makes possible run commands in command prompt. when want export registry key, use reg export path file access registry key , export information file. if use path contains no whitespaces @ all, works fine. use path whitespaces, e.g. hkey_current_user\software\nvidia corporation , not work. i'm appending path string stringbuilder command, string looks this: string path = "hkey_current_user\\software\\nvidia corporation" . do have change string contained in path ? or there special static method can use format string? you need surround path quotes. might help: string path = "\"hkey_current_user\\software\\nvidia corporation\"";

apache - Suddenly 404 errors in cPanel -

we have shared host , want 2 sites on addon domain. the first site no problem second site addon domain ii when go wordpress page, face strange problem , that's problem files too. for example on page: http://song-fa.ir/wp-admin/install.php sometimes page installed , cpanel 404 error page. even static files such js file created error 404 specified in following file: http://song-fa.ir/wp-includes/js/jquery/jquery.js?ver=1.12.4 reset entire host solve problem , installation again perhaps problem solved

linux - Supporting graphpad prism in R and add external library to poratbleR -

are there linux based library dplyr , tidyr? find these r-libraries windows , mac not linux. is possible add external library portabler zip ( http://nafiux.github.io/portabler/ ) file. if yes, how add external library portabler zip file? in our application aws lambda invokes r-script using portabler zip file. want add new external dplyr library portabler zip file.