[Solved] What’s done in this line of code? [closed]

It creates a constant value named RADIX, which is the radix value for the non-standard type Doub. A radix for a floating-point type is the base of the exponent of its representation (usually 2, but since we don’t know what Doub is, it could also be a custom numeric class which uses a different base … Read more

[Solved] C# Regular expression: how to get one of two texts with condition?

You can capture each value and use the MatchEvaluator to process the groups. string inputString = “[sex:he|she] took the dog with [sex:him|her]”; string result = Regex.Replace(inputString, @”\[(?<name>[^:]+):(?<value1>[^\|]+)\|(?<value2>[^\]]+)\]”, Evaluator); And the evaluator could replace any group with the appropriate response: private string Evaluator(Match match) { if (match.Groups[“name”].Value == “sex”) { if (m_IsMale) { return match.Groups[“value1”].Value; } … Read more

[Solved] when upload zip folder validate that only .jpg,.png files will save inside zip folder +php [closed]

welcome to SO, if you like to get a nice answer and don’t want to get downvoted i suggest you to make a nice question and not provide only your code and wait that someone fix your stuff. besides that, you can use the php ZipArchive functions to get your work done http://php.net/manual/en/class.ziparchive.php // validate … Read more

[Solved] The syntax of the method [closed]

(double…values) means the method takes one or more parameters. You can call the method with different number of parameters. They are threated as an array. findMax(23.0, 13.0); // values array contains 2 double value findMax(12.0,13.0,17.0) // values array contains 3 double value for(double v : values) means the for loop iterates on every element in … Read more

[Solved] Program gives unstable output? [closed]

New code that works: #include <stdio.h> #include <conio.h> #include <string.h> #include <stdlib.h> #include <time.h> int main() { int i,j=0,code,amt, key,lines=0; int id[100],stock[100],k=0; char name[100][20],product[100]; float price[100],sum; float total=0; char ipname[100][20]; int quantity[100], ch; float ipprice[100]; float ipsub[100]; FILE*fp1; fp1=fopen(“Fruit.txt”,”r”); if(fp1==NULL) { printf(“ERROR in opening file\n”); return 1; } else { while((ch=getc(fp1))!=EOF) { if(ch==’\n’) lines++; } … Read more

[Solved] How to get combo value dynamically

1) I added id attribute to the select box id=”choose” var jsonc = [ { ID : 0, VALUE : “United State” },{ ID : 1, VALUE : “United Kingdom” },{ ID : 2, VALUE : “Afghanistan” },{ ID : 3, VALUE : “Aland Islands” },{ ID : 4, VALUE : “Albania” } ]; var … Read more

[Solved] Convert character ‘A’ to ‘B’ if I add 1 [closed]

Furthering Sergio’s answer, you can isolate the letter-ordinals and use modulo. class String def plus n case self when (‘a’..’z’) (((ord – 97 + n) % 26) + 97).chr #ord means self.ord when (‘A’..’Z’) (((ord – 65 + n) % 26) + 65).chr else raise “single-letters only” end end end ‘a’.plus 2 #=> ‘c’ ‘z’.plus … Read more

[Solved] bank, 4 atm machine input txt files, syncing information between them with semaphores

I know it’s tagged c, but since you spammed it in Lounge<C++>, let me humor you with C++: Live On Coliru #include <algorithm> #include <functional> #include <atomic> #include <fstream> #include <iostream> #include <list> #include <mutex> #include <sstream> #include <string> #include <thread> #include <vector> // not thread-aware: struct Bank { struct Account { int id; int … Read more

[Solved] copy all the properties of config to obj unless they already exist in obj

var obj ={ name : ‘x’, age:50, color : ‘clo’};var config ={ name:’suhaib’,id:25}; copyif(obj,config); function copyif(obj, config) { for (var prop in obj) { if (obj.hasOwnProperty(prop)) { if(!config.hasOwnProperty(prop)) config[prop] = obj[prop]; } } console.log(config); } var obj ={ name : ‘x’, age:50, color : ‘clo’};var config ={ name:’suhaib’,id:25}; copyif(obj,config); function copyif(obj, config) { for (var … Read more

[Solved] expected ‘)’ error in a c++ code [closed]

void Bresenham(int x1,int y1, int x2, int y2, colour) ^ you forgot the type here It should be void Bresenham(int x1,int y1, int x2, int y2, int colour) ( But you are not even using this function in your code ) You should also use int main() over void main() int main() { // your … Read more

[Solved] how to calling a php function when submitting a ninja form? [closed]

<?php function ninja_forms_register_example(){ add_action( ‘ninja_forms_process’, ‘ninja_forms_example’ ); } add_action( ‘init’, ‘ninja_forms_register_example’ ); function ninja_forms_example(){ global $ninja_forms_processing; //Get all the user submitted values $all_fields = $ninja_forms_processing->get_all_fields(); if( is_array( $all_fields ) ){ //Make sure $all_fields is an array. //Loop through each of our submitted values. foreach( $all_fields as $field_id => $user_value ){ //Do something with those values … Read more