Cerjam.Net  

Go Back   Cerjam.Net > General > Programming/Programs
Register FAQ Members List Casino Arcade Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
Old 02-08-2010, 02:13 PM   #31
karz
206 > *
 

Join Date: Nov 2006
Posts: 669

Points: 197,215.38
Bank: 424,695.51

Stock Value: 0.000
Stock Gain: 0.000

Spent Time On Board: 6 day 8 hour 51 min
Send a message via AIM to karz
Default



Hmmm.
__________________
Guys are smarter because we have two heads.
Girls talk too much because they have four lips.

Snitches get Stitches.
~karz~

00000100:10010100 bitches xD
karz is offline  
Reply With Quote
Old 02-08-2010, 03:07 PM   #32
smh
...
 

Join Date: Sep 2007
Posts: 1,131

Points: 23,862.15
Bank: 0.00

Stock Value: 0.000
Stock Gain: 0.000

Spent Time On Board: 1 day 17 hour 9 min
My Mood:
Send a message via AIM to smh
Default

or you know you can get a life off the computer.
__________________
smh is offline  
Reply With Quote
Old 02-08-2010, 05:00 PM   #33
sdlvx
look at the titties
 
sdlvx's Avatar
 
Acne Be Gone Champion!
Join Date: May 2005
Posts: 7,439

Points: 108,857.36
Bank: 142,183,530,509.88

Stock Value: 93,480.00
Stock Gain: 10460.000

Spent Time On Board: 3 week 5 day 11 hour
My Mood:
Default

Yeah, get a real life like scotty here. A real life that involves being a bisexual juggalo rapper who is mildly obese.
__________________
http://myhuddler.com
sdlvx is offline  
Reply With Quote
Old 02-08-2010, 10:08 PM   #34
Nh 2
nou
 
Nh 2's Avatar
 

Join Date: May 2005
Location: New York
Posts: 4,093

Points: 189,354.45
Bank: 891,082,347,813.24

Stock Value: 0.000
Stock Gain: 0.000

Spent Time On Board: 3 week 2 day 0 hour
My Mood:
Send a message via AIM to Nh 2
Default

Quote:
Originally Posted by karz View Post


Hmmm.
Doesn't surprise me in the least.
Nh 2 is offline  
Reply With Quote
Old 02-08-2010, 11:42 PM   #35
Are you watching closely?
 



's Avatar
 

Join Date: Jun 2005
Posts: 2,794

Points: 2,189,305.25
Bank: 355.52

Stock Value: 0.000
Stock Gain: 0.000

Spent Time On Board: 2 week 2 day 5 hour
Default

Quote:
Originally Posted by karz View Post


Hmmm.
lol it thinks Pokegame is a trojan? Cool, might be the socket if anything. The source to my exe itself is in that archive. The SRS Audio Sandbox is that program (made by SRS, obviously) and a crack I got off some site. Cracks = viruses. Most of the files in /files are crap I downloaded and put up for other people. I'm surprised it didn't flag that 'stress' archive, I've seen some other AVs do that. It's some old ass, I'm talking WinME or earlier, program that let you trash a screenshot of your desktop.

Did you like my redesigned main page at least?
__________________

Last edited by zerxer : 02-08-2010 at 11:46 PM.



 is offline  
Reply With Quote
Old 02-09-2010, 03:17 AM   #36
karz
206 > *
 

Join Date: Nov 2006
Posts: 669

Points: 197,215.38
Bank: 424,695.51

Stock Value: 0.000
Stock Gain: 0.000

Spent Time On Board: 6 day 8 hour 51 min
Send a message via AIM to karz
Default

Quote:
Originally Posted by Zerxer View Post

Did you like my redesigned main page at least?
I was going to say something about it but I forgot....

I like it... It looks nice and sleek. Not sure what the old one looked like..... But this is a nice design.
__________________
Guys are smarter because we have two heads.
Girls talk too much because they have four lips.

Snitches get Stitches.
~karz~

