C: differences between char pointer and array [duplicate]

C: differences between char pointer and array [duplicate]

This question already has an answer here: Why do I get a segmentation fault when writing to a string initialized with “char *s” but not “char s[]”? 16 answers

How to add a subview that has its own UIViewController in Objective-C?

How to add a subview that has its own UIViewController in Objective-C?

I am struggling with subviews that have their own UIViewControllers. I have a UIViewController with a view (light pink) and two buttons on a toolbar. I want blue view to display when the first button is pressed and the yellow view to disp

Relative imports in Python 3

Relative imports in Python 3

I want to import a function from another file in the same directory.Sometimes it works for me with from .mymodule import myfunction but sometimes I get a:SystemError: Parent module '' not loaded, cannot perform relative importSometimes it w

How do I use $scope.$watch and $scope.$apply in AngularJS?

How do I use $scope.$watch and $scope.$apply in AngularJS?

I don't understand how to use $scope.$watch and $scope.$apply. The official documentation isn't helpful.What I don't understand specifically:Are they connected to the DOM?How can I update DOM changes to the model?What is the connection poin

How can I use external JARs in an Android project?

How can I use external JARs in an Android project?

I have created an Android project and added an external JAR (hessian-4.0.1.jar) to my project. I then added the JAR to the build path and checked it off in Order and Export.Order and Export is ignored it seems, and all classes from the exte

Can I use a :before or :after pseudo-element on an input field?

Can I use a :before or :after pseudo-element on an input field?

I am trying to use the :after CSS pseudo-element on an input field, but it does not work. If I use it with a span, it works OK. This works (puts th

How do I format a Microsoft JSON date?

How do I format a Microsoft JSON date?

I'm taking my first crack at Ajax with jQuery. I'm getting my data onto my page, but I'm having some trouble with the JSON data that is returned for Date data types. Basically, I'm getting a string back that looks like this:/Date(1224043200

How to call Objective-C code from Swift

How to call Objective-C code from Swift

In the new Swift language from Apple, how does one call Objective-C code?Apple mentioned that they could co-exist in one application, but does this mean that one could technically re-use old classes made in Objective-C whilst building new c

What is the explicit promise construction antipattern and how do I avoid it?

What is the explicit promise construction antipattern and how do I avoid it?

I was writing code that does something that looks like:Using the Promise constructor:function getStuffDone(param) { return new Promise(function(resolve, reject) { myPromiseFn(param+1) .then(function(val) { resolve(val);

How is concatenating urls in templates in angular less secure than in other locations?

How is concatenating urls in templates in angular less secure than in other locations?

I have an angularjs template which looks similar to this:However this results in an $interpolate:noconcat error. In contrast to that this template:or even:

Run “mvn package” on “Build project” in Eclipse

Run “mvn package” on “Build project” in Eclipse

I have maven java project in eclipse. I right click project, choose "Build project" and I want "mvn package" get invoked automatically. Is it possible? 1:Rightclick on your pom.xml and choose "Run as" -> "Maven build.." and put in Goals:

yylval and union

yylval and union

What is the purpose of union in the yacc file? Is it directly related to yylval in the flex file? If you don't use yylval, then you don't need to use union? 1:The purpose of the union is to allow storing different kind of objects into

How to log an installation made from a WiX bundle

How to log an installation made from a WiX bundle

When creating a Windows installer using the WiX (Windows Installer for XML) toolset, how do you make the install process write logging information to a log file?Is there a command-line switch which triggers the output of the log file? 1:

How does MongoDB deal with concurrent updates?

How does MongoDB deal with concurrent updates?

I started to use MongoDB at work so far so good.I was wondering though how does MongoDB deal with concurrent updates ?I've read that there is no locking feature in MongoDB so I was wondering what is the the common practice to deal with this

Auto TimeStamp new entry to DB (phpMyAdmin)

Auto TimeStamp new entry to DB (phpMyAdmin)

If I want each new entry into my db to be automatically timestamped, would I set the Field Type to "timestamp" and have the Default value set to "CURRENT_TIMESTAMP"?Is this the correct method? 1:That is correct. In SQL code that would be

$this->session->set_flashdata() and then $this->session->flashdata() doesn't work i

$this->session->set_flashdata() and then $this->session->flashdata() doesn't work i

Please take a look at the following code:$this->session->set_flashdata('message', 'This is a message.');var_dump($this->session->flashdata('message'));It returns bool(false).I hope it doesn't NEED a redirect() to be recallable after that, b

stop development server when i stop debugging

stop development server when i stop debugging

How can automatically I stop the development web server when I stop debugging in Visual Studio? 1:There is no way to get the Asp.Net development service to automatically stop when you hit the "stop debugging" button, as all that does is

Table layout panel scroll bar

Table layout panel scroll bar

given a table layout panel with 2 columns and many rows, how can i attatch a scroll bar to it as sometimes it grows much greater than the size of the form .Thank you 1:The TableLayoutPanel is an example of a ScrollableControl. You can th

How to know in which file that defined a js global var in chrome console?

How to know in which file that defined a js global var in chrome console?

How to find out which file and line a variable was defined in using google chrome console?For example, the variable Native (from MooTools) has been defined in global scope. I want to know in which file that defined this variable using googl

Does the “using” keyword mean the object is disposed and GC'ed?

Does the “using” keyword mean the object is disposed and GC'ed?

I struck up a conversation with my colleague today, who said she'd just learned the reason behind using the using statement. //Using keyword is used to clean up resources that require disposal (IDisposable interface). using (StreamReader r

How do you tweak “-webkit-” prefixed CSS properties in jQuery?

How do you tweak “-webkit-” prefixed CSS properties in jQuery?

$(this).css({ -webkit-transform:'rotate(180deg)', -moz-transform: 'rotate(180deg)', -o-transform: 'rotate(180deg)', -ms-transform: 'rotate(180deg)'});This is throwing the error: Uncaught SyntaxError: Unexpected token -I'm reall

Unable to open debugger port : java.net.SocketException “Socket closed”

Unable to open debugger port : java.net.SocketException “Socket closed”

I get this error when trying to debug an Android app on Android Studio (v.0.4.4):Error running [assembleDebug]: Unable to open debugger port : java.net.SocketException "Socket closed"The app compiles, and can be pushed to the phone using a

Android Network Discovery Service (ish) before API 14

Android Network Discovery Service (ish) before API 14

I need to be able to discover the services on the local network (so say I am running a chat application and I want to discover other devices on local network running this chat), but sadly I need to be able to use it on devices with API Broa

Instagram Video iPhone Hook

Instagram Video iPhone Hook

The current best solution:https://stackoverflow.com/a/21888830/1786820I am trying to do one better, by opening the Instagram app with a preselected video file from the PhotoRoll, and a preloaded caption. In the Flipagram app, they do just t

How to stop Chrome auto refresh tab when keep a bit long time?

How to stop Chrome auto refresh tab when keep a bit long time?

I am using Window 7 it just a bit annoying page auto refresh in chrome browser when keep tab a bit long time. It always lose my data when page is refresh.Do you have any advise for stop Chrome auto refresh?Thanks for advance. 1:Disable A