La programmation

Q & A pour les programmeurs professionnels et passionnés


13
MongoDB: exception dans initAndListen: 20 Tentative de création d'un fichier de verrouillage sur un répertoire en lecture seule: / data / db, arrêt
J'ai créé /data/dbdans le répertoire racine et j'ai couru ./mongod: [initandlisten] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating [initandlisten] shutdown: going to close listening sockets... [initandlisten] shutdown: going to flush diaglog... [initandlisten] now exiting [initandlisten] shutting down with code:100
146 mongodb 

8
Comment générer buildConfigField avec le type String
Dans mon Android Studioprojet, il y en a deux build configurationavec certains buildConfigField: buildTypes { def SERVER_URL = "SERVER_URL" def APP_VERSION = "APP_VERSION" debug { buildConfigField "String", SERVER_URL, "http://dev.myserver.com" buildConfigField "String", APP_VERSION, "0.0.1" } release { buildConfigField "String", SERVER_URL, "https://myserver.com" buildConfigField "String", APP_VERSION, "0.0.1" minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } …


4
Comment écrire un fichier JSON en C #?
J'ai besoin d'écrire les données suivantes dans un fichier texte en utilisant le format JSON en C #. Les crochets sont importants pour qu'il s'agisse d'un format JSON valide. [ { "Id": 1, "SSN": 123, "Message": "whatever" }, { "Id": 2, "SSN": 125, "Message": "whatever" } ] Voici ma classe …

12
Comment lever la même exception avec un message personnalisé en Python?
J'ai ce trybloc dans mon code: try: do_something_that_might_raise_an_exception() except ValueError as err: errmsg = 'My custom error message.' raise ValueError(errmsg) À proprement parler, j'en soulève un autre ValueError , pas le ValueErrorjeté par do_something...(), qui est appelé errdans ce cas. Comment puis-je joindre un message personnalisé à err? J'essaie le …




4
Changer la taille du titre et des étiquettes des axes dans ggplot2
J'ai une question très simple, à laquelle j'ai du mal à trouver la réponse. J'espérais que quelqu'un ici pourrait m'aider. Un exemple de dataframe est présenté ci-dessous: a <- c(1:10) b <- c(10:1) df <- data.frame(a,b) library(ggplot2) g = ggplot(data=df) + geom_point(aes(x=a, y=b)) + xlab("x axis") g Je veux juste …
146 r  ggplot2 




6
Const avant ou const après?
Pour commencer, vous savez probablement que cela constpeut être utilisé pour rendre les données d'un objet ou un pointeur non modifiables ou les deux. const Object* obj; // can't change data Object* const obj; // can't change pointer const Object* const obj; // can't change data or pointer Cependant, vous …
146 c++  c  syntax  const 


En utilisant notre site, vous reconnaissez avoir lu et compris notre politique liée aux cookies et notre politique de confidentialité.
Licensed under cc by-sa 3.0 with attribution required.