00000100:10010100 bitches xD
karz is offline  
Reply With Quote
Old 02-10-2010, 01:05 PM   #37
sdlvx
look at the titties
 
sdlvx's Avatar
 
Acne Be Gone Champion!
Join Date: May 2005
Posts: 7,439

Points: 108,857.36
Bank: 142,183,530,509.88

Stock Value: 93,480.00
Stock Gain: 10460.000

Spent Time On Board: 3 week 5 day 11 hour
My Mood:
Default

Quote:
Originally Posted by




;181954
lol it thinks Pokegame is a trojan? Cool, might be the socket if anything. The source to my exe itself is in that archive. The SRS Audio Sandbox is that program (made by SRS, obviously) and a crack I got off some site. Cracks = viruses. Most of the files in /files are crap I downloaded and put up for other people. I'm surprised it didn't flag that 'stress' archive, I've seen some other AVs do that. It's some old ass, I'm talking WinME or earlier, program that let you trash a screenshot of your desktop.

Did you like my redesigned main page at least?
I reported it as a virus after you repeatedly turned down my sexual advances.
__________________
http://myhuddler.com
sdlvx is offline  
Reply With Quote
Old 02-10-2010, 01:20 PM   #38
Nh 2
nou
 
Nh 2's Avatar
 

Join Date: May 2005
Location: New York
Posts: 4,093

Points: 189,354.45
Bank: 891,082,347,813.24

Stock Value: 0.000
Stock Gain: 0.000

Spent Time On Board: 3 week 2 day 0 hour
My Mood:
Send a message via AIM to Nh 2
Default

He only turned you down because he didn't want his current boyfriend to find out. Large black men tend to get violent when cheated on.
Nh 2 is offline  
Reply With Quote
Old 02-10-2010, 01:37 PM   #39
Are you watching closely?
 



's Avatar
 

Join Date: Jun 2005
Posts: 2,794

Points: 2,189,305.25
Bank: 355.52

Stock Value: 0.000
Stock Gain: 0.000

Spent Time On Board: 2 week 2 day 5 hour
Default

Quote:
Originally Posted by Nh 2 View Post
He only turned you down because he didn't want his current boyfriend to find out. Large black men tend to get violent when cheated on.
Don't bother, there's no talking sense into Steve. He just doesn't understand.
__________________



 is offline  
Reply With Quote
Old 03-16-2010, 12:43 AM   #40
a j
...yeah
Default

Well, I guess this is a good thing but I haven't written anything I thought would be worth posting here. I know some people disliked the speed of ExtJS but, I've been continuing to use it and, using PHP to help construct some of the objects ExtJS uses, I've been able to speed it up a bit.
__________________
Politeness: the greatest hypocrisy of all.
a j is offline  
Reply With Quote
Old 03-16-2010, 12:58 AM   #41
Are you watching closely?
 



's Avatar
 

Join Date: Jun 2005
Posts: 2,794

Points: 2,189,305.25
Bank: 355.52

Stock Value: 0.000
Stock Gain: 0.000

Spent Time On Board: 2 week 2 day 5 hour
Default

did you bother trying jquery yet?
__________________



 is offline  
Reply With Quote
Old 03-16-2010, 02:28 AM   #42
a j
...yeah
Default

oh yeah, I use jQuery as the intermediary between PHP & ExtJS. jQuery's faster for data processing and some UI manipulation but, when it comes to dynamically rendering completely different types of data, I didn't want to reinvent the wheel.

I use jQuery to get the JSON objects I've constructed in PHP then generate the ExtJS objects from that.

