Yes, There's More Than One Way To Do It™, but what is the most canonical, most efficient, and most concise methods to read an entire file into a string? (The latter two are perhaps at odds.)
Hello All
I am using javascript associative array like:
var testarray = [];
testarray['one'] = '1';
testarray['two'] = '2';
testarray['three'] = '3';
I am also using jquery alongside. How can I check length of this associative array using jquery or any other method? Basically i want to check whether this array is empty or not.
Thank you.
I have two NSMutableArrays:
NSMutableArray* currentMessages
NSMutableArray* items
I am trying to copy the contents of items into currentMessages as such:
[self.currentMessages addObjectsFromArray:self.items];
When I am debugging self.items contains 30 objects. After this operation self.currentMessages contains 0 objects.
Why is the copy not working?
How can I quickly extract two rows of a scipy.sparse.lil_matrix and apply bitwise operations on them? I've tried:
np.bitwise_and(A[1,:], A[2,:])
but NumPy seems to want an array type according to the documentation.
Hello,
i want to bind two exe files into one exe file, and when executed it should only create 1 process.
For example you can try to bind windows calc.exe and notepad.exe to binded.exe and when executed it should just see binded.exe in process list and both calc.exe and notepad.exe should start.
I'm using SQL Server 2008, but my ERP Vendor only offers a SQL 2005 trace template that they'd like me to run on my system.
When I attempt to import it, I receive confirmation that it was successfully imported. However, it does not show up in the list of available templates.
I've done this on two separate servers to the same effect.
Is this a known problem with SQL Server 2008? I Googled unsuccessfully.
Hi,
I am integrating paypal in my website
But i have some issues in it ,
http://www.rmmitchellconsulting.com/ -
click on the paypal button here you will see one box,
I need two boxes. to put amount and invoice number.
How can i do this.
does any one did this.
Please help me to do this.
The question may sound a bit naive or stupid, but i was wondering...will POST and GET evolve someday? What other methods exist besides those two?
I was wondering specifically about server-pushes... why can't exist a method specifically for that? I don't even know if there's already something similar, and if there is, i apologize for my ignorance.
The web is evolving, that's evident...will methods formally evolve too?
Hi,
My basic app has five distinct screens. Three of those screens have TableView data, and I'd like to associate them with a Tab bar + Navigation controller.
My question is if using different navigation paradigms in a same app is a good idea? (Button click driven for the first two screens and then through Tab bars / navigation controllers).
Thanks,
Teja.
there is two table
first table is pg_vendor_signup
pg_vendor_signup
id
vendor_id
name
country_id
secound table
is
pg_vendor_friends
vid
fid
status
pg_vendor_signup
contain data
is
1
3
ramu
381
2
4
raj
381
2
4
usha
381
3
4
krian
381
4
4
manu
381
4
9
aswin
381
pg_vendor_friends
countain
1
9
4
0
1
9
3
0
i Want get all name where country id=381 and
in pg_vendor_friends get status of table
In my ViewModel I have two commands:
ICommand ExecuteMeOnCheck { get; }
ICommand ExecuteMeOnUncheck { get; }
I wish to attach these commands to a CheckBox and have one of them execute when it is checked and the other execute when it is unchecked. What's the best way to achieve this without cluttering the View with code-behind?
My Python module has a list that contains all the data I want to save as a .txt file somewhere. The list contains several tuples like so:
list = [ ('one', 'two', 'three'), ('four', 'five', 'six')]
How do I print the list so each tuple item is separated by a tab and each tuple is separated by a newline?
Thanks
I have noticed that in a Maven artifact's JAR, the project.version attribute is included in two files:
META-INF/maven/${groupId}/${artifactId}/pom.properties
META-INF/maven/${groupId}/${artifactId}/pom.xml
Is there a recommended way to read this version at runtime?
Hi Everyone....
I am about to develop a online hotel reservation system...using php and mysql... I have some doubts about my current database schema and the business logic to get the hotels in which rooms are free between two particular dates...
Does anyone know of some kind of tutorial where i can get some idea about the hotel reservation schema and the business logics that should be used in the system...?
Thanks for your suggestions....
i have a datagrid view with two columns. the first column is readonly and the other is editable. now i want every cell of the second column to support for mulitilines in each cell. i want to press enter key and come to the next line in the same cell.
im using c#.
I want to write java tcp socket programming using java NIO. Its working fine. But I am using the same selector for accepting reading from and writing to the clients.
How Can I create different selectors for accepting new connection in java NIO, reading and writing.
Is there any online help.
Actually when I am busy in reading or writing my selector uses more iterator. So If more number of clients are connected then performance of accepting new coneection became slow.
But I donot want the accepting clients to be slow
// Create a selector and register two socket channels
Selector selector = null;
try {
// Create the selector
selector = Selector.open();
// Create two non-blocking sockets. This method is implemented in
// e173 Creating a Non-Blocking Socket.
SocketChannel sChannel1 = createSocketChannel("hostname.com", 80);
SocketChannel sChannel2 = createSocketChannel("hostname.com", 80);
// Register the channel with selector, listening for all events
sChannel1.register(selector, sChannel1.validOps());
sChannel2.register(selector, sChannel1.validOps());
} catch (IOException e) {
}
// Wait for events
while (true) {
try {
// Wait for an event
selector.select();
} catch (IOException e) {
// Handle error with selector
break;
}
// Get list of selection keys with pending events
Iterator it = selector.selectedKeys().iterator();
// Process each key at a time
while (it.hasNext()) {
// Get the selection key
SelectionKey selKey = (SelectionKey)it.next();
// Remove it from the list to indicate that it is being processed
it.remove();
try {
processSelectionKey(selKey);
} catch (IOException e) {
// Handle error with channel and unregister
selKey.cancel();
}
}
}
public void processSelectionKey(SelectionKey selKey) throws IOException {
// Since the ready operations are cumulative,
// need to check readiness for each operation
if (selKey.isValid() && selKey.isConnectable()) {
// Get channel with connection request
SocketChannel sChannel = (SocketChannel)selKey.channel();
boolean success = sChannel.finishConnect();
if (!success) {
// An error occurred; handle it
// Unregister the channel with this selector
selKey.cancel();
}
}
if (selKey.isValid() && selKey.isReadable()) {
// Get channel with bytes to read
SocketChannel sChannel = (SocketChannel)selKey.channel();
// See e174 Reading from a SocketChannel
}
if (selKey.isValid() && selKey.isWritable()) {
// Get channel that's ready for more bytes
SocketChannel sChannel = (SocketChannel)selKey.channel();
}
}
Thanks
Deepak
Is it possible (on any reasonable OS, preferably Linux) to swap the contents of two memory pages by only modifying the page table and not actually moving any data?
The motivation is a dense matrix transpose. If the data were blocked by page size it would be possible to transpose the data within a page (fits in cache) then swap pages to move the blocks into their final place. A large matrix would have many many pages moved, so hopefully flushing the TLB wouldn't cause trouble.
Hi,
I am Rashmi.I have two forms in a single JSP page which are developed using JSF.Each form has one required field input and a submit button.On click of any of the button from any form,both forms should get validated and display required message.Please need help..........
sample code:
in advance
Thanks.
I have data like following table
I want to remove Titles ( Mr. Miss, Dr etc) from name and want to split data into First name and last name if two names exists.
I want this in select statement. I can remove title using CASE statement but unable to split name into tow in same case statement.
I want data like this but in select statement, title removed and name splitted.
Hello ,
I would like to query from SQL Server 2000 Database.I have got two tables. They are Purchase and PurchaseDetails. I would like to get product records with Last Purchase ID but I can't query with the following statements.So please help me.
SELECT TOP 100 PERCENT dbo.Purchase.PurchaseID AS LastOfPurchaseID, dbo.PurchaseDetails.ProductID,
MAX(dbo.Purchase.PurchaseDate) AS LastOfPurchaseDate
FROM dbo.Purchase INNER JOIN
dbo.PurchaseDetails ON dbo.Purchase.PurchaseID = dbo.PurchaseDetails.PurchaseID
GROUP BY dbo.PurchaseDetails.ProductID, dbo.Purchase.PurchaseDate,dbo.Purchase.PurchaseID
ORDER BY MAX(dbo.Purchase.PurchaseDate) DESC
We have stored all media in Sql Filestream, but now we'll need Video and Audio streaming... Will this be possible with Sql Filestream or will I have to take all of the Video and Audio out of the database?
Which technology would you use to enable Video/Audio Streaming?
WebORB
FluorineFX
Wowza (way better I think than the first two)
IIS Media (haven't looked into this yet)
Let's say I had a char pointer pointing to a buffer that contained these values (in hex):
12 34 56 78 00 00 80 00
I want to modify the last two bytes to a short value of 42. So I would think I would have to do something like this:
(short)*(pointer+6)=42;
The compiler doesn't complain but it does not do what I'm expecting it to do. Can someone tell me the correct way to assign the value?
Does Java have (or is there a library available) that allows me to have a disk based HashMap? It doesn't need to be atomic or anything, but it will be accessed via multiple threads and shouldn't crash if two are accessing the same element at the same time.
Anyone know of anything?
Hi all,
Is there any possible way to do any arithmetic operations on enum values
enum Type{Zero=0,One,Two,Three,Four,Five,Six,Seven,Eight,Nine};
main()
{
enum Type Var = Zero;
for(int i=0;i<10;i++)
{
switch(Var)
{
case Zero:
/*do something*/
case One:
/*Do something*/
.....
}
Var++;(I know that this increment is not possible,But is there anyway by which we can have this variable named Var increment.
regards
maddy