- use expectations
- improved gibbs sampling - LayerArray is template class git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@18 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -166,7 +166,7 @@ public:
|
||||
int numBytes = stream.callIntMethod (HTTPStream.read, javaArray, (jint) bytesToRead);
|
||||
|
||||
if (numBytes > 0)
|
||||
env->GetByteArrayRegion (javaArray, 0, numBytes, static_cast<jbyte*> (buffer));
|
||||
env->GetByteArrayRegion (javaArray, 0, numBytes, static_cast <jbyte*> (buffer));
|
||||
|
||||
env->DeleteLocalRef (javaArray);
|
||||
return numBytes;
|
||||
|
||||
@@ -31,26 +31,26 @@ void MACAddress::findAllAddresses (Array<MACAddress>& result)
|
||||
const int s = socket (AF_INET, SOCK_DGRAM, 0);
|
||||
if (s != -1)
|
||||
{
|
||||
struct ifaddrs* addrs = nullptr;
|
||||
char buf [1024];
|
||||
struct ifconf ifc;
|
||||
ifc.ifc_len = sizeof (buf);
|
||||
ifc.ifc_buf = buf;
|
||||
ioctl (s, SIOCGIFCONF, &ifc);
|
||||
|
||||
if (getifaddrs (&addrs) != -1)
|
||||
for (unsigned int i = 0; i < ifc.ifc_len / sizeof (struct ifreq); ++i)
|
||||
{
|
||||
for (struct ifaddrs* i = addrs; i != nullptr; i = i->ifa_next)
|
||||
struct ifreq ifr;
|
||||
strcpy (ifr.ifr_name, ifc.ifc_req[i].ifr_name);
|
||||
|
||||
if (ioctl (s, SIOCGIFFLAGS, &ifr) == 0
|
||||
&& (ifr.ifr_flags & IFF_LOOPBACK) == 0
|
||||
&& ioctl (s, SIOCGIFHWADDR, &ifr) == 0)
|
||||
{
|
||||
struct ifreq ifr;
|
||||
strcpy (ifr.ifr_name, i->ifa_name);
|
||||
ifr.ifr_addr.sa_family = AF_INET;
|
||||
MACAddress ma ((const uint8*) ifr.ifr_hwaddr.sa_data);
|
||||
|
||||
if (ioctl (s, SIOCGIFHWADDR, &ifr) == 0)
|
||||
{
|
||||
MACAddress ma ((const uint8*) ifr.ifr_hwaddr.sa_data);
|
||||
|
||||
if (! ma.isNull())
|
||||
result.addIfNotAlreadyThere (ma);
|
||||
}
|
||||
if (! ma.isNull())
|
||||
result.addIfNotAlreadyThere (ma);
|
||||
}
|
||||
|
||||
freeifaddrs (addrs);
|
||||
}
|
||||
|
||||
close (s);
|
||||
@@ -263,7 +263,7 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
String responseHeader (readResponse (timeOutTime));
|
||||
String responseHeader (readResponse (socketHandle, timeOutTime));
|
||||
position = 0;
|
||||
|
||||
if (responseHeader.isNotEmpty())
|
||||
@@ -302,7 +302,7 @@ private:
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
String readResponse (const uint32 timeOutTime)
|
||||
String readResponse (const int socketHandle, const uint32 timeOutTime)
|
||||
{
|
||||
int numConsecutiveLFs = 0;
|
||||
MemoryOutputStream buffer;
|
||||
@@ -338,8 +338,7 @@ private:
|
||||
dest << "\r\n" << key << ' ' << value;
|
||||
}
|
||||
|
||||
static void writeHost (MemoryOutputStream& dest, const bool isPost,
|
||||
const String& path, const String& host, int /*port*/)
|
||||
static void writeHost (MemoryOutputStream& dest, const bool isPost, const String& path, const String& host, const int port)
|
||||
{
|
||||
dest << (isPost ? "POST " : "GET ") << path << " HTTP/1.0\r\nHost: " << host;
|
||||
}
|
||||
|
||||
@@ -234,13 +234,7 @@ namespace
|
||||
if (isDir != nullptr) *isDir = statOk && ((info.st_mode & S_IFDIR) != 0);
|
||||
if (fileSize != nullptr) *fileSize = statOk ? info.st_size : 0;
|
||||
if (modTime != nullptr) *modTime = Time (statOk ? (int64) info.st_mtime * 1000 : 0);
|
||||
|
||||
if (creationTime != nullptr) *creationTime = Time ((! statOk) ? 0 : (int64) (1000 *
|
||||
#if JUCE_MAC || JUCE_IOS
|
||||
info.st_birthtime));
|
||||
#else
|
||||
info.st_ctime));
|
||||
#endif
|
||||
if (creationTime != nullptr) *creationTime = Time (statOk ? (int64) info.st_ctime * 1000 : 0);
|
||||
}
|
||||
|
||||
if (isReadOnly != nullptr)
|
||||
@@ -670,7 +664,6 @@ int File::getVolumeSerialNumber() const
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
#if ! JUCE_IOS
|
||||
void juce_runSystemCommand (const String&);
|
||||
void juce_runSystemCommand (const String& command)
|
||||
{
|
||||
@@ -691,7 +684,7 @@ String juce_getOutputFromCommand (const String& command)
|
||||
tempFile.deleteFile();
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//==============================================================================
|
||||
#if JUCE_IOS
|
||||
|
||||
@@ -38,7 +38,7 @@ void Logger::outputDebugString (const String& text)
|
||||
#endif
|
||||
|
||||
//==============================================================================
|
||||
#if JUCE_USE_MSVC_INTRINSICS
|
||||
#if JUCE_USE_INTRINSICS
|
||||
|
||||
// CPU info functions using intrinsics...
|
||||
|
||||
@@ -313,7 +313,7 @@ double Time::getMillisecondCounterHiRes() noexcept { return hiResCounterHa
|
||||
//==============================================================================
|
||||
static int64 juce_getClockCycleCounter() noexcept
|
||||
{
|
||||
#if JUCE_USE_MSVC_INTRINSICS
|
||||
#if JUCE_USE_INTRINSICS
|
||||
// MS intrinsics version...
|
||||
return (int64) __rdtsc();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ void* getUser32Function (const char* functionName)
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
#if ! JUCE_USE_MSVC_INTRINSICS
|
||||
#if ! JUCE_USE_INTRINSICS
|
||||
// In newer compilers, the inline versions of these are used (in juce_Atomic.h), but in
|
||||
// older ones we have to actually call the ops as win32 functions..
|
||||
long juce_InterlockedExchange (volatile long* a, long b) noexcept { return InterlockedExchange (a, b); }
|
||||
|
||||
Reference in New Issue
Block a user