Code:
function getGreaterNumber(x, y){
    //build this specifically to make sure column widths are of appropriate sizes
    //x = current high number, y = current string to compare
    var o = 0;
    if (typeof x !== "undefined" && typeof y !== "undefined") {
        var _xl = 0;
        var _yl = 0;
        if (typeof x == "number") {
            _xl = x;
        }
        else {
            var _x = x + "";
            _xl = _x.length * 4;
        }
        var _y = y + "";
        _yl = ((_y.length < 20) ? ((_y.length < 15) ? ((_y.length < 10) ? ((_y.length < 5) ? _y.length * 20 : _y.length * 10) : _y.length * 8) : _y.length * 5) : _y.length * 3);
        if (_xl > _yl) {
            o = _xl;
        }
        else {
            o = _yl;
        }
    }
    if (o < 1) {
        errorList.push({
            functionName: "getGreaterNumber",
            description: 'There was an error setting the column widths'
        });
    }
    return o;
}

var errorList = []; //I'm not displaying this but the errorList is sent back to the server when a user navigates away from the page so I can work on them and, if necessary debug
var iData;
var dataObj = [];
function parseData(a){
    //right now this fills in the specific requirements of the GridPanel object
    //I don't intend on working on this anymore because I know I can perform the same function in PHP but, I'm making an abstraction layer for ExtJS in the db so, when I want to move this over it'll be a one shot deal...vs. making this unnecessarily complex or having ExtJS-specific conditional statements in the PHP code, which is just wrong
    if (((a.constructor.toString().indexOf("Object") == -1) ? false : true) == true) {
        if (a.hasOwnProperty('dsName') == true) {
            //the data from the php page already has some objects it responds with to reduce the overhead in constructing the dynamic objects on the browser
            dataObj[a.dsName] = a.dsName;
            if (a.hasOwnProperty('fields') == true) {
                dataObj['fields'] = [];
                dataObj['fields'] = a.fields;
                dataObj['columns'] = [];
                var tmpData = a;
                $.each(a.fields, function(){
                    var rl = this.name;
                    var colWidth = this.name.length * 4 > 25 ? this.name.length * 3 : 25;
                    var m = a[a.dsName];
                    $.each(m, function(){
                        var _tmp = this[rl];
                        colWidth = getGreaterNumber(colWidth, _tmp);
                    });
                    dataObj['columns'].push({
                        id: this.id,
                        header: this.friendly_name,
                        width: colWidth,
                        dataIndex: this.name,
                        filterable: true
                    });
                });
                var _store = new Ext.data.JsonStore({
                    fields: dataObj['fields'],
                    root: a.dsName
                });
                _store.loadData(tmpData);
                return _store;
            }
        }
    }
}

function getNewObject(x, m, toDataStore){
    //generic function to get the JSON data
    $.getJSON(Samscreen.links.erp + 'JS/d-js.php?rid=' + Math.floor(Math.random() * 11) + '&task=' + x.task + '&filter=' + x.filter + '&employee=' + userInfo.id + '&start=0&limit=10', function(data){
        var _localFx;
        if (data.hasOwnProperty("parser")) {
            _localFx = data.parser;
        }
        else {
            _localFx = parseData;
        }//Most often I'm making grids so that parser is setup by default but, for certain forms, I want a different method of controlling the output so I pass the function name in the JSON object
        if (toDataStore === 1) {
            iData = _localFx(data);
            if (typeof m == "undefined") {
                return iData;
            }
            else {
                m(iData);
            }
        }
        else {
            return data;
        }//after the parser's done its work, the function that called this sometimes calls a follow up function. In the case of rendering whatever was received, this is where I call the final rendering function. At this point, the objects necessary to render the object have all been made & brought over to the client.
    });
}

function getclientList(x){
    var grid = new Ext.grid.GridPanel({
        title: 'Client List',
        store: x,
        trackMouseOver: false,
        disableSelection: true,
        region: 'center',
        loadMask: true,
        columns: dataObj.columns,
        bbar: new Ext.PagingToolbar({
            pageSize: 15,
            store: x,
            displayInfo: true,
            displayMsg: 'Displaying clients {0} - {1} of {2}',
            emptyMsg: "No clients to display",
            items: ['-', {
                pressed: true,
                enableToggle: true,
                text: 'Show Preview',
                cls: 'x-btn-text-icon details',
                toggleHandler: function(btn, pressed){
                    var view = grid.getView();
                    view.showPreview = pressed;
                    view.refresh();
                }
            }]
        })
    });
    openReportWindow('reportDisp', '', grid, 'Client List');
}

