Darwin

DSS(Darwin Streaming Server) install failed on OS X10.10

末鹿安然 提交于 2019-12-22 00:35:03
问题 I want to build a Darwin Streaming Server on my mac for iOS development test. But after taking the following steps which I searched from google, it fails all the time. Method 1: Download from http://dss.macosforge.org/ ->Mac OS X Install -> Streaming Server; Install the dmg; It tries to open http://127.0.0.1:1220/ but fails with "This webpage is not available ERR_CONNECTION_REFUSED". Method 2: Download the source code of 6.0.3 version; $ tar xvf DarwinStreamingSrvr6.0.3-Source.tar $ cd

Basic authentication : failure supergaent+OSX , success on superagent+Redhat , success on Postman+OSX,

落爺英雄遲暮 提交于 2019-12-20 03:13:31
问题 Using POSTMAN , everything is fine : I pass the same headers,params,... to superagent as following : const superagent = require('superagent'); const grab = require('ps-grab'); superagent.get('https://x.rathath.net/issue_statuses.json') .set({ 'Accept': 'application/json', 'Content-Type': 'application/json' }) .auth(grab('--user'),grab('--password')) .send({}) .end((error,response)=>{ console.log(response.text); }); However it is failed ! I have a doubt in : superagent+Authorization Header+

Using Rsync include and exclude options to include directory and file by pattern

谁都会走 提交于 2019-12-18 10:11:28
问题 I'm having problems getting my rsync syntax right and I'm wondering if my scenario can actually be handled with rsync. First, I've confirmed that rsync is working just fine between my local host and my remote host. Doing a straight sync on a directory is successful. Here's what my filesystem looks like: uploads/ 1260000000/ file_11_00.jpg file_11_01.jpg file_12_00.jpg 1270000000/ file_11_00.jpg file_11_01.jpg file_12_00.jpg 1280000000/ file_11_00.jpg file_11_01.jpg file_12_00.jpg What I want

How to get mathemical PI constant in Swift

拜拜、爱过 提交于 2019-12-17 07:14:28
问题 I am trying to find a way to include the PI constant in my Swift code . I already found help in another answer, to import Darwin which I know gives me access to C functions . I also checked the Math package in Darwin and came across the following declaration: var M_PI: Double { get } /* pi */ So, I assume there is a way to use PI in the code, I just don't know how ... 回答1: With Swift 3 & 4 , pi is now defined as a static variable on the floating point number types Double , Float and CGFloat ,

How to determine iPhone is being used/unlocked

☆樱花仙子☆ 提交于 2019-12-12 20:26:08
问题 I am facing one of the requirements where I need to detect if the user is using the iPhone or not. Even if my app is in background then also. So far I've found the following way outs, but none of them points to the unlocking mechanism: applicationProtectedDataWillBecomeUnavailable : This will tell if the user has locked/unlocked the device but will work only If a passcode is set. Darwin lock/unlock notifications : Not accepted on AppStore. Proximity Sensor (

Java OS X Dock Menu

我的未来我决定 提交于 2019-12-12 16:15:05
问题 Is it possible to add items to the applications dock menu? EDIT: I think i miss phrased the question, i am not looking for a way to add an icon to the dock. what i am looking for is, when you right click on the itunes icon you get itunes control on the menu (play pause etc) i was wondering how can i add custom items to that menu. 回答1: Look into the com.apple.eawt package. Specifically, when you initialize your app, do something like the following: if (System.getProperty("os.name").startsWith(

Searching images with Googliser.sh in Mac: “ls: illegal option — I”

感情迁移 提交于 2019-12-12 03:29:05
问题 I have a question over the script Googliser and the Mac commands. I tried the script some days ago in the Mac shell and made it work. I followed the script listed here: brew install wget brew install gnu-getopt brew link --force gnu-getopt curl -sO https://raw.githubusercontent.com/teracow/googliser/master/googliser.sh sed -i "" "s/readlink/stat/;s/dev\/shm/tmp/;s/p -p/p -t/" googliser.sh chmod +x googliser.sh Easy. It worked, not the first time, and I don't remember how I made it work. But

If i set an mbuf tag in a socket filter can i later find these tagged packets in an IP filter?

吃可爱长大的小学妹 提交于 2019-12-11 18:25:32
问题 I am writing a Network Kernel Extension on MacOS that is comprised of a Socket Filter and an IP filter. My IP filter works as a kind of fire-wall, i only want to allow packets through that have been previously tagged as ALLOWED by the socket filter. In the socket filter sf_data_out_func function, I successfully tag all the mbufs. However in my ipf_output_func I do not seem to be able to find these tagged packets with a mbuf_tag_find() . I am tagging the packets in the socket filter as follows

time.h clock() broken on OS X?

帅比萌擦擦* 提交于 2019-12-11 10:37:33
问题 Am I going mad? I'm running this on x86_64. #include <stdio.h> #include <time.h> #include <unistd.h> int main(int argc, char *argv[]) { printf("Clock: %f\n", clock() / (double)CLOCKS_PER_SEC); sleep(1); printf("Clock: %f\n", clock() / (double)CLOCKS_PER_SEC); sleep(1); printf("Clock: %f\n", clock() / (double)CLOCKS_PER_SEC); return 0; } This prints Clock: 0.002880 Clock: 0.002968 Clock: 0.003019 It clearly waits for a second at the sleep(1) lines, but the output is clearly wrong. If that

vswprintf fails for certain unicode codepoints under Mac OS X

谁都会走 提交于 2019-12-11 04:08:58
问题 I am getting inexplicable failures (return value -1) from vswprintf using GCC and Mac OS X (tested with gcc 4.0 and 4.2.1 under Mac OS X 10.6 and 10.8. GCC under Linux is not affected. Visual Studio is also not affected). To demonstrate the problem I have minimally adapted the example from here so that it prints out vswprintf 's return value: /* vswprintf example */ #include <stdio.h> #include <stdarg.h> #include <wchar.h> void PrintWide ( const wchar_t * format, ... ) { wchar_t buffer[256];