Why do I get a segmentation fault when writing to a string initialized with “char *s” but not “char

Why do I get a segmentation fault when writing to a string initialized with “char *s” but not “char

The following code receives seg fault on line 2: char *str = "string"; str[0] = 'z'; printf("%s", str);While this works perfectly well: char str[] = "string"; str[0] = 'z'; printf("%s", str);Tested with MSVC and GCC. 1:See the C FA

Can 'iterator' type just subclass 'const_iterator'?

Can 'iterator' type just subclass 'const_iterator'?

After another question about iterators I'm having some doubts about custom containers. In my container, iterator is a subclass of const_iterator, so that I get conversion from non-const to const "for free". But is this allowed or are ther

A more elegant way of escaping dynamic SQL?

A more elegant way of escaping dynamic SQL?

OK, so I've got this line of code in a search stored procedure:SET @where = 'job_code = ''' + REPLACE(@job_code, '''', '''''') + ''''and there are basically two operations I'd like to streamline -the first being surrounding the concate

How can I convert List to Hashtable in C#?

How can I convert List to Hashtable in C#?

I have a list of objects, each containing an Id, Code and Description.I need to convert this list into a Hashtable, using Description as the key and Id as the value.This is so the Hashtable can then be serialised to JSON.Is there a way to c

Where can I find examples or tutorials about creating a custom android lockscreen?

Where can I find examples or tutorials about creating a custom android lockscreen?

I'm interested about Android and have been trying to find an example or tutorial about creating a custom lockscreen.I wanna create new lock screen for easy accessibilities.For example fast access to camera.fast access to phone dial.Using Sp

Is there anyway to get ID3 metadata from an MP3 or Vorbis comments from Ogg via the HTML5 audio elem

Is there anyway to get ID3 metadata from an MP3 or Vorbis comments from Ogg via the HTML5 audio elem

Mozilla Developer Center's HTML5 media guide describes an event for audio and video elements called "loadedmetadata". Is there anyway to get the metadata for files? I am writing an HTML5 extension for Google Chrome and I don't know what the

How to read app.config from a custom location, i.e. from a database in .NET

How to read app.config from a custom location, i.e. from a database in .NET

I am trying to override the ApplyConfiguration method in my custom ServiceHost to read the configuration from a database instead of app.config. Ideally I would want to be able to do something like this:Configuration config = GetConfigFromMy

stop all videos when a new video is played

stop all videos when a new video is played

I need some help with Youtube API and embeded videos. I want to stop all iframe videos (here i have taken only 3, but there are several videos)running on the current page when a new youtube video is clicked. At one point of time, only one i

Using ANTLR to parse a log file

Using ANTLR to parse a log file

I'm just about starting with ANTLR and trying to parse some pattern out of a log filefor example: log file: 7114422 2009-07-16 15:43:07,078 [LOGTHREAD] INFO StatusLog - Task 0 input : uk.project.Evaluation.Input.Function1(selected=["r

How to get the time between two TFS Work Item States in SSAS (or any other report)?

How to get the time between two TFS Work Item States in SSAS (or any other report)?

Is there a way in TFS's reports that you can get the amount of time taken for a work item to transition between states?Looking at the data in the Tfs_Warehouse database I can see that there is a record of every revision of a work item, and

Reading large file in chunks c#

Reading large file in chunks c#

I want to read very large file (4GBish) chunk by chunk.I am currently trying to use a StreamReader and the Read() read method. The syntax is:sr.Read(char[] buffer, int index, int count)Because the index is an int it will overflow in my case

ffprobe or avprobe not found. Please install one

ffprobe or avprobe not found. Please install one

i want to add tags to mp3 converted by youtube-dl & ffmpeg : youtube-dl -o '/Output/qpgTC9MDx1o.mp3' qpgTC9MDx1o -f bestaudio --extract-audio --metadata-from-title "%(artist)s - %(title)s" 2>&1i have this error in output result : [youtu

The Little Schemer evens-only*&co

The Little Schemer evens-only*&co

I'm having difficulty understanding what's going on with The Little Schemer's evens-only*&co example on page 145.Here's the code:(define evens-only*&co (lambda (l col) (cond ((null? l) (col '() 1 0)) ((atom? (car l)) (cond

How to exclude nonserializable observers from a [Serializable] INotifyPropertyChanged implementor?

How to exclude nonserializable observers from a [Serializable] INotifyPropertyChanged implementor?

I have almost a hundred of entity classes looking like that:[Serializable]public class SampleEntity : INotifyPropertyChanged{ private string name; public string Name { get { return this.name; } set { this.name = value

SOAP 1.2 python client

SOAP 1.2 python client

I am looking for a python SOAP 1.2 client but it seems that it does not exist . All of the existing clients are either not maintainted or only compatible with SOAP 1.1:sudsSOAPpyZSI 1:The zeep library supports both SOAP 1.1 and 1.2 as lo

How to log Keras loss output to a file

How to log Keras loss output to a file

When you run a Keras neural network model you might see something like this in the console: Epoch 1/3 6/1000 [..............................] - ETA: 7994s - loss: 5111.7661As time goes on the loss hopefully improves. I want to log these l

64 bit ODBC Exception

64 bit ODBC Exception

I am getting the following ODBC exception when I moved my development platform from Windows XP X86 to Windows 7 X64:ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Ap

What is a good use of lambda expressions, and how can I learn to use them? [duplicate]

What is a good use of lambda expressions, and how can I learn to use them? [duplicate]

This question already has an answer here: C# Lambda expressions: Why should I use them? 14 answers I've read that Lambda Expressions are an incredibly

What does a pipe (|) do in a CSS selector?

What does a pipe (|) do in a CSS selector?

I found the following definition in a CSS stylesheet : *|*:link {color:#ff00ff;}What's the use of the |? Is it some sort of CSS Hack? 1:It separates namespace and element name.Unless a default namespace has been defined, *|*:link is a co

Applying a function to values in dict

Applying a function to values in dict

I want to apply a function to all values in dict and store that in a separate dict. I am just trying to see how I can play with python and want to see how I can rewrite something like thisfor i in d: d2[i] = f(d[i])to something like d2[i

SeekBar Thumb position issue

SeekBar Thumb position issue

I'm trying to do a "labeled" thumb for my Seekbar. The objective is to customize a text above the thumb every time the Seekbar position changes.I'm doing this: ... seekBar = (SeekBar) findViewById(R.id.bet_seek_bar); se

Should compile sdk be lower than target sdk

Should compile sdk be lower than target sdk

The overwhelming advice on SO is that compile SDK should usually match target SDK.https://stackoverflow.com/a/27629181/360211 Likewise it is advisable to have this [compileSdk] match you target sdk version.https://stackoverflow.com/a/28294

Problem with SerialPort

Problem with SerialPort

I'm working with SerialPort to communicate (read only) with barcode reader. I've installed driver to operate with the reader as if it was connected via Com-port, though it is a usb device. When the device is plugged, one more Com-port appea

How to initialize SelectElements while using PageFactory / FindsBy in Selenium C#?

How to initialize SelectElements while using PageFactory / FindsBy in Selenium C#?

I am building a Page Object Model in Selenium WebDriver for C#, using the PageFactory.Unfortunately, I have discovered that the FindsByAttribute will not initialize a SelectElement (HTML tag / dropdown menu). I've happened upon or come up

Is it possible to use 2 versions of jQuery on the same page?

Is it possible to use 2 versions of jQuery on the same page?

NOTE: I know similar questions have already been asked here and here, but I'm looking for additional clarification as to how to make this work or good reasons for avoiding it entirely.I'm adding functionality to an existing web site that is