function showCL(){
    var asdf = [];
    asdf.task = 3;
    getNewObject(asdf, handleData, 1);
}
The function showCL isn't what I actually use but it contains how I handle the initial call for the rest of it. The way showCL is actually constructed is the same as the other data but for a menu so, instead of parsing the data to return a data store, I use jQuery to build a menu and create the necessary DOM elements.

For everything that's here, I'm sure there's a better way of going about it but, so far, this has been the most useful to me. Like I said, jQuery's great, for some things, but I'm not a fan of reinventing the wheel for marginal performance gains. With this framework, I'm able to load lists of several thousand or 10 items relatively quickly. As I focus more on the abstraction of ExtJS between PHP and the DB I'll probably find more efficient ways of using jQuery but, for right now, I've got a lot of different types of data and reporting needs to work with.
__________________
Politeness: the greatest hypocrisy of all.

Last edited by a j : 03-18-2010 at 08:44 PM. Reason: corrected src formatting
a j is offline  
Reply With Quote
Old 03-16-2010, 07:27 AM   #43
a j
...yeah
Default Dependencies

Figured I'd include the files I'm using in this to paint a little clearer of a picture.

d-js.php
PHP Code:
<?php
error_reporting
(-1);
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Wed, 13 Jun 1984 18:30:00 AKST"); //Yes, this is my birthdate, what of it?
header("Content-type: text/javascript; charset=UTF-8");
include(
"js-functions.php");
$filterString =$outputJSON="";
$totalWanted=$sInt=$tid=$employee=0;
$requestID;
if (isset(
$_REQUEST['rid'])) {
    
$requestID $_REQUEST["rid"];
}
if (isset(
$_REQUEST["employee"])) {
    
$employee $_REQUEST["employee"];
}
if (isset(
$_REQUEST["task"])) {
    
$tid $_REQUEST["task"];
}
if (isset(
$_REQUEST["start"])) {
    
$sInt $_REQUEST["start"];
}
if (isset(
$_REQUEST["limit"])) {
    
$totalWanted $_REQUEST["limit"];
}
if (isset(
$_REQUEST["filter"])) {
    
$filterString $_REQUEST["filter"];
}
$psx=new dbConnect;
if (isset(
$filterString)) {
    
$ps=$psx->getData($employee$tid$sInt$totalWanted,$filterString);
}
else {
    
$ps=$psx->getData($employee$tid$sInt$totalWanted);
}

$dh=new dataHandler;
$dh->showArray($ps);
unset(
$ps);
unset(
$dh);
?>
js-functions.php
PHP Code:
<?php
error_reporting
(-1);/**
 *
 * Description of jsfunctions
 *
 * @author A.J. Rembert
 */
class dbConnect {
    public function 
convertAnsi2UTF8($array) {
        
//not my function
        
foreach ($array as  $key=>$item) {
            if(
is_array($item)) $array[$key]=convertAnti2UTF8($item);
            else 
$array[$key]=iconv("ISO-8859-1","UTF-8",$item);
        }
        return 
$array;
    }
    public function 
getData($employee,$task,$startNum,$returnLimit$filterS NULL) {
        
$link mssql_connect(my super secret connection);
        if (!
$link) {
            die(
'Fail');
        }
        
        
mssql_select_db(my super secret db name$link);
        
$proc mssql_init('UI_Employee_Based_Reports'$link);
        
mssql_bind($proc'@EMID',    $employeeSQLINT1,     false,  false,   3);
        
mssql_bind($proc'@TID',    $taskSQLINT1,     false,  false,   3);
        if (
$startNum 0) {
            
mssql_bind($proc'@startNum',    $startNumSQLINT1,     false,  false,   3);
        }
        if (
$returnLimit  0) {
            
mssql_bind($proc'@totalWanted',    $returnLimitSQLINT1,     false,  false,   3);
        }
        if (isset(
$filterS)) {
            
mssql_bind($proc'@sFilter',    $filterSSQLVARCHAR);
        }
        
$resultSet = array();
        
$proc_result mssql_execute($proc);
        
$q=array();
        do {
            while (
$row mssql_fetch_assoc($proc_result)) {
                
/* @var $row pulls the row specification, attempting to normalize the data */
                
$q[]=$this->convertAnsi2UTF8($row);
                
            }
            
array_push($resultSet$q);
            unset(
$q);
        } while(
mssql_next_result($proc_result));
        
        return 
$resultSet;
    }
}

