Search Results

Search found 3516 results on 141 pages for 'malloc history'.

Page 11/141 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • How do I change a file's path in git's history?

    - by carleeto
    Here is what I have - a git repo of my code: projects |-proj1 (no git repo here yet) |-subproj1 <- current git repo here Here is what I want - a git repo which is now tracking a new project that uses my code: projects |-proj1 <-git repo moved to here, but still tracking files in subproj1 |-subproj1 (no git repo here) I'd like to keep the history intact and therefore the new repository will be referring to files that are one level deeper than the original. What is the most pain free way to do this?

    Read the article

  • C release dynamically allocated memory

    - by user1152463
    I have defined function, which returns multidimensional array. allocation for rows arr = (char **)malloc(size); allocation for columns (in loop) arr[i] = (char *)malloc(v); and returning type is char** Everything works fine, except freeing the memory. If I call free(arr[i]) and/or free(arr) on array returned by function, it crashes. Thanks for help EDIT:: allocating fuction pole = malloc(zaznamov); char ulica[52], t[52], datum[10]; float dan; int i = 0, v; *max = 0; while (!is_eof(f)) { get_record(t, ulica, &dan, datum, f); v = strlen(ulica) - 1; pole[i] = malloc(v); strcpy(pole[i], ulica); pole[i][v] = '\0'; if (v > *max) { *max = v; } i++; } return pole;` part of main where i am calling function pole = function(); releasing memory int i; for (i = 0; i < zaznamov; i++) { free(pole[i]); pole[i] = NULL; } free(pole); pole = NULL;

    Read the article

  • June 23, 1983: First Successful Test of the Domain Name System [Geek History]

    - by Jason Fitzpatrick
    Nearly 30 years ago the first Domain Name System (DNS) was tested and it changed the way we interacted with the internet. Nearly impossible to remember number addresses became easy to remember names. Without DNS you’d be browsing a web where numbered addresses pointed to numbered addresses. Google, for example, would look like http://209.85.148.105/ in your browser window. That’s assuming, of course, that a numbers-based web every gained enough traction to be popular enough to spawn a search giant like Google. How did this shift occur and what did we have before DNS? From Wikipedia: The practice of using a name as a simpler, more memorable abstraction of a host’s numerical address on a network dates back to the ARPANET era. Before the DNS was invented in 1983, each computer on the network retrieved a file called HOSTS.TXT from a computer at SRI. The HOSTS.TXT file mapped names to numerical addresses. A hosts file still exists on most modern operating systems by default and generally contains a mapping of the IP address 127.0.0.1 to “localhost”. Many operating systems use name resolution logic that allows the administrator to configure selection priorities for available name resolution methods. The rapid growth of the network made a centrally maintained, hand-crafted HOSTS.TXT file unsustainable; it became necessary to implement a more scalable system capable of automatically disseminating the requisite information. At the request of Jon Postel, Paul Mockapetris invented the Domain Name System in 1983 and wrote the first implementation. The original specifications were published by the Internet Engineering Task Force in RFC 882 and RFC 883, which were superseded in November 1987 by RFC 1034 and RFC 1035.Several additional Request for Comments have proposed various extensions to the core DNS protocols. Over the years it has been refined but the core of the system is essentially the same. When you type “google.com” into your web browser a DNS server is used to resolve that host name to the IP address of 209.85.148.105–making the web human-friendly in the process. Domain Name System History [Wikipedia via Wired] What is a Histogram, and How Can I Use it to Improve My Photos?How To Easily Access Your Home Network From Anywhere With DDNSHow To Recover After Your Email Password Is Compromised

    Read the article

  • c struct pointer issues

    - by clear2k
    I'm trying to cast a struct into another struct but I'm having incompatible pointer issues within the cast and the malloc under some_func (structs layout are the same) struct stu1 **some_func(struct stu1 *my_struct) { my_struct = (struct stu1 **)malloc(sizeof(struct stu1 *)*total_size); for(i=0;i<20;i++){ my_struct[i] = (struct stu1 *)malloc(sizeof(struct stu1)); printf("%s",my_struct[i++]->a); } } int main() { struct stu1 **my_struct; struct stu2 **my_struct2; struct stu3 **my_struct3; my_struct = some_func(my_struct); my_struct2 = (struct stu2**)some_func((struct stu1*)my_struct2); my_struct3 = (struct stu3**)some_func((struct stu1*)my_struct3); }

    Read the article

  • Can I have a shell alias evaluate a history substitution command?

    - by Brandon
    I'm trying to write an alias for cd !!:1, which takes the 2nd word of the previous command, and changes to the directory of that name. For instance, if I type rails new_project cd !!:1 the second line will cd into the "new_project" directory. Since !!:1 is awkward to type (even though it's short, it requires three SHIFTed keys, on opposite sides of of the keyboard, and then an unSHIFTed version of the key that was typed twice SHIFTed), I want to just type something like cd- but since the !!:1 is evaluated on the command line, I (OBVIOUSLY) can't just do alias cd-=!!:1 or I'd be saving an alias that contained "new_project" hard-coded into it. So I tried alias cd-='!!:1' The problem with this is that the !!:1 is NEVER evaluated, and I get a message that no directory named !!:1 exists. How can I make an alias where the history substitution is evaluated AT THE TIME I ISSUE THE ALIAS COMMAND, not when I define the alias, and not never? (I've tried this in both bash and zsh, and get the same results in both.)

    Read the article

  • Strcpy and malloc issues

    - by mrblippy
    Hi, i am having trouble getting a method relating to a linked list working, i get the errors: assignment makes pointer from integer without a cast and passing argument 1 of âstrcpyâ makes pointer from integer without a cast. i have tried to include all the relevant code, but let me know if you need more info. thanks. struct unit { char code[5]; char *name; node_ptr students; }; typedef struct node *node_ptr; struct node { int student_id; char *studentname; node_ptr next; }; void enrol_student(struct unit u[], int n) { int i, p; int student_id = 0; char code_to_enrol[7]; char buffer[100]; node_ptr studentslist; scanf("%s\n", code_to_enrol); for(i=0; i <= n; i++) { studentslist = u[i].students; if(strcmp(u[i].code ,code_to_enrol)<=0) { scanf("enter student details %d %s\n", &studentID, buffer); p = (char *) malloc (strlen(buffer)+1); strcpy(p, buffer); insert_in_order(student_id, buffer, studentslist); } } } void insert_in_order(int n, char *i, node_ptr list) { node_ptr before = list; node_ptr students = (node_ptr) malloc(sizeof(struct node)); students->ID = n; students->name = *i; while(before->next && (before->next->ID < n)) { before = before->next; } students->next = before->next; before->next = students; }

    Read the article

  • malloc works, cudaHostAlloc segfaults?

    - by Mikhail
    I am new to CUDA and I want to use cudaHostAlloc. I was able to isolate my problem to this following code. Using malloc for host allocation works, using cudaHostAlloc results in a segfault, possibly because the area allocated is invalid? When I dump the pointer in both cases it is not null, so cudaHostAlloc returns something... works in_h = (int*) malloc(length*sizeof(int)); //works for (int i = 0;i<length;i++) in_h[i]=2; doesn't work cudaHostAlloc((void**)&in_h,length*sizeof(int),cudaHostAllocDefault); for (int i = 0;i<length;i++) in_h[i]=2; //segfaults Standalone Code #include <stdio.h> void checkDevice() { cudaDeviceProp info; int deviceName; cudaGetDevice(&deviceName); cudaGetDeviceProperties(&info,deviceName); if (!info.deviceOverlap) { printf("Compute device can't use streams and should be discared."); exit(EXIT_FAILURE); } } int main() { checkDevice(); int *in_h; const int length = 10000; cudaHostAlloc((void**)&in_h,length*sizeof(int),cudaHostAllocDefault); printf("segfault comming %d\n",in_h); for (int i = 0;i<length;i++) { in_h[i]=2; } free(in_h); return EXIT_SUCCESS; } ~ Invocation [id129]$ nvcc fun.cu [id129]$ ./a.out segfault comming 327641824 Segmentation fault (core dumped) Details Program is run in interactive mode on a cluster. I was told that an invocation of the program from the compute node pushes it to the cluster. Have not had any trouble with other home made toy cuda codes.

    Read the article

  • Why doesn't this work?

    - by user146780
    I'v tried to solve a memory leak in the GLU callback by creating a global variable but now it dos not draw anything: GLdouble *gluptr = NULL; void CALLBACK combineCallback(GLdouble coords[3], GLdouble *vertex_data[4], GLfloat weight[4], GLdouble **dataOut) { GLdouble *vertex; if(gluptr == NULL) { gluptr = (GLdouble *) malloc(6 * sizeof(GLdouble)); } vertex = (GLdouble*)gluptr; vertex[0] = coords[0]; vertex[1] = coords[1]; vertex[2] = coords[2]; for (int i = 3; i < 6; i++) { vertex[i] = weight[0] * vertex_data[0][i] + weight[1] * vertex_data[0][i] + weight[2] * vertex_data[0][i] + weight[3] * vertex_data[0][i]; } *dataOut = vertex; } basically instead of doing malloc each time in the loop (thus the memory leak) im using a global pointer, but this doesn't work (drawing to the screen). Why would using malloc to a pointer created in the function work any different than a global variable? Thanks

    Read the article

  • How to debug macruby?

    - by Dan
    Hi, I've encountered an inconsistent bug with MacRuby and have no idea how to go about debugging this. If anyone could help would be great. I don't know if this is due to my own code or is it a bug in the MacRuby framework. I have a feeling it's my own code, something about over-retaining a piece of memory and hence the garbage collection failed. This is the error from Xcode. Thanks. CSV Wizard(30245,0x7fff704f7ca0) malloc: resurrection error for object 0x20199da20 while assigning {conservative-block}[196608](0x302360060)[117616] = Array[64](0x20199da20) garbage pointer stored into reachable memory, break on auto_zone_resurrection_error to debug CSV Wizard(30245,0x103781000) malloc: garbage block 0x20199da20(Array[64]) was over-retained during finalization, refcount = 1 This could be an unbalanced CFRetain(), or CFRetain() balanced with -release. Break on auto_zone_resurrection_error() to debug. CSV Wizard(30245,0x103781000) malloc: fatal resurrection error for garbage block 0x20199da20(Array[64]): over-retained during finalization, refcount = 1

    Read the article

  • Getting exc_bad_access error only when mallocguard is enabled

    - by Nareshkumar
    I have an app for iPhone in development which works properly when the Malloc guard is not enabled. However when i try to enable the malloc guard i get the following error after the app is loaded. #0 0x95f65684 in objc_msgSend () #1 0x30506515 in NSPopAutoreleasePool () #2 0x30901697 in _UIApplicationHandleEvent () #3 0x32046375 in PurpleEventCallback () #4 0x30245560 in CFRunLoopRunSpecific () #5 0x30244628 in CFRunLoopRunInMode () #6 0x308f930d in -[UIApplication _run] () #7 0x309021ee in UIApplicationMain () Now my problem is that i am not able to debug the exact location where its getting the error.. have tried malloc_error_break but didnt work out. Is it that malloc guard enabling auto releases some of the objects based on allocation??

    Read the article

  • Why does accessing a member of a malloced array of structs seg fault?

    - by WSkinner
    I am working through Learn C The Hard Way and am stumped on something. I've written a simplified version of the problem I am running into to make it easier to get down to it. Here is the code: #include <stdlib.h> #define GROUP_SIZE 10 #define DATA_SIZE 64 struct Dummy { char *name; }; struct Group { struct Dummy **dummies; }; int main() { struct Group *group1 = malloc(sizeof(struct Group)); group1->dummies = malloc(sizeof(struct Dummy) * GROUP_SIZE); struct Dummy *dummy1 = group1->dummies[3]; // Why does this seg fault? dummy1->name = (char *) malloc(DATA_SIZE); return 0; } when I try to set the name pointer on one of my dummies I get a seg fault. Using valgrind it tells me this is uninitialized space. Why is this?

    Read the article

  • ZSH - output whole history?

    - by GorillaSandwich
    I recently switched from bash to zsh. In bash one way (besides recursive search) that I used to find previously-run commands was history | grep whatever, where whatever is the bit of command I remember. In zsh, this isn't working. history returns only a few items, even though my .zsh_history file contains many entries, which I have configured it to do. How can I output my whole history, suitable for searching with grep? (Note: I started out using ryanb's dotfiles, so perhaps it's a problem with his default settings?)

    Read the article

  • Contacts and chat history of skype was lost.

    - by oommu
    First, my skype didn't have sound effects so I uninstalled it then I reinstall the skype. The sound effect still not working so I downloaded the new version of skype ( beta one), I installed it then the sound effect still not working so I download the old version of skype then install it. The sound effect works but I lost all of my contacts and lost all of chat history. The chat history is really important for me. May you please help me to restore my chat history? Thank you.

    Read the article

  • What are the worst examples of moral failure in the history of software engineering?

    - by Amanda S
    Many computer science curricula include a class or at least a lecture on disasters caused by software bugs, such as the Therac-25 incidents or Ariane 5 Flight 501. Indeed, Wikipedia has a list of software bugs with serious consequences, and a question on StackOverflow addresses some of them too. We study the failures of the past so that we don't repeat them, and I believe that rather than ignoring them or excusing them, it's important to look at these failures squarely and remind ourselves exactly how the mistakes made by people in our profession cost real money and real lives. By studying failures caused by uncaught bugs and bad process, we learn certain lessons about rigorous testing and accountability, and we make sure that our innocent mistakes are caught before they cause major problems. There are kinds of less innocent failure in software engineering, however, and I think it's just as important to study the serious consequences caused by programmers motivated by malice, greed, or just plain amorality. Thus we can learn about the ethical questions that arise in our profession, and how to respond when we are faced with them ourselves. Unfortunately, it's much harder to find lists of these failures--the only one I can come up with is that apocryphal "DOS ain't done 'til Lotus won't run" story. What are the worst examples of moral failure in the history of software engineering?

    Read the article

  • How can I rewrite the history of a published git branch in multiple steps?

    - by Frerich Raabe
    I've got a git repository with two branches, master and amazing_new_feature. The latter branch contains the work on, well, an amazing new feature. A colleague and me are both working on the same repository, and the two of us commit to both branches. Now the work on the amazing new feature finished, and a bit more than 100 commits were accumulated in the amazing_new_feature branch. I'd like to clean those commits up a bit (using git rebase -i) before merging the work into master. The issue we're facing is that it's quite a pain to rewrite/reorder all 100 commits in one go. Instead, what I'd like to do is: Rewrite/merge/reorder the first few commits in the amazing_new_feature branch and put the result into a dedicated branch which contains the 'cleaned up' history (say, a amazing_new_feature_ready_for_merge branch). Rebase the remaining amazing_new_feature branch on the amazing_new_feature_ready_for_merge branch. Repeat at 1. My idea is that at some point, all the work from amazing_new_feature should be in amazing_new_feature_ready_for_merge and then I can merge the latter into master. Is this a sensible approach, or are there better/easier/more fool-proff solutions to this problem? I'm especially scared about the second step of the above algorithm since it means rebasing a published branch. IIRC it's a dangerous thing to do.

    Read the article

  • CPU DB like IMDB for Microprocessors

    - by Jason Fitzpatrick
    If you’re interested in the history of microprocessors, the CPU DB at Stanford is a massive database of microprocessors that covers everything from code names to speed to processor families. Play with their visuals or download the entire database and make your own. CPU DB [Stanford.edu] The Best Free Portable Apps for Your Flash Drive Toolkit How to Own Your Own Website (Even If You Can’t Build One) Pt 3 How to Sync Your Media Across Your Entire House with XBMC

    Read the article

  • How Would a Single Laptop Affect the Past? [Infographic Comic]

    - by Asian Angel
    What kind of impact could a single laptop have if it were introduced to people during key periods in Western history? This infographic comic provides some speculation on what the results could be like… View the Full-Size Version Crave asks: How would you change the past with a laptop? [CNET - Crave] The HTG Guide to Hiding Your Data in a TrueCrypt Hidden Volume Make Your Own Windows 8 Start Button with Zero Memory Usage Reader Request: How To Repair Blurry Photos

    Read the article

  • problem in allocating kernel memory by malloc(),

    - by basu sagar
    Is there any protection provided by kernel? Because when we tried to allocate memory using an malloc(), the kernel allowed to allocated around 124 MB of memory, and when we try to write into it, the kernel crashed. If there was protection of kernel memory area, this wouldn't have happened, I guess.

    Read the article

  • problem in allocating kernal memory by malloc(),

    - by basu sagar
    Is there any protection provided by kernel? Because when we tried to allocate memory using an malloc(), the kernel allowed to allocated around 124 MB of memory, and when we try to write into it, the kernel crashed. If there was protection of kernel memory area, this wouldn't have happened, i guess

    Read the article

  • how to init and malloc array to pointer on C

    - by DoronS
    Hi all, looks like a memory leak when i try to initializing an array of pointers, this my code: void initLabelTable(){ register int i; hashNode** hp; labelHashTable = (hashNode**) malloc(HASHSIZE*sizeof(hashNode*)); hp = labelHashTable; for(i=0; i<HASHSIZE; i++) { *(hp+i) = NULL; } } any idea?

    Read the article

  • Use of malloc() and free() in C++

    - by Matt H
    Is there any reason to use malloc and free in C++ over their more modern counterparts? Occasionally I see this, and I can't see why some people do it. Are there any advantages/disadvantage, or is there no real difference, except that it's just better to use C++ constructs in C++?

    Read the article

  • Arena in Malloc Function

    - by Vaibhav
    I am using malloc_stats() to print malloc related statistics in which I am finding "Arena 0" for some programs and "Arena 0 and Arena 1" for some other programs. What do these arenas represent?

    Read the article

  • Cocoa & Cocoa Touch. How do I create an NSData object from a plain ole pointer?

    - by dugla
    I have malloc'd a whole mess of data in an NSOperation instance. I have a pointer: data = malloc(humungous_amounts_of_god_knows_what); uint8_t* data; How do I package this up as an NSData instance and return it to the main thread? I am assuming that after conversion to an NSData instance I can simply call: free(data); Yes? Also, back on the main thread how do I retrieve the pointer? Thanks, Doug

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >