[Solved] impacting Strings with pointers [closed]

This scanf(“%s”,kar[1000]); should trigger a compiler warning, as you pass a char where a char* is expected. You pass the 1001st element of kar (which is out of kar‘s bounds, BTW). In C array indices start with 0 for the 1st element. To scan into kar, just pass the address of kar‘s 1st element. scanf(“%s”, … Read more

[Solved] Mongodb and Express

http://mongoosejs.com/docs/populate.html elaborates with a very nice example. I have extracted the gist here for you { var personSchema = Schema({ _id : Number, name : String, age : Number, stories : [{ type: Schema.Types.ObjectId, ref: ‘Story’ }] }); var storySchema = Schema({ _creator : { type: Number, ref: ‘Person’ }, title : String, fans : … Read more

[Solved] Python Combining Dictionary of A List having Same Characteristics

Not beautiful solution, but working one values = [{‘id’: 1, ‘x’: 2}, {‘id’: 1, ‘y’: 4}, {‘id’: 1, ‘z’: 6}, {‘id’: 2, ‘j’: 5}, {‘id’: 2, ‘k’: 10}, {‘id’: 3, ‘w’: 1}, {‘id’: 3, ‘x’: 3}, {‘id’: 3, ‘y’: 5}, {‘id’: 3, ‘z’: 7}] # get all unique possible keys unique_keys = set((x[‘id’] for x … Read more

[Solved] Button with a limit of one click per hour

You can store the number of clicks in a mySQL column and increment it every time a user clicks the button and then check if the click falls in the past 1 hour interval and if so, tell them they have to wait. Something like this: select count(*) as clicks_in_the_past_hour from table where click_time >= … Read more

[Solved] getting an error numberFormatException for invalid :int ” here it prints the phonenumbers””

this is what you try to parse: “+91 72072 21721 +91 79 8105 5662 ” step one, perform a .split(“\\+”); on your String, it will actually split it in the seperate numbers. Next, remove all the spaces of the number you try to parse, so you’ll end up parsing “917207221721” and “917981055662” This will bring … Read more

[Solved] Fading a background with jQuery [duplicate]

add this jQuery(document).ready(function() { $(“html”).css({ ‘background-image’: ” }); $(“html”).animate({ background:’url(image.png)’},350); }); That’s only for the first image fade effect. If you want this effect for different images you might want to try this plug-in I’m sure you will get cool output from it. 3 solved Fading a background with jQuery [duplicate]

[Solved] Theme for ggplot2 in r

First define a function with the elements that need to be changed as arguments. Set those arguments to defaults in the graph you really like. To change the defaults, pass them on to the function in its calls. library(ggplot2) my_theme <- function(plot_title_size = 30, colour = “black”, size = 20, angle= 0){ theme(plot.title = element_text(family … Read more

[Solved] decltype in static_assert

static_assert works fine, is your code that never assert. The template struct X defines low and high as of type IntT. They are both the same type, whatever values they have. When you instantiate the struct (X<char,1,’a’> x) you are telling the compiler that the type of IntT is char and are giving to low … Read more

[Solved] How to create a regexpression for a name with just letters and one “-” i java? [closed]

Not that this is the best idea to verify names. But assuming you’ve settled your requirements, then you can use next example: if(input.matches(“[a-zA-Z]+(\\-[a-zA-Z]+)?”)) { //OK } else { //Invalid } Several examples I’ve tested using this page: String matches? qwe Yes qwe- No qwe-qwe Yes qwe-qwe- No qw2e-qwe2 No qwe-qwe-qwe No solved How to create … Read more