class 
dataHandler {
    public 
$dsName;
    public 
$totalCount;
    public 
$fields=array();
    public 
$output;
    public function 
getArrayMaxTextLength($b) {
        
$arrMaxLen=0;
        if(
is_array($b)) {
            foreach(
array_values($b) as $c) {
                if (
is_array($c)) {
                    
getArrayMaxTextLength($c);
                    
                }
                else {
                    
$arrMaxLen=strlen($c);
                }
            }
        }
        return 
$arrMaxLen;
    }
    public function 
showArray($a) {
        
$cleanRows=array();
        if (isset(
$a[0][0]["dsName"])) {
            
$this->dsName=$a[0][0]["dsName"];
        }
        if (isset(
$a[0][0]["totalCount"])) {
            
$this->totalCount=$a[0][0]["totalCount"];
        }
        foreach(
$a[1] as $p) {
            
$ak=array_keys($p);
            
$k=preg_replace("/[^a-z0-9.]+/i"""$ak);
            
$v=array_values($p);
            
$cleanRows[]=array_change_key_case(array_combine($k$v));
        }
        foreach (
array_keys($a[1][0]) as $p) {
            
$maxChars=0;
            
            
array_push($this->fields,
                    array(
                    
"name" => preg_replace("/[^a-z0-9.]+/i"""strtolower($p)),
                    
"id"=>  preg_replace("/[^a-z0-9.]+/i"""$p),
                    
"friendly_name" => $p));
        }
        
$this->output .= json_encode(
                array(
                
"dsName" => $this->dsName,
                
"totalCount"=>$this->totalCount,
                
"fields"=>$this->fields,
                
$this->dsName=>$cleanRows)
        );
        echo 
$this->output;
    }
}
?>
UI_Employee_Based_Reports.sql
Code:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*
 =============================================
Author:		AJ Rembert
Description:	SP for json.php. This builds dynamic SQL queries to satisfy
the @TID variable which, in the UI is the task variable. The database this
procedure is in is very limited and basically acts as the link between the security layer of
other parts of the interface as the data retrieval processes.
From this procedure I'll:
	1. get the structure of the table I'll be returning is built (Active Reports Meta Info)
	2. if a filter has been specified, I'll identify the appropriate column in the table (Active Reports Meta Info)
	3. build two datasets to be returned. 1 containing the meta info for the UI and the second the actual data...the payload for lack of a better phrase

I'm not really satisfied with this procedure, as it is but, for the time being, it serves its purpose nicely.
Let's say my boss or a manager of a department wants to see a new report. I would first write a query against
the appropriate table. Turn that into a view in the WebsiteData database. Insert the name of the report,
columns I'm looking for in the view and specify the filter column.

This, as it is now, is relatively modulated. The Active Reports Meta Info view is actually a compilation of
multiple tables, one of which includes identifying the columns to be used in the format of:
	Report -> Dependency -> Object ID -> Column ID

So, without having to actually write a new query or anything, I can actually make a new set of output data
in minutes without ever actually touching or even referencing the database containing my information. 
In essence, this is the foundation of a solid security layer.

With the current structure of accessing information, I can also enable my users to select different elements
on the forms they see to generate new reports, again, without ever having to acknowledge the existence of
the database where information is stored.

To attach JSON object types, I may add descriptions to the columns to include the JSON object types
and use the system function ::fn_listextendedproperty to extract them.
 =============================================
