- 1
var toCrypt:String = encodeURIComponent("GET")
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 202
−94
var toCrypt:String = encodeURIComponent("GET")
пруф: https://github.com/ptitJean/AS3FaceApi/blob/master/net/metafor/faceapi/auth/OAuth.as
+130
POST /a/my-domain.com/accounts/ClientLogin HTTP/1.1
Host: www.google.com
User-Agent: Drakma/1.2.3 (SBCL 1.0.29.11.debian; Linux; 2.6.32-30-generic; http://weitz.de/drakma/)
Accept: */*
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 97
HTTP/1.1 301 Moved Permanently
Location: /a/cpanel/my-domain.com/accounts/ClientLogin
Content-Type: text/html; charset=UTF-8
Content-Length: 223
Date: Tue, 22 Mar 2011 12:44:53 GMT
Expires: Tue, 22 Mar 2011 12:44:53 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Server: GSE
Connection: close
;;; Ну ладно, попробуем еще раз...
POST /a/cpanel/my-domain.com/accounts/ClientLogin HTTP/1.1
Host: www.google.com
User-Agent: Drakma/1.2.3 (SBCL 1.0.29.11.debian; Linux; 2.6.32-30-generic; http://weitz.de/drakma/)
Accept: */*
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 97
HTTP/1.1 404 Not Found
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Date: Tue, 22 Mar 2011 12:46:32 GMT
Content-Type: text/html; charset=UTF-8
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Connection: close
Шутники, однако :)
+121
<taskdef resource="flexTasks.tasks" classpath="${FLEX_TASK_JAR}"/>
<target name="tetris_activity">
<mxmlc file="${FREELANCERS_DIR}\orientsys\skyblockwars\src\tetriswars.as"
output="${basedir}\${DEPLOY_DIR}\tetris\tetriswars.swf"
static-link-runtime-shared-libraries="true"
debug="false"
use-network="true">
<load-config filename="${FLEX_HOME}\frameworks\flex-config.xml"/>
<source-path path-element="${basedir}/LIB"/>
<source-path path-element="C:\freelancers\orientsys\skyblockwars\src"/>
<source-path path-element="${basedir}\RoundsDeveloperAPI\src"/>
<library-path dir="${basedir}\LIB\swc">
<include name="fl.swc"/>
<include name="as3corelib.swc"/>
<include name="greensock.swc"/>
<include name="icodecoder.swc"/>
<include name="maccherone-json.swc"/>
<include name="smartfox.swc"/>
</library-path>
<library-path dir="${FLEX_HOME}\frameworks\libs">
<include name="framework.swc"/>
<include name="textLayout.swc"/>
</library-path>
</mxmlc>
<echo>flickr</echo>
</target>
Просто нет слов... мудак, с которым я работаю удалил мои билд файлы и заменил вот этим. Я работаю в Убунту, и у меня даже эмулятора Виндовса нет.
−106
private function handleApplcationCallback(call:String, params:String = "") : void
{
var paramsArr:Array;
if(params)
paramsArr = params.length > 0 ? params.split(",") : [];
else
paramsArr = [];
try
{
handleApplicationCalls(call,paramsArr);
}
catch (error : Error)
{
}
}
−107
public function receive(streamName:String):void
{
stopReceive()
if(!netConnection.connected)
{
receiveStreamName = streamName;
LogAppender.getInstance().appendLog(LogType.STREAM_LOG,"FMSStream.receive?not connected, set streamName: " + receiveStreamName);
return;
}
nsReceive = new NetStream(netConnection);
nsReceive.addEventListener(NetStatusEvent.NET_STATUS, handleReceiveNetStreamStatus);
nsReceive.play(streamName, -2, -1, true);
dispatchEvent(new VRDataEvent(VRDataEvent.OPPONENT_STREAM_UPDATED));
// default audio sound
var st:SoundTransform = nsReceive.soundTransform;
st.volume = 0.7;
nsReceive.soundTransform = st;
examineCallTimer.start();
LogAppender.getInstance().appendLog(LogType.STREAM_LOG,"FMSStream.receive?play=" + streamName);
}
Уже за новыми наушниками собирался идти...
−129
static public function getCamera():Camera
{
// Return the same camera if it has been successfully requested before
if (cam != null)
{
if (cam.muted) Security.showSettings(SecurityPanel.PRIVACY);
return cam;
}
// Get the camera
cam = Camera.getCamera();
if (cam != null)
{
// Set properties if a camera was found
if((cam.name.toLowerCase().indexOf("usb") != -1) &&
(flash.system.Capabilities.os.toLowerCase().indexOf("mac") != -1))
{
// this is a mac default cam, dont change mode
Logger.getInstance().debug("has usb + mac: no set mode");
}
else
{
cam.setMode(CAMERA_WIDTH, CAMERA_HEIGHT, 30, true);
Logger.getInstance().debug("setMode to cam");
}
cam.addEventListener(StatusEvent.STATUS, NeaveCamera.statusListener);
return cam;
}
else
{
// No camera found
Security.showSettings(SecurityPanel.CAMERA);
return new Camera();
}
}
В отчаянии.
−110
var p2pStream:P2PStream = this
var client:Object = new Object();
client.onPeerConnect = function(subscriber:NetStream):Boolean{
return p2pStream.onPeerConnect()}
nsPublish = new NetStream(netConnection, NetStream.DIRECT_CONNECTIONS);
nsPublish.client = client;
Это AS3 (хотя это было бы говном в AS2 тоже, но там хоть причину можно было понять).
−102
import com.adobe.protocols.dict.events.ErrorEvent;
Ну хоть бы циферку добавили...
−231
private function generateEvent(type:String, data:Object):TcpEvent
{
var resultEvent : TcpEvent;
switch(type)
{
case TcpEvent.CALL_STARTED:
if (data.callType == "1")
resultEvent = new TcpEvent(TcpEvent.RANDOM_CALL_STARTED, data);
else
resultEvent = new TcpEvent(TcpEvent.CALL_STARTED, data);
break
case TcpEvent.CALL_RECEIVED:
resultEvent = new TcpEvent(TcpEvent.CALL_RECEIVED, data);
break
case TcpEvent.CALL_CANCELED:
resultEvent = new TcpEvent(TcpEvent.CALL_CANCELED, data);
break
case TcpEvent.CALL_REJECTED:
resultEvent = new TcpEvent(TcpEvent.CALL_REJECTED, data);
break
case TcpEvent.CALL_ENDED:
resultEvent = new TcpEvent(TcpEvent.CALL_ENDED, data);
break
case TcpEvent.CALL_ERROR:
resultEvent = new TcpEvent(TcpEvent.CALL_ERROR, data);
break
case TcpEvent.LOCK_SUCCEEDED:
resultEvent = new TcpEvent(TcpEvent.LOCK_SUCCEEDED, data);
break
case TcpEvent.LOCK_FAILED:
resultEvent = new TcpEvent(TcpEvent.LOCK_FAILED, data);
break
case TcpEvent.RECEIVE_ACTION:
resultEvent = new TcpEvent(TcpEvent.RECEIVE_ACTION, data);
break
case TcpEvent.RECEIVE_MESSAGE:
resultEvent = new TcpEvent(TcpEvent.RECEIVE_MESSAGE, data);
break
case TcpEvent.RECEIVE_PONG:
resultEvent = new TcpEvent(TcpEvent.RECEIVE_PONG, data);
break
case TcpEvent.SET_MODE:
resultEvent = new TcpEvent(TcpEvent.SET_MODE, data);
break
case TcpEvent.SET_BALANCE:
resultEvent = new TcpEvent(TcpEvent.SET_BALANCE, data);
break
case TcpEvent.SET_STOKEN:
resultEvent = new TcpEvent(TcpEvent.SET_STOKEN, data);
break
case TcpEvent.SET_TIMESTAMP:
resultEvent = new TcpEvent(TcpEvent.SET_TIMESTAMP, data);
break
case TcpEvent.ADD_TO_RANDOM_ROUNDERS_OK:
resultEvent = new TcpEvent(TcpEvent.ADD_TO_RANDOM_ROUNDERS_OK, data);
break
case TcpEvent.REMOVE_FROM_RANDOM_ROUNDERS_OK:
resultEvent = new TcpEvent(TcpEvent.REMOVE_FROM_RANDOM_ROUNDERS_OK, data);
break
case TcpEvent.TCP_ADD_TO_RANDOM_ROUNDERS_ERROR:
resultEvent = new TcpEvent(TcpEvent.TCP_ADD_TO_RANDOM_ROUNDERS_ERROR, data);
break;
case TcpEvent.TCP_GET_NEXT_RANDOM_ROUNDER_ERROR:
resultEvent = new TcpEvent(TcpEvent.TCP_GET_NEXT_RANDOM_ROUNDER_ERROR, data);
break;
case TcpEvent.GET_CLIENT_PARAM:
resultEvent = new TcpEvent(TcpEvent.GET_CLIENT_PARAM, data);
break;
case TcpEvent.SET_WEB_SESSION_ID:
resultEvent = new TcpEvent(TcpEvent.SET_WEB_SESSION_ID, data);
break;
case TcpEvent.SEND_ACTION_ERROR:
resultEvent = new TcpEvent(TcpEvent.SEND_ACTION_ERROR, data);
break;
case TcpEvent.SEND_MESSAGE_ERROR:
resultEvent = new TcpEvent(TcpEvent.SEND_MESSAGE_ERROR, data);
break;
case TcpEvent.STOP_RECONNECTION:
resultEvent = new TcpEvent(TcpEvent.STOP_RECONNECTION, data);
stopReconnection();
break;
default:
break;
}
return resultEvent;
}
Человеку платаят не построчно, и даже не по часам. Оклад.
−102
instanceId = Math.random().toString().split(".")[1];
Способ получения строки произвольной длины из случайного набора чисел :)