unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
C# Getting the Driver Details the same as Driver File Details Window
===
I'm trying to duplicate the exact file listing below which is found under "Driver Details" in Device Manager, i've come up with the below code but i'm unable to display this list. Any help is awesome.
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PnPSignedDriver");
foreach (ManagementObject obj in searcher.Get())
{
if(obj["DriverProviderName"] != null)
foreach (PropertyData prop in obj.Properties)
{
File.AppendAllText(@"C:\driverusers.txt", prop.Name +"\t" +prop.Value+"\n");
Console.WriteLine("{0}: {1}", prop.Name, prop.Value);
}
}
![Driver FIle details][1]
[1]: http://i.stack.imgur.com/tgYGy.png | 0 | [
2,
272,
5910,
1017,
14,
2425,
3289,
14,
205,
28,
2425,
3893,
3289,
1463,
800,
3726,
3726,
31,
22,
79,
749,
20,
19429,
14,
5340,
3893,
9554,
1021,
56,
25,
216,
131,
13,
7,
21752,
3289,
7,
19,
3646,
1382,
15,
31,
22,
195,
340,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WCF Self signed certificate is not trusted on the client
===
I have a WCF service that is ONLY every used between two server machines. It will NEVER be used publicly...
I was hoping I could use SSL with a self signed certificate for security.
I created a certificate using II7, installed it on the client machine using IE & the MMC (Personal, TrustedRoot, Third-Party & TrustedPeople).
I still can't get to the service, either from code or via IE8, without it questioning the certificate.
From IE I get the usual "There is a problem with this website's security certificate."
From code I get the error: "Could not establish trust relationship for the SSL/TLS secure channel with authority"
Why is this not working??
| 0 | [
2,
11801,
410,
1119,
908,
6259,
25,
52,
9968,
27,
14,
6819,
800,
3726,
3726,
31,
57,
21,
11801,
410,
365,
30,
25,
104,
352,
147,
128,
81,
8128,
6035,
9,
32,
129,
243,
44,
147,
6713,
9,
9,
9,
31,
23,
3935,
31,
110,
275,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
allow cross site scripting from javacript to a soap webservice on glassfish
===
I'm trying to use a SOAP-webservice from javascript.
Both the server and client are in the same LAN and i control both.
when i try to send a request i get:
XMLHttpRequest cannot load http://localhost:8080/datacheckService?wsdl.
Origin http://localhost:2469 is not allowed by Access-Control-Allow-Origin.
this is probably because of cross-site-scripting?
I would like to fix this on the server side.
that means: adding extra headers on outgoing messages:
Access-Control-Allow-Origin: *
how can I add these response headers?
I'm using Netbeans to manage the web service in Glassfish | 0 | [
2,
1655,
919,
689,
3884,
68,
37,
8247,
28215,
38,
20,
21,
6447,
2741,
11449,
27,
1350,
4934,
800,
3726,
3726,
31,
22,
79,
749,
20,
275,
21,
6447,
8,
14113,
11449,
37,
8247,
8741,
9,
156,
14,
8128,
17,
6819,
50,
19,
14,
205,
61... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Read two textfile line by line simultaneously -python
===
I have 2 textfiles in two different languages and they are aligned line by line. I.e. the first line in the textfile1 should be equals to the first line in textfile2, and so on and so forth.
Is there a way to read both file line-by-line simultaneously?
Below is a sample of how the files should look like, imagine the number of lines per file is around 1,000,000.
textfile1:
This is a the first line in English
This is a the 2nd line in English
This is a the third line in English
textfile2:
C'est la première ligne en Français
C'est la deuxième ligne en Français
C'est la troisième ligne en Français
desired output
This is a the first line in English\tC'est la première ligne en Français
This is a the 2nd line in English\tC'est la deuxième ligne en Français
This is a the third line in English\tC'est la troisième ligne en Français
There is a java version of this http://stackoverflow.com/questions/10831007/read-two-textfile-line-by-line-simultaneously-java, but python doesn't use bufferedreader that reads line by line. So how would it be done? | 0 | [
2,
1302,
81,
1854,
16877,
293,
34,
293,
6888,
13,
8,
6448,
11570,
800,
3726,
3726,
31,
57,
172,
1854,
16877,
18,
19,
81,
421,
2556,
17,
59,
50,
13,
12740,
293,
34,
293,
9,
31,
9,
62,
9,
14,
64,
293,
19,
14,
1854,
16877,
165,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Error specifying path for the xsd document. [using dbms_xmlschema]
===
My environment:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
I need to register a "xsd" document, so that i am later able to upload corresponding XML documents into the database.
But when i run the below code i get
begin
dbms_xmlschema.registerSchema( 'http://localhost:8080/db_objects.xsd',
xdbURIType('\public\xml\db_objects.xsd').getClob(),
TRUE,TRUE,FALSE,TRUE
);
end;
but it throws an error:
"ORA-31001: Invalid resource handle or path name "\public\xml\db_objects.xsd"
i felt that there is a problem with specifying the path so i tried various options like this:
but i again get the same error
xdbURIType(C:\Users\praagarwal\public\xml\db_objects.xsd').getClob(), | 0 | [
2,
7019,
19077,
68,
2013,
26,
14,
993,
18,
43,
4492,
9,
636,
12655,
13,
43,
13178,
18,
1,
396,
8184,
7526,
540,
500,
800,
3726,
3726,
51,
2307,
45,
15759,
6018,
332,
263,
2999,
1322,
830,
332,
9,
135,
9,
387,
9,
165,
9,
387,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why the remote terminal server return WSAECONNRESET in the calling of recv() on the client machine?
===
I am working on adding some license functionality to one RDP client program.(Previously this program simplify this part always asking the server for new license. I want to store the gotten license from server and sent it to server in the next connection)
Now I could correctly parse out the license info from the server's message in the licensing period and store it under **\HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing**. But every time I construct a Client License Information Message using the already stored license info and send it to server, the next time when I try to recv() byte from server, the return value is just WSAECONNRESET. Thus I can no longer go with the licensing handshake.
I guess probably this is because I have made some mistakes in constructing the license message to the server so that server rejects it and asks for RESET. First, I rule out the invalidity of the license info, as said by the licensing spec [MS-RDPELE].pdf from MS, even if the license info is wrong or invalid, then the server will sent back the Server Upgrade License Message rather than REST. And also I have take care about the format of the Client License Information Message, so probably there should be no concern about this. But I am not sure about the parts of EncryptedPreMasterSecret and MACData. Is is possible that something wrong with these parts make the server reset the connection?
Make it short, what is the possible situation where the server "Reset" my Client License Information Message? Or, at least, is there any way see what happening from the server side, like some log file? I have checked the event viewer, no useful info.
I have been blocked by this for about one week. Any input is appreciated, and advice from experts on windows Remote Desktop Protocol is warmly welcomed.
-------------------------------------------------------------------------------------------
The following is my code snippet of constructing the Client License Information Message, maybe you can skip this, or maybe you can find something suspect in this. Just list it here:
else
{
_bMsgType = RDP_HC_LICENSE_INFO;
LrRdpLicensePacket::prepareSend();
setLittleEndian32(1); // dwPrefKeyExchangeAlg
setLittleEndian32(0x03010000); // hard code it as windows XP
setBufferWithByte(0 , SEC_RANDOM_SIZE); // set client random to 0
setLittleEndian16(BB_ENCRYPTED_DATA_BLOB); // set the EncryptedPreMasterSecret field
unsigned short modulusLength =
_pEncryptionMgr->GetModulusLength();
setLittleEndian16(modulusLength + SEC_PADDING_SIZE);
const unsigned char *encryptedPreMasterSecret = _pEncryptionMgr->GetEncryptedLicensePreMasterSecret();
unsigned char *_pEncryptedPreMasterSecret = new unsigned char[modulusLength + SEC_PADDING_SIZE];
memcpy(&_pBuffer[_Index], encryptedPreMasterSecret, modulusLength);
_Index += modulusLength;
setBufferWithByte(0 , SEC_PADDING_SIZE);
setLittleEndian16(BB_DATA_BLOB); // set the LicenseInfo field
setLittleEndian16(mLicenseLen);
memcpy(&_pBuffer[_Index], mLicenseInfo, mLicenseLen);
_Index += mLicenseLen;
_pEncryptionMgr->EncryptHWID(mHardwareId, &_pBuffer[_Index]); // set the EncryptedHWID field
_Index += 20;
_pEncryptionMgr->AddLicenseSignature(&_pBuffer[_Index], mHardwareId, 20); //set the MACDate field
_Index += 16;
}
| 0 | [
2,
483,
14,
5388,
3855,
8128,
788,
619,
18,
4391,
1126,
103,
99,
3554,
19,
14,
2555,
16,
6042,
710,
5,
6,
27,
14,
6819,
1940,
60,
800,
3726,
3726,
31,
589,
638,
27,
4721,
109,
3962,
18548,
20,
53,
13,
897,
306,
6819,
625,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Oracle error message when trying to get tables from informix database
===
I created new data source to access an informix database over an odbc data provider(informix 3.33; 32bit). Testing this connection succeeded so i created a new connection manager (new connection from data source) to use it for my ADO NET destination task. When i try to select a destination table it takes about 10 secounds of processing to get the following error:
> ===================================
>
> Could not retrieve the table information for the connection manager
> 'Test'. Could not create a DbProviderFactory class for the provider
> invariant name 'Oracle.DataAccess.Client'. Verify that this provider
> is installed correctly on this computer. (Microsoft Visual Studio)
>
> ===================================
>
> Could not create a DbProviderFactory class for the provider invariant
> name 'Oracle.DataAccess.Client'. Verify that this provider is
> installed correctly on this computer.
> (Microsoft.DataTransformationServices.Design)
>
> ------------------------------ For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%u00ae+Visual+Studio%u00ae+2008&ProdVer=9.0.30729.1&EvtSrc=Microsoft.DataTransformationServices.Design.SR&EvtID=CouldNotGetFactory&LinkId=20476
>
> ------------------------------ Program Location:
>
> at
> Microsoft.DataTransformationServices.Design.ConnectionManagerUtils.GetConnectionTypeFromInvariantName(String
> providerInvariantName) at
> Microsoft.DataTransformationServices.Design.ConnectionManagerUtils.GetInvariantNameFromConnectionType(String
> connectionType) at
> Microsoft.DataTransformationServices.Design.PipelineUtils.GetActiveConnection(ConnectionManager
> connectionManager, IServiceProvider serviceProvider) at
> Microsoft.DataTransformationServices.Design.ComboBoxWithTables.FillTableOrViewComboBox()
>
> ===================================
>
> Exception has been thrown by the target of an invocation. (mscorlib)
>
> ------------------------------ Program Location:
>
> at System.RuntimeFieldHandle.GetValue(Object instance,
> RuntimeTypeHandle fieldType, RuntimeTypeHandle declaringType, Boolean&
> domainInitialized) at
> System.Reflection.RtFieldInfo.InternalGetValue(Object obj, Boolean
> doVisibilityCheck, Boolean doCheckConsistency) at
> System.Reflection.RtFieldInfo.GetValue(Object obj) at
> System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)
> at System.Data.Common.DbProviderFactories.GetFactory(String
> providerInvariantName) at
> Microsoft.DataTransformationServices.Design.ConnectionManagerUtils.GetConnectionTypeFromInvariantName(String
> providerInvariantName)
>
> ===================================
>
> The type initializer for
> 'Oracle.DataAccess.Client.OracleClientFactory' threw an exception.
>
> ===================================
>
> Der Provider ist mit der Version des Oracle-Clients nicht kompatibel
> (Oracle Data Provider for .NET)
>
> ------------------------------ Program Location:
>
> at Oracle.DataAccess.Client.OracleInit.Initialize() at
> Oracle.DataAccess.Client.OracleClientFactory..cctor()
This is pretty strange, because the error output shows problems with `Oracle Data Provider for .NET` and i took an informix driver & my destination is an informix, too.
**I am using Windows 7 64bit, Visual Studio 2008, Informix 7.31C4**
For some reason the package uses the oracle driver.
Any suggestions? | 0 | [
2,
15759,
7019,
2802,
76,
749,
20,
164,
7484,
37,
10361,
4028,
6018,
800,
3726,
3726,
31,
679,
78,
1054,
1267,
20,
1381,
40,
10361,
4028,
6018,
84,
40,
12340,
7229,
1054,
11747,
5,
108,
4190,
4028,
203,
9,
4048,
73,
2512,
3326,
6,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is it possible to share memory between ruby and C++
===
I have a linux machine, on which a ruby web server and a c++ process are hosted. Both the components work on the same database.
In order to avoid repeated database requests, I want to make and maintain an object model.
Is is possible to make one object model and share it between ruby server and c++ process. If yes what can be the pros and cons? | 0 | [
2,
25,
32,
938,
20,
1891,
1912,
128,
10811,
17,
272,
20512,
800,
3726,
3726,
31,
57,
21,
13024,
1940,
15,
27,
56,
21,
10811,
2741,
8128,
17,
21,
272,
20512,
953,
50,
2812,
9,
156,
14,
5090,
170,
27,
14,
205,
6018,
9,
19,
389,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Transferring ownership of apps from a disabled account - any assistance appreciated
===
My developer account was disabled out of the blue, and the link I was sent is here:
http://www.facebook.com/help/?faq=221082221253803
The link to a form to appeal the decision is broken, so it's impossible to get in touch with anybody. Is there an alternate means of contacting dev support? Any help much appreciated - I just need any means of contacting a real person | 2 | [
2,
15798,
5074,
16,
4865,
18,
37,
21,
10154,
2176,
13,
8,
186,
4067,
13746,
800,
3726,
3726,
51,
10058,
2176,
23,
10154,
70,
16,
14,
705,
15,
17,
14,
3508,
31,
23,
795,
25,
235,
45,
7775,
6903,
6483,
9,
6413,
5199,
9,
960,
118... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get the height of a div that is expandable & collapsible
===
Hope to get some help on this, I'm no expert on jQuery so bear with me.
I have 2 expandable/collapsible `<div>`'s containing dynamic search refinement links, the default collapsed state shows the first 12 links with a 'show more' toggle button which when clicked expands the `<div>` to reveal the full set of links.
I need to know the height of these `<div>`'s which I can get like this:
var heightRefLinks = $('.search-refine').outerHeight(true);
But this only captures the collapsed height prior to the 'show more' toggle button being clicked, how do I get the expanded height also?
The reason I need to do this is because I have a toolbar element which 'sticks' to the top of the viewport once you've scrolled to it, the toolbar is only required to 'stick' to the viewport whilst the search results listings are in view, once they're not in view then the toolbar becomes 'unstuck' from the viewport. In order to 'unstick' I have to set a px value for the plugin option: `bottomBound` which is the height in px from the bottom of the viewport to the bottom of the listings. I have a few elements underneath the listings and they all have static heights so it's no bother getting the 'unstick' behaviour to work but then came the aforementioned expandable/collapsible `<div>`'s.
Thanks | 0 | [
2,
184,
20,
164,
14,
2947,
16,
21,
13,
12916,
30,
25,
6073,
579,
279,
9470,
2552,
18,
3426,
800,
3726,
3726,
1376,
20,
164,
109,
448,
27,
48,
15,
31,
22,
79,
90,
5390,
27,
487,
8190,
93,
86,
2746,
29,
55,
9,
31,
57,
172,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
popen and fgets function is getting hanged here
===
#include<iostream>
#include<stdio.h>
using namespace std;
#define MAX_SIZE 512
int main()
{
char szCmd[MAX_SIZE];
char *ProcessName = "pOpen.out";
char *UserName = "tabu";
snprintf(szCmd, MAX_SIZE, "ps -eo user,comm | grep %s | grep -v grep | awk '{ printf(\
"%%s\\n%%s\\n\", $1, $2) }'", ProcessName);
FILE* fp = popen(szCmd, "r");
if (NULL == fp)
{
return false;
}
bool result = false;
while (1)
{
char User[MAX_SIZE];
char Name[MAX_SIZE];
char *pUser = fgets(User, sizeof(User)-1, fp);
char *pName = fgets(Name, sizeof(Name)-1, fp);
//cout << "user:" << pszUser << " processname:" << pszName << endl;
if ( (NULL == pUser) || (NULL == pName) )
{
break;
}
size_t nUserLen = strlen(User)-1;
size_t nNameLen = strlen(Name)-1;
while (nUserLen > 0)
{
if ( (User[nUserLen] == '\n')
|| (User[nUserLen] == '\r')
|| (User[nUserLen] == '\t') )
{
User[nUserLen] = '\0';
nUserLen--;
}
else
{
break;
}
}
while (nNameLen > 0)
{
if ( (Name[nNameLen] == '\n')
|| (Name[nNameLen] == '\r')
|| (Name[nNameLen] == '\t') )
{
Name[nNameLen] = '\0';
nNameLen--;
}
else
{
break;
}
}
cout << "user:" << User << " processname:" << Name << endl;
int nUserCmp = 0;
int nNameCmp = 1;
nNameCmp = strcmp(Name, ProcessName);
if (0 == nNameCmp)
{
if (NULL == UserName)
{
result = true;
break;
}
nUserCmp = strcmp(User, UserName);
if (0 == nUserCmp)
{
result = true;
break;
}
}
}
(void)pclose(fp);
cout << "return value:" << result << endl;
return result;
}
This function trying to get whether the defind process name with defined user name is running in the system or not...
in normal scenario this program exection is not giving any problem, but in heavily loaded system if virtual memory is low or cpu usage in too much...ths program is getting hanged in popen() and fgets function, and raising deadlock..
need ur help, if u can show any way out fron this stucking issue
| 0 | [
2,
3075,
103,
17,
398,
3060,
18,
1990,
25,
1017,
20093,
235,
800,
3726,
3726,
6926,
22640,
1,
1963,
11260,
1,
6926,
22640,
1,
384,
6921,
9,
252,
1,
568,
204,
5582,
354,
43,
73,
6926,
546,
7509,
2049,
1,
10454,
331,
918,
19,
38,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to pass data from WebUserControl to a Page
===
I have WebUserControl which made of 3 DropDownLists (day/month/year). It has public property DateTime BirthDate. I create this WebUserControl dynamically on Page (Page_Load). I want to be able to change data in loaded WebUserControl and save it with button on Page.
WebUserControl code:
public DateTime BirthDate { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
DropDownList dd = new DropDownList();
DropDownList dm = new DropDownList();
DropDownList dy = new DropDownList();
this.Controls.Add(dd);
this.Controls.Add(dm);
this.Controls.Add(dy);
dd.Items.Add(new ListItem("day","0"));
dm.Items.Add(new ListItem("month", "0"));
dy.Items.Add(new ListItem("year", "0"));
dd.Items.AddRange(GetNumericValues(1, 31).ToArray());
dm.Items.AddRange(GetNumericValues(1, 12).ToArray());
int yearNow = DateTime.Now.Year;
dy.Items.AddRange(GetNumericValues(yearNow - 100, yearNow - 17).ToArray());
dd.DataBind();
dm.DataBind();
dy.DataBind();
if (BirthDate != DateTime.MinValue)
{
dd.SelectedValue = BirthDate.Day.ToString();
dm.SelectedValue = BirthDate.Month.ToString();
dy.SelectedValue = BirthDate.Year.ToString();
}
else
{
dd.SelectedValue = "0";
dm.SelectedValue = "0";
dy.SelectedValue = "0";
}
}
private List<ListItem> GetNumericValues(int from, int to)
{
List<ListItem> n = new List<ListItem>();
for (int i = from; i <= to; i++)
{
n.Add(new ListItem(i < 10 ? "0" + i.ToString() : i.ToString()));
}
return n;
}
Page code:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
BirthDateWebUserControl bc = new BirthDateWebUserControl();
PanelForm.Controls.Add(bc);
ViewState["BirthDateWebUserControl"] = bc;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
BirthDateWebUserControl bc = (BirthDateWebUserControl)ViewState["BirthDateWebUserControl"];
LabelResult.Text = bc.BirthDate.ToString("dd/MM/yy");
}
What i'm doing wrong ?
thanks | 0 | [
2,
184,
20,
1477,
1054,
37,
2741,
16704,
12898,
20,
21,
2478,
800,
3726,
3726,
31,
57,
2741,
16704,
12898,
56,
117,
16,
203,
2804,
2968,
5739,
18,
13,
5,
1185,
118,
6444,
118,
731,
6,
9,
32,
63,
317,
1354,
1231,
891,
2208,
8209,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Consistent approach for renaming namespaces in C++
===
When using nested namespaces sometimes fully qualified names end up being quite long. I know I can use `namespace abc = aaa::bbb::ccc` for reducing the amount of typing (it may also improve readability in some cases).
I am not sure, however, what is the best way to achieve this renaming across all the files in a project. The straightforward approach (i.e., to rename long namespaces in a per-use basis) might lead to end up using different short names for the same fully qualified name in different files. So, I was thinking to come up with a more consistent way to do this.
For instance, let's assume something like:
project
|- client
| |- core
| |- plugin
| |- util
|- server
...
I was thinking to create one header per directory including the reduced names. For instance, `project/client/core/core.h` would contain `namespace pr_cl_core = project::client::core` (I know the example for this short name is rather poor, but in real projects they make more sense). Then, I would include `core.h` into all the header files in `project/client/core` so that when a header from that directory is included in, let's say, `project/client/plugin/plugin_foo.h`, the short namespace versions are readily available.
Is this a good approach to do so? Is there any other better way?
I have found several questions on C++ namespaces on SO (for instance, [1](http://stackoverflow.com/questions/5056958/is-there-a-way-to-substitute-long-namespaces-with-define) and [2](http://stackoverflow.com/questions/6108704/renaming-namespaces)), but none of them relates to how to solve namespace renaming in a project-wide manner. | 0 | [
2,
8224,
2141,
26,
25934,
204,
5582,
18,
19,
272,
20512,
800,
3726,
3726,
76,
568,
5618,
69,
204,
5582,
18,
1030,
2337,
3135,
1817,
241,
71,
142,
1450,
175,
9,
31,
143,
31,
92,
275,
13,
1,
7259,
5582,
5079,
800,
15916,
45,
45,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Appropriate data structure for paired data and extension of its functionality
===
The question hast 2 parts.
1. Which is the data structure in R that allows to store the paired data:
0:0
0.5:10
1:20
(Python dictionary {[0]:0,[0.5]:10,[1]:20})
and how to initiate it with one liner? i.e. to couple seq(0,1,by=0.5)
with seq(0,10,by=5) in this data structure
2. Assume I added 0.25 to the list, then I want the weighted average of the neighbor nodes to appear (automatically) in the data set, i.e. the element 0.25:5 and the paired set would be
0:0
0.25:5
0.5:10
1:20
If I add the element 0.3, then it must be paired with 5+(10-5)*(0.3-0.25)/(0.5-0.25)=6 and element 0.3:6 to be added.
How I can create the class with S4 class model where I could put this functionality? | 0 | [
2,
4593,
1054,
1411,
26,
14029,
1054,
17,
3896,
16,
82,
18548,
800,
3726,
3726,
14,
1301,
63,
38,
172,
1341,
9,
137,
9,
56,
25,
14,
1054,
1411,
19,
761,
30,
2965,
20,
1718,
14,
14029,
1054,
45,
713,
45,
387,
713,
9,
264,
6608,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android layout like this?
===
http://i.stack.imgur.com/4D1H8.jpg
Hi i would like to know if someone knows how to do this types of layouts in android with buttons, i cant find nothing.
Thanks!. | 1 | [
2,
13005,
9106,
101,
48,
60,
800,
3726,
3726,
7775,
6903,
49,
9,
25325,
9,
1660,
11147,
9,
960,
13722,
43,
165,
252,
457,
9,
12851,
263,
4148,
31,
83,
101,
20,
143,
100,
737,
3620,
184,
20,
107,
48,
2551,
16,
9106,
18,
19,
130... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... |
VBA custom procedure/function in Worksheet called outside its module
===
I've been playing with this problem for some time, and havent figured out how to do it.
I have same function in every worksheet (and those sheets are named like this Name="One", CodeName="SheetOne" ...):
const someVar as Boolean = True
Public Function myFunction() as Boolean
myFunction = someVar
End Function
Now I want it to be called from outside like this - In ThisWorkbook there is procedure "doThis()" and function "TestThis():
Sub doThis()
Dim i as Integer
For i = 1 to ThisWorkbook.Sheets.Count
If testThis(ThisWorkbook.Worksheets(i)) = True then
Debug.print "Success!"
End If
Next i
Function testThis(x As Worksheet)
If x.myFunction = True Then
testThis = True
Else
testThis = False
End If
Now I know that at this line "**If x.myFunction = True**" it throws error "Method or data member not found", because i cant call that function with this reference, so I've tried it with VBComponent:
Sub doThis()
Dim i as Integer
For i = 1 to ThisWorkbook.Sheets.Count
If testThis(ThisWorkbook.VBProject.VBComponents(Worksheets(i).CodeName)) _
= True then
Debug.print "Success!"
End If
Next i
Function testThis(x As VBComponent)
If x.myFunction = True Then
testThis = True
Else
testThis = False
End If
But again, it throws an "Object does not support this property or method" error. Any ideas, How can I call that function from a variable, that has stored reference of any kind to that Worksheet? Any help would be appreciated.
| 0 | [
2,
566,
969,
5816,
7004,
118,
22359,
19,
170,
17627,
227,
719,
82,
12613,
800,
3726,
3726,
31,
22,
195,
74,
791,
29,
48,
1448,
26,
109,
85,
15,
17,
12460,
5700,
70,
184,
20,
107,
32,
9,
31,
57,
205,
1990,
19,
352,
170,
17627,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
HTML5 video events not triggered
===
I used the advice here: http://stackoverflow.com/questions/3815090/webview-and-html5-video
To show a video in a webview by overriding onShowCustomView and setting the videoView the activity content.
In the js there is an event listener on the video element waiting for the "ended" event. This event never gets thrown and so the actions (eg, go to next page) that are meant to happen at the end of the video never occur.
As far as I can tell I don't have access to the js video element and so can't manually throw the event by overring onCompletion in Android code.
Is there a way to fix this without making changes to the js as it is not certain that I will always have access to this.
Thanks
KK | 0 | [
2,
13,
15895,
264,
763,
963,
52,
15164,
800,
3726,
3726,
31,
147,
14,
4978,
235,
45,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
3665,
9839,
3165,
118,
14113,
4725,
8,
290,
8,
15895,
264,
8,
14785,
20,
298,
21,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Create image canvas using a jpg source content
===
Using a jpg file source (lets suppose i get that using ajax) can i generate the image from it? Maybe using canvas or other methods?
Thank you. | 1 | [
2,
1600,
1961,
9696,
568,
21,
487,
9623,
1267,
2331,
800,
3726,
3726,
568,
21,
487,
9623,
3893,
1267,
13,
5,
11045,
5787,
31,
164,
30,
568,
20624,
6,
92,
31,
7920,
14,
1961,
37,
32,
60,
913,
568,
9696,
54,
89,
3195,
60,
3531,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
IPtables block range with exception
===
I have a server in my network for which I want to DROP outbound traffic to any other host in the LAN, except for one or 2 single hosts. E.g. I want to block outbound traffic to 123.123.1.1/16, except for 123.123.10.10 and 123.123.20.20. How can I do this in IPTABLES?
I have tried something like this:
sudo iptables -D OUTPUT -d 123.123.1.1/16 ! -d 123.123.10.10 -j DROP
However I get an error that the `-d` operator can only be used once. | 0 | [
2,
15735,
5924,
18,
1921,
978,
29,
5391,
800,
3726,
3726,
31,
57,
21,
8128,
19,
51,
982,
26,
56,
31,
259,
20,
2804,
70,
7410,
2227,
20,
186,
89,
2015,
19,
14,
6178,
15,
1613,
26,
53,
54,
172,
345,
5397,
9,
13,
62,
9,
263,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
RedirectAttributes giving IllegalStateException in Spring 3.1
===
I'm want to use [RedirectAttibutes][1] property that has come up in Spring 3.1, I have the following handler method for post in my controller
@RequestMapping(value = "/register", method = RequestMethod.POST)
public String register(@ModelAttribute("admin") Admin admin, BindingResult bindingResult, SessionStatus sessionStatus, RedirectAttributes redirectAttributes) {
redirectAttributes.addAttribute("admin", admin);
if (bindingResult.hasErrors()) {
return REGISTRATION_VIEW;
}
sessionStatus.setComplete();
return "redirect:list";
}
But when I submit the form I'm getting the following exception:
java.lang.IllegalStateException: Argument [RedirectAttributes] is of type Model or Map but is not assignable from the actual model. You may need to switch newer MVC infrastructure classes to use this argument.
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(HandlerMethodInvoker.java:322)
I have come across a few gotcha's with redirectAttributes that you cannot use ModelAndView as the return type. So I returned just the string view.
Can anyone pl. tell me where I'm going wrong?
Thanks.
[1]: http://static.springsource.org/spring/docs/3.1.x/javadoc-api/index.html | 0 | [
2,
302,
14706,
721,
14755,
18,
1438,
5143,
3859,
10066,
872,
19,
1573,
203,
9,
165,
800,
3726,
3726,
31,
22,
79,
259,
20,
275,
636,
99,
14706,
58,
5249,
811,
160,
500,
2558,
165,
500,
1354,
30,
63,
340,
71,
19,
1573,
203,
9,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ListItem background similarry to ListVIew
===
I have Listview which has a background image , now i want to give transparant background to listitem but when i scroll the list it appear black , i want listview backgroun even i scroll the list, | 0 | [
2,
968,
2119,
79,
2395,
835,
622,
20,
968,
4725,
800,
3726,
3726,
31,
57,
968,
4725,
56,
63,
21,
2395,
1961,
13,
15,
130,
31,
259,
20,
590,
2982,
3574,
1830,
2395,
20,
968,
2119,
79,
47,
76,
31,
12159,
14,
968,
32,
1893,
319,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... |
If any, what is the limit of a reference point in Flash CS3?
===
I have been studying some mechanics of Flash and have done some research on its limitation in all aspects.
For example, a BitmapData object can only have 2880x2880 pixels. A MovieClip object cannot exceed certain scale and size, as stated [here][1].
For one thing, I am unable to find out anywhere, or perhaps it is a stupid question to ask. Is there a limit for the reference point?
For example, I create a MovieClip containing a square shape of width 10 and height 10 and set the reference point in the middle. Then I use addChild to put it in my document class. Is there a valid range for the .x and .y properties of this MovieClip? Or is it only limited by 64-bit, i.e. the size of the datatype "Number" stated in the manual?
Thanks a lot.
Felastine.
[1]: http://stackoverflow.com/questions/1019360/maximum-size-of-a-sprite-in-as3 | 0 | [
2,
100,
186,
15,
98,
25,
14,
4496,
16,
21,
2801,
454,
19,
4433,
272,
18,
240,
60,
800,
3726,
3726,
31,
57,
74,
4493,
109,
9701,
16,
4433,
17,
57,
677,
109,
527,
27,
82,
24943,
19,
65,
4842,
9,
26,
823,
15,
21,
1142,
15022,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
One to Many search using AND condition
===
I have the following product which contain many colors.
I wish to find the product which contain at least RED and GREEN.
Product class
String id;
List<Color> colors{};
Color class
id
color
kindly ignore the syntax error.
I'm able to use the following to search OR condition.
Criteria criteria = createCriteria();
criteria.createAlias("colors","colors");
List<String> colorsList = new LinkedList();
colorsList.add("GREEN");
colorsList.add("RED");
criteria.add(Restriction.in("colors.color",colorsList);
The above will give me products which has red or green in their colors BUT not products which contain at least RED AND GREEN.
Thanks in advance. | 0 | [
2,
53,
20,
151,
2122,
568,
17,
2874,
800,
3726,
3726,
31,
57,
14,
249,
2374,
56,
3717,
151,
5268,
9,
31,
2536,
20,
477,
14,
2374,
56,
3717,
35,
639,
402,
17,
647,
9,
2374,
718,
3724,
4924,
73,
968,
1,
11282,
1,
5268,
1,
73,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
z-index not functioning properly on menu, due to jQuery slider
===
It appears that for some reason my content slider sits "on top" of my navigation menu despite my adjustment of various z-index properties to correct the issue.
The wrapper on my menu is a positionable element and the slider is only setting the content to z-index's of 98 or 99 so I can't quite figure out why setting my menu to a z-index of 999 doesn't work.
I've tried adjusting the various z-indexes via Firebug to no avail.
The site in question currently resides on our test server here: http://www.testflightapparel.com | 0 | [
2,
2052,
8,
25671,
52,
14175,
7428,
27,
11379,
15,
397,
20,
487,
8190,
93,
3295,
106,
800,
3726,
3726,
32,
1780,
30,
26,
109,
1215,
51,
2331,
3295,
106,
7550,
13,
7,
218,
371,
7,
16,
51,
8368,
11379,
869,
51,
16040,
16,
617,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
showFullScreen member of QWidget when used doesnt show WindowTitle
===
appWindow window;
window.setWindowTitle("xyz");
window.show();
window.showFullScreen();
center(window);
i am not getting an error but the problem is what that when i use show full screen then the window title isnt displayed along with the minimize ,maximize and close button on the top left.
what i want is that i want to show my screen in fullscreen mode along with the title and those buttons on the left.
i can do this by resizing and setting the exact size of screen but thats foolish because this code of mine if used on other PC wont look as i want it to be due to change in size of monitor.
please help me out and thanks for any help. | 0 | [
2,
298,
13727,
7187,
322,
16,
2593,
3976,
43,
3060,
76,
147,
5886,
298,
1463,
22235,
800,
3726,
3726,
4865,
27508,
1463,
73,
1463,
9,
3554,
27508,
22235,
5,
7,
15161,
380,
7,
6,
73,
1463,
9,
9303,
5,
6,
73,
1463,
9,
9303,
13727,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Eclipse 3.4 Glassfish plugin (server adapter)
===
Since ajax.dev.java.net is down I can't install the Glassfish Server Adapter (Java 5 EE) for Eclipse 3.4 (via the usual way). Does anyone have the plugin.jar and feature.jar archived (or knows where I could get them) so I can install it manually (or knows a download server for Eclipse that has it and works?). | 0 | [
2,
11652,
203,
9,
300,
1350,
4934,
10922,
108,
13,
5,
10321,
106,
9924,
106,
6,
800,
3726,
3726,
179,
20624,
9,
14438,
9,
1004,
1385,
9,
2328,
25,
125,
31,
92,
22,
38,
16146,
14,
1350,
4934,
8128,
9924,
106,
13,
5,
1004,
1385,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Allow Customers to Buy even when item is out of stock OpenCart
===
Good day.
I have been looking for a module to allow a client to be able to still purchase an item if the stock level is 0.
I presume this feature is not already built into opencart 1.5.x?
I have set the product to 2-3 days, however on the site front-end it still shows the product as out of stock. Is there away to alert the client of the 2-3 day delay, and still allow the client to purchase?
Regards-
David
| 0 | [
2,
1655,
5279,
20,
3034,
166,
76,
9101,
25,
70,
16,
2070,
368,
1367,
38,
800,
3726,
3726,
254,
208,
9,
31,
57,
74,
699,
26,
21,
12613,
20,
1655,
21,
6819,
20,
44,
777,
20,
174,
3301,
40,
9101,
100,
14,
2070,
662,
25,
713,
9,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java StringTokenizer.nextToken() skips over empty fiels
===
I am using a tab (/t) as delimiter and I know there are some empty fiels in my data e.g.:
one->two->->three
Where -> equals the tab. As you can see an empty field is still correctly surrounded by tabs.
Data is collected using a loop :
while ((strLine = br.readLine()) != null) {
StringTokenizer st = new StringTokenizer(strLine, "\t");
String test = st.nextToken();
...
}
Yet Java ignores this "empty string" and skips the field.
Is there a way to circumvent this behaviour and force java to read in empty fields anyway? | 0 | [
2,
8247,
3724,
262,
2853,
11907,
9,
20021,
262,
2853,
5,
6,
12532,
18,
84,
2424,
6028,
6798,
800,
3726,
3726,
31,
589,
568,
21,
6523,
13,
5,
118,
38,
6,
28,
121,
20565,
106,
17,
31,
143,
80,
50,
109,
2424,
6028,
6798,
19,
51,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Which SDK to chose from
===
I have a client who wants us to develop a cross platform application with native features with HTML-5. the application need to handle voice and vedio recording and uploading.
knowing the phonegap defeciencies for iuts limitaion can u suggest me some other SDK ? | 1 | [
2,
56,
13,
18,
43,
197,
20,
3305,
37,
800,
3726,
3726,
31,
57,
21,
6819,
72,
2846,
182,
20,
2803,
21,
919,
2452,
3010,
29,
1275,
967,
29,
13,
15895,
8,
264,
9,
14,
3010,
376,
20,
3053,
430,
17,
13,
195,
6921,
1576,
17,
71,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
New to WPF. Form not displaying correctly
===
I am very new to WPF and cannot seem to get my form to display correctly. I expected to have 6 rows. The first three should have buttons in them and the last 3 contain further grids. I was following code from an NHibernate ebook but it does not seem to display correctly. Could someone take a look at this code and suggest any possible errors:
<av:Window x:Class="Chapter2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Title="Product Inventory" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="459" d:DesignWidth="524" SizeToContent="WidthAndHeight">
<av:Grid Height="464" Width="553">
<av:Grid.RowDefinitions>
<av:RowDefinition Height="auto" />
<av:RowDefinition Height="auto" />
<av:RowDefinition Height="auto" />
<av:RowDefinition Height="*" />
<av:RowDefinition Height="*" />
<av:RowDefinition Height="*" />
</av:Grid.RowDefinitions>
<av:Button x:Name="btnCreateDatabase" Content="Create Database" Click="BtnCreateSessionFactoryClick"/>
<av:Button x:Name="btnCreateSessionFactory" Content="Create Session Factory" Click="BtnCreateSessionFactoryClick" av:Grid.Row="1"/>
<av:Button x:Name="btnCreateSession" Content="Create Session" Click="BtnCreateSessionClick" av:Grid.Row="2" />
<av:Grid x:Name = "CategoryGrid" av:Grid.Row="3" Margin="0 10 0 0">
<av:Grid.ColumnDefinitions>
<av:ColumnDefinition Width="Auto"/>
<av:ColumnDefinition Width="*"/>
</av:Grid.ColumnDefinitions>
<av:Grid.RowDefinitions>
<av:RowDefinition Height="Auto" />
<av:RowDefinition Height="Auto" />
<av:RowDefinition Height="Auto" />
</av:Grid.RowDefinitions>
<av:TextBlock Text="Category Name:"/>
<av:TextBlock Text="Category Description:" av:Grid.Row="1"/>
<av:TextBox x:Name="txtCategoryName" av:Grid.Column="1"/>
<av:TextBox x:Name="txtCategoryDescription" av:Grid.Row="1" av:Grid.Column="1"/>
<av:Button x:Name="btnAddCategory" Content="Add Category" av:Grid.Row="2" Click="BtnAddCategoryClick" />
</av:Grid>
<av:Grid x:Name = "ProductGrid" Margin="-1,2,1,130" av:Grid.Row="5">
<av:Grid.ColumnDefinitions>
<av:ColumnDefinition Width="Auto"/>
<av:ColumnDefinition Width="*"/>
</av:Grid.ColumnDefinitions>
<av:Grid.RowDefinitions>
<av:RowDefinition Height="Auto" />
<av:RowDefinition Height="Auto" />
<av:RowDefinition Height="Auto" />
</av:Grid.RowDefinitions>
<av:TextBlock Text="Category Name:"/>
<av:TextBlock Text="Category Description:" av:Grid.Row="1"/>
<av:TextBox x:Name="txtProductName" av:Grid.Column="1"/>
<av:TextBox x:Name="txtProductDescription" av:Grid.Row="1" av:Grid.Column="1"/>
<av:Button x:Name="btnAddProduct" Content="Add Product" av:Grid.Row="2" Click="BtnAddCategoryClick" />
</av:Grid>
<av:Grid x:Name = "LoadCategoryGrid" av:Grid.Row="5" Margin="3,73,-3,128" >
<av:Grid.ColumnDefinitions>
<av:ColumnDefinition Width="Auto"/>
<av:ColumnDefinition Width="Auto"/>
</av:Grid.ColumnDefinitions>
<av:Grid.RowDefinitions>
<av:RowDefinition Height="Auto" />
</av:Grid.RowDefinitions>
<av:Button x:Name="btnLoadCategories" Content="Load Categories" VerticalAlignment="Top" Click="BtnLoadCategoriesClick" Margin="0,188,389,0" />
<av:ListBox x:Name="lstCategories" Margin="114,188,0,-10" av:Grid.RowSpan="2" av:Grid.Column="1" />
</av:Grid>
</av:Grid>
</av:Window>
Note: The buttons and top grid display but things look off centre.
| 0 | [
2,
78,
20,
619,
7721,
9,
505,
52,
17418,
12044,
800,
3726,
3726,
31,
589,
253,
78,
20,
619,
7721,
17,
1967,
2260,
20,
164,
51,
505,
20,
3042,
12044,
9,
31,
1727,
20,
57,
400,
11295,
9,
14,
64,
132,
378,
57,
12861,
19,
105,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Function to get stored callback
===
Suppose I have a variable, that stores the callback.
void* (*function)(int, double);
Now I would like to create a function, that will return this callback. I do not want the user to access the callback directly but by a function. This doesn't work:
void* (*)(int, double) getCallback();
My question is: What will the prototype for such function look like?
| 0 | [
2,
1990,
20,
164,
8214,
645,
1958,
800,
3726,
3726,
5787,
31,
57,
21,
7612,
15,
30,
4134,
14,
645,
1958,
9,
11364,
2483,
13,
5,
2483,
22359,
6,
5,
6391,
15,
1494,
6,
73,
130,
31,
83,
101,
20,
1600,
21,
1990,
15,
30,
129,
788... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Looking for third party CMS to integrate with an MVC site
===
I am looking at the posibility of integrating a third party component into our MVC-based site. We have an MVC-based portal that is hosted in the cloud and need document handling and search features without taking the full job of implementing it from scratch.
Is there any other third party systems that are cloud compatible and provide an API for handling documents, security and full text search? | 0 | [
2,
699,
26,
422,
346,
2390,
18,
20,
18399,
29,
40,
307,
8990,
689,
800,
3726,
3726,
31,
589,
699,
35,
14,
12928,
14264,
16,
24529,
21,
422,
346,
5912,
77,
318,
307,
8990,
8,
1281,
689,
9,
95,
57,
40,
307,
8990,
8,
1281,
8281,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Bash script regex
===
Iam a newbee for bash and I have a question about parsing output of the command.I have 3 number of processes that have the same name "process" and the process have some parameters, like:
process -a 10 -b 20 -c 30 ...
process -a 15 -b 30 -c 40 ...
process -a 30 -b 40 -c 50 ...
I have to handle the 'a' parameters and assign them to an array if the processes exist.İf they dont exist, I have to restart the process.Iam handling the processes with,
$PS -ef|$GREP -v grep|$GREP process, this gives me the running processes and I have to see which process does not run and restart it with the help of 'a' parameter.
| 0 | [
2,
13158,
3884,
7953,
1706,
800,
3726,
3726,
31,
765,
21,
78,
8506,
26,
13158,
17,
31,
57,
21,
1301,
88,
2017,
18,
68,
5196,
16,
14,
1202,
9,
49,
57,
203,
234,
16,
5102,
30,
57,
14,
205,
204,
13,
7,
16835,
7,
17,
14,
953,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Jquery 1 Click Hide and Show left to Righ
===
I would like my jqeury script 1 click hide and show,
when DIV it hide the link show the word SHOW, and when it Show the link show the Word HIDE.
Please can you look for me.
Best Regards.
<script>
$(document).ready(function() {
$('#hide').click(function(e) {
$('.DIV').delay(500).animate({
marginLeft: '-100%',
});
return false;
});
$('#show').click(function(e) {
$('.DIV') .delay(500) .animate({
marginLeft: '0%',
});
return false;
});
});
</script>
/*************** HTML ********************************************/ | 0 | [
2,
487,
8190,
93,
137,
10840,
3077,
17,
298,
225,
20,
10960,
252,
800,
3726,
3726,
31,
83,
101,
51,
487,
1251,
5630,
93,
3884,
137,
10840,
3077,
17,
298,
15,
76,
13,
12916,
32,
3077,
14,
3508,
298,
14,
833,
298,
15,
17,
76,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WCF service inside an MVC-app that uses msmqIntegrationBinding does not receive messages from msmq
===
I have a MVC-app that has a controller with an action that is supposed to expose data from the latest message in a queue (msmq). I have added a private queue on my local machine. I want the application to automatically receive a message from the queue when one is added. For this i am using msmqIntegrationBinding on a WCF-service that has been added to the application. The method that takes the message in the contract i then supposed to save the message in the application cache so that it can be accessed when a client asks for the latest data.
The challenge I now face is that when I add a message to the queue, it's not being picked up by the WCF-service. I need guidance at what I might be doing wrong or feedback on my approach. Please help.
The following is the endpoint-config for the WCF-service:
<bindings>
<msmqIntegrationBinding>
<binding name="MsmqBinding">
<security mode="None" />
</binding>
</msmqIntegrationBinding>
</bindings>
<services>
<service name="TestApp.Web.Service.QueueMessageReceiver">
<endpoint address="msmq.formatname:DIRECT=OS:.\private$\testsmessagequeue"
binding="msmqIntegrationBinding"
bindingConfiguration="MsmqBinding"
contract="TestApp.Web.Service.IQueueMessageReceiver" />
</service>
</services>
And the following code is from the QueueMessageReceiver.cs WCF-service:
public class QueueMessageReceiver : IQueueMessageReceiver
{
private static readonly XmlSerializer Serializer = new XmlSerializer(typeof(ScrewInfoModel));
[OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)]
public void PutScrewInfoMessage(System.ServiceModel.MsmqIntegration.MsmqMessage<System.Xml.XmlDocument> msg)
{
CacheScrewInfoModelFromScrewInfoXmlDoc(msg.Body);
}
private static void CacheScrewInfoModelFromScrewInfoXmlDoc(XmlNode screwInfoXmlDoc)
{
var reader = new StringReader(screwInfoXmlDoc.InnerXml);
var screwInfoModel = (ScrewInfoModel)Serializer.Deserialize(reader);
Common.Utils.CacheScrewInfo(screwInfoModel);
}
}
And here is the Interface for the WCF:
[ServiceContract]
public interface IQueueMessageReceiver
{
[OperationContract(IsOneWay = true, Action = "*")]
void PutScrewInfoMessage(MsmqMessage<XmlDocument> msg);
} | 0 | [
2,
11801,
410,
365,
572,
40,
307,
8990,
8,
7753,
30,
2027,
4235,
79,
1251,
12370,
857,
22260,
630,
52,
2588,
7561,
37,
4235,
79,
1251,
800,
3726,
3726,
31,
57,
21,
307,
8990,
8,
7753,
30,
63,
21,
9919,
29,
40,
1028,
30,
25,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jQuery on change doesnt fire when the same input is re-entered
===
I have this form where you enter something in the input field and i have added an onchange event listener to throw an alert when the value is changed. Apparently the code works in Chrome but in **Firefox** it doesnt work if we re-enter the same text.
Example:
1st try --> Enters the text -> Hello. (Alerts as Text changed).
2nd try --> Enters the text -> Hello. (again) (on Change event isnt called).
Can anyone tell me why this is happening ? Thank you for your time in advance :).
Here is a jsfiddle.
http://jsfiddle.net/neoragex/6yMsf/1/
| 0 | [
2,
487,
8190,
93,
27,
753,
5886,
535,
76,
14,
205,
6367,
25,
302,
8,
23753,
800,
3726,
3726,
31,
57,
48,
505,
113,
42,
2830,
301,
19,
14,
6367,
575,
17,
31,
57,
905,
40,
27,
16229,
807,
21772,
20,
3814,
40,
7863,
76,
14,
192... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
My c# application cannot connect to database on window7 64bit with microsoft access database engine 2010 32bit
===
I'm poor in english. sorry about taht
My Computer is
1) Window7 32bit
2) VS 2005
3) language : C#
I made a applcition that connects access file and deployed the applicatioin with clickonce on my computer.
I published release/any cpu mode.
The prerequisites was dot net framework 2.0.
When I install the appliction on another computer(Window7 64bit, MS access database engine 2010 32bit) error occurred.
The error message was "Cannot Connect to Database.... System.Data".
My connection string is "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=...".
I wanna know why error like that is occurred. | 0 | [
2,
51,
272,
5910,
3010,
1967,
6379,
20,
6018,
27,
1463,
465,
4384,
3326,
29,
7099,
1381,
6018,
1406,
498,
2512,
3326,
800,
3726,
3726,
31,
22,
79,
1696,
19,
486,
9,
1875,
88,
13,
12515,
38,
51,
1428,
25,
137,
6,
1463,
465,
2512,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to handle the simplest dependent action in ant?
===
In a Makefile, I would simply specify
.a.b:
do_something_with_a $< --output=$*.b
How do I do exactly that in ant? I haven't seen this in any documentation, and can't get it to work with ant.
For those who don't know make, the first part specifies two kind of files, those with .a extension and those with .b extension. Further it specifies that the bs are dependent on the as, such that if filename.b does not exist or is older than filename.a, the command rule should be applied. The command rule specifies that the command "do_something_with_a" is called with the arguments "filename.a" and "--output==filename.b" for every such filename.
I will test your solution with ant-1.8.4 and accept the first that works. File locations may be specified. | 0 | [
2,
184,
20,
3053,
14,
24384,
9063,
1028,
19,
40,
38,
60,
800,
3726,
3726,
19,
21,
233,
16877,
15,
31,
83,
1659,
19077,
13,
9,
58,
9,
220,
45,
107,
1,
9099,
1,
1410,
1,
58,
5579,
1,
13,
8,
8,
1320,
4881,
3726,
4403,
2483,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Set ListView in view when ready
===
I have two views in my Android application (2 view fragments actually). The first view has a textfield and a button, the 2nd view has a ListView.
What i want to do is set some data in the ListView, based on what is set in the textfield (from the first view). But i'm not sure how to do this.
I'm currently setting hardcoded data in the ListView from the `onCreateView` method in the 2nd Views SecondFragment.java file. Which looks something like this:
ListView list = (ListView)view.findViewById(R.id.list_mainmenu);
items.add(new SectionItem("Section 1"));
items.add(new EntryItem("Item 1", "This is item 1", 1));
items.add(new EntryItem("Item 2", "This is item 2", 2));
items.add(new EntryItem("Item 3", "This is item 3", 3));
EntryAdapter adapter = new EntryAdapter(this.getActivity().getBaseContext(), items);
list.setAdapter(adapter);
But having that in the `onCreateView` method isn't what i want. I want to be able to set that list for that view from another java file. In my case `FirstFragment.java`.
Is this possible, and if so, how can i do that?
I can imagine that there must already be some instance of the `SecondFragment.java` class, because the `onCreateView` is immidiately called when the app loads. I just can't find out where i can get it from. | 0 | [
2,
309,
968,
4725,
19,
1418,
76,
1451,
800,
3726,
3726,
31,
57,
81,
4146,
19,
51,
13005,
3010,
13,
5,
135,
1418,
10837,
1121,
6,
9,
14,
64,
1418,
63,
21,
1854,
1109,
17,
21,
5167,
15,
14,
172,
706,
1418,
63,
21,
968,
4725,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to add new content when a checkbox is clicked?
===
I made a design with ajax, jquery, mysql and checkbox in php. It is like that :
There is box with checkboxes. And there is another box which is empty. When you checked a checkbox in first box, information about that checkbox will be displayed in empty box. I did it and work good.But when you clicked another checkbox, information about first you clicked dissappear and only current selection is displayed. That is to say, I want to add new selection on old ones. Also how can I delete information in second box when I unchecked a checkbox. Thank you.
Here is HTML code :
<div id="first_box">
<label class='checkbox'>
<input type='checkbox' id=1> First checkbox
</label>
<label class='checkbox'>
<input type='checkbox' id=2> Second checkbox
</label>
<label class='checkbox'>
<input type='checkbox' id=3> Third checkbox
</label>
</div>
<div id="second_box"> </div>
Here is jquery code :
$(document).ready(function() {
$("#first_box input:checkbox").change(function() {
if($(this).is(":checked")) {
$.post("/here/is/url", { strID:$(this).attr("id"), strState:"1" },
function(data) {
$("#second_box").html(data);
});
} else {
$.ajax({
url: 'here/is/url/',
type: 'POST',
data: { strID:$(this).attr("id"), strState:"0" }
});
}
});
});
Here is the php code for ajax request :
$strID = $_POST['strID'];
$strState = $_POST['strState'];
if ($strState) { //if checkbox is clicked
//I fetch data about checkbox which is clicked
$infos = $this->info_model->get_info_from_checkbox_id($strID);
foreach ($infos as $info) {
echo "<label class='checkbox'>
<input type='checkbox'>".$info->information .
"</label>";
}
} else { // if it is unchecked
// I do not know how to delete
}
| 0 | [
2,
184,
20,
3547,
78,
2331,
76,
21,
2631,
5309,
25,
15802,
60,
800,
3726,
3726,
31,
117,
21,
704,
29,
20624,
15,
487,
8190,
93,
15,
51,
18,
22402,
17,
2631,
5309,
19,
13,
26120,
9,
32,
25,
101,
30,
13,
45,
80,
25,
1649,
29,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Migrating app from Bamboo to Cedar: can I just change DATABASE_URL in the new instance?
===
In the <a href="https://devcenter.heroku.com/articles/cedar-migration">migration Guide</a> the recommended approaches for migrating databases don't include just changing the DATABASE_URL in the new instance. If you have a dedicated database in Bamboo, and want to use the same in Cedar, is there a problem in just pointing the DATABASE_URL in Cedar to the same DATABASE_URL?
Thanks | 0 | [
2,
28749,
4865,
37,
16998,
20,
11083,
45,
92,
31,
114,
753,
6018,
1,
911,
255,
19,
14,
78,
4851,
60,
800,
3726,
3726,
19,
14,
13,
1,
58,
746,
14057,
3726,
7,
21127,
18,
6903,
14438,
12641,
9,
1694,
9266,
9,
960,
118,
20360,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
what hook should I use to output extension after body text
===
Using mediawiki.
I have installed the extension http://www.mediawiki.org/wiki/Extension:Contribution_Credits, which is called with the main body text <?php $this->html('bodytext') ?> in my skin.php file.
I would like to insert some code (comment section) inbetween the main body text of my page and the contribution credits.
At the moment the contribution credits extension uses the hook:
$wgHooks['OutputPageBeforeHTML'][] = 'addFooter'; what can I change this to so it isn't called with the main body text but rather just above the { $this->html('catlinks'); } section?
Thanks | 0 | [
2,
98,
5559,
378,
31,
275,
20,
5196,
3896,
75,
358,
1854,
800,
3726,
3726,
568,
941,
17375,
9,
31,
57,
4066,
14,
3896,
7775,
6903,
6483,
9,
8260,
17375,
9,
5583,
118,
17375,
118,
1706,
25573,
45,
1126,
13202,
3309,
1,
21740,
18,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is is possible to make an XSS in this situation ?
===
I have a jsp file with the following code snippet:
<form action=<%= request.getContextPath() %>/query_flight? ...
When using [codesecue][1] to do static code check, i got an XSS attack warning:
![enter image description here][2]
but i am confused because `context.getContextPath` is a j2ee standard API. Is it possible to make an XSS attack??
Any suggestion?
Thank you very much .
[1]: http://www.armorize.com/codesecure/
[2]: http://i.stack.imgur.com/I1iCS.png | 0 | [
2,
25,
25,
938,
20,
233,
40,
993,
18,
18,
19,
48,
1858,
13,
60,
800,
3726,
3726,
31,
57,
21,
487,
3401,
3893,
29,
14,
249,
1797,
13,
29061,
45,
13,
1,
4190,
1028,
3726,
1,
11881,
3726,
3772,
9,
3060,
1126,
11969,
8353,
5,
6,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Programming for Symbian devices
===
I didn't know where to post this so i came here. Anyway I'm wondering is it worth even targeting Symbian phones? Especially since nokia don't even want anything to do with it anymore.
Do symbian phones get the latest updates for chrome and firefox mobile? | 0 | [
2,
3143,
26,
13,
7261,
10035,
4690,
800,
3726,
3726,
31,
223,
22,
38,
143,
113,
20,
678,
48,
86,
31,
281,
235,
9,
2774,
31,
22,
79,
5712,
25,
32,
2715,
166,
15972,
13,
7261,
10035,
14830,
60,
1118,
179,
24294,
221,
22,
38,
166... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Representing environment variable 10
===
I am passing parameters from Java program to shell script for which I am using environment variables in shell script to receive the parameters. I am able to get parameters till no 9 by using $9. But I am getting an error if I get the 10th parameter. I am using ${10} to get the input of the 10 th parameter. Am I going wrong some where . | 0 | [
2,
3793,
2307,
7612,
332,
800,
3726,
3726,
31,
589,
2848,
12905,
37,
8247,
625,
20,
3593,
3884,
26,
56,
31,
589,
568,
2307,
12157,
19,
3593,
3884,
20,
2588,
14,
12905,
9,
31,
589,
777,
20,
164,
12905,
3924,
90,
561,
34,
568,
168... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
UIWebView: Media Player Rotates View Controller
===
I'm encountering an issue while using a webview. My app is currently a portrait application, but when a media player loads in a webview within my app, the user can rotate the player, which rotates my view controller as well. I know I can get a notification for when the player comes up and disappears, but is there a way to prevent it from rotating the controller in the first place? | 0 | [
2,
13,
5661,
14113,
4725,
45,
941,
517,
21448,
18,
1418,
9919,
800,
3726,
3726,
31,
22,
79,
7007,
68,
40,
1513,
133,
568,
21,
2741,
4725,
9,
51,
4865,
25,
871,
21,
5548,
3010,
15,
47,
76,
21,
941,
517,
19069,
19,
21,
2741,
472... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
C++ Variable Type Selection at Runtime
===
I am upgrading an old application which was written for a specific hardware interface. I now need to add support for a modern hardware to the existing application.
To do this, I would like to create a class for each hardware type, and assign a variable to one type or the other whenever the user selects which hardware is in their system.
For example:
Class HardwareType1 and Class HardwareType2 both exist having the same member functions.
object HW;
if (userHwType = 1)
initialize HW as a HardwareType1 class
}
else{
initialize HW as a HardwareType2 class
}
Now I can use HW.doSomething() throughout my code without a conditional for hardware type every time I interact with the hardware.
I'm sure this is pretty basic but to be honest I don't even know what this is called or what terms to search on for this one.
Thanks! | 0 | [
2,
272,
20512,
7612,
1001,
3155,
35,
485,
891,
800,
3726,
3726,
31,
589,
26939,
40,
315,
3010,
56,
23,
642,
26,
21,
1903,
7610,
6573,
9,
31,
130,
376,
20,
3547,
555,
26,
21,
773,
7610,
20,
14,
3149,
3010,
9,
20,
107,
48,
15,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Http Live straming EXT-X-STREAM-INF, Calculating BANDWITH
===
Initially I've tried to find possible ways to do HLS segmenting on other non-Mac platforms.
Segmenting videos for HLS involves the following steps:
1) Splitting the encoded video into segments
2) Creating playlist (.m3u8) file that simply contains list of segments for the current rendition, including duration in seconds for each segment
3) Creating a variant playlist that contains relative paths to all playlists of all renditions with the information about BANDWITH which according to HTTP Live streaming protocol is:
*The value is a decimal-integer of bits per second. It MUST be an upper bound of the overall bitrate of each media segment (calculated to include container overhead) that appears or will appear in the Playlist.*
Latest version of ffmpeg includes possibilities of splitting videos. However ffmpeg can’t create m3u8 files. Creating simple playlist not a problem. But creating variant playlist might be:
So variantplaylistcreator on Mac creates those, calculates somehow bitrates and puts value based on that into BANDWITH tag.
I’ve tried many different ways but yet I couldn’t get exactly the same numbers that variantplaylistcreator does, and at this point I can’t find any information how exactly it calculates those values and what algorithm it uses.
My numbers are close, but still slightly different.
In theory it should not be a problem, but the point is - I don’t know that for sure.
Maybe the BANDWITH information should be precise for flawless video playing, maybe it doesn’t have to.
Anyway I'm really curious how exactly variantplaylistcreator calculates them:
upd: Maybe the slight difference is so called "container overhead" which I have no idea how to get and barely understand what it is
| 0 | [
2,
7775,
515,
5428,
3863,
1396,
38,
8,
396,
8,
11260,
8,
108,
410,
15,
22937,
323,
1410,
800,
3726,
3726,
1537,
31,
22,
195,
794,
20,
477,
938,
2847,
20,
107,
13,
3712,
18,
5631,
68,
27,
89,
538,
8,
6893,
6843,
9,
5631,
68,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
NullPointerException with libgdx using the gdx render() method
===
Started making a game.
Here's some of my code.
public class GameScreen implements Screen {
private World world;
private WorldRenderer renderer;
@Override
public void render(float delta) {
Gdx.gl.glClearColor(0.1f, 0.1f, 0.1f, 1);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
renderer.render();
}
....
here's the WorldRenderer Class:
public class WorldRenderer {
private World world;
private OrthographicCamera cam;
/**for debug rendering**/
ShapeRenderer debugRenderer = new ShapeRenderer();
public WorldRenderer(World world) {
this.world = world;
this.cam = new OrthographicCamera(10, 7);
this.cam.position.set(5, 3.5f, 0);
this.cam.update();
}
public void render() {
//render blocks
debugRenderer.setProjectionMatrix(cam.combined);
debugRenderer.begin(ShapeType.Rectangle);
for(Block block : world.getBlocks()) {
Rectangle rect = block.getBounds();
float x1 = block.getPosition().x + rect.x;
float y1 = block.getPosition().y + rect.y;
debugRenderer.setColor(new Color(1, 0, 0, 1));
debugRenderer.rect(x1, y1, rect.width, rect.height);
}
//render hunter
TribalHunter hunter = world.getHunter();
Rectangle rect = hunter.getBounds();
float x1 = hunter.getPosition().x + rect.x;
float y1 = hunter.getPosition().y + rect.y;
debugRenderer.setColor(new Color(0, 1, 0, 1));
debugRenderer.rect(x1, y1, rect.width, rect.height);
debugRenderer.end();
}
}
This is the exception I'm getting:
Exception in thread "LWJGL Application" java.lang.NullPointerException
at games.tribe.screens.GameScreen.render(GameScreen.java:19)
at com.badlogic.gdx.Game.render(Game.java:46)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:202)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:131)
AL lib: ReleaseALC: 1 device not closed
Line 46 of gdx.Game.render is this method:
@Override
public void render () {
if (screen != null) screen.render(Gdx.graphics.getDeltaTime());
}
Any help will be appreciated
Thanks in advance
| 0 | [
2,
16203,
3132,
106,
10066,
872,
29,
13,
8326,
263,
43,
396,
568,
14,
489,
43,
396,
16535,
5,
6,
2109,
800,
3726,
3726,
373,
544,
21,
250,
9,
235,
22,
18,
109,
16,
51,
1797,
9,
317,
718,
250,
7187,
8713,
18,
2324,
13,
1,
932... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there a generic type-constraint for "where NOT derived from"?
===
We can specify a *"derived from"* constraint on generic type parameters like this:
class Bar<T> where T : IFooGenerator
Is there a way to specify *NOT* derived from?
---
My use-case: I have a bunch of `FooGenerator`s that are parallelizable, with the same parallelization code for each, but we don't want them to *always* be parallelized.
public class FooGenerator : IFooGenerator
{
public Foo GenerateFoo() { ... }
}
Thus, I create a generic container class for generating Foo in parallel:
public class ParallelFooGenerator<T> : IFooGenerator where T : IFooGenerator
{
public Foo GenerateFoo()
{
//Call T.GenerateFoo() a bunch in parallel
}
}
Since I want `FooGenerator` and `ParallelFooGenerator<FooGenerator>` to be interchangeable, I make `ParallelFooGenerator : IFooGenerator`. However, I clearly don't want `ParallelFooGenerator<ParallelFooGenerator>` to be legal.
So, as an auxiliary question, is there perhaps a better way to design this if "not derived from" constraints are impossible? | 0 | [
2,
25,
80,
21,
12733,
1001,
8,
12124,
11809,
38,
26,
13,
7,
2798,
52,
3981,
37,
7,
60,
800,
3726,
3726,
95,
92,
19077,
21,
1637,
7,
25891,
37,
7,
2483,
28804,
27,
12733,
1001,
12905,
101,
48,
45,
718,
748,
1,
38,
1,
113,
13,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
JPA2 run-time database connection
===
I'm using JP2 in my current web project. My main database holds the main entities. To connect on this DB i defined a Persitence Unit with a JTA Datasource:
Persistance.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="MyPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>MyDB</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.logging.level" value="FINE"/>
<property name="eclipselink.logging.parameters" value="true"/>
<property name="eclipselink.logging.logger" value="ServerLogger"/>
<property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
</properties>
</persistence-unit>
</persistence>
and the JTA Datasource defined in sun-resources.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="org.postgresql.ds.PGSimpleDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="post-gre-sql_mydb_mypool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">
<property name="serverName" value="localhost"/>
<property name="portNumber" value="5432"/>
<property name="databaseName" value="mydb"/>
<property name="User" value="myuser"/>
<property name="Password" value="mypass"/>
<property name="URL" value="jdbc:postgresql://localhost:5432/mydb"/>
<property name="driverClass" value="org.postgresql.Driver"/>
<property name="characterEncoding" value="UTF-8" />
</jdbc-connection-pool>
<jdbc-resource enabled="true" jndi-name="MyDB" object-type="user" pool-name="post-gre-sql_mydb_mypoll"/>
</resources>
And this is how i access the database on my DAO classes (witch are @ManagedBeans and @SessionScoped):
@ManagedBean(name = "pageDao")
@SessionScoped
public class PageDao implements Serializable {
@Resource
private UserTransaction utx = null;
@PersistenceUnit(unitName = "MyPU")
private EntityManagerFactory emf = null;
public EntityManager getEntityManager() {
return emf.createEntityManager();
}
public List<PageEnt> getAll() { ... }
public PageEnt getOne(long pageId) { ... }
public void addPage(PageEnt newPage) throws RollbackFailureException, PreexistingEntityException, Exception { ... }
public PageEnt update(PageEnt page) throws RollbackFailureException, NonexistentEntityException, Exception { ... }
public void remove(PageEnt page) throws RollbackFailureException, Exception { ... }
}
One of entities (customer) has properties for connecting on a separate (per-customer) database, witch are defined in run-time. These properties includes:
- Databse name
- Host and port
- User and Password
My question are:
- How do I efficiently create a database connection in run-time?
- How can I create a new EntityManager from container-managed resources if there is no per-customer PersistanceUnit and Datasources defined (witch are defined at deploy-time)?
- If i have to manually deal with the EntityManagerFactory (witch, as i learned in college, is a heavy and expansive object), how do I efficiently do that? Is there a good-practice or pattern?
- How would the DAO pattern work? How do my DAO class will get the EntityManager?
Big thanks from Brazil. | 0 | [
2,
487,
1060,
135,
485,
8,
891,
6018,
2760,
800,
3726,
3726,
31,
22,
79,
568,
13,
12851,
135,
19,
51,
866,
2741,
669,
9,
51,
407,
6018,
2763,
14,
407,
12549,
9,
20,
6379,
27,
48,
13,
9007,
31,
2811,
21,
27125,
38,
2940,
1237,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Avoiding duplicate objects in JavaScript
===
I'm creating an object onfocus of an DOM Element to handle various subsequent events. However, after the element looses focus, I need to destroy the object somehow, so that future focus on the element creates a fresh object with no reference to the original.
Right now, this issue I'm having is that subsequent clicks create another object and all the functions are called twice. Click again, three times. Etc. The code below shows an example of the click event and object creation.
Any help would be appreciated.
var videoTopicsHandler = DojoOn(videoTopicsInput, 'focus', function(e){
dropKeyPress(this, 'video-topics');
});
var dropKeyPress = function(input, ulId, scroll) {
var handler;
obj = new dropDownObj(ulId, scroll);
obj.attachEvents(obj, handler, input);
}; | 0 | [
2,
10298,
19429,
3916,
19,
8247,
8741,
800,
3726,
3726,
31,
22,
79,
2936,
40,
3095,
27,
23371,
16,
40,
11859,
4520,
20,
3053,
617,
3147,
963,
9,
207,
15,
75,
14,
4520,
4675,
18,
1776,
15,
31,
376,
20,
4407,
14,
3095,
3625,
15,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java : can't call overloaded constructor
===
here I am trying to call overloaded constructor after some condition has met in my main() program , which is given by variable a. Code works fine when I am using only default constructor , but I need to call overloaded constructor at some point and it fails . folowing is code:
overloaded constructor :
**`public Paddle(int a){
//ImageIcon ii = new ImageIcon(paddle);
//image = ii.getImage();
if(a ==1){
ImageIcon ii = new ImageIcon(this.getClass().getResource(paddle1));
` further initialization -- **
default constructor :
public Paddle(){
ImageIcon ii = new ImageIcon(this.getClass().getResource(paddle));
//ImageIcon ii = new ImageIcon(paddle);
image = ii.getImage();
thanks for help in advance , further queries can be asked but I think this piece of code has some problem . Thank you | 0 | [
2,
8247,
13,
45,
92,
22,
38,
645,
84,
22546,
6960,
248,
800,
3726,
3726,
235,
31,
589,
749,
20,
645,
84,
22546,
6960,
248,
75,
109,
2874,
63,
798,
19,
51,
407,
5,
6,
625,
13,
15,
56,
25,
504,
34,
7612,
21,
9,
1797,
693,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Google Maps -> How can I darken map and disable it fully after a user clicks a button
===
So, I have created many map applications before, but the one that I am working on currently actually has some interaction to it.
Users can click markers and accept them and the data is saved after they click a button external to the map but on the same page.
At that point I am displaying a bunch of data regarding what happened in some divs outside the map.
What I want to occur now is that I want the map to darken kind of like a transparent black to give it the look that it is no longer functional and disable the map alltogether.
If you have ever worked with fancybox it would be similar to what the background screen looks like when a fancybox pulls up.
Any thoughts or ideas on this would be greatly appreciated I have been searching around but really haven't found any way to do this yet. | 0 | [
2,
8144,
6867,
13,
8,
1,
184,
92,
31,
659,
219,
2942,
17,
1460,
579,
32,
2337,
75,
21,
4155,
10840,
18,
21,
5167,
800,
3726,
3726,
86,
15,
31,
57,
679,
151,
2942,
3767,
115,
15,
47,
14,
53,
30,
31,
589,
638,
27,
871,
1121,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Phing help to upload files into S3
===
The following line sends multiple files to a S3 bucket using phing build
<property name="amazon.key" value="my_key" />
<property name="amazon.secret" value="my_secret" />
<property name="amazon.bucket" value="mybucket" />
<s3put>
<fileset dir="${project.basedir}">
<include name="**/*.jpg" />
</fileset>
</s3put>
Though it works fine I need a way to send them to a folder or subfolder? I will appretiate your help.
| 0 | [
2,
4145,
68,
448,
20,
71,
8294,
6488,
77,
13,
18,
240,
800,
3726,
3726,
14,
249,
293,
11350,
1886,
6488,
20,
21,
13,
18,
240,
12433,
568,
4145,
68,
1895,
13,
1,
10890,
106,
1084,
204,
3726,
7,
3812,
6931,
9,
4237,
7,
1923,
372... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Magento Add to cart ajax buttons not working with secure(https) cart
===
I have enabled secure cart in our magento. After that, add to cart buttons were not working. My theme has custom ajax add-to-cart buttons. Then I added following code in my template js code and add to cart button of product list page started working. But, i could not figure out how i should change the add-to-cart button code of product view(detail) page as it's not working too. I need them with my secure cart. My product detail page is under http protocol. If I manually enter product detail page with https, the add to cart button works. But, I need it working under http product detail page and works functional with secure cart page. How should I change the javascript code or any other code?
My code
if (window.location.protocol == "https:") {
url=url;
}else{
url=url.replace("https://","http://");
}
My theme: http://demo.galathemes.com/#gala-gearbox
Here is theme javascript code that's doing this job:
var test;
Event.observe(window, 'load', function () {
var containerDiv = $('containerDiv');
if(containerDiv)
test = new LightboxAJC(containerDiv);
});
function cart_form(url)
{
data = $('product_addtocart_form').serialize();
ajax_add(url,data);
}
function ajax_add(url,param)
{
tam = url.search("checkout/");
tam2 = url.search("product/");
str1 = url.substr(0,tam)+'ajaxcart/index/add/';
str2 = url.substr(tam2,url.length);
link = str1+str2;
var check = url.search("options");
if(check > 0){
window.location.href = url;
}
else{
var tmp = url.search("in_cart");
test.open();
new Ajax.Request(link, {
parameters:param,
onSuccess: function(data) {
if(tmp > 0 ) {
var host = find_host(url);
window.location.href = host+'index.php/checkout/cart/';
}
else{
//result = data.responseText;alert(result);
$('ajax_content').innerHTML = data.responseText;
if($('ajax_content').down('.top-link-cart')){
var count_cart = $('ajax_content').down('.top-link-cart').innerHTML;
$$('.top-link-cart').each(function (el){
el.innerHTML = count_cart;
});
}
if($('ajax_content').down('.block-cart')){
var ajax_product = $('ajax_content').down('.block-cart').innerHTML;
$$('.block-cart').each(function (el){
el.innerHTML = ajax_product;
});
}
if($('ajax_content').down('.col-main')){
var ajax_result = $('ajax_content').down('.col-main').innerHTML;
$$('.ajaxcart_row1').each(function (el){
el.innerHTML = ajax_result;
});
}
$('ajax_loading').hide();
$('ajaxcart_conent').show();
Event.observe('closeLink', 'click', function () {
test.close();
$$('.ajaxcart_row1').each(function (el){
el.innerHTML = '';
});
$('ajax_loading').show();
});
}
}
});
}
}
function setLocation(url){
if (window.location.protocol == "https:") {
url=url;
}else{
url=url.replace("https://","http://");
}
var tam = url.search("checkout/cart/");
if(tam > 0) ajax_add(url);
else window.location.href = url;
}
document.observe("dom:loaded", function() {
var cartInt = setInterval(function(){
if (typeof productAddToCartForm != 'undefined'){
if(test){
var tam = $('product_addtocart_form').serialize();
var check = tam.search("ajaxcart");
if(check < 0){
productAddToCartForm.submit = function(url){
if(this.validator && this.validator.validate()){
cart_form($('product_addtocart_form').readAttribute('action'));
clearInterval(cartInt);
}
return false;
}
}
}
} else {
clearInterval(cartInt);
}
},500);
});
function find_host(url)
{
var tmp = url.search("index.php");
var str = url.substr(0,tmp)
return str;
}
| 0 | [
2,
4723,
17050,
3547,
20,
6420,
20624,
12861,
52,
638,
29,
4315,
5,
21127,
18,
6,
6420,
800,
3726,
3726,
31,
57,
9338,
4315,
6420,
19,
318,
4723,
17050,
9,
75,
30,
15,
3547,
20,
6420,
12861,
46,
52,
638,
9,
51,
3184,
63,
5816,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Flot will not Zoom with xaxis in time mode
===
My graph zoomed great until I changed the xaxis to mode: "time". Now I can't zoom. The graph renders and looks good, but does not zoom. Does FLOT support zooming for time based graphs?
Thanks
$(function () {
var line1_data = [[1309507200000,82], [1310112000000,76], [1310976000000,71], [1311235200000,76], [1311753600000,82]];
var line2_data = [[1309507200000,60], [1310112000000,40], [1311235200000,60], [1311753600000,80], [1318233600000,60]];
var data = [line1_data, line2_data];
var placeholder2 = $("#placeholder2");
var options = {
series: { lines: { show: true }, shadowSize: 0 },
xaxis: { mode: "time", zoomRange: [0.1, 10] },
yaxis: { zoomRange: [0.1, 10] },
zoom: { interactive: true }
};
var plot = $.plot(placeholder2, data, options);
}); | 0 | [
2,
9319,
38,
129,
52,
19469,
29,
993,
19676,
19,
85,
3740,
800,
3726,
3726,
51,
7210,
19469,
69,
374,
163,
31,
1015,
14,
993,
19676,
20,
3740,
45,
13,
7,
891,
7,
9,
130,
31,
92,
22,
38,
19469,
9,
14,
7210,
16535,
18,
17,
187... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Open Graph referral URLs from large aggregations extremely long
===
In a large aggregation of ~90 Open Graph actions performed by a single user, the query string part of the object URLs are extremely long (approx. 8KB).
This is causing our servers to crash as they are not configured to handle such long query strings and having already increased our maximum allowed query string length we feel increasing it further to be unfeasible as we don't know how large these URLs will go before FB do something to restrict them.
It appears that the recently used parameter fb_action_types is gone and in it's place action_type_map and action_object_map include mappings for every single object in the aggregation.
How large are we expected to increase our servers' **maxQueryStringLength** in order to handle these URLs? Should they be delivered in a POST when they get this large?
I've logged a bug on the Facebook developers site so that they are aware of this issue:
http://developers.facebook.com/bugs/391678330885746?browse=search_50125698681389e40279519 | 0 | [
2,
368,
7210,
28679,
13,
911,
7532,
37,
370,
27255,
18,
3898,
175,
800,
3726,
3726,
19,
21,
370,
27255,
16,
13,
1,
3165,
368,
7210,
3078,
986,
34,
21,
345,
4155,
15,
14,
25597,
3724,
141,
16,
14,
3095,
13,
911,
7532,
50,
3898,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Definition of the Monad Instance of Data.Stream
===
The monad instanc of Data.Stream is defined that way:
instance Monad Stream where
return = repeat
xs >>= f = join (fmap f xs)
where
join :: Stream (Stream a) -> Stream a
join ~(Cons xs xss) = Cons (head xs) (join (map tail xss))
That means `join` takes the first element of the first stream, the second element of the second stream etc, so the resulting stream can be seen as "main diagonal", discarding all other elements.
Now there is a way to go through an infinite two-dimensional table, discovered by Georg Cantor for his proof that there are as many rational numbers as natural numbers: http://www.jcu.edu/math/vignettes/infinity.htm
Now my question is if a `join` using a path along all secondary diagonals (visiting every element of every stream) would be a valid implementation as well. Or would this violate one of the monad laws? | 0 | [
2,
5465,
16,
14,
9154,
43,
4851,
16,
1054,
9,
11260,
800,
3726,
3726,
14,
9154,
43,
19,
6114,
150,
16,
1054,
9,
11260,
25,
2811,
30,
161,
45,
4851,
9154,
43,
3766,
113,
788,
800,
6830,
993,
18,
13,
1,
3726,
398,
800,
1865,
13,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WPF - Button on ListBox Item
===
I have a ListBox filled with items. Some of the items may have buttons or links within RichTextBlock inside. I want to fire different action either when the item is pressed or when the button is pressed. The problem is when I hit the button, also the action connected with the item itself is fired. How can I prevent fireing the event of list item when the button inside is pressed? | 0 | [
2,
619,
7721,
13,
8,
5167,
27,
968,
5309,
9101,
800,
3726,
3726,
31,
57,
21,
968,
5309,
1943,
29,
3755,
9,
109,
16,
14,
3755,
123,
57,
12861,
54,
6271,
363,
2042,
11969,
12048,
572,
9,
31,
259,
20,
535,
421,
1028,
694,
76,
14,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
center div blocks but not in the last row
===
I'm really stuck with trying to keep div blocks centered with the exception of the last row.
Someone else already created this fiddle that kind of demonstrates my question. You can see how the blocks in the result panel stay centered even when the window is resized. I would like to have similar behavior BUT if the last row contains less blocks than the rows above, then that last row should not get centered but left aligned.
Here is the fiddle:
http://jsfiddle.net/zbbHc/1/
Someone might ask why I don't just use float:left. The problem with that is that I couldn't find a way of centering my blocks using that method without also specifying a fixed width for my wrapper. I'm trying to keep everything as liquid as possible. | 0 | [
2,
459,
13,
12916,
5198,
47,
52,
19,
14,
236,
3131,
800,
3726,
3726,
31,
22,
79,
510,
4549,
29,
749,
20,
643,
13,
12916,
5198,
10583,
29,
14,
5391,
16,
14,
236,
3131,
9,
737,
962,
614,
679,
48,
12759,
30,
825,
16,
19466,
51,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
not able to get jscrollpane working with jquery ui layout
===
I am trying to use jscrollpane.js along with jquery ui layout. I am not getting any errors but there is no scroll bar on my west and center sections. I have included these in my html header section:
<link rel="stylesheet" type="text/css" href="layout-default-latest.css" />
<link rel="stylesheet" type="text/css" href="jquery.scrollpane.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"> </script>
<script type="text/javascript" src=" http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.js"> </script>
<script type="text/javascript" src="jquery.ui.all"></script>
<script type="text/javascript" src="script/jquery.mousewheel.js"></script>
<script type="text/javascript" src="script/jquery.scrollpane.js"></script>
<script type="text/javascript" src="jquery.layout-latest.js"></script>
<script type="text/javascript" src="jquery.layout-latest.min.js"></script>
I have also updated the html file with right path to the scroll images as below:
.jScrollPaneTrack
{
background: url(img/osx_track.gif) repeat-y;
}
No errors, page runs fine. Any ideas I am missing anything?
| 0 | [
2,
52,
777,
20,
164,
487,
3862,
8694,
16660,
638,
29,
487,
8190,
93,
13,
5661,
9106,
800,
3726,
3726,
31,
589,
749,
20,
275,
487,
3862,
8694,
16660,
9,
728,
18,
303,
29,
487,
8190,
93,
13,
5661,
9106,
9,
31,
589,
52,
1017,
186... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jquery - intercept, calculate and show in real time the list boxes choices
===
I've a simple and elementary jquery function for calculate the quantities * unit prices + taxes and subtotals for some products and then the total. I wish to show in real time, with jquery, the taxes imports for the different taxes rates, based on user choices in the list boxes. I found an elementary method for 2 products but for 3 or many, my method don't work: please help me? ;)
This is my code:
<script type='text/javascript'>//<![CDATA[
$(function(){
$('#q1,#pu1,#tax1,#tax2,#q2,#pu2').change(function() {
var q1 = parseFloat($('#q1').val(), 10);
var qval1 = 0;
if (q1 > 0) {
qval1 = q1;
}
var q2 = parseFloat($('#q2').val(), 10);
var qval2 = 0;
if (q2 > 0) {
qval2 = q2;
}
var pu1 = parseFloat($('#pu1').val(), 10);
var puval1 = 0;
if (pu1 > 0) {
puval1 = pu1;
}
var pu2 = parseFloat($('#pu2').val(), 10);
var puval2 = 0;
if (pu2 > 0) {
puval2 = pu2;
}
var subtot1 = 0;
subtot1 = parseFloat(qval1 * puval1);
var subtot2 = 0;
subtot2 = parseFloat(qval2 * puval2);
var subtot = 0;
subtot = subtot1 + subtot2;
var tax1 = parseFloat($('#tax1').val(), 10);
var tax2 = parseFloat($('#tax2').val(), 10);
var ivaprice1 = 0;
var ivaprice2 = 0;
if (tax1 > 0) {
ivaprice1 = subtot1 * tax1 / 100;
}
if (tax2 > 0) {
ivaprice2 = subtot2 * tax2 / 100;
}
var ivaprice = 0;
ivaprice = parseFloat(ivaprice1 + ivaprice2);
var ivatext = "";
ivatext = "tax ";
$('#total').html(parseFloat(subtot + ivaprice).toFixed(2));
$('#tasse').html(parseFloat(ivaprice).toFixed(2));
$('#imp').html(parseFloat(subtot).toFixed(2));
$('#subtot1b').html(parseFloat(subtot1).toFixed(2));
$('#subtot2b').html(parseFloat(subtot2).toFixed(2));
if (tax2 == tax1) {
$('#taxw').html(parseInt(tax1));
$('#taxtxt2').html('');
$('#taxw2').html('');
$('#taxv').html(parseFloat(ivaprice).toFixed(2));
$('#taxv2').html('');
$('#taxtxt2b').html('');
}
else
{
$('#taxw').html(parseInt(tax1));
$('#taxw2').html(parseInt(tax2));
$('#taxtxt2').html('tax');
$('#taxtxt2b').html('%:');
$('#taxv').html(parseFloat(ivaprice1).toFixed(2));
$('#taxv2').html(parseFloat(ivaprice2).toFixed(2));
}
});
});//]]>
</script>
</head>
<body>
<p>q1 :
<input id="q1" value="0"/>
pu1 :
<input id="pu1" value="0"/>
tax1:
<select name="tax1" id="tax1">
<option value="4">4</option>
<option value="21">21</option>
<option value="16">16</option>
</select>
</p>
<p>q2 :
<input id="q2" value="0"/>
pu2 :
<input id="pu2" value="0"/>
tax2 :
<select name="tax2" id="tax2">
<option value="4">4</option>
<option value="21">21</option>
<option value="16">16</option>
</select>
<br>
<br>subtot1: <span id="subtot1b"></span><br>
subtot2: <span id="subtot2b"></span><br>
tax <span id="taxw"></span>%: <span id="taxv"></span><br>
<span id="taxtxt2"></span> <span id="taxw2"></span><span id="taxtxt2b"></span> <span id="taxv2"></span><br>
s
taxable: €<span id="imp"></span><br>
Tax: €<span id="tasse"></span><br>
Total price : £<span id="total"></span></p>
</body> | 0 | [
2,
487,
8190,
93,
13,
8,
18324,
15,
18469,
17,
298,
19,
683,
85,
14,
968,
8120,
10978,
800,
3726,
3726,
31,
22,
195,
21,
1935,
17,
3210,
487,
8190,
93,
1990,
26,
18469,
14,
13787,
1637,
1237,
7334,
2754,
7447,
17,
972,
20148,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
HG reviewboard installation on Win7 x64
===
While it was stated that it's not the best idea to host a reviewboard for mercurial on windows evironment I stil gave it a try. So far I have not succeeded. And thus I am in search of help.
I am running Windows 7 x64 and have followed this installation guide:
http://www.reviewboard.org/docs/manual/dev/admin/installation/windows/
Here I had no problems, problem occured when I chose wsgi. Now I am using Apache 2.2 32bit, python 2.5.4 32 bit and I have downloaded an apache wsgi module from: http://code.google.com/p/modwsgi/wiki/InstallationOnWindows
Strangly enough they don't have module for this particular combo (Apache 2.2|python 2.5) so I grabbed the closest thing: mod_wsgi-win32-ap22py26-3.3.so - Apache 2.2 / Python 2.6
Still I did not consider win32 would be of any problems for win64 huh ?
Well after I have told Apache2.2 in it's httpd.conf to "LoadModule wsgi_module modules/mod_wsgi.so" that I have put in modules folder, here is what it told me:
httpd.exe: Syntax error on line 129 of G:/tools/Apache2/conf/httpd.conf: Cannot load __G:/tools/Apache2/modules/mod_wsgi.so into server: %1 is not a valid Win32 application.__
Is this cause I use python 2.5 not 2.6 AND/OR windows 7 64 ? And if it's has any relation to python version - I couldn't find wsgi mod for 2.5 at least not downloadable version, only sources that need to be compiled and then some.
Has anyone faced similar problems and could advice or give hint how to load those that wsgi module ? | 0 | [
2,
13,
18187,
1487,
2806,
7758,
27,
628,
465,
993,
3470,
800,
3726,
3726,
133,
32,
23,
1240,
30,
32,
22,
18,
52,
14,
246,
882,
20,
2015,
21,
1487,
2806,
26,
9046,
3594,
192,
27,
1936,
13,
11751,
2075,
1130,
31,
13146,
492,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Negative port number in http request
===
What happens if the http request has a negative port number.
Anyone could help me towards this.
I need this for some testing purpose. | 0 | [
2,
3682,
1295,
234,
19,
7775,
3772,
800,
3726,
3726,
98,
5531,
100,
14,
7775,
3772,
63,
21,
3682,
1295,
234,
9,
1276,
110,
448,
55,
1016,
48,
9,
31,
376,
48,
26,
109,
4431,
2131,
9,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How does 'git log --graph' or 'hg graphlog' work?
===
I know that the history in Git is stored in a data structure called a DAG. I've heard about DFS and know it's somewhat related.
I'm curious, how do programs such as `git log --graph` or `hg graphlog` draw the history? I always thought it's quite complicated to draw the lanes and everything in such a nice way.
Could someone write some pseudo code that demonstrates it?
note: I tried looking around Git or hg's code but it's very hard to follow and get a general idea of what's going on. | 0 | [
2,
184,
630,
13,
22,
10404,
6738,
13,
8,
8,
9614,
22,
54,
13,
22,
18187,
7210,
5567,
22,
170,
60,
800,
3726,
3726,
31,
143,
30,
14,
447,
19,
13,
10404,
25,
8214,
19,
21,
1054,
1411,
227,
21,
10467,
9,
31,
22,
195,
752,
88,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Eclipse Maven Web Project Servlet Mappings
===
I have set up my maven project using the m2e plugin in eclipse indigo, and transformed it to an eclipse dynamic web project using `mvn eclipse:eclipse -Dwtpversion=1.5`. I have managed to get the project up and running in tomcat7, except for my servlets, for which I cannot create the servlet mappings.
I have tried modifying the web.xml file but it throws a ClassNotFoundException. Directory Structure and web.xml :
(ROOT)
+src
+main
+resources
+DrawInitialMap.java
+webapp
(WebContent here)
<web-app>
<servlet>
<servlet-name>DrawInitialMap</servlet-name>
<servlet-class>(groupId).(artifactId).src.main.resources.DrawInitialMap</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>DrawInitialMap</servlet-name>
<url-pattern>/drawInitialMap.do</url-pattern>
</servlet-mapping>
(...)
</web-app>
While the @WebServlet annotation also fails to map the servlet :
@WebServlet(name="drawInitialMap", description="visualizes ttrp on html5 canvas", urlPatterns={"/drawInitialMap.do"})
Thank you in advance, and notify if you need any more of the code.
PS : Keep in mind that the servlet worked perfectly in Dynamic Web Project mode, without Maven | 0 | [
2,
11652,
1216,
3124,
2741,
669,
13,
10321,
1336,
13305,
18,
800,
3726,
3726,
31,
57,
309,
71,
51,
1216,
3124,
669,
568,
14,
307,
135,
62,
10922,
108,
19,
11652,
22655,
15,
17,
8445,
32,
20,
40,
11652,
7782,
2741,
669,
568,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
NullPointer Exception when setting the Adapter for a ListView
===
`Adapter class :::
package com.yellow.adapter;
import java.util.ArrayList;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.yellow.R;
import com.yellow.VLogger;
public class YAdapter extends ArrayAdapter<String> {
ArrayList<String> items;
Context context;
private LayoutInflater mInflater;
static class ViewHolder {
TextView yName;
}
public YAdapter(Context context,ArrayList<String> items) {
super(context, R.layout.single_item_list_row, items);
this.context=context;
mInflater = LayoutInflater.from(context);
this.items = items;
}
@Override
public int getCount() {
return items.size();
}
@Override
public String getItem(int arg0) {
return items.get(arg0);
}
@Override
public long getItemId(int arg0) {
return arg0;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
final ViewHolder holder;
if(convertView == null) {
convertView = mInflater.inflate(R.layout.single_item_list_row, null);
holder = new ViewHolder();
holder.yName=(TextView)convertView.findViewById(R.id.text1);
convertView.setTag(holder);
}
else {
holder = (ViewHolder) convertView.getTag();
}
try
{
if(items.get(position) != null)
holder.yName.setText(items.get(position));
}
catch (Exception e) {
Log.e("ERROR","Adapter error in generating view);
}
return convertView;
}
}
Activity Class ::
@EActivity(R.layout.main)
public class Activity extends Activity {
@ViewById(R.id.list)
ListView listView;
ArrayList<String> temp = new ArrayList<String>();
YAdapter adapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
adapter = new YAdapter(YellowPagesActivity.this , temp);
listView.setAdapter(adapter);
}
@Override
public void onResume() {
super.onResume();
temp.add("one");
temp.add("two");
temp.add("three");
temp.add("four");
adapter = new YAdapter(YellowPagesActivity.this , temp);
**listView.setAdapter(adapter);** -- exception
}
}
listView.setAdapter(adapter);
this line causes an exception.
when i try setting adapter to list it gives error if i remove this line no error is displayed and also no components on screen are displayed only a black screen appears
| 0 | [
2,
16203,
3132,
106,
5391,
76,
2697,
14,
9924,
106,
26,
21,
968,
4725,
800,
3726,
3726,
13,
1,
27576,
106,
718,
13,
45,
45,
45,
6030,
13,
960,
9,
17589,
9,
27576,
106,
73,
9010,
8247,
9,
14255,
9,
8576,
93,
5739,
73,
9010,
130... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Disable Access To SQL Server Database Via SQL Server Management Studio
===
Apologies in advance for the long post, I am trying to be as clear as possible. Is there a way to disable a user / Windows AD group accessing a database via SQL Server Management Studio (SSMS)?
I have an desktop application that uses a SQL Server 2005 database. The application runs as the user logged onto the machine (unfortunately we can't change that otherwise this would be simple). The database is permissioned with groups (but it would apply to users as well) to give access to the appropriate schemas and objects that the user requires. The users have (and need) the ability to select, insert, update and delete data to complete their process.
The application carries out a series of validation and auditing steps on the user input to ensure they are entering decent data (and for some additional business processing). A user could open SSMS and make these changes through the query editor avoiding the application completely which is what we are trying to avoid. What I am looking for is a way to stop the users updating the database through any tool other than the application provided.
I have found a couple of similar posts (including http://stackoverflow.com/questions/898380/how-to-disable-sql-server-management-studio-for-a-user) but these don't quite cover this issue as they work on restricting user access or using different logins.
The only solution I can think of at the moment is to have a set of tables where the user data goes initially and then another process picks this up, runs the application processes on and then puts the data into the master / source tables. Then I could restrict user access to the master tables. | 0 | [
2,
1460,
579,
1381,
20,
4444,
255,
8128,
6018,
1197,
4444,
255,
8128,
1097,
1120,
800,
3726,
3726,
27101,
19,
3612,
26,
14,
175,
678,
15,
31,
589,
749,
20,
44,
28,
1207,
28,
938,
9,
25,
80,
21,
161,
20,
1460,
579,
21,
4155,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cannot assert against object
===
This is probably a very simple Object Oriented Programming question. What I am trying to do is take 2 empty objects, use a query to pull data from a database, populate the empty objects with the data returned from the query, and then assert against them. See the code below:
object test1;
object test2;
using (SqlConnection dbconnection = new SqlConnection(expconnstr))
{
dbconnection.Open();
var expcommand = new SqlCommand(expectedquery, dbconnection);
var actcommand = new SqlCommand(actualquery, dbconnection);
using (SqlDataReader expreader = expcommand.ExecuteReader())
{
if (expreader.Read())
{
test1 = expreader.GetValue(0);
expreader.Close();
}
}
using (SqlDataReader actreader = actcommand.ExecuteReader())
{
if (actreader.Read())
{
test2 = actreader.GetValue(0);
actreader.Close();
}
}
}
Assert.AreSame(test1, test2);
I wrote a very similar test method in VB following the same patterns and the VB code executed just fine. However whilst transitioning from VB to C#, I run into issues such as these. The compiler says "Use of unassigned variable" at the assert. However, I thought I was assigning to a value within the code block above. What am I doing wrong? | 0 | [
2,
1967,
10908,
149,
3095,
800,
3726,
3726,
48,
25,
910,
21,
253,
1935,
3095,
13,
6800,
3143,
1301,
9,
98,
31,
589,
749,
20,
107,
25,
247,
172,
2424,
3916,
15,
275,
21,
25597,
20,
2201,
1054,
37,
21,
6018,
15,
1675,
12383,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Exception throw while creating a delete query in EntityManager
===
simply here is the method
public void deleteVotesByReplyID(long replyId){
EntityManager em = getEntityManager();
try {
int re = em.createQuery("delete object(o) from Vote as o where o.memberReply.id = '"+replyId+"' ").executeUpdate();
} finally {
em.close();
}
}
where is the wrong of above query? used jpa 1.0 | 0 | [
2,
5391,
3814,
133,
2936,
21,
27448,
25597,
19,
9252,
22256,
800,
3726,
3726,
1659,
235,
25,
14,
2109,
317,
11364,
27448,
28195,
18,
779,
99,
306,
102,
1340,
5,
2701,
6504,
1340,
6,
1,
9252,
22256,
3579,
800,
164,
2291,
856,
22256,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PHP execute Select statement - Beginner
===
I have entered the following `SQL` to my `mysql`.
insert into hospital (name,age) values ('william', 'select * from department where age = $agegrp');
Now i have fetched this value (the sql), and trying to execute it. how can i do this ?
I have fetched the `select`statement, into a variable call `$var`. Now how can i execute it
$agegrp = "10";
$value = mysql_query ($var) or die ('error');
I only get `error` so something is wrong with my query that i inserted. how can i solve this ?
| 0 | [
2,
13,
26120,
15644,
5407,
3331,
13,
8,
26931,
800,
3726,
3726,
31,
57,
1297,
14,
249,
13,
1,
18,
22402,
1,
20,
51,
13,
1,
915,
18,
22402,
1,
9,
14692,
77,
980,
13,
5,
7259,
15,
1303,
6,
4070,
13,
5,
22,
15034,
22,
15,
13,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Subtleties of SQL Variables
===
All, I have the following SQL Stored Procedure (SP)
CREATE PROCEDURE ispsDcOhcAgg @TmpTableName NVARCHAR(50), @ListItem NVARCHAR(50)
AS
IF EXISTS (SELECT name
FROM sys.tables
WHERE name = @TmpTableName)
DROP TABLE @TmpTableName; -- This will not work.
GO
This will clearly not work (see the comment in the above snippit). The only (and very ugly) way I have found to get around this problem is to do the following
CREATE PROCEDURE ispsDcOhcAgg @TmpTableName NVARCHAR(50), @ListItem NVARCHAR(50)
AS
DECLARE @SQL NVARCHAR(4000)
SET @SQL = N'IF EXISTS (SELECT name ' +
N'FROM sys.tables ' +
N'WHERE name = N' + N'''' + @TmpTableName + N''') ' +
N'DROP TABLE ' + @TmpTableName + N';'
EXEC sp_executesql @SQL;
GO
which truly stinks and for large SPs is horrendous!
**Is there another way of doing this that I don't know about?**
Thanks for your time. | 0 | [
2,
11065,
3915,
16,
4444,
255,
12157,
800,
3726,
3726,
65,
15,
31,
57,
14,
249,
4444,
255,
8214,
7004,
13,
5,
3401,
6,
1600,
7004,
25,
1919,
7201,
1134,
793,
4572,
13,
1,
38,
2554,
5924,
7259,
13,
103,
3311,
5433,
5,
2290,
6,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get unique id or value of every node in jtree?
===
I am new to jtree. I want to get the unique id or value of individual nodes which have same parent.
I tried with valuechanged() method, but i am able to get only the string value of every node.
I want to compare the current selecting node with some unique value of particular node. How can i achieve this?
I think i am making clear.
Is there any possibilites available?
Thanks in advance.. | 0 | [
2,
184,
20,
164,
2619,
4924,
54,
1923,
16,
352,
15421,
19,
487,
8101,
60,
800,
3726,
3726,
31,
589,
78,
20,
487,
8101,
9,
31,
259,
20,
164,
14,
2619,
4924,
54,
1923,
16,
1359,
16272,
56,
57,
205,
4766,
9,
31,
794,
29,
1923,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
each(:as => :hash) works on localhost but not on Heroku
===
In the Rails code on my computer, I'm writing a pure SQL query (I love SQL) and then parsing the results with:
friends.each(:as => :hash) do |row|
This all works fine, but when I try to push it to Heroku, I get the following error:
ArgumentError (wrong number of arguments(1 for 0)):
And it's complaining about the each loop. Why could this be happening, is Heroku somehow behind, like with an older version of Ruby where you can't do this? Or is it a MySQL vs. PostGreSQL (I'm using MySQL on my computer) thing?
| 0 | [
2,
206,
5,
45,
472,
800,
1,
13,
45,
25436,
6,
693,
27,
375,
11694,
47,
52,
27,
36,
9266,
800,
3726,
3726,
19,
14,
2240,
18,
1797,
27,
51,
1428,
15,
31,
22,
79,
1174,
21,
4267,
4444,
255,
25597,
13,
5,
49,
339,
4444,
255,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I make a external phpbb-login without redirecting to another page?
===
It's possible to make an external login with the following code
<form action="./phpBB3/ucp.php?mode=login" method="post">
<h3><a href="./phpBB3/ucp.php?mode=login">Login</a> • <a href="./phpBB3/ucp.php?mode=register">Register</a></h3>
<fieldset>
<label for="username">Username:</label>
<input type="text" name="username" id="username" size="10" title="Username" />
<label for="password">Password:</label>
<input type="password" name="password" id="password" size="10" title="Password" />
<input type="submit" name="login" value="Login" />
</fieldset>
</form>
but this will end you up at the forum index.
If you add
<input type="hidden" name="redirect" value="./somefile.html" />
you can get it to redirect back to the page you started at, but you will still have needlessly gone to another page only to come back and have lost everything you have done on that page.
Does anyone have an idea how to make a system that lets you login without leaving the page? Maybe something with an iframe? | 0 | [
2,
184,
92,
31,
233,
21,
4886,
13,
26120,
3490,
8,
5567,
108,
366,
302,
14706,
68,
20,
226,
2478,
60,
800,
3726,
3726,
32,
22,
18,
938,
20,
233,
40,
4886,
6738,
108,
29,
14,
249,
1797,
13,
1,
4190,
1028,
3726,
7,
9,
118,
261... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MATLAB/OCTAVE- Numerical integration of an integrand containing terms obtained from numerical solution of a system of ODE
===
I want to calculate the following integral on Octave(or Matlab):
![enter image description here][1]
However, I don't have an explicit expression for H and K. The H and K are actually numerical solutions of the following differential equations.
![enter image description here][2]
[1]: http://i.stack.imgur.com/cofQQ.jpg
[2]: http://i.stack.imgur.com/Q6CLO.jpg
How do I go about doing this? Can I solve it directly somehow, or do I need to find the numerical solutions to H and K first, find a polynomial approximation, and then integrate? I am completely new to Matlab and numerical methods, so a detailed method describing everything will be most appreciated. | 0 | [
2,
4277,
9086,
118,
20303,
195,
8,
16010,
8078,
16,
40,
13,
12370,
290,
3503,
1663,
3048,
37,
16010,
4295,
16,
21,
329,
16,
13,
8355,
800,
3726,
3726,
31,
259,
20,
18469,
14,
249,
9315,
27,
22582,
5,
248,
4277,
9086,
6,
45,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Configure ScalaQuery in a Play 2.0 project
===
I wanted to try out using ScalaQuery with the Play! Framework (version 2.0.2) but I can't get it to work. I added the following line to the Build.scala file :
val appDependencies = Seq(
"org.scalaquery" %% "scalaquery" % "0.9.5"
)
But when I run the 'play dependencies' command i keep getting
sbt.ResolveException: unresolved dependency: org.scalaquery#scalaquery_2.9.1;0.9.5: not found
I tried to add the jars to the IntelliJ but obviously that wasn't enough, and I have no idea how I would get play to recognize the jars.
Has anyone succeded to get ScalaQuery (or Slick) to work in Play 2 ?
| 0 | [
2,
1065,
15951,
25975,
8190,
93,
19,
21,
418,
172,
9,
387,
669,
800,
3726,
3726,
31,
417,
20,
1131,
70,
568,
25975,
8190,
93,
29,
14,
418,
187,
6596,
13,
5,
10898,
172,
9,
387,
9,
135,
6,
47,
31,
92,
22,
38,
164,
32,
20,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SVGKit does not show potrace generated images
===
I'm generating a svg image from a bmp image with [potrace][1]. The generated image shows fine in Illustrator, but when I try to show it with [SVGKit][2] on an iPad it loads a blank image.
SVGKit works with svg-images I've created with Illustrator.
To simplify things I have created a bmp image with a simple black line.
This is what Illustrator generates (SVGKit does show this correct):
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="1024px" height="768px" viewBox="0 0 1024 768" enable-background="new 0 0 1024 768" xml:space="preserve">
<g>
<g>
<path fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" d="M1,0c341,0,682.001,0,1023,0c0,255.995,0,512.006,0,768
c-341.333,0-682.667,0-1024,0C0,513,0,258,0,3C-0.086,1.581-0.165,0.168,1,0z M160,391c0,5.667,0,11.333,0,17
c204.999,0,410,0,615,0c0-6.667,0-13.333,0-20c-204.661,0-409.337,0-614,0C159.835,388.168,159.914,389.581,160,391z"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M161,388c204.663,0,409.339,0,614,0c0,6.667,0,13.333,0,20
c-205,0-410.001,0-615,0c0-5.667,0-11.333,0-17C159.914,389.581,159.835,388.168,161,388z"/>
</g>
</g>
</svg>
This is what potrace generates (SVGKit does not show this correct, but Illustrator does):
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="1024.000000pt" height="768.000000pt" viewBox="0 0 1024.000000 768.000000" preserveAspectRatio="xMidYMid meet">
<metadata>
Created by -protrace define- -version define-, written by Peter Selinger 2001-2011
</metadata>
<g transform="translate(0.000000,768.000000) scale(0.100000,-0.100000)" fill="#000000" stroke="none">
<path d="M1600 3700 l0 -100 3075 0 3075 0 0 100 0 100 -3075 0 -3075 0 0 -100z"/>
</g>
</svg>
So as far as I can see there is some differences in the headers, but even if I use the exact same header from Illustrator's result in potrace's result, SVGKit still can't show it.
What is wrong with potrace's result since SVGKit can't show it?
[1]: http://potrace.sourceforge.net/
[2]: https://github.com/SVGKit/SVGKit/ | 0 | [
2,
13,
18,
22955,
13703,
630,
52,
298,
3997,
7367,
6756,
3502,
800,
3726,
3726,
31,
22,
79,
13500,
21,
13,
18,
22955,
1961,
37,
21,
334,
2554,
1961,
29,
636,
4296,
7367,
500,
2558,
165,
500,
9,
14,
6756,
1961,
1285,
1123,
19,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Giving input to a Python file and recieving output?
===
I'm pretty new to Python and I'm trying to do something. I'm using a Python IRC bot which let's me build functions that are used as commands on the channel. I have obtained a python version of Cleverbot and would like to link these 2 together. But becuase I'm not good with Python I'm not sure how to do it.
To use the cleverbot python I would simply type in a terminal:
python cleverbot.py
And it would give me a "> " where I can input. Then I say on that line "Hello" and the cleverbot script will print the result using a print command.
So, I've been messing around and have discovered I can use the Python IRC bot commands to print a string, so it will simply print the results string for me. The problem is I can't get it to input anything to the cleverbot script. I was hoping it was possible to do something like:
print python cleverbot.py "hello"
And it would simply print the response from Cleverbot, does that make sense? I could then simply use the IRC commands to print the response to the channel.
Thanks in advance, and I hope it was possible to understand. | 0 | [
2,
1438,
6367,
20,
21,
20059,
3893,
17,
13,
15110,
2443,
68,
5196,
60,
800,
3726,
3726,
31,
22,
79,
1772,
78,
20,
20059,
17,
31,
22,
79,
749,
20,
107,
301,
9,
31,
22,
79,
568,
21,
20059,
31,
5453,
11012,
56,
408,
22,
18,
55,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to use |float to show just two digits after decimal point?
===
I am using Flask/Jinja2 template to show a number using **|float** filter.
Here is my code
{% set proc_err = nb_err|length / sum * 100 %}
({{proc_err|float}}%)
Output is a bit awkward:
17/189 (8.99470899471%)
I am looking for a way to make the places after dot limited to a number e.g. 2.
Desired output:
17/189 (8.99%) | 0 | [
2,
184,
20,
275,
13,
1,
14712,
721,
20,
298,
114,
81,
19076,
75,
26380,
454,
60,
800,
3726,
3726,
31,
589,
568,
28972,
118,
8249,
1004,
135,
22894,
20,
298,
21,
234,
568,
13,
1409,
1,
14712,
721,
1409,
11945,
9,
235,
25,
51,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to return XML from SQL Server 2008 that is structured with multiple selections sharing a common parent
===
I've tried using "FOR XML PATH", "FOR XML EXPLICIT" and "FOR XML AUTO" but the data is never structured with the correct heirarchy.
Basically, I have one parent table (Customers) and 3 child tables. Each table has a customerid column. There is a one-to-many relationship from the Customers table to each of the 3 child tables.
As a mock example, I have a parent "Customers" table, and I have 3 other tables - Products, Hobbies and Vehicles - all related to the Customers table by a customerid.
What is the SQL code to achieve the following kind of structure -
<Customers>
<Customer customerid="1" name="Fred">
<Products>
<Product productname="table" />
<Product productname="chair" />
<Product productname="wardrobe" />
</Products>
<Hobbies>
<Hobby hobbyname="Golf" />
<Hobby hobbyname="Swimming" />
</Hobbies>
<Vehicles>
<Vehicle name="Car" color="Red" />
<Vehicle name="Bicycle" color="Blue" />
</Vehicles>
</Customer>
<Customer customerid="2" name="Sue">
<Products>
<Product productname="CD player" />
<Product productname="Picture frame" />
</Products>
<Hobbies>
<Hobby hobbyname="Dancing" />
<Hobby hobbyname="Reading" />
</Hobbies>
<Vehicles>
<Vehicle name="Car" color="Yellow" />
</Vehicles>
</Customer>
</Customers> | 0 | [
2,
184,
20,
788,
23504,
37,
4444,
255,
8128,
570,
30,
25,
17784,
29,
1886,
3155,
18,
6126,
21,
757,
4766,
800,
3726,
3726,
31,
22,
195,
794,
568,
13,
7,
1106,
23504,
2013,
7,
15,
13,
7,
1106,
23504,
14990,
7,
17,
13,
7,
1106,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Gridview with drill down
===
Hello guys I need your help, I have a project in my hand that is to use gridviews with drilldown, I have to be able to click a button or on the line and extends down another line with detailed information, I already have code for the button expand and collapse and change the button but can not do both at the same time and was exactly what I wanted, when he clicked on the more expanded and changed the image to a less and less changed when clicked on for more and collapsed detailed information.
Thank you :)
| 0 | [
2,
7354,
4725,
29,
10495,
125,
800,
3726,
3726,
10975,
2776,
31,
376,
154,
448,
15,
31,
57,
21,
669,
19,
51,
224,
30,
25,
20,
275,
7354,
4725,
18,
29,
10495,
2968,
15,
31,
57,
20,
44,
777,
20,
10840,
21,
5167,
54,
27,
14,
29... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Haskell - Does "IO ( )" means we give up the control of our program?
===
We know that within a Haskell program, almost every piece of computation will return something, and such return values can be captured by another computation to apply more transformations on it. So if we "flatten" a normal Haskell program, it should be:
-- pure `a`: comes from Hask; not from file, network or any
-- other side-effected devices
a → a' → a'' → a''' → .... → a_fin
Of course, this pure value might be "contexted". But we can still trace the path of alternating:
a → m a → m a' → a'' → n a''' → ... → z a_fin
For me, this shows that we can control our program to avoid side-effects and other 'surprises', which may be caused by missing of type system or our self. But when the `IO ()` appears, there seems a missing:
--!! What happened between the IO () and the next computation ?
a → m a → m a' → IO () >> b → b' → m b'
The `IO ()` seems passing/receiving nothing, but it MUST read/write something at least. Especially if we consider the "receiver" process:
Sender:: a → m a → m a' → IO () >> b → b' → m b' ... → m b_fin
Receiver:: IO a' → IO a'' → IO a''' → ... → IO a_fin
In the sender, we can't see what happened on `a` after the `IO ()` . But if we consider both two processes , the missing part is back ! So we can say we missed or not missed the information, according to your point of view. Is this a information leak, and we just give up the control of our program, when we put the `IO ()` in the program ?
Thanks !
PS. Oh,and I also found that the Receiver, can only start computation with a "contexted" value, not a pure value, it's another question occurs in my mind...
| 0 | [
2,
63,
16507,
13,
8,
630,
13,
7,
1963,
13,
5,
13,
6,
7,
1108,
95,
590,
71,
14,
569,
16,
318,
625,
60,
800,
3726,
3726,
95,
143,
30,
363,
21,
63,
16507,
625,
15,
557,
352,
1855,
16,
21683,
129,
788,
301,
15,
17,
145,
788,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
An alternative to installing Websphere MQ server
===
We need to send and receive messages to/from a remote MQ server installation. The remote site has given us details of their QM name and ip address, and what channels and queues to set up to communicate with it. The 'normal' solution would be to install Websphere MQ server locally and go ahead and create the required queues, channels etc.
Note also that the remote site mandates a channel security exit on our sender channel.
Is there an alternative product we can use to communicate with the remote MQ server? I dont hold out much hope because this would I assume involve reverse-engineering the MQ channel communication protocol at the very least, or put another way, the local installation would have to 'look like' an MQ QM to the remote site. Just want to check for sure whether this is a pipe dream! | 0 | [
2,
40,
2676,
20,
25429,
2741,
14079,
307,
1251,
8128,
800,
3726,
3726,
95,
376,
20,
2660,
17,
2588,
7561,
20,
118,
2665,
21,
5388,
307,
1251,
8128,
7758,
9,
14,
5388,
689,
63,
504,
182,
3289,
16,
66,
2593,
79,
204,
17,
15735,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get the files inside a folder in Supporting Files in xcode 4.2?
===
I have done the following steps.
1. Created an xcode project and created a folder named "Images" inside Supporting Files.
2. Dragged and dropped 4 images into it. Tried to access those files using the following code
NSString *pathString = [[NSBundle mainBundle] pathForResource:@"Images" ofType:nil];
NSArray *fileList = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:pathString error: nil];
NSLog(@"the fileList is %d",[fileList count]);
The count is always 0. What should I do now? There are files inside it and I am able to use it in imageviews.
So what is the mistake that I am making? | 0 | [
2,
184,
20,
164,
14,
6488,
572,
21,
19294,
19,
3134,
6488,
19,
993,
9375,
268,
9,
135,
60,
800,
3726,
3726,
31,
57,
677,
14,
249,
2382,
9,
137,
9,
679,
40,
993,
9375,
669,
17,
679,
21,
19294,
377,
13,
7,
22039,
18,
7,
572,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Training acoustic model for CMU Sphinx using Finite state grammar (JSGF)
===
I need to train my own acoustic model. On the official wiki, this process is described for ngramm models in DMP format, but I need to use a (grammar) language model provided in JSGF format. Is there a such possibility? And if so, could you give a tutorial on this subject? | 0 | [
2,
838,
5402,
1061,
26,
2390,
291,
27274,
568,
10796,
146,
7207,
13,
5,
728,
18,
16368,
6,
800,
3726,
3726,
31,
376,
20,
1528,
51,
258,
5402,
1061,
9,
27,
14,
989,
13,
17375,
15,
48,
953,
25,
745,
26,
13,
103,
6295,
79,
2761,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Rijndael or AES to match java encryption - with salt and key
===
I need to encrypt a string using a salt and a key to match a java encryption so that the 3rd party provider can decrypt the values on the other side.
I have tried several StackOverflow articles as I am no expert in encryption and just cannot get the same encryption string using SALT and KEY as the 3rd party provider.
I need to know which encryption type and mode in C# to use to match java's AES encryptions as used here
https://gist.github.com/ca958d5921d47c4c0a0f | 0 | [
2,
13,
16504,
8245,
532,
54,
21,
160,
20,
730,
8247,
24420,
13,
8,
29,
2693,
17,
1246,
800,
3726,
3726,
31,
376,
20,
1957,
11435,
21,
3724,
568,
21,
2693,
17,
21,
1246,
20,
730,
21,
8247,
24420,
86,
30,
14,
203,
897,
346,
1174... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Database schema design - products
===
SQL:-I have products ( in my supply chain management schema ), They are categorized as :
perishable
clothing
etc.. i.e. product_category
while making purchase order i can list 1 or more products.
</b>
products table
------------------
product_id(PK)
product_name
unit_price
orders table
--------------
order_id(PK)
customer_id
order_date
shipping_address
orderdetails table
------------------
order_detail_id
product_id
qty
unitprice
discount
</b>
now, is the schema ok? how do i go about categorization...:-(
| 0 | [
2,
6018,
23874,
704,
13,
8,
1985,
800,
3726,
3726,
4444,
255,
45,
8,
49,
57,
1985,
13,
5,
19,
51,
2837,
2858,
1097,
23874,
13,
6,
15,
59,
50,
23346,
28,
13,
45,
416,
1595,
579,
4774,
2722,
9,
9,
31,
9,
62,
9,
2374,
1,
1437... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Yii How To create a wrapper for extern API calls and own database?
===
I am creating an application that show products, and therefore calls an API.
However the API calls are limited by the vendor. So I create a database where I store the results of the API calls. *(All this functionality is not yet created, its where this question is about)*
I want it as follows:
- A user access a product page
- The system looks in the database for the product information that is not older then 6 hours
- If there is no data in the database relevant for the product page, or it is older then 6 hours, call the API
- If an API is called store the new values to database or update it
The question is how to implement this logic. Look, I have a Product model and can access the database values. **But do I need - for good design reasons - a Wrapper for the API access and the Product model?**
And the question is how to implement this wrapper - if I need one. And which Class do I need to extend from, CModel? And also: I cant use the same validator rules provided by Yii, because the API speaks XML.
So I am left with confusion on how to implement this.
Note: I have already a nice Class to access the API properly. | 0 | [
2,
7679,
49,
184,
20,
1600,
21,
28051,
26,
1396,
8766,
21,
2159,
3029,
17,
258,
6018,
60,
800,
3726,
3726,
31,
589,
2936,
40,
3010,
30,
298,
1985,
15,
17,
1793,
3029,
40,
21,
2159,
9,
207,
14,
21,
2159,
3029,
50,
1317,
34,
14,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Uploading and saving images in mvc 3 before post
===
I have a problem with images in my web app. let say i have a form where there are some text fields, dropdowns, upload ajax control for multiple image upload and button Save :)
I know how to upload images and posting a form and saving everything to database but the problem is that I want to achive the following user experience:
-user can upload multiple images and browser after successful upload shows thumbnail (this i know how to do it)...the problem here is that I do no want to save images to db before button save is pressed. I there any convinient how to save temporary images...i tried temp table which after button is pressed copies all images to image table but here is browser refresh problem that looses all the data and images stay in a temp table...can you use a session for storing temporary images or any other way (i think session is not particulary good idea for such things :) | 0 | [
2,
71,
16866,
17,
7599,
3502,
19,
307,
8990,
203,
115,
678,
800,
3726,
3726,
31,
57,
21,
1448,
29,
3502,
19,
51,
2741,
4865,
9,
408,
395,
31,
57,
21,
505,
113,
80,
50,
109,
1854,
2861,
15,
2804,
2968,
18,
15,
71,
8294,
20624,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Thread execution in sections
===
class{
...
method(x,y){
...
method(x-1,y); //own thread for recrusion
method(x,y-1); //own thread for recrusion
}
}
I want to execute threaded code sections, how can i sign such sections in java. | 0 | [
2,
9322,
5769,
19,
4501,
800,
3726,
3726,
718,
1,
13,
9,
9,
9,
2109,
5,
396,
15,
93,
6,
1,
13,
9,
9,
9,
2109,
5,
396,
8,
165,
15,
93,
6,
73,
12894,
16620,
9322,
26,
6042,
3403,
872,
2109,
5,
396,
15,
93,
8,
165,
6,
73,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
JQuery Multiple onload animation loops, bug with multiple tabs
===
I have an issue on a site I am developing, a version of which can be seen at http://hg.ipagtest.com/ ! I am using JQuery and JCarosel for a slider feature on the bottom of the homepage and a piece of JQuery written by a former colleague of mien for a large image changer on the top of the page.
The page loads as expected and the animations work as desired! Issues arise when clicking between tabs. When I click away from the tab and return to it, it seems as though the animation loop has been thrown out of whack! I have seen this problem in firefox 13 and in chrome 19 on windows 7, it does not occur with IE9 as far as I can see.
I replaced the code used on the top image changer with the code show here...
http://www.queness.com/post/152/simple-jquery-image-slide-show-with-semi-transparent-caption
I made this change on a dev. server which is not on line so I can't show you the link. This produced the exact same problem.
I realise that this is quite a specific problem but I am at a loss as to what to do next. Any help of pointers would be greatly appreciated
Neal | 0 | [
2,
487,
8190,
93,
1886,
27,
8294,
6236,
19661,
15,
6256,
29,
1886,
6523,
18,
800,
3726,
3726,
31,
57,
40,
1513,
27,
21,
689,
31,
589,
3561,
15,
21,
615,
16,
56,
92,
44,
541,
35,
7775,
6903,
18187,
9,
15796,
263,
10543,
9,
960,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Lucene's Near RealTime search implementation
===
This is my code to search something in lucene .
ScoreDoc[] hits = null;
StandardAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_35);
QueryParser q = new QueryParser(Version.LUCENE_35, "content", analyzer);
Query query = q.parse(searchString);
IndexReader reader = IndexReader.open(IndexWriterSingleton.getIndexWriter(), true);
IndexSearcher is = new IndexSearcher(reader);
// IndexSearcher is = new IndexSearcher(index, true);
TopScoreDocCollector collector = TopScoreDocCollector.create(100, true);
is.search(query, collector);
hits = collector.topDocs().scoreDocs;
My question is : does this line (JUST THIS LINE) makes the search Near realtime ?
IndexReader reader = IndexReader.open(IndexWriterSingleton.getIndexWriter(), true);
I am maintaining a single IndexWriter (not closing it anywhere).
| 0 | [
2,
18515,
556,
22,
18,
424,
683,
891,
2122,
6123,
800,
3726,
3726,
48,
25,
51,
1797,
20,
2122,
301,
19,
18515,
556,
13,
9,
1344,
2499,
2558,
500,
3858,
800,
16203,
73,
1236,
1629,
102,
3592,
16051,
139,
800,
78,
1236,
1629,
102,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Dynamically generating files and providing those files for download in Google App engine
===
I am creating a web app in google app engine using java which dynamically generate an HTML file. The requirement is such that if the Html file size increases from a certain limit (say 3 mb), then it should be split into two files and zipped together and that zip file should be sent back as the response.
I would like help on how and where to create those temporary HTML files and then zip it, in google app engine as i guess GAE doesnt allow to write on the filesystem.
Please help!!! | 0 | [
2,
7782,
1326,
13500,
6488,
17,
2674,
273,
6488,
26,
7121,
19,
8144,
4865,
1406,
800,
3726,
3726,
31,
589,
2936,
21,
2741,
4865,
19,
8144,
4865,
1406,
568,
8247,
56,
7782,
1326,
7920,
40,
13,
15895,
3893,
9,
14,
8981,
25,
145,
30,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to make core-data inverse relationship not nil both references
===
i have a bit of an odd problem.
So building an iOS app that uses core-data. i have a Student entity and a Session entity.
student session is a one to many.
on the student entity, there is a field/relationship called "sessions" to represent the many sessions the student can have.
on the session entity, there is a field/relationship called "student" to represent the student it belongs to.
also on the student entity, there is a field/relationship called "session" to represent the current session the student is in.
the problem i'm having is that when i end a student session, and set the session property to nil ([student setSession:nil];) the student property on the session gets also nullified.
when i try to do:
[session student]
i get a null.
the only way i've able to get around this is to set set the "Inverse" type to "No Inverse" in which case nullifying doing [student setSession:nil] does not nullify [session student]. but of course i get the pretty xcode warning about a "Misconfigured Property" "Student.session should have an inverse" and "Session.student should have an inverse"
is there a way for me to keep the inverse relationship, but not nullify session.student when student.session is set nil? i tried changing the delete rule on the Student entity and Session entity to "No Action" but it doesn't seem to help.
any suggestions would be appreciated.. maybe have no inverse is the right way.. just wanted to make sure i'm doing it correctly.
thanks!
| 0 | [
2,
184,
20,
233,
2884,
8,
18768,
19,
9453,
1429,
52,
1781,
255,
156,
7231,
800,
3726,
3726,
31,
57,
21,
1142,
16,
40,
4210,
1448,
9,
86,
353,
40,
13,
7760,
4865,
30,
2027,
2884,
8,
18768,
9,
31,
57,
21,
1209,
9252,
17,
21,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How exactly does Rails prefills forms?
===
I have a (simple) question for my own curiosity:
I'd like to find out how Rails prefill forms with posted values like... you know, when there's a validation error on some models' attributes then you do something like "render :edit" and the form is magically prefilled.
What exactly are the mechanisms that Rails use to do such a thing? I didn't manage to find any documentation on this subject and I'd like to understand the magic.
So if someone can give me some links to some documentations or some explanations on this subject, I'll be glad to read that!
Thanks! | 0 | [
2,
184,
1890,
630,
2240,
18,
782,
19971,
18,
1997,
60,
800,
3726,
3726,
31,
57,
21,
13,
5,
24629,
6,
1301,
26,
51,
258,
11581,
45,
31,
22,
43,
101,
20,
477,
70,
184,
2240,
18,
782,
19971,
1997,
29,
6054,
4070,
101,
9,
9,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ON DUPLICATE KEY UPDATE every column except
===
I am using mysql through a socket, and I am updating 4000 records therefore I need to mass `INSERT` / `UPDATE` them to reduce network lag. The problem is that I have a column `datetime_inserted` that I want to set as `NOW()` when a record is first inserted, but never be replaced when it already exists, therefore `REPLACE` is not an option and I want to update the record, so `IGNORE` won't work.
I don't really understand the whole `ON DUPLICATE KEY UPDATE` but I want every column (40 or so) to update EXCEPT for `datetime_inserted`
How can I do this? | 0 | [
2,
27,
19429,
1246,
11100,
352,
4698,
1613,
800,
3726,
3726,
31,
589,
568,
51,
18,
22402,
120,
21,
18482,
15,
17,
31,
589,
71,
43,
1880,
24762,
742,
1793,
31,
376,
20,
1619,
13,
1,
108,
18,
6767,
1,
13,
118,
13,
1,
576,
8209,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
JSON object array parsing in django
===
I am new to python and django.
For my application in my django view, I am accepting array (and sub arrays) of JSON objects as request, by using json.loads I am trying to parse and iterate thru JSON objects but facing issues while parsing.
my javascript object sent from client is
var JSONObject = {
"employees_companyA":
[
{ "firstName":"John" , "lastName":"Doe" },
{ "firstName":"Anna" , "lastName":"Smith" },
{ "firstName":"Peter" , "lastName":"Jones" }
],
"employees_companyB":
[
{ "firstName":"John" , "lastName":"Doe" },
{ "firstName":"Anna" , "lastName":"Smith" },
{ "firstName":"Peter" , "lastName":"Jones" }
]
};
What is the best way to parse above two objects and read firstName, lastName for same.
I tried using o["firstName"], o.firstName etc (below is my code snippet)
json_obj = json.loads(request.POST['json_test'])
for o in json_obj:
temp_arr.append(o["firstName"])
I am sure this would be pretty straightforward but I couldn't find exact help here. | 0 | [
2,
487,
528,
3095,
7718,
2017,
18,
68,
19,
3857,
14541,
800,
3726,
3726,
31,
589,
78,
20,
20059,
17,
3857,
14541,
9,
26,
51,
3010,
19,
51,
3857,
14541,
1418,
15,
31,
589,
10894,
7718,
13,
5,
290,
972,
7718,
18,
6,
16,
487,
528... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Creating a bullet list using mysql table data
===
I have a table similar to the following:
subcategory category
------------------------
apples fruits
oranges fruits
pears fruits
honda cars
volvo cars
audi cars
What would be an easy way to print out something like the example below, using php and mySQL?
Example:
**Fruits:**
- Apples
- Oranges
- Pears
**Cars:**
- Honda
- Volvo
- Audi
I have been trying to figure this out for hours now, I appreciate any advice.
| 0 | [
2,
2936,
21,
6812,
968,
568,
51,
18,
22402,
859,
1054,
800,
3726,
3726,
31,
57,
21,
859,
835,
20,
14,
249,
45,
972,
14375,
93,
3230,
13,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
403... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.