*/

CREATE PROCEDURE [dbo].[UI_Employee_Based_Reports]
	@EMID INT = 0, @TID INT = 0, @startNum INT = 1, @totalWanted INT = -1, @Debug BIT = 0, @sFilter sql_variant = NULL
AS
BEGIN
	SET NOCOUNT ON;
	DECLARE @execStr nvarchar(4000), @cols varchar(8000), @struct varchar(8000)
	DECLARE @nView varchar(120), @filterStr varchar(8000), @db varchar(160)
	DECLARE @filter table (idx INT IDENTITY, f varchar(200))
	DECLARE @sQ varchar(3000)
	IF @TID IS NULL RETURN
	SET @filterStr = ''
		Insert Into @filter
		Select 
			'[' + [Column Name] + '] = ' + Cast(@sFilter as nvarchar) 
			from [WebsiteData].[dbo].[Active Reports Meta Info] 
			Where 
				[Report ID] = @TID 
				And Filter = 1 
				AND @EMID <> 0 
				AND CASE WHEN [Admin Bypass] = 1 THEN @EMID ELSE -1 END NOT IN(15, 22, 25, 27) -- If I had more admins, I'd just turn this into a query against the employee's table with a column indicating their level of visibility
				AND isnull(datalength(@sFilter), 0) > 0
	IF 0<(select count(*) from @filter)

	BEGIN
		SET @filterStr = 'Where '
		Select @filterStr = ISNULL(@filterStr, '') +CASE WHEN @filterStr like '%(%)%' THEN ' AND ' ELSE '' END + '(' + f + ')' From @filter
	END
		Select @nView = Name From WebsiteData.dbo.Reports Where [Id] = @TID
        SET @db = '[WebsiteData].[dbo].[' + @nView + ']'
		select 
		@cols = CASE WHEN @cols is null then '' else @cols+',' end + '['+[WebsiteData].dbo.syscolumns.name+']',
		@struct = CASE WHEN @struct is null then '' else @struct+',' end + '['+[WebsiteData].dbo.syscolumns.name + '] ' + [WebsiteData].dbo.systypes.name + CASE WHEN LEN([WebsiteData].dbo.syscolumns.length)>1 THEN '(' + cast([WebsiteData].dbo.syscolumns.length as varchar) + ')' ELSE '' END
		from [WebsiteData].dbo.syscolumns
		inner join [WebsiteData].dbo.sysobjects on [WebsiteData].dbo.syscolumns.id = [WebsiteData].dbo.sysobjects.id
		inner join [WebsiteData].dbo.systypes on [WebsiteData].dbo.systypes.xtype = [WebsiteData].dbo.syscolumns.xtype
		where [WebsiteData].dbo.sysobjects.[name]=@nView AND [WebsiteData].dbo.sysobjects.[xtype] = 'V'
		SET @execStr= 'DECLARE @tmpTable Table (idx INT IDENTITY, ' + @struct + ')
		insert into @tmpTable SELECT '+@cols+' FROM '+@db+' ' + @filterStr + '
		Select convert(varchar(7), count(*)) totalCount, ''' + @nView + ''' dsName from @tmpTable ' + ISNULL(@filterStr,'')  
		SET @sQ = ' Select '+@cols+' FROM @tmpTable ' 
		SET @execStr=@execStr+  char(13) + char(10) + @sQ
		Insert into @filter Select 'idx between ' + cast(isnull(@startNum, 1) as varchar) + ' and ' + cast(((isnull(@startNum, 0)-1) + @totalWanted) as varchar) Where @totalWanted > 0
	IF 0<(select count(*) from @filter) 
	BEGIN
		SET @filterStr='Where '
		Select @filterStr = ISNULL(@filterStr, '') + CASE WHEN @filterStr like '%(%)%' THEN ' AND ' ELSE '' END + ' (' + f + ')' From @filter
		SET @execStr=@execStr+  @filterStr
	END
