I have 2 processes: 1 is writing to a sqlite database, 1 is reading from the same database. Occasioally, I get SQLITE_BUSY on my selects. Is this normal? Is their some option or way I could open the database so that it blocks until it CAN complete the query? (I tried the FULLMUTEX option on the open call but it appeared to have no effect).
Ok what i need is help..haha ok im making a music app with a paino but i need to be able to hold the sound long or short. So like if i hold a button it will start playing the sound but if i let go it stops WITH A FADE so how ever long i hold the button down that is how long the sound will play (that is ntill the sound ends)
I have a web site and when my users login it takes them to
verify.php
(where it connects to the DataBase and matches email and password to the user input and if OK puts client data into sessions and take the client to /memberarea/index.php ELSE back to login page with message "Invalid Email or password!")
<?php
ob_start();
session_start();
$email=$_POST['email'];
$pass=md5($_POST['pass']);
include("conn.php"); // connects to Database
$sql="SELECT * FROM `user` WHERE email='$email' AND pass='$pass'";
$result=mysql_query($sql);
$new=mysql_fetch_array($result);
$_SESSION['fname']=$new['fname'];
$_SESSION['lname']=$new['lname'];
$_SESSION['email1']=$new['email1'];
$_SESSION['passwrd']=$new['passwrd'];
$no=mysql_num_rows($result);
if ($no==1){
header('Location:memberarea/index.php');
}else {
header("Location:login.php?m=$msg"); //msg="Invalid Login"
}
?>
then after email id and password is verified it takes them to `
/memberarea/index.php
(This is where the problem happens.)
where in index.php it checks if a session has been created in-order to block hackers to enter member area and sends them back to the login page.
<?
session_start();
isset($_SESSION['email'])` && `isset($_SESSION['passwrd'])`
The problem is the client gets verified in verify.php (the code is above)
In varify.php only after I put
ob_start(); ontop of session_start();
It moves on to /memberarea/index.php ,
If I remove ob_start()
It keeps the client on the verify.php page and displays error header is alredy SENT.
after I put ob_start() it goes in to /memberarea/index.php but the session is blank,
so it goes back to the login page and displays the error ($msg) "Invalid Login" which I programed to display.
Can anyone tell me why the session cant pass values from verify.php to /memberarea/index.php
I need to find a certain key in a pdf file. As far as I know the only way to do that is to interpret a pdf as txt file. I want to do this in PHP without installing a addon/framework/etc.
Thanks
Looking for a solid solution for handling reading barcodes from Windows Mobile devices using .NET Compact Framework.
Ideally something open source or free, but not against paying for something that works well. I'm looking for a high quality solution if one is available.
Hi
I am reading a file using File.ReadAllText("filename.txt"). This file is located in very same folder where the .exe file is located (c:/program files/installation folder). But windows app looks into System32 folder for this file by default.
**I don't want to hard code the path of the file.
I am going to development a product related to security. It's my personal belief that any security related product should release it's source code for review. However, I also want to sell it as a commercial product and keep the code ownership to myself and don't expect deviated work.
Is there a software license for this purpose? Thanks.
So I need my WCF service to be capable of starting TCP stream on HTTP request (like sockets do) and be capable of reading if any one is sending TCP respons to it while reciving stream. I need my service to have acsessable to Internet browsers url like example.com/myTCPStreamingWCFService.svc?id=999 for reading from or riting to it.
How to do such thing?
I am trying to build an extension that will allow users to put some parameters into a text box in the popup, generate a link using that information and add it to the said popup. I have all that working, but needless to say, it gets flushed every time the user opens the extension anew. I'd like the info that has been put in there to stay, but can't seem to get it to work. Here's what I have thus far:
manifest.json
{
"manifest_version": 2,
"name": "Test",
"description": "Test Extension",
"version": "1.0",
"permissions": [
"http://*/*",
"https://*/*"
],
"browser_action": {
"default_title": "This is a test",
"default_popup": "popup.html"
}
}
popup.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="linkContainer"/>
<input type="text" id="catsList"/>
<button type="button" id="addToList">Add</button>
<script src="popup.js"></script>
</body>
</html>
popup.js
function addCats()
{
var a = document.createElement('a');
a.appendChild(document.createTextNode(document.getElementById('catsList').value));
a.setAttribute('href', 'http://google.com');
var p = document.createElement('p');
p.appendChild(a)
document.getElementById('linkContainer').appendChild(p);
indexLinks()
}
function indexLinks()
{
var links = document.getElementsByTagName("a");
for (var i = 0; i < links.length; i++)
{
(function ()
{
var ln = links[i];
var location = ln.href;
ln.onclick = function ()
{
chrome.tabs.create({active: true, url: location});
};
})();
}
};
document.getElementById('addToList').onclick = addCats;
My guess is that I need something along the lines of
localStorage['cointainer'] = document.getElementById('linkContainer');
at the end of addCats() and a call to something like
function loadLocalStorage()
{
var container = document.getElementById('linkContainer');
container.innerHTML = localStorage['container'];
}
at the beginning, but doing that didn't work. Not sure what's going wrong.
Also,if there is a different way to save users' additions, I'd be open to them.
I have a C++ function that looks like this
__declspec(dllexport) int ___stdcall RegisterPerson(char const * const szName)
{
std::string copyName( szName );
// Assign name to a google protocol buffer object
// Psuedo code follows..
Protobuf::Person person;
person->set_name(copyName);
// Error Occurs here...
std::cerr << person->DebugString() << std::endl;
}
The corresponding C# code looks like this...
[DllImport(@"MyLibrary.dll", SetLastError = true)]
public static unsafe extern int RegisterPerson([MarshalAs(UnmanagedType.LPTStr)]string szName)
Not sure why this is not working. My C++ library is compiled as Multi Threaded DLL with MultiByte encoding.
Any help would be appreciated. I saw this is a common problem online but no answers lead me to a solution for my problem.
I made a UITableViewCell subclass, and now I want that subclass to be "clever". It should align it's contents to the height of the row. But for this, the cell must know what height value was provided for it in this method:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
However, no matter what value I assign here, my cell's frame is 44 px height at initialization time (default style). Is there any way I can get that value from the cell at initialization time?
I created my own dictionary by taking the values ??from a json file in the dictionary I have a set of values??, the other can take them and use them, instead of these start with a brace can not seem to get them:
weather = (
{
description = "broken clouds";
icon = 04d;
id = 803;
main = Clouds;
}
);
Use this command to take the values ??in the Dictionary:
NSString *currweather = myDict[@"weather"][@"main"];
The application quits when the launch. How can I fix?
I have three questions about three nested loops:
for (int x=0; x<400; x++)
{
for (int y=0; y<300; y++)
{
for (int z=0; z<400; z++)
{
// compute and store value
}
}
}
And I need to store all computed values. My standard approach would be to use a 3D-array:
values[x][y][z] = 1; // test value
but this turns out to be slow: it takes 192 ms to complete this loop, where a single int-assignment
int value = 1; // test value
takes only 66 ms.
1) Why is an array so relatively slow? 2) And why does it get even slower when I put this in the inner loop:
values[z][y][x] = 1; // (notice x and z switched)
This takes more than 4 seconds!
3) Most importantly: Can I use a data structure that is as quick as the assignment of a single integer, but can store as much data as the 3D-array?
Is there a simple :) and efficient way or reading very large number of rows sequentially using Zend_Db?
Basically I need to process entire table, row by row. Table is large, primary key sequence is not guaranteed(i.e. not an autoincrement, but is UNSIGNED INT).
What's the best way to approach this?
Environment: PHP 5.2, Zend Framework 1.10, MySQL 5.1
How can I write the output of this line of code to a float variable instead of piping it to a file? The output of this line is a floating number.
FILE *child = _popen("java -jar c:\\simmetrics.jar c:\\chtml.txt c:\\thtml.txt", "r");
hello
is there any way that when i user send an email to [email protected] the php script reads the email's information and replay to the user automatically ?
Cheer
I am making a grease-monkey plugin for a website that has many flash files. I'd like to make a hash of the flash, the problem is that the flash files are up to 10(total) * 10MEGS. This is slow; I'd like to be able to only grab the first 80KB to hash. The end result would be an easy way to blacklist certain flash files containing unwanted content.
Is this possible? Suggestions?
Code examples are greatly appreciated!
I have been working with SQL Server for more than 8 years now continuously and I like to read a lot. Some time I read easy things and sometime I read stuff which are not so easy. Here are few recently released article which I referred and read. They are not easy read but indeed very important read if you are the one who like to read things which are more advanced.
SQL Server Standards Support Documentation
The SQL Server standards support documentation provides detailed support information for certain standards that are implemented in Microsoft SQL Server.
Microsoft SQL Server Protocol Documentation
The Microsoft SQL Server protocol documentation provides technical specifications for Microsoft proprietary protocols that are implemented and used in Microsoft SQL Server 2008.
Microsoft SQL Server Data Portability Documentation
The SQL Server data portability documentation explains various mechanisms by which user-created data in SQL Server can be extracted for use in other software products. These mechanisms include import/export functionality, documented APIs, industry standard formats, or documented data structures/file formats.
Reference: Pinal Dave (http://blog.sqlauthority.com)
Filed under: PostADay, SQL, SQL Authority, SQL Documentation, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology
An enumerated type, also called an enumeration (or just an enum for short), is simply a way to create a numeric type restricted to a predetermined set of valid values with meaningful names for those values. While most enumerations represent discrete values, or well-known combinations of those values, sometimes you want to combine values in an arbitrary fashion. These enumerations are known as flags enumerations because the values represent flags which can be set or unset. To combine multiple enumeration values, you use the logical OR operator. For example, consider the following: public enum FileAccess
{
None = 0,
Read = 1,
Write = 2,
}
class Program
{
static void Main(string[] args)
{
FileAccess access = FileAccess.Read | FileAccess.Write;
Console.WriteLine(access);
}
}
The output of this simple console application is:
The value 3 is the numeric value associated with the combination of FileAccess.Read and FileAccess.Write. Clearly, this isn’t the best representation. What you really want is for the output to look like:
To achieve this result, you simply add the Flags attribute to the enumeration. The Flags attribute changes how the string representation of the enumeration value is displayed when using the ToString() method.
Although the .NET Framework does not require it, enumerations that will be used to represent flags should be decorated with the Flags attribute since it provides a clear indication of intent.
One “problem” with Flags enumerations is determining when a particular flag is set. The code to do this isn’t particularly difficult, but unless you use it regularly it can be easy to forget. To test if the access variable has the FileAccess.Read flag set, you would use the following code:
(access & FileAccess.Read) == FileAccess.Read
Starting with .NET 4, a HasFlag static method has been added to the Enum class which allows you to easily perform these tests:
access.HasFlag(FileAccess.Read)
This method follows one of the “themes” for the .NET Framework 4, which is to simplify and reduce the amount of boilerplate code like this you must write.
Technorati Tags: .NET,C# 4
from what i understand somethings is wrong with hdd
i am trying to find some commands in order to run some tests to check if hard disk is OK
I will post a full list of logs after REBOOT of system:
"Unknown problem somewhere in the system."
kernel: ata2.00: failed command: READ FPDMA QUEUED
kernel: res 51/40:c8:38:5c:16/00:00:00:00:00/40 Emask 0x409 (media error) <F>
kernel: ata2.00: error: { UNC }
kernel: ata2.00: failed command: READ FPDMA QUEUED
kernel: res 51/40:78:88:5c:16/00:00:00:00:00/40 Emask 0x409 (media error) <F>
kernel: sd 1:0:0:0: [sda] Sense Key : Medium Error [current] [descriptor]
kernel: sd 1:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed
kernel: md/raid1:md1: read error corrected (8 sectors at 1461400 on sda1)
kernel: sd 1:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed
kernel: sd 1:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed
kernel: md/raid1:md1: read error corrected (8 sectors at 1461672 on sda1)
Also some of this logs are duplicate or even more.
Thanks.
Simple Shell script
echo "Enter 1 for month of March"
echo "Enter 2 for month of April"
echo "Enter 3 for month of May"
read Month
case "$Month" in
1)
echo "enter establishment name"
read a;
mysql -u root -p $a < "March.sql";;
2)
echo "enter establishment name"
read b;
mysql -u root -p $b < "April.sql";;
3)
echo "enter establishment name"
read c;
mysql -u root -p $c < "May.sql";;
esac
done
In this i have three other query files March.sql, April.sql, May.sql. i'm linking this in shell script .
Example of .sql file:
SELECT DISTINCT substr(
a.case_no, 3, 2
), b.case_type, b.type_name, a.case_no into outfile '/tmp/April.csv'
FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
FROM Civil_t AS a, Case_type_t AS b, disposal_proc AS c
WHERE substr(
a.case_no, 3, 2
) = b.case_type
AND a.date_of_decision
BETWEEN '2014-04-01'
AND '2014-04-30'
AND a.case_no = c.case_no
AND a.court_no =1;
I have to alter the .sql script every time.
Is there any method to read the variables from shell script and use it in mysql. For example:-
echo "enter date"
read a #input date
Now i have read a "date" and i want to use it in March.sql query in where clause. Is there is any method of using this variable in .sql query.