This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mapReduce(f:Int=>Int,combine: (Int,Int)=>Int, zero:Int)(a:Int,b:Int):Int ={ | |
if(a>b) zero | |
else combine(f(a),mapReduce(f, combine, zero)(a+1, b)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mapReducev1(f: Int => Int, combine: (Int, Int) => Int, zero: Int)(a: Int, b: Int): Int = { | |
if (a > b) zero | |
else (a to b).map(f).reduce(combine) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function arrangeItems():void { | |
var itemSelected:FluctGridItem = _dictionary[_currentItem]; | |
var cellToBeDraggedOn:Point = getCellCoord(_currentItem.x, _currentItem.y); | |
var intialCol:int = itemSelected.col; | |
var intialRow:int = itemSelected.row; | |
var colToBeDraggedOn:int = cellToBeDraggedOn.x; | |
var rowToBeDraggedOn:int = cellToBeDraggedOn.y; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cgon { | |
import flash.display.MovieClip; | |
import flash.display.Sprite; | |
public class FluctGridItem extends Sprite { | |
public var row:int; | |
public var col:int; | |
public var itemonme:MovieClip; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cgon { | |
import com.greensock.easing.Expo; | |
import com.greensock.TweenLite; | |
import flash.display.Sprite; | |
import flash.events.MouseEvent; | |
import flash.geom.Point; | |
import flash.utils.Dictionary; | |
public class FluctGrid extends Sprite { | |
public var _tweenTime:Number = 0.5; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> | |
<hibernate-configuration> | |
<session-factory> | |
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> | |
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> | |
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/game_db</property> | |
<property name="hibernate.connection.username">root</property> | |
<property name="hibernate.connection.password">!.Wlu9RrCA</property> | |
<!-- Use the C3P0 connection pool provider --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cgon.executer; | |
import com.electrotank.electroserver5.extensions.BaseManagedObjectFactory; | |
import com.electrotank.electroserver5.extensions.api.value.EsObjectRO; | |
import java.util.concurrent.*; | |
import java.util.concurrent.atomic.AtomicInteger; | |
public class ExecutorServiceManagedObjectFactory extends BaseManagedObjectFactory { | |
private ExecutorService executor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<Extension> | |
<Name>FunES</Name> | |
<EventHandlers> | |
<LoginHandlers> | |
<LoginHandler> | |
<Handle>Login</Handle> | |
<Type>Java</Type> | |
<Path>com.cgon.loginmodule.Login</Path> | |
</LoginHandler> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cgon.hqls; | |
import game_db.entity.Userlogin; | |
import java.util.List; | |
import org.hibernate.Query; | |
import org.hibernate.Session; | |
public class SelectHQLS { | |
public static Userlogin getUserByUname(String userName,Session session){ | |
Query q = session.createQuery("from Userlogin where email=:uEmail"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cgon.loginmodule; | |
import com.cgon.hqls.SelectHQLS; | |
import com.electrotank.electroserver5.extensions.BasePlugin; | |
import com.electrotank.electroserver5.extensions.api.value.EsObject; | |
import com.electrotank.electroserver5.extensions.api.value.EsObjectRO; | |
import game_db.entity.Userlogin; | |
import game_db.util.HibernateUtil; | |
import java.util.concurrent.Executor; | |
import org.hibernate.Session; |