IF @Debug = 1 PRINT @execStr
IF @execStr is not null Exec(@execStr)

END
Active Reports Meta Info.sql
Code:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER VIEW [dbo].[Active Reports Meta Info]
/*
This creates a vertical listing of the reports by column for identifying filters and
column configuration. This acts as the configuration settings of the UI_Employee_Based_Reports
procedure.
*/
([Column Name], [Column ID], [Report ID], [Report Name], [Filter], [Admin Bypass])
AS
SELECT     
SC.name, 
SC.colid, 
dbo.Report_Dependencies.[Report ID], 
R.Name, 
DC.Filter,
DC.[Admin Can Bypass Filter]
FROM         dbo.syscolumns AS SC INNER JOIN
                      dbo.Report_Dependencies ON dbo.Report_Dependencies.[View ID] = SC.id INNER JOIN
                      dbo.Reports AS R ON R.Id = dbo.Report_Dependencies.[Report ID] INNER JOIN
                      dbo.Dependency_Configuration AS DC ON DC.[Column ID] = SC.colid AND DC.[Dependent ID] = R.Id
WHERE     (DC.Viewable = 1)
I didn't include the entire db but, if anyone wants a more complete example, I can post it.

Edit:
And I know I'm using the same schema so there are some inherent security risks but this isn't part of an outward facing service.
__________________
Politeness: the greatest hypocrisy of all.

Last edited by a j : 03-18-2010 at 08:51 PM. Reason: corrected src formatting for php and js...sql's pretty straight forward
a j is offline  
Reply With Quote
Old 03-16-2010, 12:57 PM   #44
Are you watching closely?
 



's Avatar
 

Join Date: Jun 2005
Posts: 2,794

Points: 2,189,305.25
Bank: 355.52

Stock Value: 0.000
Stock Gain: 0.000

Spent Time On Board: 2 week 2 day 5 hour
Default

I am not a fan of your tabbing. Good tabbing makes for good readability. There are definitely several things that could be done differently, but I don't think we need to pick apart your code (you could use .toString() instead of +"" to make it a string, for example).

As for jQuery, did you check out their plugin database? You don't have to reinvent the wheel; everything I've wanted to do I've managed to find a pretty good plugin for it. Whether it's from their own jQuery UI site or their plugins database. Marginal performance gains mean a lot, especially when it comes to ExtJS which is pretty robust.
__________________



 is offline  
Reply With Quote
Old 03-18-2010, 08:08 PM   #45
a j
...yeah
Default

Pick my code apart heh, worst case scenario I learn something new...I can live with that. For using .toString() vs declaring the variable with the quotations, I was thinking, using the toString function would require a little more resources since it'd have to first go through the prototype of the passed variable but...looking at the ECMA-262 standard, I was wrong. Good call. As far as using plugins, I'd rather not stray from what's been standardized as much as possible. ExtJS has a decent amount of support. Some of the plugins for jQuery do too but, as a general rule, I don't use a language or framework that, in order for me to keep up to date with, I need to monitor the vendor and the underlying support. What happens is, I wind up spending an unreasonable amount of time learning more than I need to to get the job done.

jQuery and ExtJS have enough of a following that there are people more knowledgeable than me supporting both in any area I may come across. Visually, ExtJS handles what I don't have the creativity to do and functionally, jQuery supports the scalability and performance I want. Both handle the browser-specific variations so I don't have to keep tabs on all the browsers I want to target and, from a selfish standpoint, I'd rather work on a database than any other layers. I like researching ways of developing business intelligence tools and things like that. To me, this stuff is just a hurdle.

Edit:
The code was taken from the production files so they weren't formatted for debugging...sorry.
__________________
Politeness: the greatest hypocrisy of all.

Last edited by a j : 03-18-2010 at 09:23 PM.
a j is offline  
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Points Per Thread View: 15.00
Points Per Thread: 100.00
Points Per Reply: 50.00
Forum Jump


All times are GMT -5. The time now is 03:28 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.