[Solved] Segmentation fault while reading data from file

While you have a good answer addressing your problems with strtok(), you may be over-complicating your code by using strtok() to begin with. When reading a delimited file with a fixed delimiter, reading a line-at-a-time into a sufficiently sized buffer and then separating the buffer into the needed values with sscanf() can provide a succinct … Read more

[Solved] Import some code so that loop become infinite? [closed]

byte i=-1; From comments: Unsigned right-shifting, in Java, causes unary promotion to int: the byte 0xff becomes the int 0xffffffff, which is then right-shifted to 0x7fffffff and narrowed to 0xff for storage. 3 solved Import some code so that loop become infinite? [closed]

[Solved] css box with two different shapes

This is an answer based off of the one by damien hawks. I have included some jQuery so that both shapes change color on hover. You can adapt this to be closer to the code you had provided. DEMO HTML: <div id=”rectangle” class=”hover”></div> <div id=”halfCircleBottom” class=”hover”></div> CSS: .hover { background-color: #e7f4ef; } .hovered { background-color: … Read more

[Solved] Extract variable names from file [closed]

I don’t know about sed or R, but in Python: >>> import re >>> i = “””NOTE: Variable Variable_S1 already exists on file D1.D, using Var_S8 instead. NOTE: The variable name more_than_eight_letters_m has been truncated to ratio_s. NOTE: Variable ratio_s already exists on file D1.D, using Var_S9 instead.””” >>> print(re.findall(r'(\w+_\w+)’, i)) [‘Variable_S1’, ‘Var_S8’, ‘more_than_eight_letters_m’, ‘ratio_s’, … Read more

[Solved] Running an executable that is inside the project

Try: String exePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),”AIRApplication”, “COMTEST.exe”); The above code resolved 1/2 of the issue. The other 1/2 was that the exe was not being copied to the debug folder. Updating the ‘Copy to Output Directory’ option resolved this. 6 solved Running an executable that is inside the project

[Solved] Replace a string in string that is in a List [closed]

Simple. Iterate over all strings inside List and then check if myString contains that or not. If yes, then replace it. foreach (string item in lst) { if (myString.Contains(item)) { myString = myString.Replace(item, string.Format(“$${0}$$”, item)); } } Also you can do same with LINQ: lst.Where(item=> myString.Contains(item)).ToList() .ForEach(item => myString = myString.Replace(item, string.Format(“$${0}$$”, item))); You can … Read more

[Solved] Jquery : Drag two elements in one

If I understand you correctly, yes, it is possible. You can use the custom drag(); method there. Example : $(.class).drag().drag(); as it is chainable. Take a look at this fiddle : http://jsfiddle.net/ubEqb/58/ Hope it helps. 2 solved Jquery : Drag two elements in one

[Solved] Student Info System

In the public static String Calculate() function, you need to return return sgrade; and currently, you are not returning any object, but the method calls for the return of a string. Also, remove String sgrade = d.readLine(); from line 199 (in the addData function). This is causing problems, because you are defining a new variable … Read more