« first day (926 days earlier)      last day (1502 days later) » 

11:19 AM
738
Q: Splitting a string in C++

AshwinWhat's the most elegant way to split a string in C++? The string can be assumed to be composed of words separated by whitespace. (Note that I'm not interested in C string functions or that kind of character manipulation/access. Also, please give precedence to elegance over efficiency in your ans...

 
1 message moved from Lounge<C++>
 
 
4 hours later…
2:52 PM
and the code is:
static void init_random(uint32_t initseed=0)
{
	if (initseed==0)
	{
		struct timeval tv;
		gettimeofday(&tv, NULL);
		seed=(uint32_t) (4223517*getpid()*tv.tv_sec*tv.tv_usec);
	}
	else
		seed=initseed;
#if !defined(CYGWIN) && !defined(__INTERIX)
	//seed=42
	//SG_SPRINT("initializing random number generator with %d (seed size %d)\n", seed, RNG_SEED_SIZE)
	initstate(seed, CMath::rand_state, RNG_SEED_SIZE);
#endif
}
and included files are:
#ifndef __MATHEMATICS_H_
#define __MATHEMATICS_H_

#include <shogun/base/SGObject.h>
#include <shogun/lib/common.h>
#include <shogun/io/SGIO.h>
#include <shogun/base/Parallel.h>

#include <math.h>
#include <stdio.h>
#include <float.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>

#ifdef SUNOS
#include <ieeefp.h>
#endif
 
3:19 PM
4 messages moved from Lounge<C++>
 
 
3 hours later…
5:50 PM
0
Q: Sending "string" and "int" var using send() method in socket

KarimkhanMy below code: for (std::map < int, std::vector < std::string > >::iterator hit = three_highest.begin(); hit != three_highest.end(); ++hit) { //std::cout << hit->first << ":"; for (std::vector < std::string >::iterator vit = (*hit).second.begin(); vit != (*hit).second.end(); vit++) { ...

 
1 message moved from Lounge<C++>
 
6:22 PM
-1
Q: Sending "string" and "int" var using send() method in socket

KarimkhanMy below code: for (std::map < int, std::vector < std::string > >::iterator hit = three_highest.begin(); hit != three_highest.end(); ++hit) { //std::cout << hit->first << ":"; for (std::vector < std::string >::iterator vit = (*hit).second.begin(); vit != (*hit).second.end(); vit++) { ...

 
1 message moved from Lounge<C++>
 
 
2 hours later…
8:48 PM
public function GetStaff(structures\GetStaff $parameters) {
return $this->__soapCall('GetStaff', array(
$parameters
) , array(
'uri' => 'http://clients.mindbodyonline.com/api/0_5',
'soapaction' => ''
));
}
<?php
require_once("../MindbodyClient.php");

class StaffService extends MindbodyClient
{
public static $classmap = array(
'GetStaff' => 'MindbodyAPI\structures\GetStaff',
'GetStaffRequest' => 'MindbodyAPI\structures\GetStaffRequest',
'MBRequest' => 'MindbodyAPI\structures\MBRequest',
'SourceCredentials' => 'MindbodyAPI\structures\SourceCredentials',
'UserCredentials' => 'MindbodyAPI\structures\UserCredentials',
'XMLDetailLevel' => 'MindbodyAPI\structures\XMLDetailLevel',
'StaffCredentials' => 'MindbodyAPI\structures\StaffCredentials',
 
2 messages moved from PHP
 

« first day (926 days earlier)      last day (1502 days later) »