PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 30k | Tag1 stringlengths 1 25 ⌀ | Tag2 stringlengths 1 25 ⌀ | Tag3 stringlengths 1 25 ⌀ | Tag4 stringlengths 1 25 ⌀ | Tag5 stringlengths 1 25 ⌀ | PostClosedDate stringlengths 19 19 ⌀ | OpenStatus stringclasses 5 values | unified_texts stringlengths 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,859,486 | 10/04/2010 22:02:12 | 360,533 | 06/07/2010 15:00:19 | 142 | 2 | Slow DataGridView Drawing\Rendering | I'm using a DataGridView to load data from a DataTable. This DataGridView is located on a tab (Forms.TabPage). When clicking this tab the datagrid takes a second or two to draw from the top down, regardless of wheather data is being loaded or not.
Is there anything I can do to speed up the Drawing\Rendering when clicking the Tab?
I Don't think the actual population of the DGV is causing this, as it's filled during form load so by the time the tabs click it would have loaded the few rows (20 - 30) it displays.
Using cn As New SqlConnection(connectionString)
Using cmd As SqlCommand = cn.CreateCommand()
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = _
" SELECT [finish_time], [file_name], [transfer_status]" & _
" FROM dbo.[transfer_log]"
cmd.Notification = Nothing
cn.Open()
Dim columnSpec = New DataColumn()
With columnSpec
.DataType = GetType(System.String)
.ColumnName = "ClmFinishTime"
End With
Datatable1.Columns.Add(columnSpec)
Dim columnSpec2 = New DataColumn()
With columnSpec2
.DataType = GetType(System.String)
.ColumnName = "ClmFilename"
End With
Datatable1.Columns.Add(columnSpec2)
Dim columnSpec3 = New DataColumn()
With columnSpec3
.DataType = GetType(System.Byte())
.ColumnName = "ClmStatus"
End With
Datatable1.Columns.Add(columnSpec3)
Using dr As SqlDataReader = cmd.ExecuteReader()
While dr.Read()
Dim row As DataRow = Datatable1.NewRow
row("ClmFinishTime") = dr.Item("finish_time")
row("ClmFilename") = dr.Item("file_name")
Select Case dr.Item("transfer_status")
Case 0
row("ClmStatus") = ConvertToByte(My.Resources.accept)
Case 1
row("ClmStatus") = ConvertToByte(My.Resources.remove)
End Select
Datatable1.Rows.Add(row)
End While
End Using
End Using
DataGridView2.AutoGenerateColumns = False
DataGridView2.DataSource = Datatable1 | vb.net | null | null | null | null | null | open | Slow DataGridView Drawing\Rendering
===
I'm using a DataGridView to load data from a DataTable. This DataGridView is located on a tab (Forms.TabPage). When clicking this tab the datagrid takes a second or two to draw from the top down, regardless of wheather data is being loaded or not.
Is there anything I can do to speed up the Drawing\Rendering when clicking the Tab?
I Don't think the actual population of the DGV is causing this, as it's filled during form load so by the time the tabs click it would have loaded the few rows (20 - 30) it displays.
Using cn As New SqlConnection(connectionString)
Using cmd As SqlCommand = cn.CreateCommand()
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = _
" SELECT [finish_time], [file_name], [transfer_status]" & _
" FROM dbo.[transfer_log]"
cmd.Notification = Nothing
cn.Open()
Dim columnSpec = New DataColumn()
With columnSpec
.DataType = GetType(System.String)
.ColumnName = "ClmFinishTime"
End With
Datatable1.Columns.Add(columnSpec)
Dim columnSpec2 = New DataColumn()
With columnSpec2
.DataType = GetType(System.String)
.ColumnName = "ClmFilename"
End With
Datatable1.Columns.Add(columnSpec2)
Dim columnSpec3 = New DataColumn()
With columnSpec3
.DataType = GetType(System.Byte())
.ColumnName = "ClmStatus"
End With
Datatable1.Columns.Add(columnSpec3)
Using dr As SqlDataReader = cmd.ExecuteReader()
While dr.Read()
Dim row As DataRow = Datatable1.NewRow
row("ClmFinishTime") = dr.Item("finish_time")
row("ClmFilename") = dr.Item("file_name")
Select Case dr.Item("transfer_status")
Case 0
row("ClmStatus") = ConvertToByte(My.Resources.accept)
Case 1
row("ClmStatus") = ConvertToByte(My.Resources.remove)
End Select
Datatable1.Rows.Add(row)
End While
End Using
End Using
DataGridView2.AutoGenerateColumns = False
DataGridView2.DataSource = Datatable1 | 0 |
5,853,864 | 05/02/2011 05:53:28 | 733,981 | 05/02/2011 05:53:28 | 1 | 0 | geotools and maven for normal users | I was trying to get started with using (not making contributions to) the geotools lib yesterday,but i ended up trying to figure out what purpose does maven serve when it comes to someone that just wants to build a small/medium app based on geotools;At first i thought that using maven spares the dev on writing all the imports ( that's what i recon dependencies are BTW) but after reading a blog that had a somewhat modified version of the quickstart tutorial i'm not that sure anymore..Could someone make clarify what is maven's use for someone that just wants to build some apps and not make contributions? | java | maven | geotools | null | null | null | open | geotools and maven for normal users
===
I was trying to get started with using (not making contributions to) the geotools lib yesterday,but i ended up trying to figure out what purpose does maven serve when it comes to someone that just wants to build a small/medium app based on geotools;At first i thought that using maven spares the dev on writing all the imports ( that's what i recon dependencies are BTW) but after reading a blog that had a somewhat modified version of the quickstart tutorial i'm not that sure anymore..Could someone make clarify what is maven's use for someone that just wants to build some apps and not make contributions? | 0 |
1,492,603 | 09/29/2009 13:35:24 | 150,006 | 08/03/2009 21:07:23 | 34 | 1 | Tips needed for a skills-presentation website | I want to create a dummy presentation website that would show my .NET webprogramming skills; I could put a link to this dummy website on my blog and show it at interviews.
If you would need to create a presentation website that shows your web programming skills, what functionality would that website contain? Or if you were a hiring person, what would you like to see in such a website?
I need a few examples of web applications that I could implement in there. Someone told me already I could make a digg it system so for now I'm looking into that.
Anything in frontend, backend, any tip could help me.
Thank you in advance for any suggestion.
Regards,
Andrei | hints-and-tips | portfolio | null | null | null | 11/27/2011 17:31:14 | not constructive | Tips needed for a skills-presentation website
===
I want to create a dummy presentation website that would show my .NET webprogramming skills; I could put a link to this dummy website on my blog and show it at interviews.
If you would need to create a presentation website that shows your web programming skills, what functionality would that website contain? Or if you were a hiring person, what would you like to see in such a website?
I need a few examples of web applications that I could implement in there. Someone told me already I could make a digg it system so for now I'm looking into that.
Anything in frontend, backend, any tip could help me.
Thank you in advance for any suggestion.
Regards,
Andrei | 4 |
6,794,631 | 07/22/2011 18:44:00 | 858,501 | 07/22/2011 18:44:00 | 1 | 0 | How do i use this code? | I want to implement this code in app for android but have no idea where to start. Any help would be appreciated.
Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
resolver.query(uri, new String[]{PhoneLookup.DISPLAY_NAME} .....)
| android | name | contact | null | null | 05/06/2012 02:12:55 | not a real question | How do i use this code?
===
I want to implement this code in app for android but have no idea where to start. Any help would be appreciated.
Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
resolver.query(uri, new String[]{PhoneLookup.DISPLAY_NAME} .....)
| 1 |
4,216,755 | 11/18/2010 15:54:19 | 324,900 | 04/24/2010 11:38:23 | 267 | 17 | problem with maven webapp-cache.xml | We have a web application configured with maven.
I have done a re-factoring (moved a file from one package to another) outside of eclipse, since this is not setup on eclipse and it is small fix. But, however I did forget to update reference to this file in a file.
Then I did `mvn clean install`
surprisingly it is built successfully. Later it got failed on CI machine.
When I searched for text occurrences of the file I have re-factored, I have found an occurrence of this file name in `target\war\webapp-cache.xml` file.
It contain both references (old path, new path) of this re-factored file in it.
What is this file?
And did anybody else faced this problem? | java | maven-2 | null | null | null | null | open | problem with maven webapp-cache.xml
===
We have a web application configured with maven.
I have done a re-factoring (moved a file from one package to another) outside of eclipse, since this is not setup on eclipse and it is small fix. But, however I did forget to update reference to this file in a file.
Then I did `mvn clean install`
surprisingly it is built successfully. Later it got failed on CI machine.
When I searched for text occurrences of the file I have re-factored, I have found an occurrence of this file name in `target\war\webapp-cache.xml` file.
It contain both references (old path, new path) of this re-factored file in it.
What is this file?
And did anybody else faced this problem? | 0 |
3,916,047 | 10/12/2010 15:04:26 | 469,248 | 10/07/2010 15:03:40 | 13 | 1 | GWT gwt i18n Gin Module | My question is the following:
I got one application running with GWT.
At the startup of the application, one GWTClientModule which extends AbstractGinModule or another GWTClientModule is loaded.
Based on that switch I would like to set the local.
Is there a way to set the local not directly in .html by doing as follow:
<meta name="gwt:property" content="locale=fr">
but directly in one of the selected GWTClientModule?
Thank you very much for your kind assistance ;-) | gwt | internationalization | guice | null | null | null | open | GWT gwt i18n Gin Module
===
My question is the following:
I got one application running with GWT.
At the startup of the application, one GWTClientModule which extends AbstractGinModule or another GWTClientModule is loaded.
Based on that switch I would like to set the local.
Is there a way to set the local not directly in .html by doing as follow:
<meta name="gwt:property" content="locale=fr">
but directly in one of the selected GWTClientModule?
Thank you very much for your kind assistance ;-) | 0 |
5,179,876 | 03/03/2011 11:04:28 | 642,848 | 03/03/2011 11:04:28 | 1 | 0 | Postgres CAST macaddr | Lets say I have two tables in Postgres:
Name: table_rad
Column Type
id integer
username character varying(64)
Name: table_mac
Column Type
id integer
mac macaddr
I want to do to a join:
SELECT * FROM table_rad WHERE username = mac;
Postgres will complain:
ERROR: operator does no exist: character varying = macaddr
LINE 1: ...ELECT * from table_rad WHERE username = mac;
^
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Sofar I have googled for a solution and I know I have to CAST. But how can I cast type macaddr as varhcar?
| postgresql | casting | null | null | null | null | open | Postgres CAST macaddr
===
Lets say I have two tables in Postgres:
Name: table_rad
Column Type
id integer
username character varying(64)
Name: table_mac
Column Type
id integer
mac macaddr
I want to do to a join:
SELECT * FROM table_rad WHERE username = mac;
Postgres will complain:
ERROR: operator does no exist: character varying = macaddr
LINE 1: ...ELECT * from table_rad WHERE username = mac;
^
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Sofar I have googled for a solution and I know I have to CAST. But how can I cast type macaddr as varhcar?
| 0 |
1,788,434 | 11/24/2009 07:26:01 | 212,464 | 11/16/2009 23:05:10 | 11 | 1 | Bash scripting on Android | Has anybody tried bash scripting on android?
I tried to write a simple script on Android's bash shell through adb.
I tried the following script which works for me:
\#sh1
x="hello"
echo "$x"
But when I do:
\#sh1
x="hello"
if [ -n "$X" ]; then
echo "hi"
fi
The error say [ -n not found!!
Thanks!
| android | bash | scripting | null | null | 02/20/2012 17:07:45 | too localized | Bash scripting on Android
===
Has anybody tried bash scripting on android?
I tried to write a simple script on Android's bash shell through adb.
I tried the following script which works for me:
\#sh1
x="hello"
echo "$x"
But when I do:
\#sh1
x="hello"
if [ -n "$X" ]; then
echo "hi"
fi
The error say [ -n not found!!
Thanks!
| 3 |
11,182,369 | 06/25/2012 00:48:32 | 505,765 | 11/12/2010 13:00:03 | 115 | 5 | Win2008R2 ASP.NET 3.5 Custom Errors... can't seem to get this to work | Help!
I have a custom HttpModule that handles the Application.Error event. The module is working... it logs messages to the event log and I can see these messages... all the way through to the end of the module (after it writes a custom response and calls response.flush()). Roughly speaking the purpose of this module is to log the errors and to show a polite error message to the user (configurable such that the message may/may not contain useful details about the error).
In the application's web.config I have configured <httpErrors errorMode="Detailed"> and <customErrors mode="Off" />. In the applicationHost.config I have configured <section name="httpErrors" overrideModeDefault="Allow" />. Also in the applicationHost.config I have configured <httpErrors errorMode="Detailed"> under a <location path="default web site/myvdir"> element.
The "yellow screen of death" is still showing though (for both local requests and remote requests).
This seems to be a Win2008R2 issue... this all works in win2008 (I just now loaded up my test environment and tried this). I doubt it's x64 vs x86 related... but Win2008R2 is x64 only... and my Win2008 test environment is x86.
Any thoughts on where I'm going wrong?
Help immensely appreciated!!! | asp.net | windows-server-2008-r2 | custom-errors | null | null | null | open | Win2008R2 ASP.NET 3.5 Custom Errors... can't seem to get this to work
===
Help!
I have a custom HttpModule that handles the Application.Error event. The module is working... it logs messages to the event log and I can see these messages... all the way through to the end of the module (after it writes a custom response and calls response.flush()). Roughly speaking the purpose of this module is to log the errors and to show a polite error message to the user (configurable such that the message may/may not contain useful details about the error).
In the application's web.config I have configured <httpErrors errorMode="Detailed"> and <customErrors mode="Off" />. In the applicationHost.config I have configured <section name="httpErrors" overrideModeDefault="Allow" />. Also in the applicationHost.config I have configured <httpErrors errorMode="Detailed"> under a <location path="default web site/myvdir"> element.
The "yellow screen of death" is still showing though (for both local requests and remote requests).
This seems to be a Win2008R2 issue... this all works in win2008 (I just now loaded up my test environment and tried this). I doubt it's x64 vs x86 related... but Win2008R2 is x64 only... and my Win2008 test environment is x86.
Any thoughts on where I'm going wrong?
Help immensely appreciated!!! | 0 |
5,075,410 | 02/22/2011 07:45:15 | 627,903 | 02/22/2011 07:45:15 | 1 | 0 | What's 133xxxx.dat? | somebody help me, what is 133xxxx.dat? I found 133xxxx.dat to 189xxxx.dat on my Nokia N70. Is Virus? | virus | null | null | null | null | 02/22/2011 07:50:58 | off topic | What's 133xxxx.dat?
===
somebody help me, what is 133xxxx.dat? I found 133xxxx.dat to 189xxxx.dat on my Nokia N70. Is Virus? | 2 |
4,203,969 | 11/17/2010 11:39:21 | 482,138 | 10/20/2010 18:45:36 | 137 | 2 | c# virtual dictionary? | I have a class with a dictionary object. Any class that derives from that class, I want to override the dictionary with it's own implementation.
How can this be achieved as the virtual keyword is not valid here?
Thanks. | c# | dictionary | null | null | null | null | open | c# virtual dictionary?
===
I have a class with a dictionary object. Any class that derives from that class, I want to override the dictionary with it's own implementation.
How can this be achieved as the virtual keyword is not valid here?
Thanks. | 0 |
7,952,744 | 10/31/2011 10:57:08 | 975,699 | 10/02/2011 18:45:33 | 1 | 0 | Sorting associative array with variable keys in PHP | i have the following associative array
word => count
where word is an english word ('more', 'creme', 'car' and so on), while count is the number of times that word appeared in a given string.
I want to sort by count.
Thx.
Ps.
I tried usort but didn't work | php | sorting | associative-array | null | null | 11/02/2011 08:43:47 | not a real question | Sorting associative array with variable keys in PHP
===
i have the following associative array
word => count
where word is an english word ('more', 'creme', 'car' and so on), while count is the number of times that word appeared in a given string.
I want to sort by count.
Thx.
Ps.
I tried usort but didn't work | 1 |
11,539,361 | 07/18/2012 10:32:59 | 436,992 | 09/01/2010 13:19:16 | 41 | 3 | Java nio Reading SocketChannel on a Selector | I have a small server application which receives connections from multiple clients.
The clients will connect, send a message and disconnect, there is no response sent back.
I'm using a ServerSocketChannel to listen for connections.
I get notified of new connections using a selector, When this happens I register the SocketChannel with the selector for `SelectionKey.OP_READ`
The part I'm unsure of is when I get notified data is available for reading.
My SocketChannels are in nonblocking mode.
I call `channel.read(buffer)` on the SocketChannel to read into the byte buffer
From the javadoc for read, I should repeatadly call this until I get a -1 indicating the end of the stream. However, I'm not sure if I should be waiting for the selector to notify me again before calling read again.
That is:
* I get notified by the selector that data is available.
* I call read
* Should I then call read again until -1 is returned or should I let the selector notify me then call read again
Many Thanks
| java | nio | socketchannel | null | null | null | open | Java nio Reading SocketChannel on a Selector
===
I have a small server application which receives connections from multiple clients.
The clients will connect, send a message and disconnect, there is no response sent back.
I'm using a ServerSocketChannel to listen for connections.
I get notified of new connections using a selector, When this happens I register the SocketChannel with the selector for `SelectionKey.OP_READ`
The part I'm unsure of is when I get notified data is available for reading.
My SocketChannels are in nonblocking mode.
I call `channel.read(buffer)` on the SocketChannel to read into the byte buffer
From the javadoc for read, I should repeatadly call this until I get a -1 indicating the end of the stream. However, I'm not sure if I should be waiting for the selector to notify me again before calling read again.
That is:
* I get notified by the selector that data is available.
* I call read
* Should I then call read again until -1 is returned or should I let the selector notify me then call read again
Many Thanks
| 0 |
10,376,386 | 04/29/2012 22:00:55 | 1,364,280 | 04/29/2012 14:59:58 | 6 | 0 | Layout Gravity is not working with LayoutParams | Basically speaking, I create a tablerow, and inside it I create some views and put in the layout, but when I use someview.LayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,
TableRow.LayoutParams.WRAP_CONTENT,Gravity.CENTER_vERTICAL)); it doesn't work, but the strange fact is that if I declare the tablerow in the xml and put layout_gravity in some view inside the tablerow, it will work. Someone knows why? | android | android-layout | tablerow | gravity | null | 04/30/2012 23:08:26 | not a real question | Layout Gravity is not working with LayoutParams
===
Basically speaking, I create a tablerow, and inside it I create some views and put in the layout, but when I use someview.LayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT,
TableRow.LayoutParams.WRAP_CONTENT,Gravity.CENTER_vERTICAL)); it doesn't work, but the strange fact is that if I declare the tablerow in the xml and put layout_gravity in some view inside the tablerow, it will work. Someone knows why? | 1 |
10,695,654 | 05/22/2012 04:15:28 | 1,407,928 | 05/21/2012 13:02:45 | 1 | 0 | Books for beginners in MongoDB | Can you recommend me some strong and useful book of mongoDB, Python and Ruby for beginners? Thanks! | python | ruby | mongodb | null | null | 05/22/2012 04:47:13 | not constructive | Books for beginners in MongoDB
===
Can you recommend me some strong and useful book of mongoDB, Python and Ruby for beginners? Thanks! | 4 |
10,069,526 | 04/09/2012 06:01:05 | 385,273 | 07/07/2010 07:39:55 | 3,645 | 266 | Windows - why is "program files" two words? | Is there a history, or a reason, for the fact that the "Program Files" folders in Windows installations have a space in the title?
Why wasn't it called "Programs" or "Installations" or something that's ONE word (command line access, hello)? I figure there must be a good reason for this...does someone know? | windows | command-line | history | null | null | 04/09/2012 07:13:03 | not constructive | Windows - why is "program files" two words?
===
Is there a history, or a reason, for the fact that the "Program Files" folders in Windows installations have a space in the title?
Why wasn't it called "Programs" or "Installations" or something that's ONE word (command line access, hello)? I figure there must be a good reason for this...does someone know? | 4 |
3,280,140 | 07/19/2010 10:12:55 | 168,507 | 09/04/2009 12:48:45 | 37 | 2 | asp.net: Bind XML from Webservice to a dropdownlist | how do i bind a xml (http://www.webservicex.net/country.asmx/GetCountries) to a dropdownlist? Currently I'm working with ASP.NET 2.0.
Greetings... | asp.net | xml | web-services | drop-down-menu | null | null | open | asp.net: Bind XML from Webservice to a dropdownlist
===
how do i bind a xml (http://www.webservicex.net/country.asmx/GetCountries) to a dropdownlist? Currently I'm working with ASP.NET 2.0.
Greetings... | 0 |
527,001 | 02/09/2009 02:41:11 | 33,536 | 11/03/2008 01:32:09 | 23 | 1 | Get the status of a live stream for a VideoDisplay control | I'm looking for a way to find the status of a live stream through a VideoDisplay (or any other method really). I am interested to know if the stream is currently being published to or if the publisher has stopped. This is for a Flex/Flash ActionScript 3 project.
Is there a way to do this or is this ANOTHER oversight by adobe?
flex flash adobe adobe-flex actionscript
| flex | flash | adobe | actionscript-3 | actionscript | null | open | Get the status of a live stream for a VideoDisplay control
===
I'm looking for a way to find the status of a live stream through a VideoDisplay (or any other method really). I am interested to know if the stream is currently being published to or if the publisher has stopped. This is for a Flex/Flash ActionScript 3 project.
Is there a way to do this or is this ANOTHER oversight by adobe?
flex flash adobe adobe-flex actionscript
| 0 |
8,162,756 | 11/17/2011 05:56:05 | 104,461 | 05/10/2009 19:40:33 | 648 | 18 | A good to book to read in order to prepare for reading Crockford's "The Good Parts"? | I've been reading Crockford's *JavaScript: The Good Parts*, but I've found it hard to wrap my head around. Especially challenging has been its treatments of various programming patterns. I'm looking for a book that makes accessible the concepts of closures, currying, prototypes, inheritance... and preferably, something with exercises. Any suggestions? | javascript | books | null | null | null | 11/18/2011 22:27:29 | not constructive | A good to book to read in order to prepare for reading Crockford's "The Good Parts"?
===
I've been reading Crockford's *JavaScript: The Good Parts*, but I've found it hard to wrap my head around. Especially challenging has been its treatments of various programming patterns. I'm looking for a book that makes accessible the concepts of closures, currying, prototypes, inheritance... and preferably, something with exercises. Any suggestions? | 4 |
10,004,289 | 04/04/2012 02:45:25 | 429,649 | 08/24/2010 14:30:34 | 178 | 14 | lost a public key and disabled root ssh login on rackspace cloud, how do i ssh to server now? | I have a cloud server (centos) on rackspace, and long time ago i've disabled root login and created a user with ssh public key autorisation. A hard drive on my laptop broke down recently and i lost my public key...how can i access my server now? | ssh | centos | rackspace-cloud | rackspace | null | 04/04/2012 16:38:22 | off topic | lost a public key and disabled root ssh login on rackspace cloud, how do i ssh to server now?
===
I have a cloud server (centos) on rackspace, and long time ago i've disabled root login and created a user with ssh public key autorisation. A hard drive on my laptop broke down recently and i lost my public key...how can i access my server now? | 2 |
4,081,902 | 11/02/2010 20:41:03 | 491,827 | 10/29/2010 22:26:45 | 1 | 0 | get extension's human friendly description of a given extension. | I' m sure there's a way to get a human friendly description of a file's extension in objective-c - cocoa.
For example: given an extension "pdf" to get "Portable Document Format", or given "app" -> "Application", or "txt" -> "Plain Text", etc.
I think I made my point!
Any hints, ideas ?
Thanks ... | objective-c | file | types | extension | friendly | null | open | get extension's human friendly description of a given extension.
===
I' m sure there's a way to get a human friendly description of a file's extension in objective-c - cocoa.
For example: given an extension "pdf" to get "Portable Document Format", or given "app" -> "Application", or "txt" -> "Plain Text", etc.
I think I made my point!
Any hints, ideas ?
Thanks ... | 0 |
9,784,630 | 03/20/2012 10:02:37 | 876,211 | 08/03/2011 08:44:54 | 154 | 6 | c# equivalent to java ... in input | As the title says I need to know if there is a corresponding syntax as java's ... in method parameters, like
void printReport(String header, int... numbers) { //numbers represents varargs
System.out.println(header);
for (int num : numbers) {
System.out.println(num);
}
}
(code courtesy of wikipedia) | c# | java | function | null | null | null | open | c# equivalent to java ... in input
===
As the title says I need to know if there is a corresponding syntax as java's ... in method parameters, like
void printReport(String header, int... numbers) { //numbers represents varargs
System.out.println(header);
for (int num : numbers) {
System.out.println(num);
}
}
(code courtesy of wikipedia) | 0 |
7,088,715 | 08/17/2011 06:25:00 | 495,778 | 11/03/2010 10:16:50 | 1 | 0 | Naming resources prior to creation using Neo4j Restful API | This is for people with knowledge on REST and Neo4j.
Is it possible to name a node before creating it in Neo4j ?
Typical Restful thing, you create a URI "XXX/db/data/node/mynode" and you want to create a node with this identifier if it is not existent in the moment.
For all that I have been researching (and testing) to the present moment, the answer is : "no it is not possible, neo4j will just always automatically give ids to the created nodes and the attempt to do create a URI and use POST to cause its creation will result in 405"
Thanks in advance.
| rest | neo4j | null | null | null | null | open | Naming resources prior to creation using Neo4j Restful API
===
This is for people with knowledge on REST and Neo4j.
Is it possible to name a node before creating it in Neo4j ?
Typical Restful thing, you create a URI "XXX/db/data/node/mynode" and you want to create a node with this identifier if it is not existent in the moment.
For all that I have been researching (and testing) to the present moment, the answer is : "no it is not possible, neo4j will just always automatically give ids to the created nodes and the attempt to do create a URI and use POST to cause its creation will result in 405"
Thanks in advance.
| 0 |
10,658,280 | 05/18/2012 18:57:18 | 1,350,064 | 04/22/2012 20:44:15 | 1 | 0 | Quadrant Queries almost solved | 3 down vote favorite
3
share [g+] share [fb] share [tw]
I have almost solved this quadrant queries problem of interviewstreet using segment trees with lazy propogation but still getting wrong answer so need help in my code.
This is the question :
Quadrant Queries (30 points)
There are N points in the plane. The ith point has coordinates (xi, yi). Perform the following queries:
1) Reflect all points between point i and j both including along the X axis. This query is represented as "X i j"
2) Reflect all points between point i and j both including along the Y axis. This query is represented as "Y i j"
3) Count how many points between point i and j both including lie in each of the 4 quadrants. This query is represented as "C i j"
Input:
The first line contains N, the number of points. N lines follow.
The ith line contains xi and yi separated by a space.
The next line contains Q the number of queries. The next Q lines contain one query each, of one of the above forms.
All indices are 1 indexed.
Output:
Output one line for each query of the type "C i j". The corresponding line contains 4 integers; the number of points having indices in the range [i..j] in the 1st,2nd,3rd and 4th quadrants respectively.
Constraints:
1 <= N <= 100000
1 <= Q <= 100000
You may assume that no point lies on the X or the Y axis.
All (xi,yi) will fit in a 32-bit signed integer
In all queries, 1 <=i <=j <=N
Sample Input:
4
1 1
-1 1
-1 -1
1 -1
5
C 1 4
X 2 4
C 3 4
Y 1 2
C 1 3
Sample Output:
1 1 1 1
1 1 0 0
0 2 0 1
Explanation:
When a query says "X i j", it means that take all the points between indices i and j both including and reflect those points along the X axis. The i and j here have nothing to do with the co-ordinates of the points. They are the indices. i refers to point i and j refers to point j
'C 1 4' asks you to 'Consider the set of points having index in {1,2,3,4}. Amongst those points, how many of them lie in the 1st,2nd,3rd and 4th quads respectively?' The answer to this is clearly 1 1 1 1.
Next we reflect the points between indices '2 4' along the X axis. So the new coordinates are :
1 1
-1 -1
-1 1
1 1
Now 'C 3 4' is 'Consider the set of points having index in {3,4}. Amongst those points, how many of them lie in the 1st,2nd,3rd and 4th quads respectively?' Point 3 lies in quadrant 2 and point 4 lies in quadrant 1. So the answer is 1 1 0 0
Here is my solution in c:
#include<stdio.h>
#include<malloc.h>
#include<stdlib.h>
void initialize(int,int,int);
int query(int, int, int, int, int, char);
int **P,Q[194000][4]={0},L[194000][2]={0};
int ans[4],tmp;
void initialize(int node, int b, int e)
{
if (b == e)
{if(P[b][0]>0 && P[b][1]>0)
Q[node][0]++;
else if(P[b][0]<0 && P[b][1]>0)
Q[node][1]++;
else if(P[b][0]<0 && P[b][1]<0)
Q[node][2]++;
else if(P[b][0]>0 && P[b][1]<0)
Q[node][3]++;
// printf("%d %d %d %d\n",Q[node][0],Q[node][1],Q[node][2],Q[node][3]);
}
else
{
initialize(2 * node+1, b, (b + e) / 2);
initialize(2 * node + 2, (b + e) / 2 + 1, e);
Q[node][0] = Q[2 * node+1][0] + Q[2*node +2][0];
Q[node][1] = Q[2 * node+1][1] + Q[2*node +2][1];
Q[node][2] = Q[2 * node+1][2] + Q[2*node +2][2];
Q[node][3] = Q[2 * node+1][3] + Q[2*node +2][3];
}
}
void query(int node, int b, int e, int i, int j, char ch)
{
if(L[node][0]!=0 || L[node][1]!=0)
{
if(b!=e){
L[2*node+1][0]=L[node][0];
L[2*node+1][1]=L[node][1];
L[2*node+2][0]=L[node][0];
L[2*node+2][1]=L[node][1];
}
if(L[node][0]%2!=0)
{
tmp=Q[node][0];
Q[node][0]=Q[node][3];
Q[node][3]=tmp;
tmp=Q[node][1];
Q[node][1]=Q[node][2];
Q[node][2]=tmp;
}
if(L[node][1]%2!=0)
{
tmp=Q[node][0];
Q[node][0]=Q[node][1];
Q[node][1]=tmp;
tmp=Q[node][2];
Q[node][2]=Q[node][3];
Q[node][3]=tmp;
}
L[node][0]=0;
L[node][1]=0;
}
if (i > e || j < b)
return ;
if (b >= i && e <= j)
{
if(ch == 'C'){
ans[0]+=Q[node][0];
ans[1]+=Q[node][1];
ans[2]+=Q[node][2];
ans[3]+=Q[node][3];
}
if(ch == 'X')
{
if(b!=e){
L[2*node+1][0]++;
L[2*node+2][0]++;
}
tmp=Q[node][0];
Q[node][0]=Q[node][3];
Q[node][3]=tmp;
tmp=Q[node][1];
Q[node][1]=Q[node][2];
Q[node][2]=tmp;
}
if(ch == 'Y')
{
if(b!=e){
L[2*node+1][1]++;
L[2*node+2][1]++;
}
tmp=Q[node][0];
Q[node][0]=Q[node][1];
Q[node][1]=tmp;
tmp=Q[node][2];
Q[node][2]=Q[node][3];
Q[node][3]=tmp;
}
return ;
}
query(2 * node +1, b, (b + e) / 2, i, j,ch);
query(2 * node + 2, (b + e) / 2 + 1, e, i, j,ch);
Q[node][0]=Q[2*node+1][0] + Q[2*node+2][0];
Q[node][1]=Q[2*node+1][1] + Q[2*node+2][1];
Q[node][2]=Q[2*node+1][2] + Q[2*node+2][2];
Q[node][3]=Q[2*node+1][3] + Q[2*node+2][3];
return ;
}
int main()
{
int i,n,qn,q[2];
char ch;
scanf("%d",&n);
if(n>100000)
exit(0);
P=(int **)malloc(n*sizeof(int *));
for(i=0;i<n;i++)
{
P[i]=(int *)malloc(2*sizeof(int));
}
for(i=0;i<n;i++)
{
scanf("%d %d",&P[i][0],&P[i][1]);
}
initialize(0,0,n-1);
for(i=0;i<n;i++)
{
free(P[i]);
}
free(P);
// printf("%d %d %d %d\n",Q[0][0],Q[0][1],Q[0][2],Q[0][3]);
scanf("%d\n",&qn);
if(qn>1000000)
exit(0);
for(i=0;i<qn;i++)
{
scanf("%c",&ch);
scanf("%d %d\n",&q[0],&q[1]);
ans[0]=0;ans[1]=0;ans[2]=0;ans[3]=0;
/* for( j=0;j<7;j++)
{
printf("%d:%d:%d:%d\n\n",Q[j][0],Q[j][1],Q[j][2],Q[j][3]);
} */
query(0,0,n-1,q[0]-1,q[1]-1,ch);
if(ch=='C')
printf("%d %d %d %d\n",ans[0],ans[1],ans[2],ans[3]);
}
return 0;
}
| c | null | null | null | null | 05/26/2012 00:29:33 | not a real question | Quadrant Queries almost solved
===
3 down vote favorite
3
share [g+] share [fb] share [tw]
I have almost solved this quadrant queries problem of interviewstreet using segment trees with lazy propogation but still getting wrong answer so need help in my code.
This is the question :
Quadrant Queries (30 points)
There are N points in the plane. The ith point has coordinates (xi, yi). Perform the following queries:
1) Reflect all points between point i and j both including along the X axis. This query is represented as "X i j"
2) Reflect all points between point i and j both including along the Y axis. This query is represented as "Y i j"
3) Count how many points between point i and j both including lie in each of the 4 quadrants. This query is represented as "C i j"
Input:
The first line contains N, the number of points. N lines follow.
The ith line contains xi and yi separated by a space.
The next line contains Q the number of queries. The next Q lines contain one query each, of one of the above forms.
All indices are 1 indexed.
Output:
Output one line for each query of the type "C i j". The corresponding line contains 4 integers; the number of points having indices in the range [i..j] in the 1st,2nd,3rd and 4th quadrants respectively.
Constraints:
1 <= N <= 100000
1 <= Q <= 100000
You may assume that no point lies on the X or the Y axis.
All (xi,yi) will fit in a 32-bit signed integer
In all queries, 1 <=i <=j <=N
Sample Input:
4
1 1
-1 1
-1 -1
1 -1
5
C 1 4
X 2 4
C 3 4
Y 1 2
C 1 3
Sample Output:
1 1 1 1
1 1 0 0
0 2 0 1
Explanation:
When a query says "X i j", it means that take all the points between indices i and j both including and reflect those points along the X axis. The i and j here have nothing to do with the co-ordinates of the points. They are the indices. i refers to point i and j refers to point j
'C 1 4' asks you to 'Consider the set of points having index in {1,2,3,4}. Amongst those points, how many of them lie in the 1st,2nd,3rd and 4th quads respectively?' The answer to this is clearly 1 1 1 1.
Next we reflect the points between indices '2 4' along the X axis. So the new coordinates are :
1 1
-1 -1
-1 1
1 1
Now 'C 3 4' is 'Consider the set of points having index in {3,4}. Amongst those points, how many of them lie in the 1st,2nd,3rd and 4th quads respectively?' Point 3 lies in quadrant 2 and point 4 lies in quadrant 1. So the answer is 1 1 0 0
Here is my solution in c:
#include<stdio.h>
#include<malloc.h>
#include<stdlib.h>
void initialize(int,int,int);
int query(int, int, int, int, int, char);
int **P,Q[194000][4]={0},L[194000][2]={0};
int ans[4],tmp;
void initialize(int node, int b, int e)
{
if (b == e)
{if(P[b][0]>0 && P[b][1]>0)
Q[node][0]++;
else if(P[b][0]<0 && P[b][1]>0)
Q[node][1]++;
else if(P[b][0]<0 && P[b][1]<0)
Q[node][2]++;
else if(P[b][0]>0 && P[b][1]<0)
Q[node][3]++;
// printf("%d %d %d %d\n",Q[node][0],Q[node][1],Q[node][2],Q[node][3]);
}
else
{
initialize(2 * node+1, b, (b + e) / 2);
initialize(2 * node + 2, (b + e) / 2 + 1, e);
Q[node][0] = Q[2 * node+1][0] + Q[2*node +2][0];
Q[node][1] = Q[2 * node+1][1] + Q[2*node +2][1];
Q[node][2] = Q[2 * node+1][2] + Q[2*node +2][2];
Q[node][3] = Q[2 * node+1][3] + Q[2*node +2][3];
}
}
void query(int node, int b, int e, int i, int j, char ch)
{
if(L[node][0]!=0 || L[node][1]!=0)
{
if(b!=e){
L[2*node+1][0]=L[node][0];
L[2*node+1][1]=L[node][1];
L[2*node+2][0]=L[node][0];
L[2*node+2][1]=L[node][1];
}
if(L[node][0]%2!=0)
{
tmp=Q[node][0];
Q[node][0]=Q[node][3];
Q[node][3]=tmp;
tmp=Q[node][1];
Q[node][1]=Q[node][2];
Q[node][2]=tmp;
}
if(L[node][1]%2!=0)
{
tmp=Q[node][0];
Q[node][0]=Q[node][1];
Q[node][1]=tmp;
tmp=Q[node][2];
Q[node][2]=Q[node][3];
Q[node][3]=tmp;
}
L[node][0]=0;
L[node][1]=0;
}
if (i > e || j < b)
return ;
if (b >= i && e <= j)
{
if(ch == 'C'){
ans[0]+=Q[node][0];
ans[1]+=Q[node][1];
ans[2]+=Q[node][2];
ans[3]+=Q[node][3];
}
if(ch == 'X')
{
if(b!=e){
L[2*node+1][0]++;
L[2*node+2][0]++;
}
tmp=Q[node][0];
Q[node][0]=Q[node][3];
Q[node][3]=tmp;
tmp=Q[node][1];
Q[node][1]=Q[node][2];
Q[node][2]=tmp;
}
if(ch == 'Y')
{
if(b!=e){
L[2*node+1][1]++;
L[2*node+2][1]++;
}
tmp=Q[node][0];
Q[node][0]=Q[node][1];
Q[node][1]=tmp;
tmp=Q[node][2];
Q[node][2]=Q[node][3];
Q[node][3]=tmp;
}
return ;
}
query(2 * node +1, b, (b + e) / 2, i, j,ch);
query(2 * node + 2, (b + e) / 2 + 1, e, i, j,ch);
Q[node][0]=Q[2*node+1][0] + Q[2*node+2][0];
Q[node][1]=Q[2*node+1][1] + Q[2*node+2][1];
Q[node][2]=Q[2*node+1][2] + Q[2*node+2][2];
Q[node][3]=Q[2*node+1][3] + Q[2*node+2][3];
return ;
}
int main()
{
int i,n,qn,q[2];
char ch;
scanf("%d",&n);
if(n>100000)
exit(0);
P=(int **)malloc(n*sizeof(int *));
for(i=0;i<n;i++)
{
P[i]=(int *)malloc(2*sizeof(int));
}
for(i=0;i<n;i++)
{
scanf("%d %d",&P[i][0],&P[i][1]);
}
initialize(0,0,n-1);
for(i=0;i<n;i++)
{
free(P[i]);
}
free(P);
// printf("%d %d %d %d\n",Q[0][0],Q[0][1],Q[0][2],Q[0][3]);
scanf("%d\n",&qn);
if(qn>1000000)
exit(0);
for(i=0;i<qn;i++)
{
scanf("%c",&ch);
scanf("%d %d\n",&q[0],&q[1]);
ans[0]=0;ans[1]=0;ans[2]=0;ans[3]=0;
/* for( j=0;j<7;j++)
{
printf("%d:%d:%d:%d\n\n",Q[j][0],Q[j][1],Q[j][2],Q[j][3]);
} */
query(0,0,n-1,q[0]-1,q[1]-1,ch);
if(ch=='C')
printf("%d %d %d %d\n",ans[0],ans[1],ans[2],ans[3]);
}
return 0;
}
| 1 |
3,644,510 | 09/05/2010 00:23:46 | 227,290 | 12/08/2009 16:46:07 | 64 | 0 | Treatment of 'empty' values in R | This is a newbie question in R. I am importing a csv file into R using sqldf package. I have several missing values for both numeric and string variables. I notice that missing values are left empty in the dataframe (as opposed to being filled with NA or something else). I want to replace the missing values with an user defined value. Obviously, a function like is.na() will not work in this case.
Thank you in advance.
Toy dataframe with three columns.
A B C
3 4
2 4 6
34 23 43
2 5
I want
A B C
3 4 NA
2 4 6
34 23 43
2 5 NA
| r | null | null | null | null | null | open | Treatment of 'empty' values in R
===
This is a newbie question in R. I am importing a csv file into R using sqldf package. I have several missing values for both numeric and string variables. I notice that missing values are left empty in the dataframe (as opposed to being filled with NA or something else). I want to replace the missing values with an user defined value. Obviously, a function like is.na() will not work in this case.
Thank you in advance.
Toy dataframe with three columns.
A B C
3 4
2 4 6
34 23 43
2 5
I want
A B C
3 4 NA
2 4 6
34 23 43
2 5 NA
| 0 |
10,073,572 | 04/09/2012 13:00:03 | 1,161,133 | 01/20/2012 17:40:39 | 166 | 11 | CakePHP-2.0, how can i upload an image for user profile? | I have used CakeDC users plugin.
I need to upload/add a profile picture for an user.
How can i do this? | php | cakephp | upload | cakephp-2.0 | cakedc | 05/01/2012 01:47:51 | not a real question | CakePHP-2.0, how can i upload an image for user profile?
===
I have used CakeDC users plugin.
I need to upload/add a profile picture for an user.
How can i do this? | 1 |
11,726,809 | 07/30/2012 17:48:51 | 567,620 | 01/07/2011 23:55:27 | 2,610 | 120 | Python: Efficient workaround for mulitprocessing a function that is a data member of a class, from within that class | I'm aware of [various](http://stackoverflow.com/questions/11321370/python-mutliprocess-member-functions-of-classes) [discussions](http://stackoverflow.com/questions/7545385/python-class-inheriting-multiprocessing-trouble-with-accessing-class-members?rq=1) of [limitations](http://stackoverflow.com/questions/7016567/picklingerror-when-using-multiprocessing) of the mulitprocessing module when dealing with functions that are data members of a class (due to Pickling problems).
But is there another module, or any sort of work-around in mulitprocessing, that allows something specifically like the following (specifically without forcing the definition of the function to be applied in parallel to exist outside of the class)?
class MyClass():
def __init__(self):
self.my_args = [1,2,3,4]
self.output = {}
def my_single_function(self, arg):
return arg**2
def my_parallelized_function(self):
# Use map or map_async to map my_single_function onto the
# list of self.my_args, and append the return values into
# self.output, using each arg in my_args as the key.
# The result should make self.output become
# {1:1, 2:4, 3:9, 4:16}
foo = MyClass()
foo.my_parallelized_function()
print foo.output
Note: I can easily do this by moving `my_single_function` outside of the class, and passing something like `foo.my_args` to the `map` or `map_async` commands. But this pushes the parallelized execution of the function outside of instances of `MyClass`.
For my application (parallelizing a large data query that retrieves, joins, and cleans monthly cross-sections of data, and then appends them into a long time-series of such cross-sections), it is very important to have this functionality *inside the class* since different users of my program will instantiate different instances of the class with different time intervals, different time increments, different sub-sets of data to gather, and so on, that should all be associated with that instance.
Thus, I want the work of parallelizing to also be done by the instance, since it owns all the data relevant to the parallelized query, and it would just be silly to try write some hacky wrapper function that binds to some arguments and lives outside of the class (Especially since such a function would be non-general. It would need all kinds of specifics from inside the class.) | python | class | mulitprocessing | null | null | null | open | Python: Efficient workaround for mulitprocessing a function that is a data member of a class, from within that class
===
I'm aware of [various](http://stackoverflow.com/questions/11321370/python-mutliprocess-member-functions-of-classes) [discussions](http://stackoverflow.com/questions/7545385/python-class-inheriting-multiprocessing-trouble-with-accessing-class-members?rq=1) of [limitations](http://stackoverflow.com/questions/7016567/picklingerror-when-using-multiprocessing) of the mulitprocessing module when dealing with functions that are data members of a class (due to Pickling problems).
But is there another module, or any sort of work-around in mulitprocessing, that allows something specifically like the following (specifically without forcing the definition of the function to be applied in parallel to exist outside of the class)?
class MyClass():
def __init__(self):
self.my_args = [1,2,3,4]
self.output = {}
def my_single_function(self, arg):
return arg**2
def my_parallelized_function(self):
# Use map or map_async to map my_single_function onto the
# list of self.my_args, and append the return values into
# self.output, using each arg in my_args as the key.
# The result should make self.output become
# {1:1, 2:4, 3:9, 4:16}
foo = MyClass()
foo.my_parallelized_function()
print foo.output
Note: I can easily do this by moving `my_single_function` outside of the class, and passing something like `foo.my_args` to the `map` or `map_async` commands. But this pushes the parallelized execution of the function outside of instances of `MyClass`.
For my application (parallelizing a large data query that retrieves, joins, and cleans monthly cross-sections of data, and then appends them into a long time-series of such cross-sections), it is very important to have this functionality *inside the class* since different users of my program will instantiate different instances of the class with different time intervals, different time increments, different sub-sets of data to gather, and so on, that should all be associated with that instance.
Thus, I want the work of parallelizing to also be done by the instance, since it owns all the data relevant to the parallelized query, and it would just be silly to try write some hacky wrapper function that binds to some arguments and lives outside of the class (Especially since such a function would be non-general. It would need all kinds of specifics from inside the class.) | 0 |
11,603,234 | 07/22/2012 19:13:06 | 1,375,170 | 05/04/2012 14:12:10 | 43 | 2 | Linux mint 12 inittab? | Trying find inittab in Linux Mint 12.
There is no **/etec/inittab** or **/etc/event.d**
Where is it? | linux | linuxmint | null | null | null | 07/22/2012 20:20:45 | off topic | Linux mint 12 inittab?
===
Trying find inittab in Linux Mint 12.
There is no **/etec/inittab** or **/etc/event.d**
Where is it? | 2 |
950,422 | 06/04/2009 13:00:16 | 191 | 08/03/2008 09:55:26 | 1,236 | 50 | Stackoverflow Search Algorithm | How the search algorithm of stackoverflow works? I need to implement search functionality in one of my web site. | stackoverflow | search | algorithm | null | null | null | open | Stackoverflow Search Algorithm
===
How the search algorithm of stackoverflow works? I need to implement search functionality in one of my web site. | 0 |
6,011,714 | 05/15/2011 22:35:14 | 732,027 | 04/30/2011 03:41:27 | 6 | 0 | Locating Template CSS File in Concrete5 | I just installed concrete5 and wanted to customize the css file to match the color scheme of my business. Unfortunately, I can't find the CSS file for any of the templates. Unlike Wordpress, it isn't simply a style.css file located inside the theme folder. This is what the the page source looks like:
`<link rel="stylesheet" media="screen" type="text/css" href="/concrete/index.php/tools/css/themes/solutions/main.css" />`
I get lost at index.php. I'm not familiar enough with php to understand how a file (index.php) can have sub-folders underneath it.
Thanks for the help. | php | css | concrete5 | null | null | 05/16/2011 08:32:11 | too localized | Locating Template CSS File in Concrete5
===
I just installed concrete5 and wanted to customize the css file to match the color scheme of my business. Unfortunately, I can't find the CSS file for any of the templates. Unlike Wordpress, it isn't simply a style.css file located inside the theme folder. This is what the the page source looks like:
`<link rel="stylesheet" media="screen" type="text/css" href="/concrete/index.php/tools/css/themes/solutions/main.css" />`
I get lost at index.php. I'm not familiar enough with php to understand how a file (index.php) can have sub-folders underneath it.
Thanks for the help. | 3 |
2,003,440 | 01/05/2010 00:49:57 | 243,575 | 01/05/2010 00:18:48 | 1 | 0 | NHibernate - mapping entity from multiple database tables | Is it possible to map an entities properties from different database tables? Say you had the below data model...
[dbo.Songs] [dbo.Artists]
SongID int ArtistID int
SongTitle nvarchar(50) ArtistName nvarchar(100)
Duration int .
ArtistID int .
. .
Required entity:
public class Song
{
public virtual int SongID { get; private set; }
public virtual string SongTitle { get; set; }
public virtual int Duration { get; set; }
public virtual ArtistID { get; set; }
public virtual ArtistName { get; private set; } <- from different table, read only
}
I know I should probably be creating an Artists entity and attaching that to the Song entity but if the Artists table had lots of columns and all I needed was the ArtistName what's the point in returning all the extra data across the wire when it's not going to be used or updated? I only want the ArtistName for display purposes only.
Thanks, FJ | nhibernate | null | null | null | null | null | open | NHibernate - mapping entity from multiple database tables
===
Is it possible to map an entities properties from different database tables? Say you had the below data model...
[dbo.Songs] [dbo.Artists]
SongID int ArtistID int
SongTitle nvarchar(50) ArtistName nvarchar(100)
Duration int .
ArtistID int .
. .
Required entity:
public class Song
{
public virtual int SongID { get; private set; }
public virtual string SongTitle { get; set; }
public virtual int Duration { get; set; }
public virtual ArtistID { get; set; }
public virtual ArtistName { get; private set; } <- from different table, read only
}
I know I should probably be creating an Artists entity and attaching that to the Song entity but if the Artists table had lots of columns and all I needed was the ArtistName what's the point in returning all the extra data across the wire when it's not going to be used or updated? I only want the ArtistName for display purposes only.
Thanks, FJ | 0 |
4,304,582 | 11/29/2010 14:16:47 | 206,330 | 11/08/2009 18:13:23 | 24 | 1 | VS2010 Editor slow | Does anyone know how is it possible to use simple and fast editor (like in VS2008) in VS2010 IDE instead of stupid and slow own VS2010 !?
Thanks! | visual-studio | visual-studio-2008 | visual-studio-2010 | ide | editor | 11/29/2010 14:29:04 | not constructive | VS2010 Editor slow
===
Does anyone know how is it possible to use simple and fast editor (like in VS2008) in VS2010 IDE instead of stupid and slow own VS2010 !?
Thanks! | 4 |
1,754,411 | 11/18/2009 08:21:59 | 213,568 | 11/18/2009 08:21:59 | 1 | 0 | How to select date from datetime column? | I have a column, which is datetime type, the value is like this:
2009-10-20 10:00:00
I want to do a select, my query:
SELECT * FROM
data
WHERE datetime = '2009-10-20'
ORDER BY datetime DESC
Should I do this:
SELECT * FROM
data
WHERE datetime BETWEEN('2009-10-20 00:00:00' AND '2009-10-20 23:59:59'
ORDER BY datetime DESC
But it returns 0 result. Please help
| mysql | query | date | null | null | null | open | How to select date from datetime column?
===
I have a column, which is datetime type, the value is like this:
2009-10-20 10:00:00
I want to do a select, my query:
SELECT * FROM
data
WHERE datetime = '2009-10-20'
ORDER BY datetime DESC
Should I do this:
SELECT * FROM
data
WHERE datetime BETWEEN('2009-10-20 00:00:00' AND '2009-10-20 23:59:59'
ORDER BY datetime DESC
But it returns 0 result. Please help
| 0 |
8,182,078 | 11/18/2011 12:00:26 | 1,049,440 | 11/16/2011 10:25:31 | 3 | 0 | Gmail API --- Java | Can some one help me out with a Gmail Api.
It should have the feature like.
1. Send an email.
2. Read an email and also download the attachments if any.
Downloading the attachment is important.
This is going to be one of the features in my upcoming project please help me on this.
Thanks in advance. | java | gmail | java-api | null | null | 11/18/2011 15:59:19 | not a real question | Gmail API --- Java
===
Can some one help me out with a Gmail Api.
It should have the feature like.
1. Send an email.
2. Read an email and also download the attachments if any.
Downloading the attachment is important.
This is going to be one of the features in my upcoming project please help me on this.
Thanks in advance. | 1 |
8,956,253 | 01/21/2012 20:08:00 | 798,042 | 06/14/2011 16:06:41 | 461 | 11 | Nginx encounters 101 connection reset randomly | I began to encounter error 101 connection reset (not 104 by peer) randomly since last night, the rate I encounter this error is approximately 1/3, and I didn't find any log on these events both in the nginx log and PHP log.
<p> I'm in China and I don't know whether my site is DNS blocked by the authorities,is there any technical way to check this?<br><br> And I suspect it's caused by my nginx config because I have changed the configuration last night before I encounter these errors, is there any error in my configurations? Below is my nginx conf, tell me if you need other information to help me.
</p>
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format gzip '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" "$gzip_ratio"';
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
sendfile on;
keepalive_timeout 65;
client_max_body_size 50m;
gzip on;
#don't show version info
server_tokens off;
server {
listen 80;
server_name domain.com;
root E:/webroot;
charset utf-8;
access_log c:/ftp/Log/main-access.log gzip buffer=32k;
location / {
deny 61.90.191.250;
index index.php;
try_files $uri $uri/ /index.php?$args;
}
location ~ ^/(protected|framework|nbproject|themes/\w+/views) {
deny all;
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root E:/webroot;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME E:/webroot$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
server {
server_name img.domain.com;
access_log c:/ftp/Log/static-access.log gzip buffer=32k;
location / {
root G:/;
index index.html index.htm;
}
}
}
| php | nginx | connection-reset | null | null | 01/22/2012 19:46:58 | off topic | Nginx encounters 101 connection reset randomly
===
I began to encounter error 101 connection reset (not 104 by peer) randomly since last night, the rate I encounter this error is approximately 1/3, and I didn't find any log on these events both in the nginx log and PHP log.
<p> I'm in China and I don't know whether my site is DNS blocked by the authorities,is there any technical way to check this?<br><br> And I suspect it's caused by my nginx config because I have changed the configuration last night before I encounter these errors, is there any error in my configurations? Below is my nginx conf, tell me if you need other information to help me.
</p>
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format gzip '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" "$gzip_ratio"';
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
sendfile on;
keepalive_timeout 65;
client_max_body_size 50m;
gzip on;
#don't show version info
server_tokens off;
server {
listen 80;
server_name domain.com;
root E:/webroot;
charset utf-8;
access_log c:/ftp/Log/main-access.log gzip buffer=32k;
location / {
deny 61.90.191.250;
index index.php;
try_files $uri $uri/ /index.php?$args;
}
location ~ ^/(protected|framework|nbproject|themes/\w+/views) {
deny all;
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root E:/webroot;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME E:/webroot$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
server {
server_name img.domain.com;
access_log c:/ftp/Log/static-access.log gzip buffer=32k;
location / {
root G:/;
index index.html index.htm;
}
}
}
| 2 |
5,422,070 | 03/24/2011 16:05:22 | 249,092 | 01/12/2010 17:20:12 | 36 | 3 | PHP array to jQuery options | I'm creating a Wordpress Plugin which uses a jQuery script. I've created a PHP array which contains its options like:
`$settings = array('setting1' => 'value1', 'setting2' => 'value2', 'setting3' => 10)`
I was now going to use foreach to loop over the items and print them like this:
foreach($settings as $setting => $value) {
if (is_string($value)) { $value = "'" . $value . "'"; }
$output .= $setting . ':' . $value .',';
}
which should make me end up with:
(window).load(function() {
$('#widget').myWidget({
setting1:'value1',
setting2:'value2',
setting3:10})
With the current setup I end up with the last entry having a ',' at the end (one too many) which means I get a Javascript error, so I need to remove it.
All with all, I have the feeling I'm doing something very dirty (including the is_string check) and I was wondering if there is a neat way to deal with this? | php | jquery | null | null | null | null | open | PHP array to jQuery options
===
I'm creating a Wordpress Plugin which uses a jQuery script. I've created a PHP array which contains its options like:
`$settings = array('setting1' => 'value1', 'setting2' => 'value2', 'setting3' => 10)`
I was now going to use foreach to loop over the items and print them like this:
foreach($settings as $setting => $value) {
if (is_string($value)) { $value = "'" . $value . "'"; }
$output .= $setting . ':' . $value .',';
}
which should make me end up with:
(window).load(function() {
$('#widget').myWidget({
setting1:'value1',
setting2:'value2',
setting3:10})
With the current setup I end up with the last entry having a ',' at the end (one too many) which means I get a Javascript error, so I need to remove it.
All with all, I have the feeling I'm doing something very dirty (including the is_string check) and I was wondering if there is a neat way to deal with this? | 0 |
11,720,743 | 07/30/2012 11:36:29 | 1,562,827 | 07/30/2012 11:35:12 | 1 | 0 | Form Which Creates a new page | I want to make a website in which when they enter some code into the form and submit it, it redirects them to a page which shows the code raw. | php | html | website | null | null | 07/30/2012 21:54:27 | not a real question | Form Which Creates a new page
===
I want to make a website in which when they enter some code into the form and submit it, it redirects them to a page which shows the code raw. | 1 |
658,629 | 03/18/2009 15:00:51 | 26,087 | 10/08/2008 10:01:49 | 193 | 2 | Programmer's obligation of the software developed for a client. | Am i obligated to give the source code and support of the software I have created for a client especially if the client wanted to add some functionalities? For how long? | untagged | null | null | null | null | 05/03/2012 08:07:02 | off topic | Programmer's obligation of the software developed for a client.
===
Am i obligated to give the source code and support of the software I have created for a client especially if the client wanted to add some functionalities? For how long? | 2 |
3,832,069 | 09/30/2010 15:22:25 | 459,598 | 09/27/2010 14:42:12 | 11 | 0 | How can I redirect an asp.net mvc2 page | I'm looking to take data posted to a form, process it and then make a redirect to a third-party website with both GET data AND POST data.
I understand that Response.Redirect() is not the way to go about this - what is though?
I dont want to make the original form submit to the third party provider, I have some processing to do on their results first - so that's not an option.
Can anyone recommend a way for me to pass the user along to the 3rd party provider (outside of my domain)? | c# | asp.net | post | redirect | null | null | open | How can I redirect an asp.net mvc2 page
===
I'm looking to take data posted to a form, process it and then make a redirect to a third-party website with both GET data AND POST data.
I understand that Response.Redirect() is not the way to go about this - what is though?
I dont want to make the original form submit to the third party provider, I have some processing to do on their results first - so that's not an option.
Can anyone recommend a way for me to pass the user along to the 3rd party provider (outside of my domain)? | 0 |
3,869,435 | 10/06/2010 04:07:42 | 301,860 | 03/25/2010 16:18:35 | 233 | 8 | Why do C programs require decompilers but python programs dont? | If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that?. I mean I simply cant open up the Safari web browser and look at its code. | python | c | decompiling | null | null | null | open | Why do C programs require decompilers but python programs dont?
===
If I write a python script, anyone can simply point an editor to it and read it. But for programming written in C, one would have to use decompilers and hex tables and such. Why is that?. I mean I simply cant open up the Safari web browser and look at its code. | 0 |
11,291,120 | 07/02/2012 09:37:12 | 1,474,138 | 06/22/2012 07:31:53 | 15 | 1 | paypal initWithAppID() what should be? | I want to add paypal api to my project.
------------------------------------------------------
And I use this code for sandbox and its work :
pp = PayPal.initWithAppID(this, "APP-80W284485P519543T",
PayPal.ENV_SANDBOX);
------------------------------------------------------
And what I should be use in ENV_LIVE ? what should be the app id?
pp = PayPal.initWithAppID(this, ????,
PayPal.ENV_LIVE); | android | paypal | paypal-api | null | null | null | open | paypal initWithAppID() what should be?
===
I want to add paypal api to my project.
------------------------------------------------------
And I use this code for sandbox and its work :
pp = PayPal.initWithAppID(this, "APP-80W284485P519543T",
PayPal.ENV_SANDBOX);
------------------------------------------------------
And what I should be use in ENV_LIVE ? what should be the app id?
pp = PayPal.initWithAppID(this, ????,
PayPal.ENV_LIVE); | 0 |
9,019,737 | 01/26/2012 14:37:58 | 1,171,432 | 01/26/2012 14:21:06 | 1 | 0 | Deobfuscating PHP code | I have this script I am working on updating which I recognize to be obfuscated using evals and base64 encoding. I have researched through many of the similar questions already asked and made *some* progress. However I am a little confused as to what my next step should be.
**Original Code**
<?php $OOO000000=urldecode('%66%67%36%73%62%65%68%70%72%61%34%63%6f%5f%74%6e%64');$OOO0000O0=$OOO000000{4}.$OOO000000{9}.$OOO000000{3}.$OOO000000{5};$OOO0000O0.=$OOO000000{2}.$OOO000000{10}.$OOO000000{13}.$OOO000000{16};$OOO0000O0.=$OOO0000O0{3}.$OOO000000{11}.$OOO000000{12}.$OOO0000O0{7}.$OOO000000{5};$OOO000O00=$OOO000000{0}.$OOO000000{12}.$OOO000000{7}.$OOO000000{5}.$OOO000000{15};$O0O000O00=$OOO000000{0}.$OOO000000{1}.$OOO000000{5}.$OOO000000{14};$O0O000O0O=$O0O000O00.$OOO000000{11};$O0O000O00=$O0O000O00.$OOO000000{3};$O0O00OO00=$OOO000000{0}.$OOO000000{8}.$OOO000000{5}.$OOO000000{9}.$OOO000000{16};$OOO00000O=$OOO000000{3}.$OOO000000{14}.$OOO000000{8}.$OOO000000{14}.$OOO000000{8};$OOO0O0O00=__FILE__;$OO00O0000=0x2450;eval($OOO0000O0('JE8wMDBPME8wMD0kT09PMDAwTzAwKCRPT08wTzBPMDAsJ3JiJyk7JE8wTzAwT08wMCgkTzAwME8wTzAwLDB4NDk3KTskT08wME8wME8wPSRPT08wMDAwTzAoJE9PTzAwMDAwTygkTzBPMDBPTzAwKCRPMDAwTzBPMDAsMHgxN2MpLCdEb2pURUdWaGZzSzZST1BtcmQ1Y0o5SGxraThZMC9aQm5wTmdJelhTTDNDMTJiZU1VdkFhV3E0dXhGN1F0dyt5PScsJ0FCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU2Nzg5Ky8nKSk7ZXZhbCgkT08wME8wME8wKTs='));return;?>iksEwmRTomRTomRTqa/hsB0X9UYVGgi5nSlqwV5JvGlqtS6jfSfNxIcWwmREtUcaDU6NfSfNUIcWwmRTDUREtUKjdmcWtURTDUREtLsEtUcaDUcWtURjnIcaDUREtUcaDU6jdmcaDUcaDURTD36j/EY43JdJ/H8Via5ai5cqob0XrqkWLF5Vv18cpiRjw8rXFUcX/sZzpccTOTRcsNiJq9/IGp9uEW/lpVOqGW/AbFm502sWGjrWdGdI/f5J36cEqPcqodJzOJ99ilHGz8kHsgiV9Xi4p38Xb2YHFM0hGA0udq/S/xZlLURcfaOTJ4OanFKAtSK5I3P4igYVwai5nIcaDUREtUcaDUKcbz/XG2KjdmcaDUcaDUcaD3PU==jXiqYXOW8HwefEOM8HFalqo2/H/3YNnIkXwWK5oQjXzXfjnIkXwW6cFX8lsa/hsqYNInfhsz/h9AYg2KsVdp/VEnm5DIkXwW6cF2ijW+d49WJVvcildW8HFS0AnSr4w3YSRS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/HA/3ij//fTWnsVwN8z2S8HrSlc2KsVGbiNW+l4sMihzaHao/6cFB/XG2/H9YR9qYRGqYsuop0XGb0A//HaG/HA/UYuO3/VzMYN//fTWnsVwN8z2S0Vwa8ld3Y4xSlc2KsVGbiNW+l4sMihzaHao/6cFB/XG2/H9YR9qYRGqYsuop0XGb0A//Has/HA/UYuO3/VzMYN//fTWnsVwN8z2S0Vwa8ld3Y4xSlc2KsVGbiNW+l4sMihzaHao/6cFB/XG2/H9YR9qYRGqYsuop0XGb0A//HaO/fTWnklsAklILKc2KshOz0XzpYVz7ilfnm5oeil0nrJqVJ49A8HG28l3z0Nn3PULI0X9a/HvWfTWnshOz0XzpYVz7ilfbmSOz0XzpYVz7i5nIkHqXKc2Kshnnm5DIkXwW6cFciHFIJX9v/H9a/jnI0X9a/HvWKc2KBrLQsf[|GL~Y
**My First Step was to change the eval to echo, which gave me this for output:**
$O000O0O00=$OOO000O00($OOO0O0O00,'rb');$O0O00OO00($O000O0O00,0x497);$OO00O00O0=$OOO0000O0($OOO00000O($O0O00OO00($O000O0O00,0x17c),'DojTEGVhfsK6ROPmrd5cJ9Hlki8Y0/ZBnpNgIzXSL3C12beMUvAaWq4uxF7Qtw+y=','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'));eval($OO00O00O0);
**I then proceeded to dump that result back into the original code, replacing the original eval. I end up with this:**
<?php $OOO000000=urldecode('%66%67%36%73%62%65%68%70%72%61%34%63%6f%5f%74%6e%64');$OOO0000O0=$OOO000000{4}.$OOO000000{9}.$OOO000000{3}.$OOO000000{5};$OOO0000O0.=$OOO000000{2}.$OOO000000{10}.$OOO000000{13}.$OOO000000{16};$OOO0000O0.=$OOO0000O0{3}.$OOO000000{11}.$OOO000000{12}.$OOO0000O0{7}.$OOO000000{5};$OOO000O00=$OOO000000{0}.$OOO000000{12}.$OOO000000{7}.$OOO000000{5}.$OOO000000{15};$O0O000O00=$OOO000000{0}.$OOO000000{1}.$OOO000000{5}.$OOO000000{14};$O0O000O0O=$O0O000O00.$OOO000000{11};$O0O000O00=$O0O000O00.$OOO000000{3};$O0O00OO00=$OOO000000{0}.$OOO000000{8}.$OOO000000{5}.$OOO000000{9}.$OOO000000{16};$OOO00000O=$OOO000000{3}.$OOO000000{14}.$OOO000000{8}.$OOO000000{14}.$OOO000000{8};$OOO0O0O00=__FILE__;$OO00O0000=0x2450;$O000O0O00=$OOO000O00($OOO0O0O00,'rb');$O0O00OO00($O000O0O00,0x497);$OO00O00O0=$OOO0000O0($OOO00000O($O0O00OO00($O000O0O00,0x17c),'DojTEGVhfsK6ROPmrd5cJ9Hlki8Y0/ZBnpNgIzXSL3C12beMUvAaWq4uxF7Qtw+y=','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'));eval($OO00O00O0);return;?>iksEwmRTomRTomRTqa/hsB0X9UYVGgi5nSlqwV5JvGlqtS6jfSfNxIcWwmREtUcaDU6NfSfNUIcWwmRTDUREtUKjdmcWtURTDUREtLsEtUcaDUcWtURjnIcaDUREtUcaDU6jdmcaDUcaDURTD36j/EY43JdJ/H8Via5ai5cqob0XrqkWLF5Vv18cpiRjw8rXFUcX/sZzpccTOTRcsNiJq9/IGp9uEW/lpVOqGW/AbFm502sWGjrWdGdI/f5J36cEqPcqodJzOJ99ilHGz8kHsgiV9Xi4p38Xb2YHFM0hGA0udq/S/xZlLURcfaOTJ4OanFKAtSK5I3P4igYVwai5nIcaDUREtUcaDUKcbz/XG2KjdmcaDUcaDUcaD3PU==jXiqYXOW8HwefEOM8HFalqo2/H/3YNnIkXwWK5oQjXzXfjnIkXwW6cFX8lsa/hsqYNInfhsz/h9AYg2KsVdp/VEnm5DIkXwW6cF2ijW+d49WJVvcildW8HFS0AnSr4w3YSRSKc2K8HknKjnIiVGWk5W+i49Wl4qMYX9FfTWwfTD3fjkXKjdIkldp6cFq049BYHweilInmcWnRjI3jSsz/h9AYg2KsVsM/jW+J49eiEqa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TWnsVwN8z2S0Vwa8ld3Y4xSlc2KsVGbiNW+l4sMihzaHao/6cFB/XG2/H9YR9qYRGqYsuop0XGb0A//Has/HA/UYuO3/VzMYN//fTWnsVwN8z2S0Vwa8ld3Y4xSlc2KsVGbiNW+l4sMihzaHao/6cFB/XG2/H9YR9qYRGqYsuop0XGb0A//HaO/fTWnklsAklILKc2KshOz0XzpYVz7ilfnm5oeil0nrJqVJ49A8HG28l3z0Nn3PULI0X9a/HvWfTWnshOz0XzpYVz7ilfbmSOz0XzpYVz7i5nIkHqXKc2Kshnnm5DIkXwW6cFciHFIJX9v/H9a/jnI0X9a/HvWKc2KBrLQsf[|GL~Y
**I tried repeating my previous step of changing the eval to echo but when I run the script it does not output anything. It also is not giving me any errors.**
Can someone point me in the right direction of what to do next so i can finish cleaning up this script? I would really appreciate it. | php | base64 | deobfuscation | null | null | 01/26/2012 15:38:59 | too localized | Deobfuscating PHP code
===
I have this script I am working on updating which I recognize to be obfuscated using evals and base64 encoding. I have researched through many of the similar questions already asked and made *some* progress. However I am a little confused as to what my next step should be.
**Original Code**
<?php $OOO000000=urldecode('%66%67%36%73%62%65%68%70%72%61%34%63%6f%5f%74%6e%64');$OOO0000O0=$OOO000000{4}.$OOO000000{9}.$OOO000000{3}.$OOO000000{5};$OOO0000O0.=$OOO000000{2}.$OOO000000{10}.$OOO000000{13}.$OOO000000{16};$OOO0000O0.=$OOO0000O0{3}.$OOO000000{11}.$OOO000000{12}.$OOO0000O0{7}.$OOO000000{5};$OOO000O00=$OOO000000{0}.$OOO000000{12}.$OOO000000{7}.$OOO000000{5}.$OOO000000{15};$O0O000O00=$OOO000000{0}.$OOO000000{1}.$OOO000000{5}.$OOO000000{14};$O0O000O0O=$O0O000O00.$OOO000000{11};$O0O000O00=$O0O000O00.$OOO000000{3};$O0O00OO00=$OOO000000{0}.$OOO000000{8}.$OOO000000{5}.$OOO000000{9}.$OOO000000{16};$OOO00000O=$OOO000000{3}.$OOO000000{14}.$OOO000000{8}.$O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a8ld3Y4xSlc2KsVGbiNW+l4sMihzaHao/6cFB/XG2/H9YR9qYRGqYsuop0XGb0A//Has/HA/UYuO3/VzMYN//fTWnsVwN8z2S0Vwa8ld3Y4xSlc2KsVGbiNW+l4sMihzaHao/6cFB/XG2/H9YR9qYRGqYsuop0XGb0A//HaO/fTWnklsAklILKc2KshOz0XzpYVz7ilfnm5oeil0nrJqVJ49A8HG28l3z0Nn3PULI0X9a/HvWfTWnshOz0XzpYVz7ilfbmSOz0XzpYVz7i5nIkHqXKc2Kshnnm5DIkXwW6cFciHFIJX9v/H9a/jnI0X9a/HvWKc2KBrLQsf[|GL~Y
**My First Step was to change the eval to echo, which gave me this for output:**
$O000O0O00=$OOO000O00($OOO0O0O00,'rb');$O0O00OO00($O000O0O00,0x497);$OO00O00O0=$OOO0000O0($OOO00000O($O0O00OO00($O000O0O00,0x17c),'DojTEGVhfsK6ROPmrd5cJ9Hlki8Y0/ZBnpNgIzXSL3C12beMUvAaWq4uxF7Qtw+y=','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'));eval($OO00O00O0);
**I then proceeded to dump that result back into the original code, replacing the original eval. I end up with this:**
<?php $OOO000000=urldecode('%66%67%36%73%62%65%68%70%72%61%34%63%6f%5f%74%6e%64');$OOO0000O0=$OOO000000{4}.$OOO000000{9}.$OOO000000{3}.$OOO000000{5};$OOO0000O0.=$OOO000000{2}.$OOO000000{10}.$OOO000000{13}.$OOO000000{16};$OOO0000O0.=$OOO0000O0{3}.$OOO000000{11}.$OOO000000{12}.$OOO0000O0{7}.$OOO000000{5};$OOO000O00=$OOO000000{0}.$OOO000000{12}.$OOO000000{7}.$OOO000000{5}.$OOO000000{15};$O0O000O00=$OOO000000{0}.$OOO000000{1}.$OOO000000{5}.$OOO000000{14};$O0O000O0O=$O0O000O00.$OOO000000{11};$O0O000O00=$O0O000O00.$OOO000000{3};$O0O00OO00=$OOO000000{0}.$OOO000000{8}.$OOO000000{5}.$OOO000000{9}.$OOO000000{16};$OOO00000O=$OOO000000{3}.$OOO000000{14}.$OOO000000{8}.$OOO000000{14}.$OOO000000{8};$OOO0O0O00=__FILE__;$OO00O0000=0x2450;$O000O0O00=$OOO000O00($OOO0O0O00,'rb');$O0O00OO00($O000O0O00,0x497);$OO00O00O0=$OOO0000O0($OOO00000O($O0O00OO00($O000O0O00,0x17c),'DojTEGVhfsK6ROPmrd5cJ9Hlki8Y0/ZBnpNgIzXSL3C12beMUvAaWq4uxF7Qtw+y=','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'));eval($OO00O00O0);return;?>iksEwmRTomRTomRTqa/hsB0X9UYVGgi5nSlqwV5JvGlqtS6jfSfNxIcWwmREtUcaDU6NfSfNUIcWwmRTDUREtUKjdmcWtURTDUREtLsEtUcaDUcWtURjnIcaDUREtUcaDU6jdmcaDUcaDURTD36j/EY43JdJ/H8Via5ai5cqob0XrqkWLF5Vv18cpiRjw8rXFUcX/sZzpccTOTRcsNiJq9/IGp9uEW/lpVOqGW/AbFm502sWGjrWdGdI/f5J36cEqPcqodJzOJ99ilHGz8kHsgiV9Xi4p38Xb2YHFM0hGA0udq/S/xZlLURcfaOTJ4OanFKAtSK5I3P4igYVwai5nIcaDUREtUcaDUKcbz/XG2KjdmcaDUcaDUcaD3PU==jXiqYXOW8HwefEOM8HFalqo2/H/3YNnIkXwWK5oQjXzXfjnIkXwW6cFX8lsa/hsqYNInfhsz/h9AYg2KsVdp/VEnm5DIkXwW6cF2ijW+d49WJVvcildW8HFS0AnSr4w3YSRSKc2K8HknKjnIiVGWk5W+i49Wl4qMYX9FfTWwfTD3fjkXKjdIkldp6cFq049BYHweilInmcWnRjI3jSsz/h9AYg2KsVsM/jW+J49eiEqaiAnSrlszfhzM/5oAiHGIZ5oWYAoXKXO1fG3FYX/pfh9UmA03PULIYHGxkuzgYV9afTWnKVze/jIIiVGWk5W+YHGxkuzgYV9aPU33iNDLsVdp/VEbmX/z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a8ld3Y4xSlc2KsVGbiNW+l4sMihzaHao/6cFB/XG2/H9YR9qYRGqYsuop0XGb0A//HaO/fTWnklsAklILKc2KshOz0XzpYVz7ilfnm5oeil0nrJqVJ49A8HG28l3z0Nn3PULI0X9a/HvWfTWnshOz0XzpYVz7ilfbmSOz0XzpYVz7i5nIkHqXKc2Kshnnm5DIkXwW6cFciHFIJX9v/H9a/jnI0X9a/HvWKc2KBrLQsf[|GL~Y
**I tried repeating my previous step of changing the eval to echo but when I run the script it does not output anything. It also is not giving me any errors.**
Can someone point me in the right direction of what to do next so i can finish cleaning up this script? I would really appreciate it. | 3 |
7,353,451 | 09/08/2011 19:32:59 | 935,587 | 09/08/2011 19:32:59 | 1 | 0 | How to escape all special characters in a string with php? | i.e:
<?php
echo "Hello $nome";
?>
out:
Hello
<?php
echo "Hello \$nome";
?>
Hello $nome
----
i need to put '\', is there a way to do it automatic? some function.
thanks. | php | null | null | null | null | 11/11/2011 09:52:44 | not a real question | How to escape all special characters in a string with php?
===
i.e:
<?php
echo "Hello $nome";
?>
out:
Hello
<?php
echo "Hello \$nome";
?>
Hello $nome
----
i need to put '\', is there a way to do it automatic? some function.
thanks. | 1 |
10,042,504 | 04/06/2012 10:54:05 | 1,097,772 | 12/14/2011 12:24:26 | 149 | 0 | Generating fractal terrain | I have to create a proram that from plane consisting of triangles generate fractal terrain using "dividing of triangles technique", the result will save to text file in format:
1st row - number of vertices in each next row 3 real coordinates (x,y,z) of vertice, then number of triangles and in each next row three integer inices of triangle (all indexes from 0 to number of triangles - 1).
Where should I start? | c# | homework | graphics | terrain | fractals | 04/10/2012 02:05:52 | not constructive | Generating fractal terrain
===
I have to create a proram that from plane consisting of triangles generate fractal terrain using "dividing of triangles technique", the result will save to text file in format:
1st row - number of vertices in each next row 3 real coordinates (x,y,z) of vertice, then number of triangles and in each next row three integer inices of triangle (all indexes from 0 to number of triangles - 1).
Where should I start? | 4 |
8,460,496 | 12/10/2011 22:40:11 | 810,372 | 06/22/2011 12:48:18 | 131 | 8 | Best practices for android mmo game? | I am planning to make a mmo game like iMobsters from Storm8. There will be no extensive graphics, so i'm particulary interested in whats the best way to build the game backend. SOAP or Rest? Are there any frameworks to build such a backend? | android | backend | null | null | null | 12/11/2011 03:27:34 | not a real question | Best practices for android mmo game?
===
I am planning to make a mmo game like iMobsters from Storm8. There will be no extensive graphics, so i'm particulary interested in whats the best way to build the game backend. SOAP or Rest? Are there any frameworks to build such a backend? | 1 |
9,387,131 | 02/21/2012 23:48:41 | 1,224,597 | 02/21/2012 23:31:30 | 1 | 0 | XmlHttpRequest to PHP changes newline (0x0a) to a literal "\n" | I'm completely baffled by this:
- A string is created in JavaScript with several newlines ("\n")
- It is passed through encodeURIComponent and send to Apache/PHP via XmlHttpRequest
- On the PHP end it arrives as a literal '\n', not a newline.
What I have checked:
- The newlines are correct inside the string, alert(string) breaks correctly.
- After it is encoded, newlines are correctly replaced with %0a.
- Tried both GET and POST (with the variable in the POST body).
- Tried without encodeURIComponent(), same effect.
- Tried \r and \r\n - they also arrive literally.
- Actually counted "\n" and '\n' on the PHP end to make sure it's not "one of those" problems. No doubt, $_REQUEST contains a literal \n.
Things which might be irrelevant, but just in case:
- This all happens inside a window.onerror() handler
- Magic quotes and friends are off
I've looked through the code over and over again and have googled for hours. I got nothing. :( Anyone? Bueller?
| php | javascript | xmlhttprequest | newline | literals | 02/24/2012 00:13:46 | too localized | XmlHttpRequest to PHP changes newline (0x0a) to a literal "\n"
===
I'm completely baffled by this:
- A string is created in JavaScript with several newlines ("\n")
- It is passed through encodeURIComponent and send to Apache/PHP via XmlHttpRequest
- On the PHP end it arrives as a literal '\n', not a newline.
What I have checked:
- The newlines are correct inside the string, alert(string) breaks correctly.
- After it is encoded, newlines are correctly replaced with %0a.
- Tried both GET and POST (with the variable in the POST body).
- Tried without encodeURIComponent(), same effect.
- Tried \r and \r\n - they also arrive literally.
- Actually counted "\n" and '\n' on the PHP end to make sure it's not "one of those" problems. No doubt, $_REQUEST contains a literal \n.
Things which might be irrelevant, but just in case:
- This all happens inside a window.onerror() handler
- Magic quotes and friends are off
I've looked through the code over and over again and have googled for hours. I got nothing. :( Anyone? Bueller?
| 3 |
7,442,222 | 09/16/2011 08:48:41 | 948,429 | 09/16/2011 08:41:13 | 1 | 0 | PHPExcel charts creator | Does any one have any idea if I can create charts on a xlsx using PHPExcel? I have read until now that there is an extension that supports graphs but is in an early dev stage. I have also the solution of creating graphs as pictures and inert them into my document, but for what i need, this is not a solution. I have tried also a trick by opening a document with the chats in it and trying to edit the values on it, but PHPExcel creates a copy of the document in memory and i can just save that document as a new one, of course with no graph support. Tx for your answers and sorry for my hi tech english. | phpexcel | null | null | null | null | 06/19/2012 12:22:40 | not a real question | PHPExcel charts creator
===
Does any one have any idea if I can create charts on a xlsx using PHPExcel? I have read until now that there is an extension that supports graphs but is in an early dev stage. I have also the solution of creating graphs as pictures and inert them into my document, but for what i need, this is not a solution. I have tried also a trick by opening a document with the chats in it and trying to edit the values on it, but PHPExcel creates a copy of the document in memory and i can just save that document as a new one, of course with no graph support. Tx for your answers and sorry for my hi tech english. | 1 |
10,882,149 | 06/04/2012 13:26:35 | 1,311,422 | 04/03/2012 21:00:30 | 10 | 0 | Road Maps, Java | I'm trying to implement a road map in my desktop Java application.
The idea of my project is so allow the user to place points onto a map where a specific photo was taken.
I was going to use Google maps, but reading the T&C, I noticed it has to be used on the web only. I have managed to implement a map onto some free web hosting (http://jwasley.netii.net) - but it won't display in the Java web browser I created.
Is this the best way of doing it, or is there an API for road maps. I did look into OpenStreetMap but couldn't find any decent tutorials.
Cheers | java | google-maps | google | maps | null | null | open | Road Maps, Java
===
I'm trying to implement a road map in my desktop Java application.
The idea of my project is so allow the user to place points onto a map where a specific photo was taken.
I was going to use Google maps, but reading the T&C, I noticed it has to be used on the web only. I have managed to implement a map onto some free web hosting (http://jwasley.netii.net) - but it won't display in the Java web browser I created.
Is this the best way of doing it, or is there an API for road maps. I did look into OpenStreetMap but couldn't find any decent tutorials.
Cheers | 0 |
7,347,370 | 09/08/2011 11:31:52 | 517,047 | 11/23/2010 05:58:49 | 705 | 81 | Dropbox app for iPhone/iPad | Can anyone give me link of some tutorial or source code for app like standard Dropbox app. Having root directory shown first and then upon click on folders show contents of that folder.
Thanks | iphone | dropbox | null | null | null | 09/08/2011 11:59:14 | not a real question | Dropbox app for iPhone/iPad
===
Can anyone give me link of some tutorial or source code for app like standard Dropbox app. Having root directory shown first and then upon click on folders show contents of that folder.
Thanks | 1 |
5,605,598 | 04/09/2011 14:25:28 | 515,212 | 11/21/2010 16:43:07 | 11 | 1 | [C] gcc register optimization | I was interested in what assembly code will gcc generate from this code (this is just dummy code to illustrate my point):
int a = 0;
int foo(void)
{
int result = a;
a += 2;
return result;
}
I was surprized that gcc copies the variable a to the stack and then from the stack to a register so it can return it. When I added register to the declaration of result, it optimized the code not to use the stack but instead to copy the variable directly to a register. I know this doesn't really make any difference but I was wondering is there any good reason why gcc doesn't make such optimization implicitly. I hope I made it clear what I am talking about...
Any ideas? | c | gcc | assembly | null | null | null | open | [C] gcc register optimization
===
I was interested in what assembly code will gcc generate from this code (this is just dummy code to illustrate my point):
int a = 0;
int foo(void)
{
int result = a;
a += 2;
return result;
}
I was surprized that gcc copies the variable a to the stack and then from the stack to a register so it can return it. When I added register to the declaration of result, it optimized the code not to use the stack but instead to copy the variable directly to a register. I know this doesn't really make any difference but I was wondering is there any good reason why gcc doesn't make such optimization implicitly. I hope I made it clear what I am talking about...
Any ideas? | 0 |
5,195,244 | 03/04/2011 14:49:33 | 600,082 | 02/02/2011 13:56:17 | 27 | 0 | LINQ to SQL WHERE "IN" | How ia can write query with IN. I want write query
Products.Where(x=>x.CategoryId = {4,5,6....}) | linq-to-sql | null | null | null | null | null | open | LINQ to SQL WHERE "IN"
===
How ia can write query with IN. I want write query
Products.Where(x=>x.CategoryId = {4,5,6....}) | 0 |
9,037,846 | 01/27/2012 17:59:33 | 831,061 | 07/06/2011 07:30:55 | 85 | 10 | Callback function to jQuery plugin | I doubt about the "call" function in Javascript. I have this jQuery plugin:
(function($) {
var methods = {
method1 : function( settings, callback ) {
// do stuff
if($.isFunction(callback)){
callback.call(this, $(list));
}
},
method2 : function( settings, callback ) {
// do stuff
if($.isFunction(callback)){
callback.call(this, $(list));
}
},
method3 : function( settings, callback ) {
// do stuff
if($.isFunction(callback)){
callback.call(this, $(list));
}
},
};
$.fn.jPlugin = function( method ) {
if ( methods[method] ) {
return methods[method].apply( this, Array.prototype.slice.call(arguments, 1));
}
else if ( typeof method === 'object') {
$.error( 'Expected two (2) parameters: parameter 1 must be the method name to call. Parameter 2 must be an object containing the settings for this method.' );
}
else {
$.error( 'Method ' + method + ' does not exist' );
}
};
And I'm a bit confused about this line in the jQuery plugin documentation:
return methods[method].apply( this, Array.prototype.slice.call(arguments, 1));
The plugin works as expected id no callback is passed. But how should I do to pass the callback to the correct method if I call the plugin like this?
$('#my-div').jPlugin('method1', settings);
Should the callback function be part of the settings object or might I adapt the plugin to accept this?
$('#my-div').jPlugin('method1', settings, callback);
Thank you guys!
| jquery | jquery-plugins | jquery-callback | null | null | null | open | Callback function to jQuery plugin
===
I doubt about the "call" function in Javascript. I have this jQuery plugin:
(function($) {
var methods = {
method1 : function( settings, callback ) {
// do stuff
if($.isFunction(callback)){
callback.call(this, $(list));
}
},
method2 : function( settings, callback ) {
// do stuff
if($.isFunction(callback)){
callback.call(this, $(list));
}
},
method3 : function( settings, callback ) {
// do stuff
if($.isFunction(callback)){
callback.call(this, $(list));
}
},
};
$.fn.jPlugin = function( method ) {
if ( methods[method] ) {
return methods[method].apply( this, Array.prototype.slice.call(arguments, 1));
}
else if ( typeof method === 'object') {
$.error( 'Expected two (2) parameters: parameter 1 must be the method name to call. Parameter 2 must be an object containing the settings for this method.' );
}
else {
$.error( 'Method ' + method + ' does not exist' );
}
};
And I'm a bit confused about this line in the jQuery plugin documentation:
return methods[method].apply( this, Array.prototype.slice.call(arguments, 1));
The plugin works as expected id no callback is passed. But how should I do to pass the callback to the correct method if I call the plugin like this?
$('#my-div').jPlugin('method1', settings);
Should the callback function be part of the settings object or might I adapt the plugin to accept this?
$('#my-div').jPlugin('method1', settings, callback);
Thank you guys!
| 0 |
11,710,109 | 07/29/2012 14:42:48 | 1,561,075 | 07/29/2012 14:25:34 | 1 | 0 | how can i change from python2 http request code to python3 Requests | i used python2.6
> import urllib, urllib2 import cookielib
> cj = cookielib.CookieJar() opener =
> urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
> urllib2.install_opener(opener)
>
> params = urllib.urlencode(dict(x = '0' , y = '0', url='login.php', password='1234',id='userid'))
> f = urllib2.urlopen('http://test.com/login_check.php', params)
> data = f.read()
> login_response = opener.open('http://aaa.com/bbs/confirm.php?')
> htmlContent = login_response.read()
> print htmlContent
> response.close()
i want chage python3.2 and Requests
some body help me
| python-3.x | requests | null | null | null | 07/30/2012 14:58:11 | too localized | how can i change from python2 http request code to python3 Requests
===
i used python2.6
> import urllib, urllib2 import cookielib
> cj = cookielib.CookieJar() opener =
> urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
> urllib2.install_opener(opener)
>
> params = urllib.urlencode(dict(x = '0' , y = '0', url='login.php', password='1234',id='userid'))
> f = urllib2.urlopen('http://test.com/login_check.php', params)
> data = f.read()
> login_response = opener.open('http://aaa.com/bbs/confirm.php?')
> htmlContent = login_response.read()
> print htmlContent
> response.close()
i want chage python3.2 and Requests
some body help me
| 3 |
10,848,333 | 06/01/2012 10:09:59 | 1,306,777 | 04/01/2012 20:05:10 | 18 | 0 | java -like friend class mechanism | Do you know guys how can i make an object changable only inside special class?
In this example i want the object PrivateObject to be only changable ( incrementable) inside the Box class, nowhere else. Is there a way to gain this?
public class Box{
private PrivateObject prv;
public void setPrivateObject(PrivateObject p){
prv=p;
}
public void changeValue(){
prv.increment();
}
}
public class PrivateObject {
private value;
public increment(){
value++;
}
}
PrivateObject priv = new PrivateObject ();
Box box = new Box();
box.setPPrivateObject(priv);
box.changevalue();
priv.increment(); //i dont want it to be changable outside the Box class!
In C++, i would make all the PrivateObject properties and methods private, and the declare the Box class as a friend for the PrivateObject class.
| java | friend | null | null | null | null | open | java -like friend class mechanism
===
Do you know guys how can i make an object changable only inside special class?
In this example i want the object PrivateObject to be only changable ( incrementable) inside the Box class, nowhere else. Is there a way to gain this?
public class Box{
private PrivateObject prv;
public void setPrivateObject(PrivateObject p){
prv=p;
}
public void changeValue(){
prv.increment();
}
}
public class PrivateObject {
private value;
public increment(){
value++;
}
}
PrivateObject priv = new PrivateObject ();
Box box = new Box();
box.setPPrivateObject(priv);
box.changevalue();
priv.increment(); //i dont want it to be changable outside the Box class!
In C++, i would make all the PrivateObject properties and methods private, and the declare the Box class as a friend for the PrivateObject class.
| 0 |
2,070,001 | 01/15/2010 07:07:34 | 251,343 | 01/15/2010 07:07:34 | 1 | 0 | borders in java | i want to set single title border to group of testfields how can i do this in java.
| core | java | null | null | null | null | open | borders in java
===
i want to set single title border to group of testfields how can i do this in java.
| 0 |
11,354,163 | 07/06/2012 00:00:15 | 872,344 | 08/01/2011 07:12:44 | 651 | 4 | C# Parsing Json File with no name | So, part of the Json file is like this:
{
"number":"23",
"name":{
"":"LJames" <----------- look at this line
},
"Gender":"Male",
...
I am trying to parse this, and as long as the name field is there (without a name match with the value), the `DataContractJsonSerializer` will fail to read it.
Anyone has experience with this kind of Json file please share some idea, thank you. | c# | json | silverlight | parsing | null | null | open | C# Parsing Json File with no name
===
So, part of the Json file is like this:
{
"number":"23",
"name":{
"":"LJames" <----------- look at this line
},
"Gender":"Male",
...
I am trying to parse this, and as long as the name field is there (without a name match with the value), the `DataContractJsonSerializer` will fail to read it.
Anyone has experience with this kind of Json file please share some idea, thank you. | 0 |
7,868,921 | 10/23/2011 20:21:40 | 508,377 | 11/15/2010 14:47:43 | 711 | 6 | Parsing XML usin SAX in java | I have this code to parse XML data ..
But when startelement and endelement functions don't get the parameters values ( as name parameter don't have any data ) why ?
I call updateArticle function in the following code
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
public class RSSHandler extends DefaultHandler {
// Used to define what elements we are currently in
private boolean inItem = false;
private boolean inTitle = false;
private boolean inLink = false;
// Feed and Article objects to use for temporary storage
private Article currentArticle = new Article();
private Feed currentFeed = new Feed();
// Number of articles added so far
private int articlesAdded = 0;
private ArrayList<Article> articles = new ArrayList<Article>();
private ArrayList<Feed> feeds = new ArrayList<Feed>();
// Number of articles to download
private static final int ARTICLES_LIMIT = 15;
// The possible values for targetFlag
private static final int TARGET_FEED = 0;
private static final int TARGET_ARTICLES = 1;
// A flag to know if looking for Articles or Feed name
private int targetFlag;
public RSSHandler(){ }
public void startElement(String uri, String name, String qName,Attributes atts) {
if (name.trim().equals("title"))
inTitle = true;
else if (name.trim().equals("item"))
inItem = true;
else if (name.trim().equals("link"))
inLink = true;
System.out.println(name.trim());
}
public void endElement(String uri, String name, String qName)throws SAXException {
if (name.trim().equals("title"))
inTitle = false;
else if (name.trim().equals("item"))
inItem = false;
else if (name.trim().equals("link"))
inLink = false;
// Check if looking for feed, and if feed is complete
if (targetFlag == TARGET_FEED && currentFeed.url != null && currentFeed.title != null) {
// We know everything we need to know, so insert feed and exit
System.out.println("add current feed");
feeds.add(currentFeed);
// throw new SAXException();
}
// Check if looking for article, and if article is complete
if (targetFlag == TARGET_ARTICLES && currentArticle.url != null && currentArticle.title != null) {
Article article = new Article();
article.feedId = currentFeed.id;
article.title = currentArticle.title;
article.url = currentArticle.url;
System.out.print(article.title);
articles.add(article);
//store articles in database
currentArticle.title = null;
currentArticle.url = null;
// Lets check if we've hit our limit on number of articles
articlesAdded++;
if (articlesAdded >= ARTICLES_LIMIT)
throw new SAXException();
}
}
public ArrayList<Article> getArticles(){
return this.articles;
}
public ArrayList<Feed> getFeeds(){
return this.feeds;
}
public void characters(char ch[], int start, int length) {
String chars = (new String(ch).substring(start, start + length));
System.out.println(chars);
try {
// If not in item, then title/link refers to feed
if (!inItem) {
if (inTitle)
currentFeed.title = chars;
} else {
if (inLink)
currentArticle.url = new URL(chars);
if (inTitle)
currentArticle.title = chars;
}
} catch (MalformedURLException e) {
}
}
public void createFeed(URL url) {
try {
targetFlag = TARGET_FEED;
currentFeed.url = url;
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();
xr.setContentHandler(this);
xr.parse(new InputSource(url.openStream()));
} catch (IOException e) {}
catch (SAXException e) {}
catch (ParserConfigurationException e) {}
}
public void updateArticles(Feed feed) {
try {
targetFlag = TARGET_ARTICLES;
currentFeed = feed;
System.out.println(feed.url.toString());
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();
xr.setContentHandler(this);
xr.parse(new InputSource(currentFeed.url.openStream()));
} catch (IOException e) {}
catch (SAXException e) {}
catch (ParserConfigurationException e) {}
}
}
| java | xml | sax | null | null | null | open | Parsing XML usin SAX in java
===
I have this code to parse XML data ..
But when startelement and endelement functions don't get the parameters values ( as name parameter don't have any data ) why ?
I call updateArticle function in the following code
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
public class RSSHandler extends DefaultHandler {
// Used to define what elements we are currently in
private boolean inItem = false;
private boolean inTitle = false;
private boolean inLink = false;
// Feed and Article objects to use for temporary storage
private Article currentArticle = new Article();
private Feed currentFeed = new Feed();
// Number of articles added so far
private int articlesAdded = 0;
private ArrayList<Article> articles = new ArrayList<Article>();
private ArrayList<Feed> feeds = new ArrayList<Feed>();
// Number of articles to download
private static final int ARTICLES_LIMIT = 15;
// The possible values for targetFlag
private static final int TARGET_FEED = 0;
private static final int TARGET_ARTICLES = 1;
// A flag to know if looking for Articles or Feed name
private int targetFlag;
public RSSHandler(){ }
public void startElement(String uri, String name, String qName,Attributes atts) {
if (name.trim().equals("title"))
inTitle = true;
else if (name.trim().equals("item"))
inItem = true;
else if (name.trim().equals("link"))
inLink = true;
System.out.println(name.trim());
}
public void endElement(String uri, String name, String qName)throws SAXException {
if (name.trim().equals("title"))
inTitle = false;
else if (name.trim().equals("item"))
inItem = false;
else if (name.trim().equals("link"))
inLink = false;
// Check if looking for feed, and if feed is complete
if (targetFlag == TARGET_FEED && currentFeed.url != null && currentFeed.title != null) {
// We know everything we need to know, so insert feed and exit
System.out.println("add current feed");
feeds.add(currentFeed);
// throw new SAXException();
}
// Check if looking for article, and if article is complete
if (targetFlag == TARGET_ARTICLES && currentArticle.url != null && currentArticle.title != null) {
Article article = new Article();
article.feedId = currentFeed.id;
article.title = currentArticle.title;
article.url = currentArticle.url;
System.out.print(article.title);
articles.add(article);
//store articles in database
currentArticle.title = null;
currentArticle.url = null;
// Lets check if we've hit our limit on number of articles
articlesAdded++;
if (articlesAdded >= ARTICLES_LIMIT)
throw new SAXException();
}
}
public ArrayList<Article> getArticles(){
return this.articles;
}
public ArrayList<Feed> getFeeds(){
return this.feeds;
}
public void characters(char ch[], int start, int length) {
String chars = (new String(ch).substring(start, start + length));
System.out.println(chars);
try {
// If not in item, then title/link refers to feed
if (!inItem) {
if (inTitle)
currentFeed.title = chars;
} else {
if (inLink)
currentArticle.url = new URL(chars);
if (inTitle)
currentArticle.title = chars;
}
} catch (MalformedURLException e) {
}
}
public void createFeed(URL url) {
try {
targetFlag = TARGET_FEED;
currentFeed.url = url;
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();
xr.setContentHandler(this);
xr.parse(new InputSource(url.openStream()));
} catch (IOException e) {}
catch (SAXException e) {}
catch (ParserConfigurationException e) {}
}
public void updateArticles(Feed feed) {
try {
targetFlag = TARGET_ARTICLES;
currentFeed = feed;
System.out.println(feed.url.toString());
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();
xr.setContentHandler(this);
xr.parse(new InputSource(currentFeed.url.openStream()));
} catch (IOException e) {}
catch (SAXException e) {}
catch (ParserConfigurationException e) {}
}
}
| 0 |
5,853,363 | 05/02/2011 04:04:29 | 733,907 | 05/02/2011 04:04:29 | 1 | 0 | remoting clinet's | i have made 2 application server/clinet iwant to remote the clinet from server for example if i press 1 then action happened in clinet if 2 another action occure how can i do it? i think i should use select statment
Select case a' a dim as integer
case Keys.1
frmmain.axwindowsMediaPlayer1.ctlcontrol.play()
end select
is this right ?
| .net | vb.net | vb | null | null | 05/02/2011 04:52:45 | not a real question | remoting clinet's
===
i have made 2 application server/clinet iwant to remote the clinet from server for example if i press 1 then action happened in clinet if 2 another action occure how can i do it? i think i should use select statment
Select case a' a dim as integer
case Keys.1
frmmain.axwindowsMediaPlayer1.ctlcontrol.play()
end select
is this right ?
| 1 |
6,677,005 | 07/13/2011 09:46:30 | 835,075 | 07/08/2011 09:17:21 | 1 | 0 | Why Splash Screen takes long time to launch | In my apps why Splash screen takes long time for launching. Any one tell me please.
Thanks in Advanced:) | iphone | objective-c | null | null | null | 07/14/2011 06:38:37 | not a real question | Why Splash Screen takes long time to launch
===
In my apps why Splash screen takes long time for launching. Any one tell me please.
Thanks in Advanced:) | 1 |
10,802,445 | 05/29/2012 15:46:15 | 1,379,984 | 05/07/2012 14:30:00 | 11 | 1 | Which framework should be selected for the P2P nfc development? | Which framework (libnfc,opennfc and nfcpy) should be selected for the P2P nfc development?Why?We use Windows 7 and Mac OS X 10.7 both.
Thanks for any input. | android | windows | osx | nfc | null | 05/30/2012 16:34:50 | not constructive | Which framework should be selected for the P2P nfc development?
===
Which framework (libnfc,opennfc and nfcpy) should be selected for the P2P nfc development?Why?We use Windows 7 and Mac OS X 10.7 both.
Thanks for any input. | 4 |
7,840,829 | 10/20/2011 18:59:53 | 690,430 | 04/04/2011 01:49:19 | 360 | 24 | Practical Resources for Creating a Custom CMS with PHP OOP/Zend Framework | I've developed a content management system for a small business using PHP 5. All the code is procedural. I've decided to recode everything using object oriented programming to have a more robust and extensible site. I'm familiar with OOP and design patterns but only in the Java language.
I want to use a framework to make life easier and, after reading http://stackoverflow.com/questions/77371/zend-framework-or-cakephp, I have decided to use the Zend framework because of its alleged flexibility and corporate support.
Many- if not all- of the Zend framework books on Amazon.com books have very mixed reviews. I'm really looking for book or site to show a bunch of specific examples as opposed to just go through a bunch of theory and descriptions which I can easily look up in the internet. Something in the spirit of the HeadFirst series if that's even possible. | php | oop | content-management-system | null | null | 11/10/2011 22:38:36 | not constructive | Practical Resources for Creating a Custom CMS with PHP OOP/Zend Framework
===
I've developed a content management system for a small business using PHP 5. All the code is procedural. I've decided to recode everything using object oriented programming to have a more robust and extensible site. I'm familiar with OOP and design patterns but only in the Java language.
I want to use a framework to make life easier and, after reading http://stackoverflow.com/questions/77371/zend-framework-or-cakephp, I have decided to use the Zend framework because of its alleged flexibility and corporate support.
Many- if not all- of the Zend framework books on Amazon.com books have very mixed reviews. I'm really looking for book or site to show a bunch of specific examples as opposed to just go through a bunch of theory and descriptions which I can easily look up in the internet. Something in the spirit of the HeadFirst series if that's even possible. | 4 |
9,321,500 | 02/17/2012 01:00:07 | 1,215,148 | 02/17/2012 00:57:42 | 1 | 0 | Java Array Comparison | I need some help with Java code.
I have an array of 10 elements. I want to compare the first element, ie. array[0] to array[1], array[2], ... array[9]. If I find any elements that are equal to array[0] then I perform some actions. I then need to compare array[1] to array[2], array[3],...array[9] and find if array[1] is equal to something and so on. I really can't figure this out, and I am stuck. Can someone help me. | java | arrays | loops | null | null | 02/18/2012 01:21:39 | not a real question | Java Array Comparison
===
I need some help with Java code.
I have an array of 10 elements. I want to compare the first element, ie. array[0] to array[1], array[2], ... array[9]. If I find any elements that are equal to array[0] then I perform some actions. I then need to compare array[1] to array[2], array[3],...array[9] and find if array[1] is equal to something and so on. I really can't figure this out, and I am stuck. Can someone help me. | 1 |
10,015,341 | 04/04/2012 16:26:34 | 333,390 | 05/05/2010 11:48:51 | 1,481 | 0 | Size of a directory | is there a way to get the directory size/folder size without actually traversing this directory and adding size of each file in it? Ideally would like to use some library like boost but win api would be ok too.
Thanks. | c++ | winapi | null | null | null | null | open | Size of a directory
===
is there a way to get the directory size/folder size without actually traversing this directory and adding size of each file in it? Ideally would like to use some library like boost but win api would be ok too.
Thanks. | 0 |
4,342,843 | 12/03/2010 05:48:57 | 411,924 | 08/05/2010 12:05:09 | 65 | 5 | Assembly.GlobalAssemblyCache returning FALSE although assembly is loaded from GAC | I have created a test project to understand reflection. I'm loading an assembly from .NET 4.0 GAC. (As I understand, .NET 4.0 maintains it's GAC in C:\WINDOWS\Microsoft.NET\assembly)
I wrote the code like this:
Assembly testAssembly = Assembly.ReflectionOnlyLoadFrom(@"C:\WINDOWS\Microsoft.NET\assembly\GAC_32\TestReflection\v4.0_1.0.0.0__7ff2353191526e8c\TestReflection.dll");
if(testAssembly.GlobalAssemblyCache)
Console.WriteLine(testAssembly.FullName);
When I run this code, `GlobalAssemblyCache` property always return FALSE although I'm loading assembly from GAC.
Can someone tell me the reason? Or Am I missing something?
| .net | reflection | null | null | null | null | open | Assembly.GlobalAssemblyCache returning FALSE although assembly is loaded from GAC
===
I have created a test project to understand reflection. I'm loading an assembly from .NET 4.0 GAC. (As I understand, .NET 4.0 maintains it's GAC in C:\WINDOWS\Microsoft.NET\assembly)
I wrote the code like this:
Assembly testAssembly = Assembly.ReflectionOnlyLoadFrom(@"C:\WINDOWS\Microsoft.NET\assembly\GAC_32\TestReflection\v4.0_1.0.0.0__7ff2353191526e8c\TestReflection.dll");
if(testAssembly.GlobalAssemblyCache)
Console.WriteLine(testAssembly.FullName);
When I run this code, `GlobalAssemblyCache` property always return FALSE although I'm loading assembly from GAC.
Can someone tell me the reason? Or Am I missing something?
| 0 |
2,374,334 | 03/03/2010 19:32:38 | 25,968 | 10/07/2008 21:51:27 | 2,088 | 72 | Static Variables in Python C API | How would one expose "static" variables like this
class MyClass:
X = 1
Y = 2
via the C API? The only variable on the PyTypeObject that looks like it would work is tp_members, but I see no flag in the PyMemberDef to indicate that the member should be per-class, not per-instance.
For a bit more clarification, since it may change the answer, I'm trying to expose a C enum to Python such that the enumeration
enum MyFlags {
Alpha = 0,
Beta = 1
};
Can be accessed in Python as:
module.MyFlags.Alpha
module.MyFlags.Beta | python | python-c-api | null | null | null | null | open | Static Variables in Python C API
===
How would one expose "static" variables like this
class MyClass:
X = 1
Y = 2
via the C API? The only variable on the PyTypeObject that looks like it would work is tp_members, but I see no flag in the PyMemberDef to indicate that the member should be per-class, not per-instance.
For a bit more clarification, since it may change the answer, I'm trying to expose a C enum to Python such that the enumeration
enum MyFlags {
Alpha = 0,
Beta = 1
};
Can be accessed in Python as:
module.MyFlags.Alpha
module.MyFlags.Beta | 0 |
131,535 | 09/25/2008 04:53:43 | 16,940 | 09/17/2008 22:43:34 | 21 | 3 | What can cause ASPNET AJAX page to revert to normal ASPX mode ? / UpdatePanel broken | I am using VS 2008 with a very simple UpdatePanel scenario.
But i cannot get UpdatePanel to work and cant seem to find out why
I have in fact reverted to a very simple example to validate it is not my code:
http://ajax.net-tutorials.com/controls/updatepanel-control/
In this example I click on either button and both text links update.
I dont get any errors, the page just behaves like a normal ASPX page.
What things do i need to check. I've been googling this for an hour and not found what I need. | aspnet | ajax | updatepanel | null | null | null | open | What can cause ASPNET AJAX page to revert to normal ASPX mode ? / UpdatePanel broken
===
I am using VS 2008 with a very simple UpdatePanel scenario.
But i cannot get UpdatePanel to work and cant seem to find out why
I have in fact reverted to a very simple example to validate it is not my code:
http://ajax.net-tutorials.com/controls/updatepanel-control/
In this example I click on either button and both text links update.
I dont get any errors, the page just behaves like a normal ASPX page.
What things do i need to check. I've been googling this for an hour and not found what I need. | 0 |
2,449,253 | 03/15/2010 17:50:11 | 250,903 | 01/14/2010 16:40:57 | 13 | 0 | Get reference to the EJB3 local business interaface inside the JCA adapter | I'd like to know whether it is possible to get a reference to the ejb3 local business interfaces inside the jca adapter. Resource adapter and ejb jar are packed into the same ear. Application is running under WebSphere AS 6.1 with ejb3 featurepack.
I have tried to use ejblocal:<full_class_name_of_local_interface> jndi name, but without success. | websphere | ejb-3.0 | jca | java | null | null | open | Get reference to the EJB3 local business interaface inside the JCA adapter
===
I'd like to know whether it is possible to get a reference to the ejb3 local business interfaces inside the jca adapter. Resource adapter and ejb jar are packed into the same ear. Application is running under WebSphere AS 6.1 with ejb3 featurepack.
I have tried to use ejblocal:<full_class_name_of_local_interface> jndi name, but without success. | 0 |
11,289,135 | 07/02/2012 07:06:56 | 1,458,345 | 06/15/2012 09:50:18 | 23 | 0 | what function's call will be right and why? | if it's prototype is the following:
> int f(int* a, int& b);
> 1. int k = f(&x, *y);
> 2. f(*x, &y);
> 3. int k = f(&x, y);
generally, I didn't get the main idea of ***** and **&** ( I don't know their names on English, so sorry). so I didn't understand how to call the following function.. | c++ | null | null | null | null | 07/02/2012 07:29:50 | too localized | what function's call will be right and why?
===
if it's prototype is the following:
> int f(int* a, int& b);
> 1. int k = f(&x, *y);
> 2. f(*x, &y);
> 3. int k = f(&x, y);
generally, I didn't get the main idea of ***** and **&** ( I don't know their names on English, so sorry). so I didn't understand how to call the following function.. | 3 |
10,628,043 | 05/16/2012 23:20:21 | 1,399,724 | 05/16/2012 22:01:21 | 1 | 0 | Error whit JPA on update | I have working with JPA on little desktop system. The problem is after the system updates a table 4 or 5 times correctly, the sixth time updates wrong, then the seventh time works well, until after 10 times it fails again once or twice more.
Details: Use JPA 2.0 with eclipselink and Netbeans 7.0.1. I'm using mysql.
I hope can you help me.
Thanks | java | jpa | eclipselink | netbeans-7 | null | 05/28/2012 08:41:43 | not a real question | Error whit JPA on update
===
I have working with JPA on little desktop system. The problem is after the system updates a table 4 or 5 times correctly, the sixth time updates wrong, then the seventh time works well, until after 10 times it fails again once or twice more.
Details: Use JPA 2.0 with eclipselink and Netbeans 7.0.1. I'm using mysql.
I hope can you help me.
Thanks | 1 |
2,164,960 | 01/29/2010 20:33:30 | 262,124 | 01/29/2010 20:33:30 | 1 | 0 | Type inference failed ? | Suppose we have:
public class FooBase
{
public void Write(byte value)
{
//something
}
public void Write(int value)
{
//something
}
}
public class Foo : FooBase
{
public void Write(decimal value)
{
//something
}
}
than this:
var writer = new Foo();
writer.Write(5); //calls Write(decimal) !!
writer.Write((byte)6); //calls Write(decimal) !!
will call Write(decimal) overload. Why? And how can I call Write(int) or Write(byte) ? | type-inference | c# | null | null | null | null | open | Type inference failed ?
===
Suppose we have:
public class FooBase
{
public void Write(byte value)
{
//something
}
public void Write(int value)
{
//something
}
}
public class Foo : FooBase
{
public void Write(decimal value)
{
//something
}
}
than this:
var writer = new Foo();
writer.Write(5); //calls Write(decimal) !!
writer.Write((byte)6); //calls Write(decimal) !!
will call Write(decimal) overload. Why? And how can I call Write(int) or Write(byte) ? | 0 |
5,005,412 | 02/15/2011 15:12:54 | 589,202 | 01/25/2011 15:16:14 | 6 | 0 | genetic algorithm to be solved with matlab | Dear John Thanks for reply. i wanted to solve some problems of with objective function and with constraints in MAtlab GATOOL. suppose the example is like this MIN Z = 2(X1)square + 3(x2)squre + 2(X1)(3X2).... and the constraints are x1 <= 0, x2<=0 and (X1)+(X2)<=5 this example is just imaginary or like any example from Operations research or Simplex problem. i will be highly obliged if you will please guide me. | genetic-algorithm | null | null | null | null | 02/16/2011 14:35:47 | not a real question | genetic algorithm to be solved with matlab
===
Dear John Thanks for reply. i wanted to solve some problems of with objective function and with constraints in MAtlab GATOOL. suppose the example is like this MIN Z = 2(X1)square + 3(x2)squre + 2(X1)(3X2).... and the constraints are x1 <= 0, x2<=0 and (X1)+(X2)<=5 this example is just imaginary or like any example from Operations research or Simplex problem. i will be highly obliged if you will please guide me. | 1 |
7,365,370 | 09/09/2011 17:37:50 | 937,270 | 09/09/2011 17:37:50 | 1 | 0 | How can I create a dynamic stylesheet using an ID selector? | I want to be able to get the following code to work:
<br/>
var head = document.getElementsByTagName("head")[0];
var style = document.createElement( "style" );
style.type = "text/css";
style.media = "print";
style.styleSheet.cssText = "#menu {display:none;}";
head.appendChild( style );
window.print();
The problem is that it ends up with the following style:<br/>
UNKNOWN {display:none;}
I've also tried using addRule with the same result, well actually it errors with "Invalid argument" and nothing is set.
What I'm trying to accomplish is to dynamically hide some elements within a given page to not print, these elements use different tags, formats, and classes, so there is no generic way to exclude them (at least that I can think of) without using an ID selector.
This is for a business application on an intranet using IE7.
My only current workaround is to send this information to an ASP to just return it back as a stylesheet so I can use it as an href stylesheet since that is all I can think of to dynamically create a stylesheet using ID selectors.
Thanks in advance.
| javascript | css | css-selectors | null | null | null | open | How can I create a dynamic stylesheet using an ID selector?
===
I want to be able to get the following code to work:
<br/>
var head = document.getElementsByTagName("head")[0];
var style = document.createElement( "style" );
style.type = "text/css";
style.media = "print";
style.styleSheet.cssText = "#menu {display:none;}";
head.appendChild( style );
window.print();
The problem is that it ends up with the following style:<br/>
UNKNOWN {display:none;}
I've also tried using addRule with the same result, well actually it errors with "Invalid argument" and nothing is set.
What I'm trying to accomplish is to dynamically hide some elements within a given page to not print, these elements use different tags, formats, and classes, so there is no generic way to exclude them (at least that I can think of) without using an ID selector.
This is for a business application on an intranet using IE7.
My only current workaround is to send this information to an ASP to just return it back as a stylesheet so I can use it as an href stylesheet since that is all I can think of to dynamically create a stylesheet using ID selectors.
Thanks in advance.
| 0 |
9,862,859 | 03/25/2012 18:35:54 | 548,846 | 12/20/2010 15:53:55 | 10 | 0 | initialization vectors in CBC mode encryption | what is the purpose of initialization vectors in CBC mode encryption? | encryption | cryptography | null | null | null | 03/25/2012 20:07:30 | not a real question | initialization vectors in CBC mode encryption
===
what is the purpose of initialization vectors in CBC mode encryption? | 1 |
11,061,639 | 06/16/2012 07:30:01 | 1,283,836 | 03/21/2012 15:38:53 | 1 | 0 | Python RAD (Desktop Deployment) | please forgive me if this questions were answered so many times!
How can I deploy desktop applications with python (in RAD way), I mean:
1. there is an IDE and i can create user interface(gui) like virtual studio that you just ***drag and drop objects*** (label, combobox, radiobutton...) to the form.
2.editing code behind that objects(label, combobox, radiobutton...) for example ***when i click a button with my mouse something happens***.
thanks in advance for answers. (forgive me for may English guys!) | python | null | null | null | null | 06/16/2012 09:53:08 | not a real question | Python RAD (Desktop Deployment)
===
please forgive me if this questions were answered so many times!
How can I deploy desktop applications with python (in RAD way), I mean:
1. there is an IDE and i can create user interface(gui) like virtual studio that you just ***drag and drop objects*** (label, combobox, radiobutton...) to the form.
2.editing code behind that objects(label, combobox, radiobutton...) for example ***when i click a button with my mouse something happens***.
thanks in advance for answers. (forgive me for may English guys!) | 1 |
6,770,881 | 07/21/2011 03:13:01 | 555,493 | 12/28/2010 00:04:58 | 50 | 5 | Correct way to do OpenGL multi-threading in GLSurfaceVIew? | I keep reading that OpenGL is not thread safe, so what's the best way to synchronize OpenGL with the program logic?
Here's what's going on:
- I'm actually using GLWallpaperService, which uses GLSurfaceView, to create a live wallpaper.
- I use FFmpeg to load a frame from a video via NDK
- I take that frame and use it as a texture
- I draw the texture using OpenGL on the screen
It works fine until onSurfaceChanged() gets called with different parameters (say because the user rotates the phone). For some reason, the texture doesn't resize even though I'm recreating it in onSurfaceChanged(). My guess is that OpenGL tries to change the texture dimensions at the same that it's still drawing a frame. Hence, the corrupted state and the threading issues. Is there a workaround?
| android | opengl | opengl-es | android-ndk | live-wallpaper | 06/14/2012 18:42:36 | not a real question | Correct way to do OpenGL multi-threading in GLSurfaceVIew?
===
I keep reading that OpenGL is not thread safe, so what's the best way to synchronize OpenGL with the program logic?
Here's what's going on:
- I'm actually using GLWallpaperService, which uses GLSurfaceView, to create a live wallpaper.
- I use FFmpeg to load a frame from a video via NDK
- I take that frame and use it as a texture
- I draw the texture using OpenGL on the screen
It works fine until onSurfaceChanged() gets called with different parameters (say because the user rotates the phone). For some reason, the texture doesn't resize even though I'm recreating it in onSurfaceChanged(). My guess is that OpenGL tries to change the texture dimensions at the same that it's still drawing a frame. Hence, the corrupted state and the threading issues. Is there a workaround?
| 1 |
1,639,482 | 10/28/2009 19:18:19 | 190,949 | 10/15/2009 23:29:21 | 30 | 0 | Facebook Connect Examples - Connect.registerUsers and login/logout processes | I'm looking for example PHP code (preferably using the FB PHP library) that does the following:
- Let my website connect to my FB
account when i log into FB connect.
- Store my facebook credentials (email
hash and FBID?) locally
- Log me out of Facebook connect when I
log out of my website
- Automatically log me back into FB
connect without the connect dialog
when I log back into my site using
the stored credentials.
Basically trying to do what sites like digg do with FB connect but I can't find a good (basic) example of exactly what I need. (which I'd of assumed to be a common need to FB connect websites)
Any suggestions?
Thanks | facebook | facebook-connect | php | null | null | null | open | Facebook Connect Examples - Connect.registerUsers and login/logout processes
===
I'm looking for example PHP code (preferably using the FB PHP library) that does the following:
- Let my website connect to my FB
account when i log into FB connect.
- Store my facebook credentials (email
hash and FBID?) locally
- Log me out of Facebook connect when I
log out of my website
- Automatically log me back into FB
connect without the connect dialog
when I log back into my site using
the stored credentials.
Basically trying to do what sites like digg do with FB connect but I can't find a good (basic) example of exactly what I need. (which I'd of assumed to be a common need to FB connect websites)
Any suggestions?
Thanks | 0 |
1,181,794 | 07/25/2009 10:05:16 | 2,313 | 08/21/2008 15:27:23 | 354 | 35 | Dissepearing head | I've faced strange problem with my git repo. In process of cloning it looses all it's heads except master. Isn't head is just a file-reference to the commit id? Or it should be registered somewhere else to be cloned?
| git | null | null | null | null | null | open | Dissepearing head
===
I've faced strange problem with my git repo. In process of cloning it looses all it's heads except master. Isn't head is just a file-reference to the commit id? Or it should be registered somewhere else to be cloned?
| 0 |
11,241,289 | 06/28/2012 09:03:15 | 952,559 | 09/19/2011 11:21:52 | 6 | 2 | Find all .php files inside directories with 777 permissions | I have recently had a linux server compromised from bots uploading .php scripts and posing as images. I'm currently in the process of fixing this.
Because my server has a lot of websites I'm looking for a linux command to scan through all the 777 directories on the server and show ones with .php files inside them.
You can use the following command to return all 777 directories but this is not
`find httpdocs/ -type d -perm 777`
Any ideas? | php | linux | permissions | chmod | 777 | 06/28/2012 14:11:33 | off topic | Find all .php files inside directories with 777 permissions
===
I have recently had a linux server compromised from bots uploading .php scripts and posing as images. I'm currently in the process of fixing this.
Because my server has a lot of websites I'm looking for a linux command to scan through all the 777 directories on the server and show ones with .php files inside them.
You can use the following command to return all 777 directories but this is not
`find httpdocs/ -type d -perm 777`
Any ideas? | 2 |
3,600,313 | 08/30/2010 12:33:56 | 407,309 | 07/31/2010 05:52:58 | 42 | 0 | query for ms access | my query is `"SELECT column_name, table_name FROM information_schema.columns"`
.but it execute true in sqlserver ,but it dosn't execute true
in Ms Access.i want to get all colums and tables'name from specific
database.thanks. | sql | query | ms-access | null | null | null | open | query for ms access
===
my query is `"SELECT column_name, table_name FROM information_schema.columns"`
.but it execute true in sqlserver ,but it dosn't execute true
in Ms Access.i want to get all colums and tables'name from specific
database.thanks. | 0 |
11,506,035 | 07/16/2012 14:04:44 | 1,528,960 | 07/16/2012 12:58:47 | 1 | 0 | tumblr - how to change size of photo posts | How do I make images a fixed height (and varying width) in the permalink page (the individual post page)? As opposed to of fixed width and varying height?
Any advice would be greatly appreciated
Here is the site: http://iamanarteest.tumblr.com
Here is the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>{Title}{block:SearchPage} | {SearchQuery}{/block:SearchPage}{block:PostSummary} | {PostSummary}{/block:PostSummary}</title>
<link rel="shortcut icon" href="{Favicon}">
<link rel="alternate" type="application/rss+xml" href="{RSS}">
{block:Description}<meta name="description" content="{MetaDescription}" />{/block:Description}
<meta name="image:Background" content="" />
<meta name="color:Background" content="#FFFFFF" />
<meta name="text:Blog title size" content="75px" />
<meta name="if:Infinite scroll" content="1" />
<meta name="color:Body text" content="#FF3030" />
<meta name="color:Blog title" content="#000000" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
/**
* jQuery Masonry v2.0.110825
* A dynamic layout plugin for jQuery
* The flip-side of CSS Floats
* http://masonry.desandro.com
*
* Licensed under the MIT license.
* Copyright 2011 David DeSandro
*/
(function(a,b,c){var d=b.event,e;d.special.smartresize={setup:function(){b(this).bind("resize",d.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",d.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",e&&clearTimeout(e),e=setTimeout(function(){jQuery.event.handle.apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Mason=function(a,c){this.element=b(c),this._create(a),this._init()};var f=["position","height"];b.Mason.settings={isResizable:!0,isAnimated:!1,animationOptions:{queue:!1,duration:500},gutterWidth:0,isRTL:!1,isFitWidth:!1},b.Mason.prototype={_filterFindBricks:function(a){var b=this.options.itemSelector;return b?a.filter(b).add(a.find(b)):a},_getBricks:function(a){var b=this._filterFindBricks(a).css({position:"absolute"}).addClass("masonry-brick");return b},_create:function(c){this.options=b.extend(!0,{},b.Mason.settings,c),this.styleQueue=[],this.reloadItems();var d=this.element[0].style;this.originalStyle={};for(var e=0,g=f.length;e<g;e++){var h=f[e];this.originalStyle[h]=d[h]||""}this.element.css({position:"relative"}),this.horizontalDirection=this.options.isRTL?"right":"left",this.offset={};var i=b(document.createElement("div"));this.element.prepend(i),this.offset.y=Math.round(i.position().top),this.options.isRTL?(i.css({"float":"right",display:"inline-block"}),this.offset.x=Math.round(this.element.outerWidth()-i.position().left)):this.offset.x=Math.round(i.position().left),i.remove();var j=this;setTimeout(function(){j.element.addClass("masonry")},0),this.options.isResizable&&b(a).bind("smartresize.masonry",function(){j.resize()})},_init:function(a){this._getColumns("masonry"),this._reLayout(a)},option:function(a,c){b.isPlainObject(a)&&(this.options=b.extend(!0,this.options,a))},layout:function(a,c){var d,e,f,g,h,i;for(var j=0,k=a.length;j<k;j++){d=b(a[j]),e=Math.ceil(d.outerWidth(!0)/this.columnWidth),e=Math.min(e,this.cols);if(e===1)this._placeBrick(d,this.colYs);else{f=this.cols+1-e,g=[];for(i=0;i<f;i++)h=this.colYs.slice(i,i+e),g[i]=Math.max.apply(Math,h);this._placeBrick(d,g)}}var l={};l.height=Math.max.apply(Math,this.colYs)-this.offset.y,this.options.isFitWidth&&(l.width=this.cols*this.columnWidth-this.options.gutterWidth),this.styleQueue.push({$el:this.element,style:l});var m=this.isLaidOut?this.options.isAnimated?"animate":"css":"css",n=this.options.animationOptions,o;for(j=0,k=this.styleQueue.length;j<k;j++)o=this.styleQueue[j],o.$el[m](o.style,n);this.styleQueue=[],c&&c.call(a),this.isLaidOut=!0},_getColumns:function(){var a=this.options.isFitWidth?this.element.parent():this.element,b=a.width();this.columnWidth=this.options.columnWidth||this.$bricks.outerWidth(!0)||b,this.columnWidth+=this.options.gutterWidth,this.cols=Math.floor((b+this.options.gutterWidth)/this.columnWidth),this.cols=Math.max(this.cols,1)},_placeBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g={top:c};g[this.horizontalDirection]=this.columnWidth*d+this.offset.x,this.styleQueue.push({$el:a,style:g});var h=c+a.outerHeight(!0),i=this.cols+1-f;for(e=0;e<i;e++)this.colYs[d+e]=h},resize:function(){var a=this.cols;this._getColumns("masonry"),this.cols!==a&&this._reLayout()},_reLayout:function(a){var b=this.cols;this.colYs=[];while(b--)this.colYs.push(this.offset.y);this.layout(this.$bricks,a)},reloadItems:function(){this.$bricks=this._getBricks(this.element.children())},reload:function(a){this.reloadItems(),this._init(a)},appended:function(a,b,c){if(b){this._filterFindBricks(a).css({top:this.element.height()});var d=this;setTimeout(function(){d._appended(a,c)},1)}else this._appended(a,c)},_appended:function(a,b){var c=this._getBricks(a);this.$bricks=this.$bricks.add(c),this.layout(c,b)},remove:function(a){this.$bricks=this.$bricks.not(a),a.remove()},destroy:function(){this.$bricks.removeClass("masonry-brick").each(function(){this.style.position="",this.style.top="",this.style.left=""});var c=this.element[0].style;for(var d=0,e=f.length;d<e;d++){var g=f[d];c[g]=this.originalStyle[g]}this.element.unbind(".masonry").removeClass("masonry").removeData("masonry"),b(a).unbind(".masonry")}},b.fn.imagesLoaded=function(a){function h(){--d<=0&&this.src!==f&&(setTimeout(g),b.unbind("load error",h))}function g(){a.call(e,b)}var b=this.find("img"),d=b.length,e=this,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";d||g(),b.bind("load error",h).each(function(){if(this.complete||this.complete===c){var a=this.src;this.src=f,this.src=a}});return this};var g=function(a){this.console&&console.error(a)};b.fn.masonry=function(a){if(typeof a=="string"){var c=Array.prototype.slice.call(arguments,1);this.each(function(){var d=b.data(this,"masonry");if(!d)g("cannot call methods on masonry prior to initialization; attempted to call method '"+a+"'");else{if(!b.isFunction(d[a])||a.charAt(0)==="_"){g("no such method '"+a+"' for masonry instance");return}d[a].apply(d,c)}})}else this.each(function(){var c=b.data(this,"masonry");c?(c.option(a||{}),c._init()):b.data(this,"masonry",new b.Mason(a,this))});return this}})(window,jQuery);var headID = document.getElementsByTagName("head")[0];var cssNode = document.createElement('link');cssNode.type = 'text/css';cssNode.rel = 'stylesheet';cssNode.href = 'http://dl.dropbox.com/u/6496924/Theme/theme-css.css';cssNode.media = 'screen';headID.appendChild(cssNode);var headID = document.getElementsByTagName("head")[0]; newScript = document.createElement('script');newScript.type = 'text/javascript';newScript.src = 'http://dl.dropbox.com/u/6496924/Theme/theme-js.js';headID.appendChild(newScript);
/*
--------------------------------
Infinite Scroll
--------------------------------
+ https://github.com/paulirish/infinitescroll
+ version 2.0b2.110713
+ Copyright 2011 Paul Irish & Luke Shumard
+ Licensed under the MIT license
+ Documentation: http://infinite-scroll.com/
*/
(function(window,$,undefined){$.infinitescroll=function infscr(options,callback,element){this.element=$(element);this._create(options,callback);};$.infinitescroll.defaults={loading:{finished:undefined,finishedMsg:"",img:"",msg:null,msgText:"",selector:null,speed:'fast',start:undefined},state:{isDuringAjax:false,isInvalidPage:false,isDestroyed:false,isDone:false,isPaused:false,currPage:1},callback:undefined,debug:false,behavior:undefined,binder:$(window),nextSelector:"div.navigation a:first",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:false,pathParse:undefined,dataType:'html',appendCallback:true,bufferPx:40,errorCallback:function(){},infid:0,pixelsFromNavToBottom:undefined,path:undefined};$.infinitescroll.prototype={_binding:function infscr_binding(binding){var instance=this,opts=instance.options;if(!!opts.behavior&&this['_binding_'+opts.behavior]!==undefined){this['_binding_'+opts.behavior].call(this);return;}
if(binding!=='bind'&&binding!=='unbind'){this._debug('Binding value '+binding+' not valid')
return false;}
if(binding=='unbind'){(this.options.binder).unbind('smartscroll.infscr.'+instance.options.infid);}else{(this.options.binder)[binding]('smartscroll.infscr.'+instance.options.infid,function(){instance.scroll();});};this._debug('Binding',binding);},_create:function infscr_create(options,callback){if(!this._validate(options)){return false;}
var opts=this.options=$.extend(true,{},$.infinitescroll.defaults,options),relurl=/(.*?\/\/).*?(\/.*)/,path=$(opts.nextSelector).attr('href');opts.contentSelector=opts.contentSelector||this.element;opts.loading.selector=opts.loading.selector||opts.contentSelector;if(!path){this._debug('Navigation selector not found');return;}
opts.path=this._determinepath(path);opts.loading.msg=$('<div id="infscr-loading"><img alt="Loading..." src="'+opts.loading.img+'" /><div>'+opts.loading.msgText+'</div></div>');(new Image()).src=opts.loading.img;opts.pixelsFromNavToBottom=$(document).height()-$(opts.navSelector).offset().top;opts.loading.start=opts.loading.start||function(){$(opts.navSelector).hide();opts.loading.msg.appendTo(opts.loading.selector).show(opts.loading.speed,function(){beginAjax(opts);});};opts.loading.finished=opts.loading.finished||function(){opts.loading.msg.fadeOut('normal');};opts.callback=function(instance,data){if(!!opts.behavior&&instance['_callback_'+opts.behavior]!==undefined){instance['_callback_'+opts.behavior].call($(opts.contentSelector)[0],data);}
if(callback){callback.call($(opts.contentSelector)[0],data);}};this._setup();},_debug:function infscr_debug(){if(this.options.debug){return window.console&&console.log.call(console,arguments);}},_determinepath:function infscr_determinepath(path){var opts=this.options;if(!!opts.behavior&&this['_determinepath_'+opts.behavior]!==undefined){this['_determinepath_'+opts.behavior].call(this,path);return;}
if(!!opts.pathParse){this._debug('pathParse manual');return opts.pathParse;}else if(path.match(/^(.*?)\b2\b(.*?$)/)){path=path.match(/^(.*?)\b2\b(.*?$)/).slice(1);}else if(path.match(/^(.*?)2(.*?$)/)){if(path.match(/^(.*?page=)2(\/.*|$)/)){path=path.match(/^(.*?page=)2(\/.*|$)/).slice(1);return path;}
path=path.match(/^(.*?)2(.*?$)/).slice(1);}else{if(path.match(/^(.*?page=)1(\/.*|$)/)){path=path.match(/^(.*?page=)1(\/.*|$)/).slice(1);return path;}else{this._debug('Sorry, we couldn\'t parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.');opts.state.isInvalidPage=true;}}
this._debug('determinePath',path);return path;},_error:function infscr_error(xhr){var opts=this.options;if(!!opts.behavior&&this['_error_'+opts.behavior]!==undefined){this['_error_'+opts.behavior].call(this,xhr);return;}
if(xhr!=='destroy'&&xhr!=='end'){xhr='unknown';}
this._debug('Error',xhr);if(xhr=='end'){this._showdonemsg();}
opts.state.isDone=true;opts.state.currPage=1;opts.state.isPaused=false;this._binding('unbind');},_loadcallback:function infscr_loadcallback(box,data){var opts=this.options,callback=this.options.callback,result=(opts.state.isDone)?'done':(!opts.appendCallback)?'no-append':'append',frag;if(!!opts.behavior&&this['_loadcallback_'+opts.behavior]!==undefined){this['_loadcallback_'+opts.behavior].call(this,box,data);return;}
switch(result){case'done':this._showdonemsg();return false;break;case'no-append':if(opts.dataType=='html'){data='<div>'+data+'</div>';data=$(data).find(opts.itemSelector);};break;case'append':var children=box.children();if(children.length==0){return this._error('end');}
frag=document.createDocumentFragment();while(box[0].firstChild){frag.appendChild(box[0].firstChild);}
this._debug('contentSelector',$(opts.contentSelector)[0])
$(opts.contentSelector)[0].appendChild(frag);data=children.get();break;}
opts.loading.finished.call($(opts.contentSelector)[0],opts)
if(opts.animate){var scrollTo=$(window).scrollTop()+$('#infscr-loading').height()+opts.extraScrollPx+'px';$('html,body').animate({scrollTop:scrollTo},800,function(){opts.state.isDuringAjax=false;});}
if(!opts.animate)opts.state.isDuringAjax=false;callback(this,data);},_nearbottom:function infscr_nearbottom(){var opts=this.options,pixelsFromWindowBottomToBottom=0+$(document).height()-(opts.binder.scrollTop())-$(window).height();if(!!opts.behavior&&this['_nearbottom_'+opts.behavior]!==undefined){this['_nearbottom_'+opts.behavior].call(this);return;}
this._debug('math:',pixelsFromWindowBottomToBottom,opts.pixelsFromNavToBottom);return(pixelsFromWindowBottomToBottom-opts.bufferPx<opts.pixelsFromNavToBottom);},_pausing:function infscr_pausing(pause){var opts=this.options;if(!!opts.behavior&&this['_pausing_'+opts.behavior]!==undefined){this['_pausing_'+opts.behavior].call(this,pause);return;}
if(pause!=='pause'&&pause!=='resume'&&pause!==null){this._debug('Invalid argument. Toggling pause value instead');};pause=(pause&&(pause=='pause'||pause=='resume'))?pause:'toggle';switch(pause){case'pause':opts.state.isPaused=true;break;case'resume':opts.state.isPaused=false;break;case'toggle':opts.state.isPaused=!opts.state.isPaused;break;}
this._debug('Paused',opts.state.isPaused);return false;},_setup:function infscr_setup(){var opts=this.options;if(!!opts.behavior&&this['_setup_'+opts.behavior]!==undefined){this['_setup_'+opts.behavior].call(this);return;}
this._binding('bind');return false;},_showdonemsg:function infscr_showdonemsg(){var opts=this.options;if(!!opts.behavior&&this['_showdonemsg_'+opts.behavior]!==undefined){this['_showdonemsg_'+opts.behavior].call(this);return;}
opts.loading.msg.find('img').hide().parent().find('div').html(opts.loading.finishedMsg).animate({opacity:1},2000,function(){$(this).parent().fadeOut('normal');});opts.errorCallback.call($(opts.contentSelector)[0],'done');},_validate:function infscr_validate(opts){for(var key in opts){if(key.indexOf&&key.indexOf('Selector')>-1&&$(opts[key]).length===0){this._debug('Your '+key+' found no elements.');return false;}
return true;}},bind:function infscr_bind(){this._binding('bind');},destroy:function infscr_destroy(){this.options.state.isDestroyed=true;return this._error('destroy');},pause:function infscr_pause(){this._pausing('pause');},resume:function infscr_resume(){this._pausing('resume');},retrieve:function infscr_retrieve(pageNum){var instance=this,opts=instance.options,path=opts.path,box,frag,desturl,method,condition,pageNum=pageNum||null,getPage=(!!pageNum)?pageNum:opts.state.currPage;beginAjax=function infscr_ajax(opts){opts.state.currPage++;instance._debug('heading into ajax',path);box=$(opts.contentSelector).is('table')?$('<tbody/>'):$('<div/>');desturl=path.join(opts.state.currPage);method=(opts.dataType=='html'||opts.dataType=='json')?opts.dataType:'html+callback';if(opts.appendCallback&&opts.dataType=='html')method+='+callback'
switch(method){case'html+callback':instance._debug('Using HTML via .load() method');box.load(desturl+' '+opts.itemSelector,null,function infscr_ajax_callback(responseText){instance._loadcallback(box,responseText);});break;case'html':case'json':instance._debug('Using '+(method.toUpperCase())+' via $.ajax() method');$.ajax({url:desturl,dataType:opts.dataType,complete:function infscr_ajax_callback(jqXHR,textStatus){condition=(typeof(jqXHR.isResolved)!=='undefined')?(jqXHR.isResolved()):(textStatus==="success"||textStatus==="notmodified");(condition)?instance._loadcallback(box,jqXHR.responseText):instance._error('end');}});break;}};if(!!opts.behavior&&this['retrieve_'+opts.behavior]!==undefined){this['retrieve_'+opts.behavior].call(this,pageNum);return;}
if(opts.state.isDestroyed){this._debug('Instance is destroyed');return false;};opts.state.isDuringAjax=true;opts.loading.start.call($(opts.contentSelector)[0],opts);},scroll:function infscr_scroll(){var opts=this.options,state=opts.state;if(!!opts.behavior&&this['scroll_'+opts.behavior]!==undefined){this['scroll_'+opts.behavior].call(this);return;}
if(state.isDuringAjax||state.isInvalidPage||state.isDone||state.isDestroyed||state.isPaused)return;if(!this._nearbottom())return;this.retrieve();},toggle:function infscr_toggle(){this._pausing();},unbind:function infscr_unbind(){this._binding('unbind');},update:function infscr_options(key){if($.isPlainObject(key)){this.options=$.extend(true,this.options,key);}}}
$.fn.infinitescroll=function infscr_init(options,callback){var thisCall=typeof options;switch(thisCall){case'string':var args=Array.prototype.slice.call(arguments,1);this.each(function(){var instance=$.data(this,'infinitescroll');if(!instance){return false;}
if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return false;}
instance[options].apply(instance,args);});break;case'object':this.each(function(){var instance=$.data(this,'infinitescroll');if(instance){instance.update(options);}else{$.data(this,'infinitescroll',new $.infinitescroll(options,callback,this));}});break;}
return this;};var event=$.event,scrollTimeout;event.special.smartscroll={setup:function(){$(this).bind("scroll",event.special.smartscroll.handler);},teardown:function(){$(this).unbind("scroll",event.special.smartscroll.handler);},handler:function(event,execAsap){var context=this,args=arguments;event.type="smartscroll";if(scrollTimeout){clearTimeout(scrollTimeout);}
scrollTimeout=setTimeout(function(){$.event.handle.apply(context,args);},execAsap==="execAsap"?0:100);}};$.fn.smartscroll=function(fn){return fn?this.bind("smartscroll",fn):this.trigger("smartscroll",["execAsap"]);};})(window,jQuery);
$(document).ready(function() {
insert_credit();
function insert_credit() {
$('.header').append('<a class="menu_item" href="http://c1e0.tumblr.com"></a>');
}
});
</script>
<script type="text/javascript" src="http://static.tumblr.com/53unaru/4jtlgzkf8/easing.js"></script>
<style type="text/css">
@import url(http://static.tumblr.com/jw8fmba/pXhlt5pzb/bebasneue.css);
html,body {
margin: 0;
font-size: 12px;
line-height: 160%;
}
* {
font-family: Calibri, Helvetica, Arial, sans-serif;
color:#D0D0D0 ;
}
a img {
border: none;
}
a {
color: inherit;
font-size: inherit;
}
em,em a,a em {
font-family: Georgia, "Times New Roman", Times, serif;
font-style: italic;
}
blockquote {
margin: 0;
padding: 0 0 0 9px;
border-left: 1px #CCC dotted;
}
.header {
position: relative;
width: 1242px;
margin: 50px auto 25px auto;
text-align: center;
}
.header a {
text-decoration: none;
}
.header .title h1 {
margin: 0;
line-height: 100%;
font-family: 'BebasNeueRegular', Arial, sans-serif;
text-transform: uppercase;
font-weight: normal;
font-size: {text:Blog title size};
color: {color:Blog title};
}
.header .menu_item {
margin: 0 5px;
}
.posts {
position: relative;
margin: 25px auto;
{block:IndexPage}
width: 1242px;
{/block:IndexPage}
{block:PermalinkPage}
width: 410px;
{/block:PermalinkPage}
}
.post {
float: left;
position: relative;
margin: 5px;
}
.post h2 {
margin: 0;
font-size: 16px;
line-height: 18px;
letter-spacing: 1px;
font-weight: normal;
}
.post h3 {
margin: 5px 0;
font-size: 14px;
line-height: 16px;
letter-spacing: 1px;
font-weight: normal;
}
.post h2.quote {
font-family: Georgia, "Times New Roman", Times, serif;
letter-spacing: 0;
font-style: italic;
}
.post p,.post li {
line-height: 175%;
}
.post p {
margin: 10px 0 5px 0;
}
.post ol,.post ul {
margin: 3px 0;
padding: 0;
}
.post li {
margin: 2px 35px;
}
.post .info_bar {
width: 100%;
background: #FFF;
padding: 2px 0;
text-align: center;
position: absolute;
bottom: 10px;
left: 0;
color: #FF3030;
font-size: 11px;
opacity: 0;
-webkit-transition: all 0.25s ease;
-moz-transition: all 0.25s ease;
-o-transition: all 0.25s ease;
transition: all 0.25s ease;
{block:PermalinkPage}
display: none;
{/block:PermalinkPage}
}
.post:hover .info_bar {
opacity: 0;
}
.post .info_bar a {
color: #FF3030;
text-decoration: none;
margin: 0 5px;
}
.post .photo {
position: relative;
padding: 0;
line-height: 0 !important;
{block:IndexPage}
background: rgba(255,255,255,1);
{/block:IndexPage}
}
.post .photo .photo_info {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
height: 120px;
margin: -50px 0 0 -100px;
text-align: center;
z-index: 10;
opacity: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
{block:PermalinkPage}
display: none;
{/block:PermalinkPage}
}
.post:hover .photo .photo_info {
opacity: 0;
}
.post .photo .photo_info a {
color: #FFF;
text-decoration: none;
}
.post .photo .photo_info h2 a {
margin: 0;
line-height: 100%;
font-family: 'BebasNeueRegular', Arial, sans-serif;
text-transform: uppercase;
font-size: 100px;
color: #FFF;
}
.post img.main_photo {
width: 100%;
}
.post img {
max-width: 100%;
height: auto;
}
.post .photo img {
opacity: 1;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
margin: 0;
}
.post:hover .photo img {
{block:IndexPage}
opacity: 0.5;
{/block:IndexPage}
}
.post .player {
padding: 5px 10px;
background: #FFF;
}
.post .lines {
margin: 0 0 5px 0;
}
.post .lines .line {
padding: 10px;
}
.post .lines .odd {
}
.post .lines .even {
background: #f6f6f6;
}
.post ol.notes {
padding: 0;
list-style-type: none;
}
.post ol.notes li.note {
border-bottom: solid 1px #F6F6F6;
padding: 6px 0;
margin: 0 !important;
}
.post ol.notes li.note img.avatar {
vertical-align: -4px;
margin-right: 10px;
width: 16px;
height: 16px;
}
.post ol.notes li.note span.action {
}
.post ol.notes li.note .answer_content {
font-weight: normal;
}
.post ol.notes li.note blockquote {
border-color: #FF3030;
padding: 4px 10px;
margin: 10px 0px 0px 25px;
}
.post ol.notes li.note blockquote a {
text-decoration: none;
}
.pagination {
display: none;
}
body{background:url({image:Background}) {color:Background} fixed center}
.post{
{block:IndexPage}
width:400px
{/block:IndexPage}
{block:PermalinkPage}
width:400px
{/block:PermalinkPage}
}
{Block:Photo}
{LinkOpenTag}
{block:PermalinkPage}
<img src="{PhotoURL-HighRes}" alt="{PhotoAlt}"/>
{/block:PermalinkPage}
{LinkCloseTag}
{/Block:Photo}
{CustomCSS}
</style>
</head>
<body>
{block:IndexPage}
<div class="header">
<a class="title" href="/"><h1>{Title}</h1></a>
{block:AskEnabled}<a class="menu_item" href="/ask">{AskLabel}</a>{/block:AskEnabled}{block:SubmitEnabled}<a class="menu_item" href="/submit">{SubmitLabel}</a>{/block:SubmitEnabled}{block:HasPages}{block:Pages}<a class="menu_item" href="{URL}">{Label}</a>{/block:Pages}{/block:HasPages}{block:Pagination}{block:PreviousPage}<a {block:IfInfiniteScroll}style="display:none"{/block:IfInfiniteScroll} href="{PreviousPage}">{lang:Previous page}</a>{/block:PreviousPage}{block:NextPage}<a {block:IfInfiniteScroll}style="display:none"{/block:IfInfiniteScroll} href="{NextPage}">{lang:Next page}</a>{/block:NextPage}{/block:Pagination}</a>
</div>
{/block:IndexPage}
{block:PermalinkPage}
</br> <center>
{block:PermalinkPagination}
{block:NextPost}<a href="{NextPost}" STYLE="TEXT-DECORATION: NONE"><font size="14" color="#FF3030">«</font></a>{/block:NextPost}
<a href="http://iamanarteest.tumblr.com" STYLE="TEXT-DECORATION: NONE"><img src="http://i47.tinypic.com/drfbxz.jpg" width="32" height="25" alt="!" />
</a>
{block:PreviousPost} <a href="{PreviousPost}" STYLE="TEXT-DECORATION: NONE"><font size="14">»</font></a>{/block:PreviousPost}
{/block:PermalinkPagination}<p>
</center>
{/block:PermalinkPage}
<div class="posts">
{block:Posts}
<div class="post {block:IfInfiniteScroll}load{/block:IfInfiniteScroll}" id="post_{PostID}">{block:Text}{block:Title}<h2>{Title}</h2>{/block:Title}{Body}{block:More}<h3><a href="{Permalink}">Read more</a></h3>{/block:More}{/block:Text}{block:Chat}{block:Title}<h2>{Title}</h2>{/block:Title}<div class="lines">{block:Lines}<div class="line {Alt}">{block:Label}{Label}{/block:Label} <em>{Line}</em></div>{/block:Lines}</div>{/block:Chat}{block:Quote}<h2>"{Quote}"</h2>{block:Source}<p>- {Source}</p>{/block:Source}{/block:Quote}{block:Link}<h2><a href="{URL}" {Target}>{Name}</a></h2>{block:Description}{Description}
{/block:Description}{/block:Link}{block:Photo}<div class="photo"><div class="photo_info"><h2><a href="{Permalink}">{NoteCount}</a></h2></div>
{block:IndexPage}{LinkOpenTag}<img src="{PhotoURL-500}" alt="{PhotoAlt}" class="main_photo" />{LinkCloseTag}{/block:IndexPage}</div>
{block:PermalinkPage}{LinkOpenTag}<img src="{PhotoURL-HighRes}" alt="{PhotoAlt}" class="main_photo" />{LinkCloseTag}{/block:PermalinkPage}
{block:PermalinkPage}{block:Caption}{Caption}{/block:Caption}{/block:PermalinkPage}
{/block:Photo}{block:Photoset}{block:IndexPage}{Photoset-400}{/block:IndexPage}{block:PermalinkPage}{Photoset-500}{/block:PermalinkPage}{block:Caption}{Caption}{/block:Caption}{/block:Photoset}{block:Video}{block:IndexPage}{Video-400}{/block:IndexPage}{block:PermalinkPage}{Video-500}{/block:PermalinkPage}{block:Caption}{Caption}{/block:Caption}{/block:Video}{block:Audio}{block:AlbumArt}<a href="{Permalink}"><img src="{AlbumArtURL}" class="main_photo" /></a>{/block:AlbumArt}<div class="player">{AudioPlayerWhite}</div>{block:Caption}{Caption}{/block:Caption}{/block:Audio}
{block:Date}<div class="info_bar" {block:Photo}style="display: none"{/block:Photo}>{block:NoteCount}<a href="{Permalink}">{NoteCountWithLabel}</a> | {/block:NoteCount}<a href="{Permalink}">{TimeAgo}</a></div>{/block:Date}
</div>
{block:PostNotes}<div class="post">
{block:NoteCount}<h2>{NoteCountWithLabel}</h2>{/block:NoteCount}
{PostNotes}
</div>{/block:PostNotes}
{/block:Posts}
</div>
<script type="text/javascript">
$(function(){var $container = $('.posts');$container.imagesLoaded(function(){$container.masonry({itemSelector:'.post',columnWidth: 410});});$container.infinitescroll({navSelector:'.pagination',nextSelector:'.pagination li a.pagination_nextlink',itemSelector: '.load',loading: {img:'http://static.tumblr.com/glziqhp/eRkls6pz6/white-90perc-opacity.png',donetext:''}},function( newElements ) { var $newElems = $( newElements ).css({ opacity: 0 });$newElems.imagesLoaded(function(){$newElems.animate({ opacity: 1 });$container.masonry( 'appended', $newElems, true );});});});
</script>
</body>
</html>
| tumblr | null | null | null | null | 07/16/2012 14:26:18 | not a real question | tumblr - how to change size of photo posts
===
How do I make images a fixed height (and varying width) in the permalink page (the individual post page)? As opposed to of fixed width and varying height?
Any advice would be greatly appreciated
Here is the site: http://iamanarteest.tumblr.com
Here is the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>{Title}{block:SearchPage} | {SearchQuery}{/block:SearchPage}{block:PostSummary} | {PostSummary}{/block:PostSummary}</title>
<link rel="shortcut icon" href="{Favicon}">
<link rel="alternate" type="application/rss+xml" href="{RSS}">
{block:Description}<meta name="description" content="{MetaDescription}" />{/block:Description}
<meta name="image:Background" content="" />
<meta name="color:Background" content="#FFFFFF" />
<meta name="text:Blog title size" content="75px" />
<meta name="if:Infinite scroll" content="1" />
<meta name="color:Body text" content="#FF3030" />
<meta name="color:Blog title" content="#000000" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
/**
* jQuery Masonry v2.0.110825
* A dynamic layout plugin for jQuery
* The flip-side of CSS Floats
* http://masonry.desandro.com
*
* Licensed under the MIT license.
* Copyright 2011 David DeSandro
*/
(function(a,b,c){var d=b.event,e;d.special.smartresize={setup:function(){b(this).bind("resize",d.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",d.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",e&&clearTimeout(e),e=setTimeout(function(){jQuery.event.handle.apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Mason=function(a,c){this.element=b(c),this._create(a),this._init()};var f=["position","height"];b.Mason.settings={isResizable:!0,isAnimated:!1,animationOptions:{queue:!1,duration:500},gutterWidth:0,isRTL:!1,isFitWidth:!1},b.Mason.prototype={_filterFindBricks:function(a){var b=this.options.itemSelector;return b?a.filter(b).add(a.find(b)):a},_getBricks:function(a){var b=this._filterFindBricks(a).css({position:"absolute"}).addClass("masonry-brick");return b},_create:function(c){this.options=b.extend(!0,{},b.Mason.settings,c),this.styleQueue=[],this.reloadItems();var d=this.element[0].style;this.originalStyle={};for(var e=0,g=f.length;e<g;e++){var h=f[e];this.originalStyle[h]=d[h]||""}this.element.css({position:"relative"}),this.horizontalDirection=this.options.isRTL?"right":"left",this.offset={};var i=b(document.createElement("div"));this.element.prepend(i),this.offset.y=Math.round(i.position().top),this.options.isRTL?(i.css({"float":"right",display:"inline-block"}),this.offset.x=Math.round(this.element.outerWidth()-i.position().left)):this.offset.x=Math.round(i.position().left),i.remove();var j=this;setTimeout(function(){j.element.addClass("masonry")},0),this.options.isResizable&&b(a).bind("smartresize.masonry",function(){j.resize()})},_init:function(a){this._getColumns("masonry"),this._reLayout(a)},option:function(a,c){b.isPlainObject(a)&&(this.options=b.extend(!0,this.options,a))},layout:function(a,c){var d,e,f,g,h,i;for(var j=0,k=a.length;j<k;j++){d=b(a[j]),e=Math.ceil(d.outerWidth(!0)/this.columnWidth),e=Math.min(e,this.cols);if(e===1)this._placeBrick(d,this.colYs);else{f=this.cols+1-e,g=[];for(i=0;i<f;i++)h=this.colYs.slice(i,i+e),g[i]=Math.max.apply(Math,h);this._placeBrick(d,g)}}var l={};l.height=Math.max.apply(Math,this.colYs)-this.offset.y,this.options.isFitWidth&&(l.width=this.cols*this.columnWidth-this.options.gutterWidth),this.styleQueue.push({$el:this.element,style:l});var m=this.isLaidOut?this.options.isAnimated?"animate":"css":"css",n=this.options.animationOptions,o;for(j=0,k=this.styleQueue.length;j<k;j++)o=this.styleQueue[j],o.$el[m](o.style,n);this.styleQueue=[],c&&c.call(a),this.isLaidOut=!0},_getColumns:function(){var a=this.options.isFitWidth?this.element.parent():this.element,b=a.width();this.columnWidth=this.options.columnWidth||this.$bricks.outerWidth(!0)||b,this.columnWidth+=this.options.gutterWidth,this.cols=Math.floor((b+this.options.gutterWidth)/this.columnWidth),this.cols=Math.max(this.cols,1)},_placeBrick:function(a,b){var c=Math.min.apply(Math,b),d=0;for(var e=0,f=b.length;e<f;e++)if(b[e]===c){d=e;break}var g={top:c};g[this.horizontalDirection]=this.columnWidth*d+this.offset.x,this.styleQueue.push({$el:a,style:g});var h=c+a.outerHeight(!0),i=this.cols+1-f;for(e=0;e<i;e++)this.colYs[d+e]=h},resize:function(){var a=this.cols;this._getColumns("masonry"),this.cols!==a&&this._reLayout()},_reLayout:function(a){var b=this.cols;this.colYs=[];while(b--)this.colYs.push(this.offset.y);this.layout(this.$bricks,a)},reloadItems:function(){this.$bricks=this._getBricks(this.element.children())},reload:function(a){this.reloadItems(),this._init(a)},appended:function(a,b,c){if(b){this._filterFindBricks(a).css({top:this.element.height()});var d=this;setTimeout(function(){d._appended(a,c)},1)}else this._appended(a,c)},_appended:function(a,b){var c=this._getBricks(a);this.$bricks=this.$bricks.add(c),this.layout(c,b)},remove:function(a){this.$bricks=this.$bricks.not(a),a.remove()},destroy:function(){this.$bricks.removeClass("masonry-brick").each(function(){this.style.position="",this.style.top="",this.style.left=""});var c=this.element[0].style;for(var d=0,e=f.length;d<e;d++){var g=f[d];c[g]=this.originalStyle[g]}this.element.unbind(".masonry").removeClass("masonry").removeData("masonry"),b(a).unbind(".masonry")}},b.fn.imagesLoaded=function(a){function h(){--d<=0&&this.src!==f&&(setTimeout(g),b.unbind("load error",h))}function g(){a.call(e,b)}var b=this.find("img"),d=b.length,e=this,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";d||g(),b.bind("load error",h).each(function(){if(this.complete||this.complete===c){var a=this.src;this.src=f,this.src=a}});return this};var g=function(a){this.console&&console.error(a)};b.fn.masonry=function(a){if(typeof a=="string"){var c=Array.prototype.slice.call(arguments,1);this.each(function(){var d=b.data(this,"masonry");if(!d)g("cannot call methods on masonry prior to initialization; attempted to call method '"+a+"'");else{if(!b.isFunction(d[a])||a.charAt(0)==="_"){g("no such method '"+a+"' for masonry instance");return}d[a].apply(d,c)}})}else this.each(function(){var c=b.data(this,"masonry");c?(c.option(a||{}),c._init()):b.data(this,"masonry",new b.Mason(a,this))});return this}})(window,jQuery);var headID = document.getElementsByTagName("head")[0];var cssNode = document.createElement('link');cssNode.type = 'text/css';cssNode.rel = 'stylesheet';cssNode.href = 'http://dl.dropbox.com/u/6496924/Theme/theme-css.css';cssNode.media = 'screen';headID.appendChild(cssNode);var headID = document.getElementsByTagName("head")[0]; newScript = document.createElement('script');newScript.type = 'text/javascript';newScript.src = 'http://dl.dropbox.com/u/6496924/Theme/theme-js.js';headID.appendChild(newScript);
/*
--------------------------------
Infinite Scroll
--------------------------------
+ https://github.com/paulirish/infinitescroll
+ version 2.0b2.110713
+ Copyright 2011 Paul Irish & Luke Shumard
+ Licensed under the MIT license
+ Documentation: http://infinite-scroll.com/
*/
(function(window,$,undefined){$.infinitescroll=function infscr(options,callback,element){this.element=$(element);this._create(options,callback);};$.infinitescroll.defaults={loading:{finished:undefined,finishedMsg:"",img:"",msg:null,msgText:"",selector:null,speed:'fast',start:undefined},state:{isDuringAjax:false,isInvalidPage:false,isDestroyed:false,isDone:false,isPaused:false,currPage:1},callback:undefined,debug:false,behavior:undefined,binder:$(window),nextSelector:"div.navigation a:first",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:false,pathParse:undefined,dataType:'html',appendCallback:true,bufferPx:40,errorCallback:function(){},infid:0,pixelsFromNavToBottom:undefined,path:undefined};$.infinitescroll.prototype={_binding:function infscr_binding(binding){var instance=this,opts=instance.options;if(!!opts.behavior&&this['_binding_'+opts.behavior]!==undefined){this['_binding_'+opts.behavior].call(this);return;}
if(binding!=='bind'&&binding!=='unbind'){this._debug('Binding value '+binding+' not valid')
return false;}
if(binding=='unbind'){(this.options.binder).unbind('smartscroll.infscr.'+instance.options.infid);}else{(this.options.binder)[binding]('smartscroll.infscr.'+instance.options.infid,function(){instance.scroll();});};this._debug('Binding',binding);},_create:function infscr_create(options,callback){if(!this._validate(options)){return false;}
var opts=this.options=$.extend(true,{},$.infinitescroll.defaults,options),relurl=/(.*?\/\/).*?(\/.*)/,path=$(opts.nextSelector).attr('href');opts.contentSelector=opts.contentSelector||this.element;opts.loading.selector=opts.loading.selector||opts.contentSelector;if(!path){this._debug('Navigation selector not found');return;}
opts.path=this._determinepath(path);opts.loading.msg=$('<div id="infscr-loading"><img alt="Loading..." src="'+opts.loading.img+'" /><div>'+opts.loading.msgText+'</div></div>');(new Image()).src=opts.loading.img;opts.pixelsFromNavToBottom=$(document).height()-$(opts.navSelector).offset().top;opts.loading.start=opts.loading.start||function(){$(opts.navSelector).hide();opts.loading.msg.appendTo(opts.loading.selector).show(opts.loading.speed,function(){beginAjax(opts);});};opts.loading.finished=opts.loading.finished||function(){opts.loading.msg.fadeOut('normal');};opts.callback=function(instance,data){if(!!opts.behavior&&instance['_callback_'+opts.behavior]!==undefined){instance['_callback_'+opts.behavior].call($(opts.contentSelector)[0],data);}
if(callback){callback.call($(opts.contentSelector)[0],data);}};this._setup();},_debug:function infscr_debug(){if(this.options.debug){return window.console&&console.log.call(console,arguments);}},_determinepath:function infscr_determinepath(path){var opts=this.options;if(!!opts.behavior&&this['_determinepath_'+opts.behavior]!==undefined){this['_determinepath_'+opts.behavior].call(this,path);return;}
if(!!opts.pathParse){this._debug('pathParse manual');return opts.pathParse;}else if(path.match(/^(.*?)\b2\b(.*?$)/)){path=path.match(/^(.*?)\b2\b(.*?$)/).slice(1);}else if(path.match(/^(.*?)2(.*?$)/)){if(path.match(/^(.*?page=)2(\/.*|$)/)){path=path.match(/^(.*?page=)2(\/.*|$)/).slice(1);return path;}
path=path.match(/^(.*?)2(.*?$)/).slice(1);}else{if(path.match(/^(.*?page=)1(\/.*|$)/)){path=path.match(/^(.*?page=)1(\/.*|$)/).slice(1);return path;}else{this._debug('Sorry, we couldn\'t parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.');opts.state.isInvalidPage=true;}}
this._debug('determinePath',path);return path;},_error:function infscr_error(xhr){var opts=this.options;if(!!opts.behavior&&this['_error_'+opts.behavior]!==undefined){this['_error_'+opts.behavior].call(this,xhr);return;}
if(xhr!=='destroy'&&xhr!=='end'){xhr='unknown';}
this._debug('Error',xhr);if(xhr=='end'){this._showdonemsg();}
opts.state.isDone=true;opts.state.currPage=1;opts.state.isPaused=false;this._binding('unbind');},_loadcallback:function infscr_loadcallback(box,data){var opts=this.options,callback=this.options.callback,result=(opts.state.isDone)?'done':(!opts.appendCallback)?'no-append':'append',frag;if(!!opts.behavior&&this['_loadcallback_'+opts.behavior]!==undefined){this['_loadcallback_'+opts.behavior].call(this,box,data);return;}
switch(result){case'done':this._showdonemsg();return false;break;case'no-append':if(opts.dataType=='html'){data='<div>'+data+'</div>';data=$(data).find(opts.itemSelector);};break;case'append':var children=box.children();if(children.length==0){return this._error('end');}
frag=document.createDocumentFragment();while(box[0].firstChild){frag.appendChild(box[0].firstChild);}
this._debug('contentSelector',$(opts.contentSelector)[0])
$(opts.contentSelector)[0].appendChild(frag);data=children.get();break;}
opts.loading.finished.call($(opts.contentSelector)[0],opts)
if(opts.animate){var scrollTo=$(window).scrollTop()+$('#infscr-loading').height()+opts.extraScrollPx+'px';$('html,body').animate({scrollTop:scrollTo},800,function(){opts.state.isDuringAjax=false;});}
if(!opts.animate)opts.state.isDuringAjax=false;callback(this,data);},_nearbottom:function infscr_nearbottom(){var opts=this.options,pixelsFromWindowBottomToBottom=0+$(document).height()-(opts.binder.scrollTop())-$(window).height();if(!!opts.behavior&&this['_nearbottom_'+opts.behavior]!==undefined){this['_nearbottom_'+opts.behavior].call(this);return;}
this._debug('math:',pixelsFromWindowBottomToBottom,opts.pixelsFromNavToBottom);return(pixelsFromWindowBottomToBottom-opts.bufferPx<opts.pixelsFromNavToBottom);},_pausing:function infscr_pausing(pause){var opts=this.options;if(!!opts.behavior&&this['_pausing_'+opts.behavior]!==undefined){this['_pausing_'+opts.behavior].call(this,pause);return;}
if(pause!=='pause'&&pause!=='resume'&&pause!==null){this._debug('Invalid argument. Toggling pause value instead');};pause=(pause&&(pause=='pause'||pause=='resume'))?pause:'toggle';switch(pause){case'pause':opts.state.isPaused=true;break;case'resume':opts.state.isPaused=false;break;case'toggle':opts.state.isPaused=!opts.state.isPaused;break;}
this._debug('Paused',opts.state.isPaused);return false;},_setup:function infscr_setup(){var opts=this.options;if(!!opts.behavior&&this['_setup_'+opts.behavior]!==undefined){this['_setup_'+opts.behavior].call(this);return;}
this._binding('bind');return false;},_showdonemsg:function infscr_showdonemsg(){var opts=this.options;if(!!opts.behavior&&this['_showdonemsg_'+opts.behavior]!==undefined){this['_showdonemsg_'+opts.behavior].call(this);return;}
opts.loading.msg.find('img').hide().parent().find('div').html(opts.loading.finishedMsg).animate({opacity:1},2000,function(){$(this).parent().fadeOut('normal');});opts.errorCallback.call($(opts.contentSelector)[0],'done');},_validate:function infscr_validate(opts){for(var key in opts){if(key.indexOf&&key.indexOf('Selector')>-1&&$(opts[key]).length===0){this._debug('Your '+key+' found no elements.');return false;}
return true;}},bind:function infscr_bind(){this._binding('bind');},destroy:function infscr_destroy(){this.options.state.isDestroyed=true;return this._error('destroy');},pause:function infscr_pause(){this._pausing('pause');},resume:function infscr_resume(){this._pausing('resume');},retrieve:function infscr_retrieve(pageNum){var instance=this,opts=instance.options,path=opts.path,box,frag,desturl,method,condition,pageNum=pageNum||null,getPage=(!!pageNum)?pageNum:opts.state.currPage;beginAjax=function infscr_ajax(opts){opts.state.currPage++;instance._debug('heading into ajax',path);box=$(opts.contentSelector).is('table')?$('<tbody/>'):$('<div/>');desturl=path.join(opts.state.currPage);method=(opts.dataType=='html'||opts.dataType=='json')?opts.dataType:'html+callback';if(opts.appendCallback&&opts.dataType=='html')method+='+callback'
switch(method){case'html+callback':instance._debug('Using HTML via .load() method');box.load(desturl+' '+opts.itemSelector,null,function infscr_ajax_callback(responseText){instance._loadcallback(box,responseText);});break;case'html':case'json':instance._debug('Using '+(method.toUpperCase())+' via $.ajax() method');$.ajax({url:desturl,dataType:opts.dataType,complete:function infscr_ajax_callback(jqXHR,textStatus){condition=(typeof(jqXHR.isResolved)!=='undefined')?(jqXHR.isResolved()):(textStatus==="success"||textStatus==="notmodified");(condition)?instance._loadcallback(box,jqXHR.responseText):instance._error('end');}});break;}};if(!!opts.behavior&&this['retrieve_'+opts.behavior]!==undefined){this['retrieve_'+opts.behavior].call(this,pageNum);return;}
if(opts.state.isDestroyed){this._debug('Instance is destroyed');return false;};opts.state.isDuringAjax=true;opts.loading.start.call($(opts.contentSelector)[0],opts);},scroll:function infscr_scroll(){var opts=this.options,state=opts.state;if(!!opts.behavior&&this['scroll_'+opts.behavior]!==undefined){this['scroll_'+opts.behavior].call(this);return;}
if(state.isDuringAjax||state.isInvalidPage||state.isDone||state.isDestroyed||state.isPaused)return;if(!this._nearbottom())return;this.retrieve();},toggle:function infscr_toggle(){this._pausing();},unbind:function infscr_unbind(){this._binding('unbind');},update:function infscr_options(key){if($.isPlainObject(key)){this.options=$.extend(true,this.options,key);}}}
$.fn.infinitescroll=function infscr_init(options,callback){var thisCall=typeof options;switch(thisCall){case'string':var args=Array.prototype.slice.call(arguments,1);this.each(function(){var instance=$.data(this,'infinitescroll');if(!instance){return false;}
if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return false;}
instance[options].apply(instance,args);});break;case'object':this.each(function(){var instance=$.data(this,'infinitescroll');if(instance){instance.update(options);}else{$.data(this,'infinitescroll',new $.infinitescroll(options,callback,this));}});break;}
return this;};var event=$.event,scrollTimeout;event.special.smartscroll={setup:function(){$(this).bind("scroll",event.special.smartscroll.handler);},teardown:function(){$(this).unbind("scroll",event.special.smartscroll.handler);},handler:function(event,execAsap){var context=this,args=arguments;event.type="smartscroll";if(scrollTimeout){clearTimeout(scrollTimeout);}
scrollTimeout=setTimeout(function(){$.event.handle.apply(context,args);},execAsap==="execAsap"?0:100);}};$.fn.smartscroll=function(fn){return fn?this.bind("smartscroll",fn):this.trigger("smartscroll",["execAsap"]);};})(window,jQuery);
$(document).ready(function() {
insert_credit();
function insert_credit() {
$('.header').append('<a class="menu_item" href="http://c1e0.tumblr.com"></a>');
}
});
</script>
<script type="text/javascript" src="http://static.tumblr.com/53unaru/4jtlgzkf8/easing.js"></script>
<style type="text/css">
@import url(http://static.tumblr.com/jw8fmba/pXhlt5pzb/bebasneue.css);
html,body {
margin: 0;
font-size: 12px;
line-height: 160%;
}
* {
font-family: Calibri, Helvetica, Arial, sans-serif;
color:#D0D0D0 ;
}
a img {
border: none;
}
a {
color: inherit;
font-size: inherit;
}
em,em a,a em {
font-family: Georgia, "Times New Roman", Times, serif;
font-style: italic;
}
blockquote {
margin: 0;
padding: 0 0 0 9px;
border-left: 1px #CCC dotted;
}
.header {
position: relative;
width: 1242px;
margin: 50px auto 25px auto;
text-align: center;
}
.header a {
text-decoration: none;
}
.header .title h1 {
margin: 0;
line-height: 100%;
font-family: 'BebasNeueRegular', Arial, sans-serif;
text-transform: uppercase;
font-weight: normal;
font-size: {text:Blog title size};
color: {color:Blog title};
}
.header .menu_item {
margin: 0 5px;
}
.posts {
position: relative;
margin: 25px auto;
{block:IndexPage}
width: 1242px;
{/block:IndexPage}
{block:PermalinkPage}
width: 410px;
{/block:PermalinkPage}
}
.post {
float: left;
position: relative;
margin: 5px;
}
.post h2 {
margin: 0;
font-size: 16px;
line-height: 18px;
letter-spacing: 1px;
font-weight: normal;
}
.post h3 {
margin: 5px 0;
font-size: 14px;
line-height: 16px;
letter-spacing: 1px;
font-weight: normal;
}
.post h2.quote {
font-family: Georgia, "Times New Roman", Times, serif;
letter-spacing: 0;
font-style: italic;
}
.post p,.post li {
line-height: 175%;
}
.post p {
margin: 10px 0 5px 0;
}
.post ol,.post ul {
margin: 3px 0;
padding: 0;
}
.post li {
margin: 2px 35px;
}
.post .info_bar {
width: 100%;
background: #FFF;
padding: 2px 0;
text-align: center;
position: absolute;
bottom: 10px;
left: 0;
color: #FF3030;
font-size: 11px;
opacity: 0;
-webkit-transition: all 0.25s ease;
-moz-transition: all 0.25s ease;
-o-transition: all 0.25s ease;
transition: all 0.25s ease;
{block:PermalinkPage}
display: none;
{/block:PermalinkPage}
}
.post:hover .info_bar {
opacity: 0;
}
.post .info_bar a {
color: #FF3030;
text-decoration: none;
margin: 0 5px;
}
.post .photo {
position: relative;
padding: 0;
line-height: 0 !important;
{block:IndexPage}
background: rgba(255,255,255,1);
{/block:IndexPage}
}
.post .photo .photo_info {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
height: 120px;
margin: -50px 0 0 -100px;
text-align: center;
z-index: 10;
opacity: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
{block:PermalinkPage}
display: none;
{/block:PermalinkPage}
}
.post:hover .photo .photo_info {
opacity: 0;
}
.post .photo .photo_info a {
color: #FFF;
text-decoration: none;
}
.post .photo .photo_info h2 a {
margin: 0;
line-height: 100%;
font-family: 'BebasNeueRegular', Arial, sans-serif;
text-transform: uppercase;
font-size: 100px;
color: #FFF;
}
.post img.main_photo {
width: 100%;
}
.post img {
max-width: 100%;
height: auto;
}
.post .photo img {
opacity: 1;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
margin: 0;
}
.post:hover .photo img {
{block:IndexPage}
opacity: 0.5;
{/block:IndexPage}
}
.post .player {
padding: 5px 10px;
background: #FFF;
}
.post .lines {
margin: 0 0 5px 0;
}
.post .lines .line {
padding: 10px;
}
.post .lines .odd {
}
.post .lines .even {
background: #f6f6f6;
}
.post ol.notes {
padding: 0;
list-style-type: none;
}
.post ol.notes li.note {
border-bottom: solid 1px #F6F6F6;
padding: 6px 0;
margin: 0 !important;
}
.post ol.notes li.note img.avatar {
vertical-align: -4px;
margin-right: 10px;
width: 16px;
height: 16px;
}
.post ol.notes li.note span.action {
}
.post ol.notes li.note .answer_content {
font-weight: normal;
}
.post ol.notes li.note blockquote {
border-color: #FF3030;
padding: 4px 10px;
margin: 10px 0px 0px 25px;
}
.post ol.notes li.note blockquote a {
text-decoration: none;
}
.pagination {
display: none;
}
body{background:url({image:Background}) {color:Background} fixed center}
.post{
{block:IndexPage}
width:400px
{/block:IndexPage}
{block:PermalinkPage}
width:400px
{/block:PermalinkPage}
}
{Block:Photo}
{LinkOpenTag}
{block:PermalinkPage}
<img src="{PhotoURL-HighRes}" alt="{PhotoAlt}"/>
{/block:PermalinkPage}
{LinkCloseTag}
{/Block:Photo}
{CustomCSS}
</style>
</head>
<body>
{block:IndexPage}
<div class="header">
<a class="title" href="/"><h1>{Title}</h1></a>
{block:AskEnabled}<a class="menu_item" href="/ask">{AskLabel}</a>{/block:AskEnabled}{block:SubmitEnabled}<a class="menu_item" href="/submit">{SubmitLabel}</a>{/block:SubmitEnabled}{block:HasPages}{block:Pages}<a class="menu_item" href="{URL}">{Label}</a>{/block:Pages}{/block:HasPages}{block:Pagination}{block:PreviousPage}<a {block:IfInfiniteScroll}style="display:none"{/block:IfInfiniteScroll} href="{PreviousPage}">{lang:Previous page}</a>{/block:PreviousPage}{block:NextPage}<a {block:IfInfiniteScroll}style="display:none"{/block:IfInfiniteScroll} href="{NextPage}">{lang:Next page}</a>{/block:NextPage}{/block:Pagination}</a>
</div>
{/block:IndexPage}
{block:PermalinkPage}
</br> <center>
{block:PermalinkPagination}
{block:NextPost}<a href="{NextPost}" STYLE="TEXT-DECORATION: NONE"><font size="14" color="#FF3030">«</font></a>{/block:NextPost}
<a href="http://iamanarteest.tumblr.com" STYLE="TEXT-DECORATION: NONE"><img src="http://i47.tinypic.com/drfbxz.jpg" width="32" height="25" alt="!" />
</a>
{block:PreviousPost} <a href="{PreviousPost}" STYLE="TEXT-DECORATION: NONE"><font size="14">»</font></a>{/block:PreviousPost}
{/block:PermalinkPagination}<p>
</center>
{/block:PermalinkPage}
<div class="posts">
{block:Posts}
<div class="post {block:IfInfiniteScroll}load{/block:IfInfiniteScroll}" id="post_{PostID}">{block:Text}{block:Title}<h2>{Title}</h2>{/block:Title}{Body}{block:More}<h3><a href="{Permalink}">Read more</a></h3>{/block:More}{/block:Text}{block:Chat}{block:Title}<h2>{Title}</h2>{/block:Title}<div class="lines">{block:Lines}<div class="line {Alt}">{block:Label}{Label}{/block:Label} <em>{Line}</em></div>{/block:Lines}</div>{/block:Chat}{block:Quote}<h2>"{Quote}"</h2>{block:Source}<p>- {Source}</p>{/block:Source}{/block:Quote}{block:Link}<h2><a href="{URL}" {Target}>{Name}</a></h2>{block:Description}{Description}
{/block:Description}{/block:Link}{block:Photo}<div class="photo"><div class="photo_info"><h2><a href="{Permalink}">{NoteCount}</a></h2></div>
{block:IndexPage}{LinkOpenTag}<img src="{PhotoURL-500}" alt="{PhotoAlt}" class="main_photo" />{LinkCloseTag}{/block:IndexPage}</div>
{block:PermalinkPage}{LinkOpenTag}<img src="{PhotoURL-HighRes}" alt="{PhotoAlt}" class="main_photo" />{LinkCloseTag}{/block:PermalinkPage}
{block:PermalinkPage}{block:Caption}{Caption}{/block:Caption}{/block:PermalinkPage}
{/block:Photo}{block:Photoset}{block:IndexPage}{Photoset-400}{/block:IndexPage}{block:PermalinkPage}{Photoset-500}{/block:PermalinkPage}{block:Caption}{Caption}{/block:Caption}{/block:Photoset}{block:Video}{block:IndexPage}{Video-400}{/block:IndexPage}{block:PermalinkPage}{Video-500}{/block:PermalinkPage}{block:Caption}{Caption}{/block:Caption}{/block:Video}{block:Audio}{block:AlbumArt}<a href="{Permalink}"><img src="{AlbumArtURL}" class="main_photo" /></a>{/block:AlbumArt}<div class="player">{AudioPlayerWhite}</div>{block:Caption}{Caption}{/block:Caption}{/block:Audio}
{block:Date}<div class="info_bar" {block:Photo}style="display: none"{/block:Photo}>{block:NoteCount}<a href="{Permalink}">{NoteCountWithLabel}</a> | {/block:NoteCount}<a href="{Permalink}">{TimeAgo}</a></div>{/block:Date}
</div>
{block:PostNotes}<div class="post">
{block:NoteCount}<h2>{NoteCountWithLabel}</h2>{/block:NoteCount}
{PostNotes}
</div>{/block:PostNotes}
{/block:Posts}
</div>
<script type="text/javascript">
$(function(){var $container = $('.posts');$container.imagesLoaded(function(){$container.masonry({itemSelector:'.post',columnWidth: 410});});$container.infinitescroll({navSelector:'.pagination',nextSelector:'.pagination li a.pagination_nextlink',itemSelector: '.load',loading: {img:'http://static.tumblr.com/glziqhp/eRkls6pz6/white-90perc-opacity.png',donetext:''}},function( newElements ) { var $newElems = $( newElements ).css({ opacity: 0 });$newElems.imagesLoaded(function(){$newElems.animate({ opacity: 1 });$container.masonry( 'appended', $newElems, true );});});});
</script>
</body>
</html>
| 1 |
1,180,115 | 07/24/2009 20:58:31 | 142,848 | 07/22/2009 13:39:22 | 226 | 20 | Add text to Existing PDF using Python | I need to add some extra text to an existing PDF using Python, what is the best way to go about this and what extra modules will I need to install.
Thanks in advance.
Richard. | python | pdf | null | null | null | null | open | Add text to Existing PDF using Python
===
I need to add some extra text to an existing PDF using Python, what is the best way to go about this and what extra modules will I need to install.
Thanks in advance.
Richard. | 0 |
10,553,825 | 05/11/2012 14:57:05 | 1,244,193 | 03/02/2012 02:59:06 | 1 | 0 | How pass variable from jquery to php? | i want way to pass variable from jquery to php
how to do it? ihave this code `<script>
$(document).ready(function(){
$('a').click(function(){
var title = $(this).attr('value');
$('.div').attr('value', title);
});
}); </script>`
iwant pass title variable to php | php | javascript | jquery | php5 | null | 05/12/2012 21:39:03 | not constructive | How pass variable from jquery to php?
===
i want way to pass variable from jquery to php
how to do it? ihave this code `<script>
$(document).ready(function(){
$('a').click(function(){
var title = $(this).attr('value');
$('.div').attr('value', title);
});
}); </script>`
iwant pass title variable to php | 4 |
8,709,563 | 01/03/2012 08:21:54 | 1,127,395 | 01/03/2012 07:47:39 | 1 | 0 | J2ME Uncaught Exception | I plan to start my first lesson in j2me, and I download a simple book and I try my first program.
When I take a second step to add commands, I face an error message which is:
uncaught exception java/lang/noclassdeffounderror: readfile.
So, would you please help me to understand this message? and how to solve it?
Please find my code below.
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class ReadFile extends MIDlet implements CommandListener
{
private Form form1;
private Command Ok, Quit;
private Display display;
private TextField text1;
public void startApp()
{
form1 = new Form( "TA_Pog" );
Ok = new Command("Ok", Command.OK, 1);
Quit = new Command("Quit", Command.EXIT, 2);
form1.setCommandListener(this);
form1.addCommand(Ok);
form1.addCommand(Quit);
text1 = new TextField("Put Your Name :","His Name : " , 32, TextField.URL );
form1.append(text1);
display = Display.getDisplay(this);
display.setCurrent(form1);
}
public void commandAction(Command c , Displayable d)
{
if (c == Ok)
{
Alert a = new Alert("Alert","This Alert from Ok Button", null, AlertType.ALARM);
a.setTimeout (3000);
display.setCurrent(a,this.form1);
}
else
{
this.notifyDestroyed();
}
}
public void pauseApp() {}
public void destroyApp( boolean bool ) {}
}
Note: the code above is taken exactly from a book.
Thanks in advance
Besr regards | java-me | null | null | null | null | null | open | J2ME Uncaught Exception
===
I plan to start my first lesson in j2me, and I download a simple book and I try my first program.
When I take a second step to add commands, I face an error message which is:
uncaught exception java/lang/noclassdeffounderror: readfile.
So, would you please help me to understand this message? and how to solve it?
Please find my code below.
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class ReadFile extends MIDlet implements CommandListener
{
private Form form1;
private Command Ok, Quit;
private Display display;
private TextField text1;
public void startApp()
{
form1 = new Form( "TA_Pog" );
Ok = new Command("Ok", Command.OK, 1);
Quit = new Command("Quit", Command.EXIT, 2);
form1.setCommandListener(this);
form1.addCommand(Ok);
form1.addCommand(Quit);
text1 = new TextField("Put Your Name :","His Name : " , 32, TextField.URL );
form1.append(text1);
display = Display.getDisplay(this);
display.setCurrent(form1);
}
public void commandAction(Command c , Displayable d)
{
if (c == Ok)
{
Alert a = new Alert("Alert","This Alert from Ok Button", null, AlertType.ALARM);
a.setTimeout (3000);
display.setCurrent(a,this.form1);
}
else
{
this.notifyDestroyed();
}
}
public void pauseApp() {}
public void destroyApp( boolean bool ) {}
}
Note: the code above is taken exactly from a book.
Thanks in advance
Besr regards | 0 |
9,105,542 | 02/02/2012 00:34:18 | 464,314 | 10/01/2010 23:11:45 | 107 | 1 | Customizing Analyzers in Solr | In Solr I have a custom Analyzer that has two parameters. I know how to specify this Analyzer in the schema.xml but I'm wondering how I can pass the two arguments either in the schema.xml or runtime in the code. | solr | analyzer | null | null | null | null | open | Customizing Analyzers in Solr
===
In Solr I have a custom Analyzer that has two parameters. I know how to specify this Analyzer in the schema.xml but I'm wondering how I can pass the two arguments either in the schema.xml or runtime in the code. | 0 |
4,236,196 | 11/21/2010 02:57:28 | 465,986 | 10/04/2010 15:36:32 | 197 | 11 | How to write an AREL statement on a self-referencing table | I have written quite a few AREL statements, but I'm tying myself in knots over this one. Here is my situation:
class Product < AR::Base
has_many :parents, :class_name => "ProductLink", :foreign_key => :to_product_id
has_many :children, :class_name => "ProductLink", :foreign_key => :from_product_id
# has an attribute called "identifier"
end
class ProductLink < AR::Base
belongs_to :parent, :class_name => "Product", :foreign_key => :from_product_id
belongs_to :child, :class_name => "Product", :foreign_key => :to_product_id
end
I want to retrieve all of the Products that have a child product with an identifier that matches some value.
I have twisted myself into a pretzel with this, seems easy, but I have been looking at it for too long now. I appreciate any help! | ruby-on-rails-3 | arel | null | null | null | null | open | How to write an AREL statement on a self-referencing table
===
I have written quite a few AREL statements, but I'm tying myself in knots over this one. Here is my situation:
class Product < AR::Base
has_many :parents, :class_name => "ProductLink", :foreign_key => :to_product_id
has_many :children, :class_name => "ProductLink", :foreign_key => :from_product_id
# has an attribute called "identifier"
end
class ProductLink < AR::Base
belongs_to :parent, :class_name => "Product", :foreign_key => :from_product_id
belongs_to :child, :class_name => "Product", :foreign_key => :to_product_id
end
I want to retrieve all of the Products that have a child product with an identifier that matches some value.
I have twisted myself into a pretzel with this, seems easy, but I have been looking at it for too long now. I appreciate any help! | 0 |
3,706,583 | 09/14/2010 06:33:39 | 362,261 | 06/09/2010 09:38:29 | 19 | 1 | web programming choice - language, database, reliable hoster and auto-scaling | Could you please suggest - programming option?
Our Web application could have 60000 database requests/second or more in future.
Which is better: MS-SQL or MySQL or other?
Which is better: Asp.net, PHP, JSP or other?
What kind of webhosting is reliable for auto-scaling?
Any good webhosters or hosting plans?
Thanks a lot. | php | asp.net | mysql | sql-server | jsp | 09/14/2010 06:50:29 | not constructive | web programming choice - language, database, reliable hoster and auto-scaling
===
Could you please suggest - programming option?
Our Web application could have 60000 database requests/second or more in future.
Which is better: MS-SQL or MySQL or other?
Which is better: Asp.net, PHP, JSP or other?
What kind of webhosting is reliable for auto-scaling?
Any good webhosters or hosting plans?
Thanks a lot. | 4 |
1,528,329 | 10/06/2009 21:59:59 | 179,489 | 09/26/2009 14:24:35 | 5 | 0 | ASP.NET GridView TextBox Problem | I have a gridview in a page and it have a template field:
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txtReturn" runat="server" Text="0"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
And I wrote some code in a command button Click Event to read TextValue of this text box :
int i = 0;
foreach (GridViewRow row in grdFactor.Rows)
{
TextBox txt = (TextBox)(row.FindControl("txtReturn"));
int ret = 0;
try
{
ret = Int32.Parse(txt.Text);
if (ret > 0 && ret < factor.Orders[i].Entity)
{
factor.Orders[i].updateReturn(ret);
}
}
catch (Exception ex) { }
i++;
}
But the value of txt.Text is always Zero.
Could you help me please?
Thanks. | asp.net | gridview | null | null | null | null | open | ASP.NET GridView TextBox Problem
===
I have a gridview in a page and it have a template field:
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txtReturn" runat="server" Text="0"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
And I wrote some code in a command button Click Event to read TextValue of this text box :
int i = 0;
foreach (GridViewRow row in grdFactor.Rows)
{
TextBox txt = (TextBox)(row.FindControl("txtReturn"));
int ret = 0;
try
{
ret = Int32.Parse(txt.Text);
if (ret > 0 && ret < factor.Orders[i].Entity)
{
factor.Orders[i].updateReturn(ret);
}
}
catch (Exception ex) { }
i++;
}
But the value of txt.Text is always Zero.
Could you help me please?
Thanks. | 0 |
1,230,456 | 08/04/2009 23:38:07 | 130,204 | 06/29/2009 00:57:25 | 35 | 3 | Google Chrome CSS/rendering bug? | Here is my website: [link text][2]
On my website, it seems every updated browser (FF, Opera, Safari, IE8, IE7, and even IE6) seem to render the separating line between my content div and sideMenu div.
However, chrome browser doesn't seem to want to render the background to the container div ([link text][1]) where the content div is. It seems like my content div is one pixel to the left too much. However, when you zoom the text (Ctrl + Scrollwheel) the line will appear.
Is this a known rendering bug? or a CSS bug?
Here is my website: [link text][2]
[1]: http://www.ipalaces.org/files/images/containerbg.gif
[2]: http://www.ipalaces.org | css | render | google-chrome | null | null | 05/07/2012 11:49:35 | not a real question | Google Chrome CSS/rendering bug?
===
Here is my website: [link text][2]
On my website, it seems every updated browser (FF, Opera, Safari, IE8, IE7, and even IE6) seem to render the separating line between my content div and sideMenu div.
However, chrome browser doesn't seem to want to render the background to the container div ([link text][1]) where the content div is. It seems like my content div is one pixel to the left too much. However, when you zoom the text (Ctrl + Scrollwheel) the line will appear.
Is this a known rendering bug? or a CSS bug?
Here is my website: [link text][2]
[1]: http://www.ipalaces.org/files/images/containerbg.gif
[2]: http://www.ipalaces.org | 1 |
9,117,026 | 02/02/2012 17:33:03 | 1,076,011 | 12/01/2011 17:59:24 | 25 | 0 | Code to populate Richfaces Tree component | **Code to populate Richfaces Tree component from properties file?**
| jsf | tree | richfaces | null | null | 02/05/2012 21:32:08 | not a real question | Code to populate Richfaces Tree component
===
**Code to populate Richfaces Tree component from properties file?**
| 1 |
7,542,168 | 09/24/2011 21:50:58 | 962,602 | 09/24/2011 12:24:45 | 26 | 0 | How to prevent facebook or twitter to slow down my website? | I'm pretty annoyed, I followed all the best practices to speed up my website, but since I'm using f***ing twitter & facebook widgets, my website is getting slower and slower.
I'm pretty sure there is something to do prevent that.
What are the best practices to implement such tools and prevent them from slowing down my website? | javascript | html | performance | optimization | null | 09/24/2011 23:13:33 | not a real question | How to prevent facebook or twitter to slow down my website?
===
I'm pretty annoyed, I followed all the best practices to speed up my website, but since I'm using f***ing twitter & facebook widgets, my website is getting slower and slower.
I'm pretty sure there is something to do prevent that.
What are the best practices to implement such tools and prevent them from slowing down my website? | 1 |
7,075,888 | 08/16/2011 09:06:39 | 415,795 | 08/10/2010 05:42:09 | 171 | 5 | C# - Thread Abort and System.NullReferenceException | I am doing a practise GUI Oven program using a thread, I am not sure if I should even be doing this because I want to interact with the GUI when the Heating process is ongoing. When I try to abort the thread by click btnStop_Click, it throws the NullReference exception:
**System.NullReferenceException: Object reference not set to an instance of an object.**
Please advice on how can I gracefully stop the thread. Thanks.
Code:
public partial class Form1 : Form
{
private Thread t;
public Form1()
{
InitializeComponent();
}
// button to begin heating
private void btnStart_Click(object sender, EventArgs e)
{
if ((txtMin.Text) == "" || (txtSec.Text) == "")
{
MessageBox.Show("Please enter duration of heating");
}
else
{
t = new Thread(heatIt);
btnHeat.Enabled = false;
t.Start();
bool start = true;
t.Abort();
}
}
//stop heating
private void btnStop_Click(object sender, EventArgs e)
{
Heating heat = new Heating();
Form1 l = new Form1();
l.Subscribe(heat);
heat.stopHeat();
btnHeat.Enabled = true;
}
private void heatIt()
{
// heat food Implementation that calls the 'Heating' class
}
public void stopHeat()
{
if (heatStop != null)
{
heatStop(this, e);
}
}
public void Subscribe(Heating m)
{
m.heatComplete += SignalHeatCompleted;
m.heatStop += SignalStop;
}
private void SignalHeatCompleted(Heating m, EventArgs e)
{
MessageBox.Show( "Done, please enjoy your food");
return;
}
private void SignalStop(Heating m, EventArgs e)
{
t.Abort();
MessageBox.Show("Heating Terminated");
return;
}
public class Heating
{
public event HeatingCompleted heatComplete; // Heating Completed Event
public event HeatingStop heatStop; // Heating Stop Event
public EventArgs e = null;
public delegate void HeatingCompleted(Heating h, EventArgs e);
public delegate void HeatingStop(Heating s, EventArgs e);
public void startHeat(int temp, int min, int sec)
{
int totalSec;
totalSec = ((min*60) + sec) * 1000;
Thread.Sleep(totalSec);
if (heatComplete != null)
{
heatComplete(this, e);
}
else
{
//Use default signal if there's no subscription to this event
MessageBox.Show("*TING*");
}
return;
}
}
} | c# | null | null | null | null | null | open | C# - Thread Abort and System.NullReferenceException
===
I am doing a practise GUI Oven program using a thread, I am not sure if I should even be doing this because I want to interact with the GUI when the Heating process is ongoing. When I try to abort the thread by click btnStop_Click, it throws the NullReference exception:
**System.NullReferenceException: Object reference not set to an instance of an object.**
Please advice on how can I gracefully stop the thread. Thanks.
Code:
public partial class Form1 : Form
{
private Thread t;
public Form1()
{
InitializeComponent();
}
// button to begin heating
private void btnStart_Click(object sender, EventArgs e)
{
if ((txtMin.Text) == "" || (txtSec.Text) == "")
{
MessageBox.Show("Please enter duration of heating");
}
else
{
t = new Thread(heatIt);
btnHeat.Enabled = false;
t.Start();
bool start = true;
t.Abort();
}
}
//stop heating
private void btnStop_Click(object sender, EventArgs e)
{
Heating heat = new Heating();
Form1 l = new Form1();
l.Subscribe(heat);
heat.stopHeat();
btnHeat.Enabled = true;
}
private void heatIt()
{
// heat food Implementation that calls the 'Heating' class
}
public void stopHeat()
{
if (heatStop != null)
{
heatStop(this, e);
}
}
public void Subscribe(Heating m)
{
m.heatComplete += SignalHeatCompleted;
m.heatStop += SignalStop;
}
private void SignalHeatCompleted(Heating m, EventArgs e)
{
MessageBox.Show( "Done, please enjoy your food");
return;
}
private void SignalStop(Heating m, EventArgs e)
{
t.Abort();
MessageBox.Show("Heating Terminated");
return;
}
public class Heating
{
public event HeatingCompleted heatComplete; // Heating Completed Event
public event HeatingStop heatStop; // Heating Stop Event
public EventArgs e = null;
public delegate void HeatingCompleted(Heating h, EventArgs e);
public delegate void HeatingStop(Heating s, EventArgs e);
public void startHeat(int temp, int min, int sec)
{
int totalSec;
totalSec = ((min*60) + sec) * 1000;
Thread.Sleep(totalSec);
if (heatComplete != null)
{
heatComplete(this, e);
}
else
{
//Use default signal if there's no subscription to this event
MessageBox.Show("*TING*");
}
return;
}
}
} | 0 |
10,516,625 | 05/09/2012 12:57:21 | 418,518 | 08/12/2010 14:31:21 | 398 | 16 | How to organise template rendering in Backbone.js | I have a view (Handlebars + Haml)
%script#sentences_hb{:type => "text/x-handlebars-template"}
= form_tag search_sentences_url, :method => :get, :id => "search-sentences" do
= select_tag :authority_name, {}, class: 'authority-name'
= select_tag :authority_detail_1, {}, class: 'authority-detail-1'
= select_tag :authority_detail_2, {}, class: 'authority-detail-2'
= submit_tag "Submit"
{{sentences.length}}
{{#each sentences.models}}
%p {{attributes.authority_name}} {{attributes.authority_detail_1}} {{attributes.authority_detail_2}}
{{/each}}
On every select change (eg. `authority_name`) Backbone sends request to Server and obtain list of desired records (list for options in `authority_detail_1`).
After that I add options to select `authority_detail_1` via `jQuery.append()`.
When a user selects a option in `authority_detail_1` Backbone sends request to Server to obtain list of possible values for `authority_detail_2` and adds options to `authority_detail_2`.
On event `change .authority-detail-2` Backbone fetch list of proper records and render them on template. However when I render template, I lost values for each selects.
Sample Code (Coffeescript):
# Backbone View
events:
"submit #search-sentences": 'searchSentence'
'change .authority-name': 'getAuthorityDetail1'
'change .authority-detail-1': 'getAuthorityDetail2'
'change .authority-detail-2': 'getSentences'
getAuthorityDetail2: =>
selector = ".authority-detail-1"
@collection.fetchAuthorityDetail2 $(".authority-name"), $(selector), =>
selector = '.authority-detail-2'
this.addSelectOption(selector, "Please select value")
@collection.forEach (item) =>
this.addSelectOption(selector, item.get('authority_detail_2'))
addSelectOption: (selector, value) ->
$(selector).append('<option>' + value + '</option>')
# Backbone Collection
fetchAuthorityDetail2: (authority_name, authority_detail_1, callback) =>
this.fetch
url: this.url + "/search?" + authority_detail_1.serialize() + "&" + authority_name.serialize()
success: ->
callback() if callback and typeof (callback) is "function"
fetchSentences: (authority_name, authority_detail_1, authority_detail_2, callback) =>
this.fetch
url: this.url + "/search?" + authority_name.serialize() + "&" + authority_detail_1.serialize() + "&" + authority_detail_2.serialize()
success: ->
callback() if callback and typeof (callback) is "function"
**Questions:**
Is this approach correct (I mean is it 'backbone way')?
Or maybe there is a simple way to do that?
Any suggestions about refactor for this code?
| javascript | ruby-on-rails | ruby-on-rails-3 | backbone.js | coffeescript | null | open | How to organise template rendering in Backbone.js
===
I have a view (Handlebars + Haml)
%script#sentences_hb{:type => "text/x-handlebars-template"}
= form_tag search_sentences_url, :method => :get, :id => "search-sentences" do
= select_tag :authority_name, {}, class: 'authority-name'
= select_tag :authority_detail_1, {}, class: 'authority-detail-1'
= select_tag :authority_detail_2, {}, class: 'authority-detail-2'
= submit_tag "Submit"
{{sentences.length}}
{{#each sentences.models}}
%p {{attributes.authority_name}} {{attributes.authority_detail_1}} {{attributes.authority_detail_2}}
{{/each}}
On every select change (eg. `authority_name`) Backbone sends request to Server and obtain list of desired records (list for options in `authority_detail_1`).
After that I add options to select `authority_detail_1` via `jQuery.append()`.
When a user selects a option in `authority_detail_1` Backbone sends request to Server to obtain list of possible values for `authority_detail_2` and adds options to `authority_detail_2`.
On event `change .authority-detail-2` Backbone fetch list of proper records and render them on template. However when I render template, I lost values for each selects.
Sample Code (Coffeescript):
# Backbone View
events:
"submit #search-sentences": 'searchSentence'
'change .authority-name': 'getAuthorityDetail1'
'change .authority-detail-1': 'getAuthorityDetail2'
'change .authority-detail-2': 'getSentences'
getAuthorityDetail2: =>
selector = ".authority-detail-1"
@collection.fetchAuthorityDetail2 $(".authority-name"), $(selector), =>
selector = '.authority-detail-2'
this.addSelectOption(selector, "Please select value")
@collection.forEach (item) =>
this.addSelectOption(selector, item.get('authority_detail_2'))
addSelectOption: (selector, value) ->
$(selector).append('<option>' + value + '</option>')
# Backbone Collection
fetchAuthorityDetail2: (authority_name, authority_detail_1, callback) =>
this.fetch
url: this.url + "/search?" + authority_detail_1.serialize() + "&" + authority_name.serialize()
success: ->
callback() if callback and typeof (callback) is "function"
fetchSentences: (authority_name, authority_detail_1, authority_detail_2, callback) =>
this.fetch
url: this.url + "/search?" + authority_name.serialize() + "&" + authority_detail_1.serialize() + "&" + authority_detail_2.serialize()
success: ->
callback() if callback and typeof (callback) is "function"
**Questions:**
Is this approach correct (I mean is it 'backbone way')?
Or maybe there is a simple way to do that?
Any suggestions about refactor for this code?
| 0 |
10,790,266 | 05/28/2012 20:48:24 | 1,384,831 | 05/09/2012 14:10:08 | 20 | 0 | Converting SQL SELECT & JOIN to LINQ | Lets say I'm grabbing values from a table with the following fields:
ID | CheckInDate | V1 | V2 | V3 | Type
where 'CheckInDate' is formatted in 'YYYY-MM-DD' format. For 'Type' there are possible values 'T1', 'T2', etc (I only care about getting T1 and T2). Basically, I want to get the records for clients back with both the minimum date and the maximum dates indicated.
SELECT TblA.ID, TblA.V1, TblB.V2, TblB.V3, TblA.minDate, TblB.maxDate
FROM
(SELECT ID, V1, V2, Min(CheckInDate) AS minDate
FROM myDB
WHERE Type = 'T1'
GROUP BY ID, V1, V2) AS TblA
INNER JOIN
(SELECT ID, V2, V3, Max(CheckInDate) AS maxDate
FROM myDB
WHERE Type = 'T2'
GROUP BY ID, V2, V3) AS TblB
ON TblB.ID = TblA.ID AND TblB.V2 = TblA.V2
LIMIT 1000;
How would I convert this to LINQ? I'm having trouble mostly on how to do nested SELECT statements and joining since LINQ seems to do that backwards in code. Thanks | c# | sql | linq | null | null | 05/28/2012 21:08:33 | not a real question | Converting SQL SELECT & JOIN to LINQ
===
Lets say I'm grabbing values from a table with the following fields:
ID | CheckInDate | V1 | V2 | V3 | Type
where 'CheckInDate' is formatted in 'YYYY-MM-DD' format. For 'Type' there are possible values 'T1', 'T2', etc (I only care about getting T1 and T2). Basically, I want to get the records for clients back with both the minimum date and the maximum dates indicated.
SELECT TblA.ID, TblA.V1, TblB.V2, TblB.V3, TblA.minDate, TblB.maxDate
FROM
(SELECT ID, V1, V2, Min(CheckInDate) AS minDate
FROM myDB
WHERE Type = 'T1'
GROUP BY ID, V1, V2) AS TblA
INNER JOIN
(SELECT ID, V2, V3, Max(CheckInDate) AS maxDate
FROM myDB
WHERE Type = 'T2'
GROUP BY ID, V2, V3) AS TblB
ON TblB.ID = TblA.ID AND TblB.V2 = TblA.V2
LIMIT 1000;
How would I convert this to LINQ? I'm having trouble mostly on how to do nested SELECT statements and joining since LINQ seems to do that backwards in code. Thanks | 1 |
9,920,922 | 03/29/2012 07:31:45 | 1,300,106 | 03/29/2012 07:14:33 | 1 | 0 | How can i get current width of view while animate it | I have a View above the map. I scale it with scale animation. I have some overlay on my map that should draw icons under this view. So in overlay's onDraw() i need to know the current size of animated view. All methods like getWidth() return the full size but not current. Anyone know how to get this width or current scale value to calculate current size of the view? I need this solution work for android 2.1 | android | animation | null | null | null | null | open | How can i get current width of view while animate it
===
I have a View above the map. I scale it with scale animation. I have some overlay on my map that should draw icons under this view. So in overlay's onDraw() i need to know the current size of animated view. All methods like getWidth() return the full size but not current. Anyone know how to get this width or current scale value to calculate current size of the view? I need this solution work for android 2.1 | 0 |
11,187,187 | 06/25/2012 10:03:57 | 1,421,570 | 05/28/2012 11:07:55 | 1 | 0 | About font loading issues | My website has an issue i.e. fonts are not loading first i don't know why font is loading very slow i used @fontface for fonts
Check it out http://www.yellowandred.in/newTest/jobs.php | css | null | null | null | null | 06/27/2012 11:48:40 | too localized | About font loading issues
===
My website has an issue i.e. fonts are not loading first i don't know why font is loading very slow i used @fontface for fonts
Check it out http://www.yellowandred.in/newTest/jobs.php | 3 |
5,371,166 | 03/20/2011 20:08:36 | 666,637 | 03/18/2011 19:56:37 | 54 | 0 | Visual studio not allowing ommision of default parameters? | I am using VS2010 on a C++ project using opencv. Many of the calls in opencv have default parameters for the last few parameters to functions. However, when omitting these parameters in function calls, Visual Studio complains and says `"functionname: too few arguments for call`
Is this a quirk of visual studio? Is it a setting somewhere that I can turn off? Why is this occurring. The code compiles fine under g++. | c++ | visual-studio | opencv | null | null | null | open | Visual studio not allowing ommision of default parameters?
===
I am using VS2010 on a C++ project using opencv. Many of the calls in opencv have default parameters for the last few parameters to functions. However, when omitting these parameters in function calls, Visual Studio complains and says `"functionname: too few arguments for call`
Is this a quirk of visual studio? Is it a setting somewhere that I can turn off? Why is this occurring. The code compiles fine under g++. | 0 |
9,370,276 | 02/21/2012 00:01:14 | 962,029 | 09/23/2011 22:07:36 | 27 | 0 | JAVA regex, I am trying to replace all non word character and non numbers with an empty string in the string array | line1.replaceAll("[^A-Za-z0-9]","");
//This is the Regex I am using for each string in the array
// output
Processing -> Subject:
post process->Subject:
Processing -> re
post process->re
Processing -> :
post process->:
Processing -> issue
post process->issue
Processing -> *()&&&*
post process->*()&&&*
// Expected output
Subject
re
issue
<end> | java | regex | null | null | null | 02/21/2012 02:16:38 | not a real question | JAVA regex, I am trying to replace all non word character and non numbers with an empty string in the string array
===
line1.replaceAll("[^A-Za-z0-9]","");
//This is the Regex I am using for each string in the array
// output
Processing -> Subject:
post process->Subject:
Processing -> re
post process->re
Processing -> :
post process->:
Processing -> issue
post process->issue
Processing -> *()&&&*
post process->*()&&&*
// Expected output
Subject
re
issue
<end> | 1 |
6,105,393 | 05/24/2011 03:28:24 | 267,738 | 02/06/2010 13:49:45 | 196 | 1 | Changing JPanel Graphics g color drawing line | i have a program similar to paint. and that i am trying to implement a change pen color however when i change the color, everything currently drawn is changed to the color RED for example in my program,how can i make it such that it will not repaint everything currently drawn to the currently changed color?Below code will compile and run
Class for the JPanel drawing area
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
//refer to http://jkost.ergoway.gr/jnkjavaconnection/freedraw.html for the algorithm.
public class STDrawingArea extends JPanel {
/**
*
*/
private static final long serialVersionUID = 1L;
ArrayList<Rectangle> dPoint = new ArrayList<Rectangle>();
Point point = new Point(-1,-1);
private Color currentColor;
public STDrawingArea()
{
setBorder(BorderFactory.createLineBorder(Color.black));
setBackground(Color.WHITE);
addMouseMotionListener(new MouseAdapter() {
public void mouseDragged(MouseEvent e)
{
dPoint.add(new Rectangle(point.x,point.y,e.getX(),e.getY()));
point.x = e.getX();
point.y = e.getY();
repaint();
}
});
addMouseListener(new MouseAdapter(){
public void mousePressed(MouseEvent e)
{
System.out.println("mousePressed X: "+e.getX()+"mousePressed Y: "+e.getY());
dPoint.add(new Rectangle(e.getX(),e.getY(),-1,-1));
point.x = e.getX();
point.y = e.getY();
}
});
addMouseListener(new MouseAdapter(){
public void mouseReleased(MouseEvent e)
{
System.out.println("mouseReleased X: "+e.getX()+"mouseReleased Y: "+e.getY());
repaint();
}
});
}
@Override
public Dimension getPreferredSize() {
return new Dimension(700,500);
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(getCurrentColor());
for (int i=0; i < dPoint.size(); i++) {
Rectangle r = dPoint.get(i);
if (r.width != -1)
{
g.drawLine(r.x, r.y, r.width, r.height);
}
}
/* Draw current point.*/
g.drawLine(point.x, point.y, point.x, point.y);
}
//set current drawing color
public void changePenColor(Color color)
{
if (color == null)
setCurrentColor(Color.BLACK);
else
setCurrentColor(color);
}
//clear drawings method
public void clearDrawings()
{
if(!(dPoint==null))
{
dPoint.clear();
repaint();
}
}
private void setCurrentColor(Color currentColor) {
this.currentColor = currentColor;
}
private Color getCurrentColor() {
return currentColor;
}
}
Test main class.
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class STTestMain extends JFrame {
STDrawingArea drawingArea = new STDrawingArea();
public STTestMain()
{
//JFrame settings
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setTitle("Spelling Trainer");
setResizable(false);
setVisible(true);
//Panel of buttons
JPanel buttonContainer = new JPanel();
JButton btnPenColor = new JButton("Red Pen");
buttonContainer.add(btnPenColor);
//Drawing Area instantiation
//Adding things to JFrame
getContentPane().add(drawingArea);
getContentPane().add(buttonContainer,BorderLayout.PAGE_END);
pack();
//button listener
btnPenColor.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
drawingArea.changePenColor(Color.RED);
}
});
}
public static void main(String args[])
{
STTestMain test = new STTestMain();
}
}
| java | swing | null | null | null | null | open | Changing JPanel Graphics g color drawing line
===
i have a program similar to paint. and that i am trying to implement a change pen color however when i change the color, everything currently drawn is changed to the color RED for example in my program,how can i make it such that it will not repaint everything currently drawn to the currently changed color?Below code will compile and run
Class for the JPanel drawing area
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
//refer to http://jkost.ergoway.gr/jnkjavaconnection/freedraw.html for the algorithm.
public class STDrawingArea extends JPanel {
/**
*
*/
private static final long serialVersionUID = 1L;
ArrayList<Rectangle> dPoint = new ArrayList<Rectangle>();
Point point = new Point(-1,-1);
private Color currentColor;
public STDrawingArea()
{
setBorder(BorderFactory.createLineBorder(Color.black));
setBackground(Color.WHITE);
addMouseMotionListener(new MouseAdapter() {
public void mouseDragged(MouseEvent e)
{
dPoint.add(new Rectangle(point.x,point.y,e.getX(),e.getY()));
point.x = e.getX();
point.y = e.getY();
repaint();
}
});
addMouseListener(new MouseAdapter(){
public void mousePressed(MouseEvent e)
{
System.out.println("mousePressed X: "+e.getX()+"mousePressed Y: "+e.getY());
dPoint.add(new Rectangle(e.getX(),e.getY(),-1,-1));
point.x = e.getX();
point.y = e.getY();
}
});
addMouseListener(new MouseAdapter(){
public void mouseReleased(MouseEvent e)
{
System.out.println("mouseReleased X: "+e.getX()+"mouseReleased Y: "+e.getY());
repaint();
}
});
}
@Override
public Dimension getPreferredSize() {
return new Dimension(700,500);
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(getCurrentColor());
for (int i=0; i < dPoint.size(); i++) {
Rectangle r = dPoint.get(i);
if (r.width != -1)
{
g.drawLine(r.x, r.y, r.width, r.height);
}
}
/* Draw current point.*/
g.drawLine(point.x, point.y, point.x, point.y);
}
//set current drawing color
public void changePenColor(Color color)
{
if (color == null)
setCurrentColor(Color.BLACK);
else
setCurrentColor(color);
}
//clear drawings method
public void clearDrawings()
{
if(!(dPoint==null))
{
dPoint.clear();
repaint();
}
}
private void setCurrentColor(Color currentColor) {
this.currentColor = currentColor;
}
private Color getCurrentColor() {
return currentColor;
}
}
Test main class.
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class STTestMain extends JFrame {
STDrawingArea drawingArea = new STDrawingArea();
public STTestMain()
{
//JFrame settings
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setTitle("Spelling Trainer");
setResizable(false);
setVisible(true);
//Panel of buttons
JPanel buttonContainer = new JPanel();
JButton btnPenColor = new JButton("Red Pen");
buttonContainer.add(btnPenColor);
//Drawing Area instantiation
//Adding things to JFrame
getContentPane().add(drawingArea);
getContentPane().add(buttonContainer,BorderLayout.PAGE_END);
pack();
//button listener
btnPenColor.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
drawingArea.changePenColor(Color.RED);
}
});
}
public static void main(String args[])
{
STTestMain test = new STTestMain();
}
}
| 0 |
7,379,784 | 09/11/2011 16:56:00 | 656,488 | 03/12/2011 10:38:48 | 124 | 13 | Autosave of programmatically created NSTableColumn in NSTableView? | I have an `NSTableView` created in Interface Builder with some columns. I've set the tableview to autosave its settings (I set the autosave name in the Attributes Inspector and checked *Column information*). Now I want to add some other columns programmatically, but when I quit the app and relaunch it, these newly added columns seem to have disappeared.
Googling I found a work-around: changing the width of the added column gets the job done, but there must be a better solution! | cocoa | nsuserdefaults | nstableview | autosave | nstablecolumn | null | open | Autosave of programmatically created NSTableColumn in NSTableView?
===
I have an `NSTableView` created in Interface Builder with some columns. I've set the tableview to autosave its settings (I set the autosave name in the Attributes Inspector and checked *Column information*). Now I want to add some other columns programmatically, but when I quit the app and relaunch it, these newly added columns seem to have disappeared.
Googling I found a work-around: changing the width of the added column gets the job done, but there must be a better solution! | 0 |
7,608,904 | 09/30/2011 10:12:03 | 228,049 | 12/09/2009 15:10:46 | 679 | 11 | Can't see differences in remote branch after a git fetch | I'm a little confused about git fetch and comparing differences .
I have the following local branches;
- master
- remote/origin/master
In master branch I have a text file which I make changes to, commit and then push to the origin/master.
In another local repo (for test purposes) I have a remote to the same repo as above. I run
- git fetch origin master
- git diff master origin/master
It displays no differences, but if i do `git pull origin master` it pulls and merges the changes I made to the text file. I'm probably wrong but I thought a pull did a fetch and a merge, so doing a fetch allowed me to see the changes to the remote branch before merging them.
| git | null | null | null | null | null | open | Can't see differences in remote branch after a git fetch
===
I'm a little confused about git fetch and comparing differences .
I have the following local branches;
- master
- remote/origin/master
In master branch I have a text file which I make changes to, commit and then push to the origin/master.
In another local repo (for test purposes) I have a remote to the same repo as above. I run
- git fetch origin master
- git diff master origin/master
It displays no differences, but if i do `git pull origin master` it pulls and merges the changes I made to the text file. I'm probably wrong but I thought a pull did a fetch and a merge, so doing a fetch allowed me to see the changes to the remote branch before merging them.
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.