unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
What is the idiomatic way to structure this UIViewController class heirarchy?
===
I have an application with several `UIListViewController` sub-classes. I have created a shared parent where I handle most of the prepareForSegue work and delegate to the sub-classes' implementations via a Template Method pattern.
This parent class has some logic like when to add a Cancel button (in `setEditing:animated`) to the `navigationItem`.
I have just added a detail view that is just a `UITextField` and a `UITextView` so it really doesn't need to be a `UIListView`. In fact, if it was a table view, I wouldn't have the scrolling behavior I want. So I have made it a `UIListViewController` sub-class, directly.
But I want it to have the same edit/cancel behavior that the other view controllers inherit from the intermediate class.
What is the idiomatic way to resolve the duplication? Categories?
| 0 | [
2,
98,
25,
14,
28380,
12479,
161,
20,
1411,
48,
13,
5661,
4725,
12898,
1252,
718,
7678,
8027,
93,
60,
800,
3726,
3726,
31,
57,
40,
3010,
29,
238,
13,
1,
21442,
702,
4725,
12898,
1252,
1,
972,
8,
1898,
160,
9,
31,
57,
679,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
access metadata of a table from Database in hibernate
===
I have a doubt..what are the methods/concepts does the hibernate use to access a metadata of a table fron SQL, ORacle Databases?. I know this is an open-source code. But can anyone provide me a link or doc which has all these details so that my understanding will be more clear?
I want more specifically on the API which hibernate use to access the metadata of a table?
Any hints or suggestions is also welcome
Thanks in advance
Sam
| 0 | [
2,
1381,
28057,
16,
21,
859,
37,
6018,
19,
4148,
2102,
8820,
800,
3726,
3726,
31,
57,
21,
3063,
9,
9,
608,
50,
14,
3195,
118,
27724,
18,
630,
14,
4148,
2102,
8820,
275,
20,
1381,
21,
28057,
16,
21,
859,
398,
2075,
4444,
255,
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... |
Hangs at "compressToJpeg"
===
there.
I am writing a video streaming client program that takes in images from a DataInputStream.
Because the server calls compressToJpeg() on these images, I figured I could simply take the byte array from my DataInputStream, decode it, and draw the Bitmap from decodeByteArray() to my SurfaceView. Unfortunately, that method only leaves me with decodeByteArray() returning null.
So I added an intermediate step. I created a compressFrame() method which simply takes the byte array from the stream, creates a new YuvImage instance, and uses that to call compressToJpeg(). When run, however, this method *hangs on compressToJpeg* and *closes my client activity*. There is no FC popup, and I get no errors in my log.
I have provided both the run() of the thread calling the problem method, the method itself, and the log printed before the app closes.
@Override
public void run() {
String fromServer = null;
int jpgSize;
byte[] buffer;
byte[] jpgData;
Bitmap image;
ByteArrayOutputStream jpgBaos = null;
while(isItOK && (receiver.textIn != null)){
if(!holder.getSurface().isValid()){
continue;
}
ReceiverUtils.init(holder);
//Receive 'ready' flag from camcorder
fromServer = ReceiverUtils.receiveText(receiver);
while((fromServer != null)){
Log.e("From server: ", fromServer); //logging here because of null pointers when done in Utils
if(fromServer.startsWith("ANDROID_JPG_READY")){
//Obtain size for byte array
jpgSize = Integer.parseInt(fromServer.substring(18));
Log.e("JPG SIZE", String.valueOf(jpgSize));
//Create byte array of size jpgSize
buffer = new byte[jpgSize];
Log.e("BUFFER SIZE", String.valueOf(buffer.length));
//Send flag and receive image data from camcorder
ReceiverUtils.sendText(receiver, "ANDROID_JPG_SEND");
jpgData = ReceiverUtils.receiveData(receiver, buffer);
//Compress jpgData and write result to jpgBaos
jpgBaos = ReceiverUtils.compressFrame(imgRect, jpgData);
//Decode jpgData into Bitmap
image = ReceiverUtils.getFrame(jpgBaos.toByteArray(), jpgSize);
//image = ReceiverUtils.getFrame(jpgData, jpgSize);
//Set buffer and jpgData to null since we aren't using them
buffer = null;
jpgData = null;
//Draw Bitmap to canvas
ReceiverUtils.draw(image, holder, imgRect);
//break; (testing one run-through)
}
//Receive 'ready' flag from camcorder
fromServer = ReceiverUtils.receiveText(receiver);
if(isItOK == false){
break;
}
}
//break; (testing one run-through)
}
}
This is the ReceiverUtils.compressFrame() called in the previous snippet.
/*----------------------------------------
* compressFrame(Rect imgRect, byte[] input): Creates new instance of YuvImage used to compress ARGB
* byte array data to jpeg. Returns ByteArrayOutputStream with data.
*/
public static ByteArrayOutputStream compressFrame(Rect imgRect, byte[] input){
boolean success = false;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
YuvImage yuvImage = new YuvImage(input, ImageFormat.NV21,
imgRect.width(), imgRect.height(), null);
Log.e("HEY", "HEY");
success = yuvImage.compressToJpeg(imgRect, 80, baos);
Log.e("Compression Success:", String.valueOf(success));
return baos;
}
Finally, this is the output I'm getting from my LogCat. (Beware some obviously hastily written debug logs.)
07-03 15:01:19.754: E/From server:(1634): ANDROID_JPG_READY_26907
07-03 15:01:19.754: E/JPG SIZE(1634): 26907
07-03 15:01:19.764: E/BUFFER SIZE(1634): 26907
07-03 15:01:19.764: E/To server:(1634): ANDROID_JPG_SEND
07-03 15:01:19.834: E/jpgIn(1634): Data received successfully.
07-03 15:01:19.834: E/HEY(1634): HEY
07-03 15:01:19.844: D/skia(1634): onFlyCompress
| 0 | [
2,
4546,
18,
35,
13,
7,
960,
5890,
262,
728,
20427,
7,
800,
3726,
3726,
80,
9,
31,
589,
1174,
21,
763,
11920,
6819,
625,
30,
1384,
19,
3502,
37,
21,
1054,
108,
4881,
11260,
9,
185,
14,
8128,
3029,
26060,
262,
728,
20427,
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... |
IOS: add imageview in a scrollview to have zoom
===
I want to set an imageview with a uiimage a d put this imageview inside a scrollview to obtain a zoom of this image;
and I want that these imageview and scrollview fit in the rect at the center of the view...is it possible? | 0 | [
2,
13,
7760,
45,
3547,
1961,
4725,
19,
21,
12159,
4725,
20,
57,
19469,
800,
3726,
3726,
31,
259,
20,
309,
40,
1961,
4725,
29,
21,
13,
5661,
22039,
21,
13,
43,
442,
48,
1961,
4725,
572,
21,
12159,
4725,
20,
5545,
21,
19469,
16,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Mercurial: abandoned transaction found run hg recover. missing revlogs
===
I recently tried to push to a central repository and received the error: abandoned transaction found. Running hg recover said there was no missing transaction. On the advice of another [answer](http://stackoverflow.com/questions/5529207/mercurial-abandoned-transaction-found-run-hg-recover-recover-does-not-work) I used hg verify to see that my repository is missing two revlogs; below is the result of running hg verify:
% hg --repository C:\dev\WHDLawWeb verify --verbose
repository uses revlog format 1
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
data/WHDLawWeb/Images/pastsponsorships.jpg.d@167: missing revlog!
data/WHDLawWeb/WHDLawWeb/Resources/Image/ALFALogoWhite.jpg.i@319: missing revlog!
7175 files, 988 changesets, 14987 total revisions
2 integrity errors encountered!
(first damaged changeset appears to be 167)
[command returned code 1 Tue Jul 03 15:02:13 2012]
In an effort to correct this, and mostly due to my frustration at this point, I decided to just clone the central repository as I'd only be missing a few revisions. However, once I try to push from this cloned repository I get the following bug report:
** Mercurial version (2.2.2). TortoiseHg version (2.4.1)
** Command: --nofork workbench
** CWD: C:\dev
** Encoding: cp1252
** Extensions loaded: bugzilla, graphlog, convert, extdiff
** Python version: 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)]
** Windows version: (6, 1, 7601, 2, 'Service Pack 1')
** Processor architecture: x86
** Qt-4.7.4 PyQt-4.8.6
Traceback (most recent call last):
File "tortoisehg\hgqt\repowidget.pyo", line 954, in repositoryChanged
File "tortoisehg\hgqt\repowidget.pyo", line 916, in rebuildGraph
File "tortoisehg\hgqt\repowidget.pyo", line 777, in setupModels
File "tortoisehg\hgqt\repomodel.pyo", line 151, in __init__
File "tortoisehg\hgqt\repomodel.pyo", line 170, in initBranchColors
File "mercurial\localrepo.pyo", line 523, in branchtags
File "mercurial\changelog.pyo", line 195, in read
File "mercurial\revlog.pyo", line 926, in revision
File "mercurial\revlog.pyo", line 849, in _chunkbase
File "mercurial\revlog.pyo", line 846, in _chunk
File "mercurial\revlog.pyo", line 115, in decompress
error: Error -5 while decompressing data: incomplete or truncated stream
Traceback (most recent call last):
File "tortoisehg\hgqt\commit.pyo", line 533, in repositoryChanged
File "tortoisehg\hgqt\commit.pyo", line 553, in refresh
File "tortoisehg\hgqt\thgrepo.pyo", line 631, in thgmqappliedpatch
File "tortoisehg\hgqt\thgrepo.pyo", line 623, in _thgmqpatchtags
File "mercurial\context.pyo", line 191, in tags
File "mercurial\localrepo.pyo", line 468, in nodetags
File "mercurial\util.pyo", line 237, in __get__
File "mercurial\localrepo.pyo", line 395, in _tagscache
File "mercurial\localrepo.pyo", line 428, in _findtags
File "mercurial\tags.pyo", line 30, in findglobaltags
File "mercurial\tags.pyo", line 242, in _readtagcache
File "mercurial\context.pyo", line 251, in filenode
File "mercurial\context.pyo", line 240, in _fileinfo
File "mercurial\context.pyo", line 183, in files
File "mercurial\util.pyo", line 237, in __get__
File "mercurial\context.pyo", line 134, in _changeset
File "mercurial\changelog.pyo", line 195, in read
File "mercurial\revlog.pyo", line 926, in revision
File "mercurial\revlog.pyo", line 849, in _chunkbase
File "mercurial\revlog.pyo", line 846, in _chunk
File "mercurial\revlog.pyo", line 115, in decompress
error: Error -5 while decompressing data: incomplete or truncated stream
Running hg verify on the central repository shows that the two revlogs are also missing here. If anyone knows how to fix either my original or cloned repository I'd appreciate any feedback.
Also tried [a solution here](http://stackoverflow.com/questions/5970648/mercurial-missing-revlog) and encountered the same problem. I'm relatively new to mercurial and tortiosehg, please forgive any stupid mistakes. Like I said help would be appreciated.
| 0 | [
2,
9046,
3594,
192,
45,
3092,
12799,
216,
485,
13,
18187,
7635,
9,
2863,
3867,
5567,
18,
800,
3726,
3726,
31,
1989,
794,
20,
3250,
20,
21,
521,
24869,
17,
420,
14,
7019,
45,
3092,
12799,
216,
9,
946,
13,
18187,
7635,
87,
80,
23,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
GPolyline offset by pixels regardless of zoom (Google Maps v2)
===
Does anyone know of a simple way to have a `GPolyline` that is offset by a certain number of pixels, no matter the zoom level?
By offset, I mean that I have a series of `GLatLng` points, and I want the line to be parallel to the line defined by these points, but a few pixels to the "right" from the perspective of someone traveling along the line in the order the points are defined.
I am reasonably sure I could process the points to come up with such a parallel line, but the offset would be in degrees (or fractions thereof), which would make the offset impossible to see at higher zoom levels (or move the line far too much at lower zoom levels). I could account for that during the initial processing, but then the user might change the zoom level and it would have to be redrawn.
I get the impression that the "correct" way to do this would be to subclass `GPolyline`. I don't know any details on how to do that, and would rather like to avoid having to do so myself if there's some code available that would do this, but I'd appreciate any links for how to do that. | 0 | [
2,
489,
17108,
1143,
17493,
34,
18146,
18,
7148,
16,
19469,
13,
5,
16111,
4875,
6867,
566,
135,
6,
800,
3726,
3726,
630,
1276,
143,
16,
21,
1935,
161,
20,
57,
21,
13,
1,
263,
17108,
1143,
1,
30,
25,
17493,
34,
21,
1200,
234,
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... |
RavenDb Mini Profiler only loads on the first page load
===
I'm trying the get the mini profiler for RavenDb running in my ASP.NET MVC4 project.
I have the following in my Unity bootstrapper:
[assembly: WebActivator.PreApplicationStartMethod(typeof(Web.App.App_Start.AppStart_Unity), "Start")]
public static class AppStart_Unity
{
public static void RegisterServices(IUnityContainer container)
{
container.RegisterInstance(DocumentStoreFactory.Create(ConfigurationManager.ConnectionStrings[0].Name));
container.RegisterType<IDocumentSession>(new HierarchicalLifetimeManager(), new InjectionFactory(c => c.Resolve<IDocumentStore>().OpenSession(ConfigurationManager.ConnectionStrings[0].Name)));
}
public static void Start()
{
// Create the unity container
IUnityContainer container = new UnityContainer();
// Register services with our Unity container
RegisterServices(container);
// Tell ASP.NET MVC to use our Unity DI container
DependencyResolver.SetResolver(new UnityServiceLocator(container));
// hook up the profiler
var store = container.Resolve<IDocumentStore>();
var documentStore = store as DocumentStore;
if (documentStore != null)
{
Raven.Client.MvcIntegration.RavenProfiler.InitializeFor(documentStore);
}
}
}
In my master _Layout I have the following:
<head>
@Raven.Client.MvcIntegration.RavenProfiler.CurrentRequestSessions()
</head>
The first time I start up the web application I can see the profiler, no problem.
However, any subsequent page requests and the profiler is not visible.
When I look at the page source, I can see the div container is there, but unpopulated with data. No JavaScript errors at all. Very odd.
I've also tried the [mini-profiler][1] and I have also tried rolling back from the latest unstable RavenDb client to the current stable release. Nothing appears to make a difference.
Is this the expected behavior? Do I need to do anything else? Am I being an idiot here?
[1]: http://miniprofiler.com/ | 0 | [
2,
7542,
9007,
4236,
5296,
139,
104,
19069,
27,
14,
64,
2478,
6305,
800,
3726,
3726,
31,
22,
79,
749,
14,
164,
14,
4236,
5296,
139,
26,
7542,
9007,
946,
19,
51,
28,
306,
9,
2328,
307,
8990,
300,
669,
9,
31,
57,
14,
249,
19,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
pass additional parameters to routes (expressjs)
===
Having started working with express recently I have stumbled across the following problem:
The entire logic of my routes is defined in separate files which are then included by means of require(route_name). The respective get / post matches are done as follows:
app.get('/', routes.home) etc.
The line above implies that routes.home is a function called with the parameters req, res & next.
I have a bunch of utility functions stored in the utils object that I want every route to be able to access. Until now, I've been solving the problem as follows:
var utils = ...
app.get('/', function (req, res, next) {
routes.home(req, res, next, utils);
});
Is there a way to tell express that it should pass the utils object as a parameter to every route or generally a better solution to my problem?
| 0 | [
2,
1477,
1351,
12905,
20,
5050,
13,
5,
21230,
728,
18,
6,
800,
3726,
3726,
452,
373,
638,
29,
2999,
1989,
31,
57,
10282,
464,
14,
249,
1448,
45,
14,
1078,
7085,
16,
51,
5050,
25,
2811,
19,
1725,
6488,
56,
50,
94,
506,
34,
1108... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Getting "Error: Generic Error. Could not generate specified XSD file!" while trying to get dependent xsd of a wsdl file
===
I have EJB Session bean exposed as a webservice:
@Stateless
@WebServiceProvider(
targetNamespace = "http://WSCreateAccountMovementListRequest.ws.mybank.ru",
serviceName = "WSCreateAccountMovementListRequest",
portName = "WSCreateAccountMovementListRequestPort",
wsdlLocation = "META-INF/wsdl/WSCreateAccountMovementListRequest/WSCreateAccountMovementListRequest.wsdl")
@ServiceMode(value = Service.Mode.MESSAGE)
@javax.jws.HandlerChain(file = "handlers.xml")
public class WSCreateAccountMovementListRequestImpl implements Provider<SOAPMessage> {
...
}
This bean is deployed on a websphere server.
I want the service's client to be able to access the wsdl in order to generate their stubs. But I faced a trouble.
I can access wsdl of the deployed service with no problems.
But when I try to create a project from the wsdl in SoapUI, I get this error:
Error loading [http://localhost:9081/WSCreateAccountMovementListRequest/WSCreateAccountMovementListRequest/META-INF/wsdl/WSCreateAccountMovementListRequest/WSCreateAccountMovementListRequestTypes.xsd
If I try to view that xsd in a browser, I get the following:
Error: Generic Error.
Could not generate specified XSD file!
The xsd file is placed in the same directory as the wsdl file(in META-INF/wsdl/WSCreateAccountMovementListRequest/ in EJB jar).
Any help would be appreciated.
| 0 | [
2,
1017,
13,
7,
29992,
45,
12733,
7019,
9,
110,
52,
7920,
9931,
993,
18,
43,
3893,
187,
7,
133,
749,
20,
164,
9063,
993,
18,
43,
16,
21,
619,
18,
8643,
3893,
800,
3726,
3726,
31,
57,
13,
10022,
220,
3723,
15322,
5043,
28,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 an equivalet to GDownloadUrl function in Google Maps API v3
===
I used the Google Maps API version 2 function [`GDownloadUrl`][1] on various places to download XML/JSON data. I am converting about 3 dozen map pages to version 3 and I am unable to find an equivalent of this function. Is there one or should I use another library for handling AJAX/XHR?
[1]: https://developers.google.com/maps/documentation/javascript/v2/reference#GDownloadUrl | 0 | [
2,
25,
80,
40,
13,
9629,
13631,
38,
20,
489,
2968,
8294,
911,
255,
1990,
19,
8144,
6867,
21,
2159,
566,
240,
800,
3726,
3726,
31,
147,
14,
8144,
6867,
21,
2159,
615,
172,
1990,
636,
1,
263,
2968,
8294,
911,
255,
1,
500,
2558,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 convert utf8 string to utf8 byte array?
===
How can I convert string to utf8 byte array, I have this sample code:
This works ok:
StreamWriter file = new StreamWriter(file1, false, Encoding.UTF8);
file.WriteLine(utf8string);
file.Close();
This works wrong, file is in ASCII:
byte[] bytes = System.Text.UTF8Encoding.UTF8.GetBytes(utf8string);
FileStream fs = new FileStream(file2, FileMode.CreateNew);
fs.Write(bytes, 0, bytes.Length);
fs.Close();
I would like to get byte array what returned by this function:
System.IO.File.ReadAllBytes(path_to_file)
because this works ok:
byte[] datab = File.ReadAllBytes(file1);
FileStream fs2 = new FileStream(file3, FileMode.CreateNew);
fs2.Write(datab, 0, datab.Length);
fs2.Close(); | 0 | [
2,
184,
20,
8406,
287,
11720,
457,
3724,
20,
287,
11720,
457,
34,
591,
7718,
60,
800,
3726,
3726,
184,
92,
31,
8406,
3724,
20,
287,
11720,
457,
34,
591,
7718,
15,
31,
57,
48,
5717,
1797,
45,
48,
693,
5854,
45,
3766,
9657,
3893,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Spawning a Thread in Spring which is aware of other beans
===
I need to create a Thread in Spring that loops forever and blocks on a LinkedBlockingQueue<E>.take() to process an object in it (a Controller puts objects in that queue). My piece of code works fine if being processed inside the @Controller. However, now that I moved it into the Thread I get multiple LazyInitializationException from Hibernate. In a nutshell the pseudo-code skeleton of my thread is:
@Component
public class AsynchronousConsumer implements Runnable
{
@Autowire
// Service Layer and other goodies (all correctly injected)
@PostConstruct
public void init(){
(new Thread(this)).start();
}
protected static LinkedBlockingQueue<MyBean> queue = new LinkedBlockingQueue<MyBean>();
@Override
public void run()
{
while(true)
{
MyBean myBean = queue.take();
this.processBean(myBean); // do the processing
}
}
Am I doing something wrong here? How should I start my thread so it is fully Spring/Hibernate aware? | 0 | [
2,
27487,
21,
9322,
19,
1573,
56,
25,
3854,
16,
89,
14685,
800,
3726,
3726,
31,
376,
20,
1600,
21,
9322,
19,
1573,
30,
19661,
3818,
17,
5198,
27,
21,
4727,
12048,
68,
2005,
4185,
1,
62,
1,
9,
4386,
5,
6,
20,
953,
40,
3095,
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... |
Parsing html page that has two different format on the same elements
===
In the same html pageThere're two different format of the same contain :
the first is :
<div class="gs"><h3 class="gsr"><a href="http://www.example1.com/">title1</a>
the second is :
<div class="gs"><h3 class="gsr"><span class="gsc"></span><a href="http://www.example2.com/">title2</a>
How to get links and titles in one code that can handle that two different format with simple_html_dom?
I've tried this code, but it doesn't work :
foreach($html->find('h3[class=gsr]') as $docLink){
$link = $docLink->first_child();
echo $link->plaintext;
echo $link->href;
}
| 0 | [
2,
2017,
18,
68,
13,
15895,
2478,
30,
63,
81,
421,
2595,
27,
14,
205,
2065,
800,
3726,
3726,
19,
14,
205,
13,
15895,
2478,
1887,
22,
99,
81,
421,
2595,
16,
14,
205,
3717,
13,
45,
14,
64,
25,
13,
45,
13,
1,
12916,
718,
3726,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Delete partially similar rows in MySQL
===
I need to delete partially similar rows in a table, using MySQL. Ex:
From table1 (id,color1,color2,key) content:
id,color1,color2,key
-----------------------------
1,Blue,Green,AASDDD
2,Blue,Green,JJUUYYY
3,Blue,Red,HHYYY
4,Green,Red,KKIII
5,Blue,Red,KKIIUUUU
I'd like to delete the duplicate rows in color1,color2 and get:
id,color1,color2,key
-----------------------------
1,Blue,Green,AASDDD
3,Blue,Red,HHYYY
4,Green,Red,KKIII
Something like
delete FROM table1 WHERE Exists(SELECT color1,color2 FROM table1)
What's the best way to do this in MySQL without creating a temporary table?
(I know there are many posts about deleting duplicate rows in MySQL, but not for partially matching rows.) | 0 | [
2,
27448,
5933,
835,
11295,
19,
51,
18,
22402,
800,
3726,
3726,
31,
376,
20,
27448,
5933,
835,
11295,
19,
21,
859,
15,
568,
51,
18,
22402,
9,
1396,
45,
37,
859,
165,
13,
5,
1340,
15,
11282,
165,
15,
11282,
135,
15,
4237,
6,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
MiniProfiler uninstall error
===
I cannot uninstall the MiniProfiler from my project. It always gives me this error message 'Microsoft JScript runtime error: 'MiniProfiler' is undefined' and inserts dynamic JavaScript code into my html page.
Please help. | 0 | [
2,
4236,
14503,
139,
367,
108,
21300,
7019,
800,
3726,
3726,
31,
1967,
367,
108,
21300,
14,
4236,
14503,
139,
37,
51,
669,
9,
32,
550,
2352,
55,
48,
7019,
2802,
13,
22,
22019,
12980,
487,
8741,
485,
891,
7019,
45,
13,
22,
6840,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 logging in production
===
I'm using Exceptional in order to track exceptions and errors from my Google Chrome Extension in production. The extension is currently concatenating and compressing all javascript files before release. A side effect of this release flow is that you end up with rather ambigious error messages. See example below:
`"Uncaught TypeError: Cannot read property 'target' of undefined" On line 2 of chrome-extension://[extension-id]/app.js`
Since the files consists of only two lines it's rather hard to spot column that caused the error.
Can this problem be solved using the JavaScript source map feature? Or is compressing javascripts inside a Google Chrome Extension even worth it since you will load locally anyway?
Thansk in advantage! | 0 | [
2,
5391,
13,
13919,
19,
637,
800,
3726,
3726,
31,
22,
79,
568,
12961,
19,
389,
20,
792,
13392,
17,
11908,
37,
51,
8144,
13,
12985,
3896,
19,
637,
9,
14,
3896,
25,
871,
1065,
793,
1316,
1880,
17,
26060,
68,
65,
8247,
8741,
6488,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
If disabling macro on excel file you can not copy a sheet from one workbook to another
===
I am using this function to copy a sheet from a Workbook to another Workbook.
I works, but it seems that if I disable the macros from Workbook,
it can not copy the sheet anymore.
If I chage this line : `m_objExcel.AutomationSecurity = msoAutomationSecurityForceDisable`
to this `m_objExcel.AutomationSecurity = msoAutomationSecurityByUI`
it works but gets a warning message.
Also if I comment the line it works perfectly but with macros On.
Private Sub CopyFunction()
Set m_objExcel = New Excel.Application 'creare obiect
m_objExcel.DisplayAlerts = False
g_secAutomation = m_objExcel.AutomationSecurity
m_objExcel.AutomationSecurity = msoAutomationSecurityForceDisable
m_objExcel.Visible = True
Dim CopyFrom As Workbook
Dim CopyTo As Workbook
Dim CopyThis As Object
Set CopyFrom = m_objExcel.Workbooks.Open("D:\FromFile.xls")
Set CopyTo = m_objExcel.Workbooks.Open("D:\ToFile.xls")
Set CopyThis = CopyFrom.Sheets(1) ''Sheet number 1
CopyThis.Copy After:=CopyTo.Sheets(1)
m_objExcel.Workbooks(CopyTo.FullName).Save
CopyFrom.Close
CopyTo.Close
m_objExcel.Workbooks.Close
MsgBox "ok"
End Sub
What is the problem? Why when disabling macro you can not copy the sheet from one file to the other? | 0 | [
2,
100,
1460,
58,
8599,
9069,
27,
20700,
3893,
42,
92,
52,
4344,
21,
6125,
37,
53,
170,
5199,
20,
226,
800,
3726,
3726,
31,
589,
568,
48,
1990,
20,
4344,
21,
6125,
37,
21,
170,
5199,
20,
226,
170,
5199,
9,
31,
693,
15,
47,
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 to find that how much time phone took to download a file from internet
===
I want to write code that will give me the time it took to download a file(speciallly an app)
from internet.
More specifically I want to know the downloading speed of last downloaded app.
So I thouhgt to find the time for downloading and then divide the file size by time ,I will get the speed.
can anyone help me in finding the time it took to download a file from internet. | 0 | [
2,
184,
20,
477,
30,
184,
212,
85,
1132,
199,
20,
7121,
21,
3893,
37,
2620,
800,
3726,
3726,
31,
259,
20,
2757,
1797,
30,
129,
590,
55,
14,
85,
32,
199,
20,
7121,
21,
3893,
5,
11118,
211,
93,
40,
4865,
6,
37,
2620,
9,
91,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
xcode moving and scaling 3d objects
===
i just tried to do my first 3d iOs app. so far it's going ok.
i loaded the view and inserted the models. Now i am wondering where
do i chose the starting cordintates and theirs size; so far i used
translate and scale but they scale or move the whole 3d view.
Is there a way to asign a 3d object to a image view or GLKit view
for easier manipulation on te x,y and scale.
code so far:
// Set matrix mode to modelview
glMatrixMode(GL_MODELVIEW);
CGFloat scale = [[UIScreen mainScreen] scale];
scale=5;
// Rotate the view. Since we don't load identity here, the rotations will
// stack each frame.
glRotatef(3, 3, 5, 10);
glTranslatef(1, 1, 0);
// Clear the buffers with your favorite color. That color will be the background.
// You must clear the depth buffer as well or there will be a mess.
glClearColor(0.1f, 0.1f, 0.1f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Draw the cube
glVertexPointer(3, GL_FLOAT, 0, Box_vertex_coordinates);
glTexCoordPointer(2, GL_FLOAT, 0, Box_texture_coordinates);
glNormalPointer(GL_FLOAT, 0, Box_normal_vectors);
glDrawArrays(GL_TRIANGLES, 0, Box_vertex_array_size);
| 0 | [
2,
993,
9375,
1219,
17,
26829,
203,
43,
3916,
800,
3726,
3726,
31,
114,
794,
20,
107,
51,
64,
203,
43,
13,
7760,
4865,
9,
86,
463,
32,
22,
18,
228,
5854,
9,
31,
8572,
14,
1418,
17,
14215,
14,
2761,
9,
130,
31,
589,
5712,
113... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 set up Dave Raggett's HTML Tidy on Windows?
===
I'm having a hard time looking for an easy to understand instruction to download, set up and use this HTML Tidy by [Dave Raggett][1].
Please help, I need this kind of tool that can almost perfectly scan html errors.
[1]: http://www.w3.org/People/Raggett/tidy/ | 0 | [
2,
184,
20,
309,
71,
3498,
6704,
3060,
38,
22,
18,
13,
15895,
28028,
27,
1936,
60,
800,
3726,
3726,
31,
22,
79,
452,
21,
552,
85,
699,
26,
40,
2010,
20,
1369,
7304,
20,
7121,
15,
309,
71,
17,
275,
48,
13,
15895,
28028,
34,
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... |
CDI injection of managed bean from java module
===
We have an JEE 6 enterprise application running in a JBoss 7.2.0 Alpha1 container with following structure:
app.ear
services.jar (EJB Module)
beans.xml
ServiceA.java
lib/domain.jar (Java module)
beans.xml
SomeDomainLogic.java
ServiceA contains a field of type 'SomeDomainLogic'. This field should be injected by CDI. Therefore there is a @Inject annotation at the field. When starting up the container it fails with following exception:
10:21:37,374 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.subunit."app.ear"."services.jar".component.ServiceA.WeldInstantiator: org.jboss.msc.service.StartException in service jboss.deployment.subunit."app.ear"."services.jar".component.ServiceA.WeldInstantiator: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]
Caused by: java.lang.RuntimeException: JBAS016060: Could not resolve CDI bean for injection point private SomeDomainLogic ServiceA.logic with qualifiers []
at org.jboss.as.weld.injection.WeldEEInjection.createWeldEEInjection(WeldEEInjection.java:161)
at org.jboss.as.weld.injection.WeldManagedReferenceFactory.start(WeldManagedReferenceFactory.java:117)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
... 3 more
If the class is moved into the 'services.jar' EJB Module everything works fine. But when it resides in the Java module it is not found. Has anyone an idea what we are doing wrong? | 0 | [
2,
1745,
49,
13646,
16,
1471,
15322,
37,
8247,
12613,
800,
3726,
3726,
95,
57,
40,
13,
13412,
400,
6002,
3010,
946,
19,
21,
487,
10349,
18,
453,
9,
135,
9,
387,
5705,
165,
12147,
29,
249,
1411,
45,
4865,
9,
10717,
687,
9,
6300,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 rename package in grail
===
I have installed grails support in STS. and I have a grails application inside that I got package com.mycompany.myapp in domain, controllers and tests. I want to rename them to mycompany.myapp, So that It should affect the functionality of application. Is there any way to do it in Grails. | 0 | [
2,
184,
20,
302,
7259,
6030,
19,
489,
7301,
800,
3726,
3726,
31,
57,
4066,
489,
7301,
18,
555,
19,
354,
18,
9,
17,
31,
57,
21,
489,
7301,
18,
3010,
572,
30,
31,
330,
6030,
13,
960,
9,
915,
28359,
9,
915,
7753,
19,
4603,
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... |
Flash AS3 Call a WSDL in a for loop
===
I'm using the Flex SOAP web service, connecting to our WSDL and everything is dandy. However, I'm new to web services and the web guy is on holiday, so I'm a bit confused. The first thing I'm doing is running a check connection:
private function configXMLHandler(event:LoaderEvent):void {
fws.wsdl = checkWSDL;
fws.loadWSDL();
fws.addEventListener(LoadEvent.LOAD, wsdlLoaded);
}
private function wsdlLoaded(event:LoadEvent):void {
checkAbstract = fws.getOperation("retrieveAssetIdbyLabel");
checkAbstract.arguments = ["poll-asset-do-not-remove"];
var token:AsyncToken = checkAbstract.send();
token.addResponder(new Responder(checkAbstractResult, checkAbstractError));
}
private function checkAbstractError(event:FaultEvent):void {
trace('Error in the WSDL');
}
private function checkAbstractResult(event:ResultEvent):void {
if (event.result.returnCode == 0) {
trace('Web service check ok');
initContentLoader();
} else {
trace('Error in the WSDL');
)
}
}
This works fine, I get the result I expect, and so I move on. I then need to iterate through an XML list and call the same web service function for each asset in that XML, my thinking was to use a loop:
private function initContent(event:LoaderEvent):void {
assetList = event.target.content.asset;
for (var i:int = 0; i < assetList.length(); i++) {
assetAbstract = fws.getOperation("retrieveAssetIdbyLabel");
assetAbstract.arguments = [assetList[i + assetCount].assetLabel]; //get the current index in the xmllist + the assetCount, grab the corresponding assetLabel from the XML and pass that to the web service
trace(assetAbstract.arguments);
var assetToken:AsyncToken = assetAbstract.send();
assetToken.addResponder(new Responder(getAssetResult, getAssetError));
}
}
private function getAssetResult(event:ResultEvent):void {
var treasuresAsset:TreasuresAsset = new TreasuresAsset(event.result.returnCode, assetList[assetCount].asset.assetLabel, assetList[assetCount].asset.assetImage, assetList[assetCount].asset.assetDescription);
addChild(treasuresAsset);
assetCount++; //increase the asset count
}
private function getAssetError(event:FaultEvent):void {
trace(event.fault);
trace('An error occured when we tried to get an asset id in the loop');
}
I now get an error:
> Error opening URL 'http://www.nhm.ac.uk/web-services/VisitorService/'
SOAPFault (Server): org.apache.axis2.databinding.ADBException: Unexpected subelement RetrieveAssetIdbyLabel
My immediate thought was that I need to create a new instance of the web service for each asset in the xml, and repeat my first code over and over. Can I use the web service only once, do you need to recreate the entire procedure?
Thanks. | 0 | [
2,
4433,
28,
240,
645,
21,
619,
18,
8643,
19,
21,
26,
5293,
800,
3726,
3726,
31,
22,
79,
568,
14,
14409,
6447,
2741,
365,
15,
6440,
20,
318,
619,
18,
8643,
17,
796,
25,
1685,
1851,
9,
207,
15,
31,
22,
79,
78,
20,
2741,
687,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Please help me to choose the best tool to achieve the google map place locator
===
In the following URL
http://www.rubloff.com/property/chicago/07760540.cfm?searchId=da30d8e9-421a-4376-965b-9541e2769ca8&page=1&pageSize=20&sortType=1
In the map tab there is a map place locator. I am working in PHP MYSQL, please help me to choose the best tool for this.
![enter image description here][1]
[1]: http://i.stack.imgur.com/yJxYh.png | 2 | [
2,
2247,
448,
55,
20,
3538,
14,
246,
5607,
20,
4689,
14,
8144,
2942,
209,
13,
10799,
3457,
800,
3726,
3726,
19,
14,
249,
287,
6362,
7775,
6903,
6483,
9,
17791,
255,
1299,
9,
960,
118,
10890,
106,
1084,
118,
26781,
118,
2984,
22460... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 with sales Force SDK?
===
i am new to Android sales Force .now i want install and that and do some sample program on that through Android i am surfing the Google i got so many links but i have some configuration which one is more suitable for achieve this Example Program.please provide any useful links and is there any videos for demo on this ?
Thanks in Advance.... | 1 | [
2,
13005,
29,
2598,
558,
13,
18,
43,
197,
60,
800,
3726,
3726,
31,
589,
78,
20,
13005,
2598,
558,
13,
9,
1387,
31,
259,
16146,
17,
30,
17,
107,
109,
5717,
625,
27,
30,
120,
13005,
31,
589,
22449,
14,
8144,
31,
330,
86,
151,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
call function until (with call limit)
===
I have a function that generates random output (string).
I need to call that function until I get 3 different outputs (strings).
What is the most elegant way to generate array with 3 unique strings by calling the function, with the limit how many times the function can be called if the output is not generated in specified number of attempts?
Here's what I currently have:
output = []
limit_calls = 5
limit_calls.times do |i|
str = generate_output_function
output.push str
break if output.uniq.size > 2
end
Can this be beautified / shortened to 1 line? I'm pretty sure in ruby.. :)
Thanks | 0 | [
2,
645,
1990,
163,
13,
5,
1410,
645,
4496,
6,
800,
3726,
3726,
31,
57,
21,
1990,
30,
7920,
18,
5477,
5196,
13,
5,
11130,
6,
9,
31,
376,
20,
645,
30,
1990,
163,
31,
164,
203,
421,
5196,
18,
13,
5,
11130,
18,
6,
9,
98,
25,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Process ID of apk
===
I have a req. like I have Application A created by me and APK of Application B.
Is it possible for me to set the process id and user id both same for the apk as well as application A. I don't have manifest of application B since its an apk. Is it possible for me to run the apk and an application of my own in the same process? Please help. | 0 | [
2,
309,
953,
4924,
16,
21,
17244,
800,
3726,
3726,
31,
57,
21,
302,
1251,
9,
101,
31,
57,
3010,
21,
679,
34,
55,
17,
21,
17244,
16,
3010,
334,
9,
25,
32,
938,
26,
55,
20,
309,
14,
953,
4924,
17,
4155,
4924,
156,
205,
26,
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... |
Helper method to Raise an exception a good idea?
===
Is there any reason having a helper method to create and throw an exception is a bad idea? In normal coding terms it would seem sensible but it does mean your stack trace will be a bit more convoluted which is my only concern.
I'm specifically working on C++ here but if you want to cover other languages for comparison/edification go ahead! | 0 | [
2,
448,
106,
2109,
20,
3972,
40,
5391,
21,
254,
882,
60,
800,
3726,
3726,
25,
80,
186,
1215,
452,
21,
448,
106,
2109,
20,
1600,
17,
3814,
40,
5391,
25,
21,
896,
882,
60,
19,
1826,
13,
15458,
1663,
32,
83,
2260,
24599,
47,
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... |
HTML5 AppCache support
===
How do I go about checking to see if my browser supports HTML5's AppCache?
I know there is a modernizr but not sure how to make use of it.
modernizr | 0 | [
2,
13,
15895,
264,
4865,
793,
2569,
555,
800,
3726,
3726,
184,
107,
31,
162,
88,
9886,
20,
196,
100,
51,
16495,
6747,
13,
15895,
264,
22,
18,
4865,
793,
2569,
60,
31,
143,
80,
25,
21,
773,
3186,
139,
47,
52,
562,
184,
20,
233,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Preparing table for SHA-1
===
I try to code the SHA-1 algorithm. In my book they wrote that the algorithm needs array of 32 bit values. I has to have length of multiple of 16(it is easy but what values I suppose to add at the end of table), the last message bit has to be set and the last 64 bits represent the message length in big endian order. I get confused: last message is set or last 64 should represent length?
Convertion into 32 bit table, but then how to fill the rest of requirements corectly. I am really bad on these operations.
public static int[] toIntArray(byte[] barr) {
//Pad the size to multiple of 4
int size = (barr.length / 4) + ((barr.length % 4 == 0) ? 0 : 1);
ByteBuffer bb = ByteBuffer.allocate(size *4);
bb.put(barr);
//Java uses Big Endian. Network program uses Little Endian.
bb.order(ByteOrder.BIG_ENDIAN);
bb.rewind();
IntBuffer ib = bb.asIntBuffer();
int [] result = new int [size];
ib.get(result);
return result;
}
| 0 | [
2,
7575,
859,
26,
4116,
8,
165,
800,
3726,
3726,
31,
1131,
20,
1797,
14,
4116,
8,
165,
9083,
9,
19,
51,
360,
59,
738,
30,
14,
9083,
2274,
7718,
16,
2512,
1142,
4070,
9,
31,
63,
20,
57,
1476,
16,
1886,
16,
347,
5,
242,
25,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Use Google OpenID from Android device without requiring username/password
===
Currently, I can authenticate against my webapp using OpenID (with Google as the provider). My Android app goes through the usual OpenID authentication flow. However, I would like to use the Google account associated with the Android device instead of requiring users to type in their username/password. Is this possible?
I've been playing around with the AccountManager, but it only seems to allow authenticating for Google services. It may be that I haven't found the appropriate auth token type. | 0 | [
2,
275,
8144,
368,
1340,
37,
13005,
3646,
366,
9052,
4155,
7259,
118,
6201,
9587,
800,
3726,
3726,
871,
15,
31,
92,
14351,
1373,
149,
51,
2741,
7753,
568,
368,
1340,
13,
5,
1410,
8144,
28,
14,
11747,
6,
9,
51,
13005,
4865,
1852,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Trying to maintain session in all the pages in Java
===
When a direct visitor comes to our site, we are unable to maintain cookies and session. For example, when visitor comes to our site for the first time, we get a null pointer exception. This is not happening when there is a return visitor to our site. Any idea why this could be happening?
Each page has a body tag. On loading the body tag, we don't get session values. We are getting only a null pointer exception (this is happening for a first time visitor only). When the same visitor comes back to our site, we are not getting a null pointer exception, and it seems to work fine.
body bgcolor="#778899" onload="change(),zipValid('<%=session.getAttribute("zip").toString() %>')"
I am trying to do this on the site www.unocardealers.com . Basically, whenever a visitor comes back to our site, we are trying to pre-fill the zip code field with the zip code they last searched with. If they are searching during the same session, then we are trying to pre-fill the zip code with which they searched previously.
| 0 | [
2,
749,
20,
4027,
3723,
19,
65,
14,
4434,
19,
8247,
800,
3726,
3726,
76,
21,
1744,
10875,
1624,
20,
318,
689,
15,
95,
50,
2343,
20,
4027,
19396,
17,
3723,
9,
26,
823,
15,
76,
10875,
1624,
20,
318,
689,
26,
14,
64,
85,
15,
95... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
HTML Hyperlink with Image AND Text
===
Is it possible to make hyperlink looked like button WITH text on it?
We can make hyperlink button with code:
<a href="..."> <img src="button.png" width="100" height="50" alt="Some text"></img> </a>
but i need also TEXT in the center of button.
Thanks. | 0 | [
2,
13,
15895,
5443,
6258,
29,
1961,
17,
1854,
800,
3726,
3726,
25,
32,
938,
20,
233,
5443,
6258,
292,
101,
5167,
29,
1854,
27,
32,
60,
95,
92,
233,
5443,
6258,
5167,
29,
1797,
45,
13,
1,
58,
746,
14057,
3726,
7,
9,
9,
9,
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... |
Trouble with JAR creation
===
sorry if this is a simple question but I'm having trouble exporting my java project into a JAR file. I'm getting the following error:
JAR creation failed. See details for additional information.
com/appiancorp/plugins/capitalize/theFunction [in Capitalize] is not on its project's build path
Unable to get package fragment root: Capitalize/com/appiancorp/plugins/capitalize/theFunction/Capitalize.java
com/appiancorp/plugins/capitalize/theFunction [in Capitalize] is not on its project's build path
I guess I need to add the "theFunction" class to my buildpath? But I don't understand how to do that...Thanks for the help
Darby | 0 | [
2,
2572,
29,
5112,
2502,
800,
3726,
3726,
1875,
100,
48,
25,
21,
1935,
1301,
47,
31,
22,
79,
452,
2572,
7487,
68,
51,
8247,
669,
77,
21,
5112,
3893,
9,
31,
22,
79,
1017,
14,
249,
7019,
45,
5112,
2502,
1702,
9,
196,
3289,
26,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Objective-c : Most efficient way to load a texture to OpenGL
===
Currently i load a texture in iOS using Image I/O and I extract its image data with Core Graphics. Then i can send the image data to OpenGL like this :
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture->width, texture->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture->imageData);
The problem is that the Core Graphics part is really slow, i need to setup and draw with Core Graphics just to extract the image data...i don't want to show it on screen. There must be a more efficient way to extract image data in iOS?...
Here is my code :
...
myTexRef = CGImageSourceCreateWithURL((__bridge CFURLRef)url, myOptions);
...
MyTexture2D* texture;
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
void *imageData = malloc( tileSize.width * tileSize.height * 4 );
CGContextRef imgContext = CGBitmapContextCreate( imageData, tileSize.width, tileSize.height, 8, 4 * tileSize.width, colorSpace, kCGImageAlphaNoneSkipLast | kCGBitmapByteOrder32Big);
CGColorSpaceRelease( colorSpace );
CGContextClearRect( imgContext, CGRectMake( 0, 0, tileSize.width, tileSize.height ) );
CGContextTranslateCTM( imgContext, 0, 0 );
...
CGImageRef tiledImage = CGImageCreateWithImageInRect (imageRef, tileArea);
CGRect drawRect = CGRectMake(0, 0, tileSize.width, tileSize.height);
// *** THIS CALL IS REALLY EXPENSIVE!
CGContextDrawImage(imgContext, drawRect, tiledImage);
CGImageRelease(tiledImage);
// TamTexture2D takes the ownership of imageData and will be responsible to free it
texture = new MyTexture2D(tileSize.width, tileSize.height, imageData);
CGContextRelease(imgContext); | 0 | [
2,
7038,
8,
150,
13,
45,
127,
8243,
161,
20,
6305,
21,
12714,
20,
368,
8430,
800,
3726,
3726,
871,
31,
6305,
21,
12714,
19,
13,
7760,
568,
1961,
31,
118,
111,
17,
31,
10962,
82,
1961,
1054,
29,
2884,
8351,
9,
94,
31,
92,
2660,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Vertica Database Advantages
===
Hy all,
I would like to ask for some opinions about Vertica Database Use :
-for the last 2 mouths i looking for a database that can handle Big Data (tables with more then 500 millions row and more then 100 gb) that have a load of 10-30 millions rows a day.
-went and tested netezza , terradata and vertica databases;
-is good to remember that i have no interest in OLTP like system, as the system is created to dig throw the data and run reports(heavy queries).
- so far vertica is few steps in front of all others(for my needs), but still since is a new product market i am still not convinced of it's power.
I would really like to know other peoples opinion about it and if possible any live experience on working with Vertica.
- if possible what is the bast use of it , Data load tools , integration tools, things that can ease my research .
And most important what is the price of this stuff??
BTW - HP marketing regarding this product is so bad -- they could do better !
THX all
| 0 | [
2,
2494,
12630,
6018,
14683,
800,
3726,
3726,
4085,
65,
15,
31,
83,
101,
20,
1349,
26,
109,
11900,
88,
2494,
12630,
6018,
275,
13,
45,
13,
8,
1106,
14,
236,
172,
725,
18,
31,
699,
26,
21,
6018,
30,
92,
3053,
580,
1054,
13,
5,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
HttpSelfHostServer and HttpContext.Current
===
I'm working on a self-hosted asp.net web api-application.
Everything works fine, but now I'm struggling with HttpContext:
I need to save session-informations from the client.
But HttpContext.Current is always null.
So it's obvious that my HttpSelfHostServer don't work with the static HttpContext-Class.
The thing I don't understand is: why..?
And I can't figure out a way to tell neither HtttpSelfHostServer nor HttpSelfHostConfiguration to work with HttpContext.
Here's what I'm doing:
1. Creating a HttpSelfHostConfiguration
- 1.1 Adding Service-Resolvers & Routes
- 1.2 Adding custom UserNamePassword-Validator
2. create new Instance of HttpSelfHostServer with the config
- 2.1 server.OpenAsync().Wait()
Any help how I can tell my server to work with HttpContext.Current is greatly appreciated!
Cheers! | 0 | [
2,
7775,
8411,
11694,
10321,
106,
17,
7775,
1126,
11969,
9,
17657,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
1119,
8,
25219,
28,
306,
9,
2328,
2741,
21,
2159,
8,
2552,
20669,
9,
796,
693,
1123,
15,
47,
130,
31,
22,
79,
7587,
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... |
xcodebuild error
===
I am having a very weird error when trying to utilize xcodebuild. Below is the error that is being logged.
> xcodebuild clean build -configuration Release -target
> WhiteLabelLibrary -sdk iphoneos 2012-07-05 10:27 xcodebuild[83795]
> (CarbonCore.framework) FSEventStreamStart: ERROR: FSEvents_connect()
> => (ipc/send) invalid destination port (268435459) 2012-07-05 10:27 xcodebuild[83795] (CarbonCore.framework) FSEventStreamInvalidate():
> failed assertion 'streamRef != NULL'
>
> 2012-07-05 10:27 xcodebuild[83795] (CarbonCore.framework)
> FSEventStreamRelease(): failed assertion 'streamRef != NULL'
>
> 2012-07-05 10:27:38.570 xcodebuild[83795:1603] [?T] Failed to start fs
> event stream. xcodebuild: error: Initialization failed. Reason:
> Scanning for plug-ins failed.
Have anyone gone through this error? I have no clue how to fix this error.
Thanks
| 0 | [
2,
993,
9375,
29361,
7019,
800,
3726,
3726,
31,
589,
452,
21,
253,
5455,
7019,
76,
749,
20,
13151,
993,
9375,
29361,
9,
1021,
25,
14,
7019,
30,
25,
142,
13,
19287,
9,
13,
1,
993,
9375,
29361,
2745,
1895,
13,
8,
1126,
13549,
857,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Adapt Method for Multiple Object Types?
===
I have this method which lets me translate the position of an object, animating its move in my iPhone app:
-(void)translatePositionForLabel:(UILabel *)label toFrame:(CGRect)newFrame
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
label.frame = newFrame;
[UIView commitAnimations];
}
You can see this works for `UILabels`, but without having a duplicate of this method (just swapping the object for say `UIButton`) is there anyway I can adapt this method so I can pass any object with a frame? Rather than needing an individual method for each object type.
Hope you van help, thanks.
| 0 | [
2,
9924,
2109,
26,
1886,
3095,
2551,
60,
800,
3726,
3726,
31,
57,
48,
2109,
56,
6884,
55,
20628,
14,
649,
16,
40,
3095,
15,
14487,
1203,
82,
780,
19,
51,
21024,
4865,
45,
13,
8,
5,
2625,
1340,
6,
7028,
6554,
9339,
1106,
21018,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
round number in php
===
Hello how do I round the following to two decimal places.
echo "<div class='quote-results-container'>" . "<div class='quote-results-label'>Price: </div>" . "<div class='quote-results-result'>ex VAT £" . (($_POST['qtylitres'] * $price ['Price']) + $fuelmargin['margin']) / 1.2 . "</div>" . "</div>";
I need to round the price bit of a php novice. | 0 | [
2,
560,
234,
19,
13,
26120,
800,
3726,
3726,
10975,
184,
107,
31,
560,
14,
249,
20,
81,
26380,
1489,
9,
8117,
13,
7,
1,
12916,
718,
3726,
22,
8970,
591,
8,
29955,
18,
8,
1126,
5851,
106,
22,
1,
7,
13,
9,
13,
7,
1,
12916,
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... |
mysql delivering a 'Can't initialize character set utf-8 (path: /usr/share/mysql/charsets/)' error, no utf8.xml file there
===
I am on the Path of learning more about mysqli and all that exciting stuff but I get blocked quite soon.
I have a local server on my debian box. It is up to date, has php and mysql installed and running smoothly.
I was looking to learn a bit more on mysqli and as I tried the following code:
<?php
$db = new mysqli('localhost', 'userdb', 'pwuserdb', 'db');
if(!$db->set_charset('utf-8')) {
printf("Error setting the character set utf-8: %s\n", $db->error);
} else {
printf("Current character set is: %s\n", $db->character_set_name());
}
print_r($db->get_charset());
?>
I was, to my surprise, getting the following message, when visiting the page:
`Error setting the character set utf-8: Can't initialize character set utf-8 (path: /usr/share/mysql/charsets/) stdClass Object ( [charset] => latin1 [collation] => latin1_swedish_ci [dir] => [min_length] => 1 [max_length] => 1 [number] => 8 [state] => 801 [comment] => cp1252 West European ) `
I thought to myself that it is logical as I didn't set up utf-8 as the standard charset of mysql so I completed with the following settings in the my.cnf file:
for `[mysqld]`
default-character-set=utf8
for `[client]`
default-character-set=utf8
I also logged into mysql from the command line and ran
`ALTER DATABASE learndb CHARSET=utf8;`
I also reloaded mysql from the command line, as well as apache.
When looking how things are going on in mysql, almost everything looks alright:
mysql> SHOW VARIABLES LIKE 'character_set%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
But due to the fact that it seems like mysql cannot locate the utf8 file, I checked for a `utf8.xml` file in the `/usr/share/mysql/charsets/` folder and there isn't one.
In the `Index.xml` file under this directory there is the mention of utf8, in the list of the charsets but I suppose that the problem comes from the fact that the xml file is missing in the directory.
Just for the information, my system locales are all UTF8 (en and pl) and I cannot understand why the utf8.xml file is not in the directory, as I haven't been goofying around with this directory or its content at all.
Any idea/ advice/ recommendation is welcome.
Thank you in advance!
Cheers!
| 0 | [
2,
51,
18,
22402,
14150,
21,
13,
22,
1245,
22,
38,
2104,
2952,
925,
309,
287,
11720,
8,
457,
13,
5,
8353,
45,
13,
118,
267,
139,
118,
16608,
118,
915,
18,
22402,
118,
5433,
3554,
18,
118,
6,
22,
7019,
15,
90,
287,
11720,
457,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 import the contacts from the gmail,yahoo,hot mail to asp.net
===
I want to implement the import the contacts from diff mails like gmail,yahoo, and hot mails in Asp.net. After get the contacts ,i will send message to them.If you know any information about this,you will share the information for me.
Thanks in Advance. | 0 | [
2,
184,
20,
9010,
14,
11894,
37,
14,
489,
8079,
15,
1046,
8884,
15,
7010,
4216,
20,
28,
306,
9,
2328,
800,
3726,
3726,
31,
259,
20,
8713,
14,
9010,
14,
11894,
37,
20811,
4216,
18,
101,
489,
8079,
15,
1046,
8884,
15,
17,
1047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 more difference between gcc's and MS preprocessor
===
One more difference between gcc preprocessor and that of MS VS cl. Consider the following snippet:
# define A(x) L ## x
# define B A("b")
# define C(x) x
C(A("a" B))
For 'gcc -E' we get the following:
L"a" A("b")
For 'cl /E' the output is different:
L"a" L"b"
MS preprocessor somehow performs an additional macro expansion. Algorithm of its work is obviously different from that of gcc, but this algorithm also seems to be a secret. Does anyone know how the observed difference can be explained and what is the scheme of preprocessing in MS cl? | 0 | [
2,
53,
91,
2841,
128,
489,
3384,
22,
18,
17,
4235,
782,
16835,
248,
800,
3726,
3726,
53,
91,
2841,
128,
489,
3384,
782,
16835,
248,
17,
30,
16,
4235,
4611,
10842,
9,
3563,
14,
249,
13,
29061,
45,
6926,
9267,
21,
5,
396,
6,
644... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 implement accented characters on windows?
===
Any pointers on how accented characters are implemented in Windows would be helpful.
Goal - Ability to add accented characters(áéíóú) using keystrokes like ctrl + ' followed by a vowel and all other combinations that work on standard applications like MS Word, Text pad etc.
**My Findings till date** -
Everywhere I could read documentation/blogs/forums related to WM_DEADCHAR message.What I understand is :
::TranslateMessage translates WM_KEYUP messages corresponding to dead keys into WM_DEADCHAR messages, and it translates WM_SYSKEYUP messages generated by dead keys into WM_SYSDEADCHAR messages. Windows provides the logic that combines these messages with character messages to produce accented characters, so dead-key messages are usually passed on for default processing.
I added this message to my CWnd derived class's message map but OnDeadChar() never gets called. Additionally I have found out using SPY++ that even in MSWord,Textpad etc where accented characters could be added with combination of these keystrokes, WM_DEADCHAR message is never dispatched.
So, Does this mean that WM_DEADCHAR is actually not the way to address this issue?
Please provide any sample code/steps/mechanism to implement accented characters.
Thanks in advance!!!
| 0 | [
2,
184,
20,
8713,
7980,
69,
1766,
27,
1936,
60,
800,
3726,
3726,
186,
454,
445,
27,
184,
7980,
69,
1766,
50,
6807,
19,
1936,
83,
44,
15600,
9,
1195,
13,
8,
2165,
20,
3547,
7980,
69,
1766,
5,
4391,
49,
2655,
6,
568,
1246,
12962... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Seach string in file if found add four lines above in PHP
===
I want to add four line of code in a PHP file if it found for string 'test' in the file anywhere. I google a lot on this, but didn't get exact solution :(
Please help me on this. Thanks in advance. | 0 | [
2,
598,
673,
3724,
19,
3893,
100,
216,
3547,
222,
1560,
784,
19,
13,
26120,
800,
3726,
3726,
31,
259,
20,
3547,
222,
293,
16,
1797,
19,
21,
13,
26120,
3893,
100,
32,
216,
26,
3724,
13,
22,
10543,
22,
19,
14,
3893,
4922,
9,
31,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
AJAX / PHP not working on new WAMP server
===
We've moved a php page from one WAMP server to another and the chap who created it has left the business. I know nothing about AJAX, so am struggling!
I've scoured the code on both the old server and new, and it's exactly the same but for some reason the AJAX on the new server isn't working correctly, whereas on the old server it's fine.
What it's supposed to do is show a list of people from our database, allow users to update those records and then show the new, updated record without refreshing the page.
On the old server, it works a treat but on the new server it doesn't load the new data through. It's probably something ridiculously basic, but I'm scratching my head (mainly as I know nothing about the technology!)
Any help much appreciated. | 0 | [
2,
20624,
13,
118,
13,
26120,
52,
638,
27,
78,
619,
10158,
8128,
800,
3726,
3726,
95,
22,
195,
385,
21,
13,
26120,
2478,
37,
53,
619,
10158,
8128,
20,
226,
17,
14,
13724,
72,
679,
32,
63,
225,
14,
508,
9,
31,
143,
626,
88,
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... |
Is it possible to split a chunk even further with magit?
===
When you review your changes sections you get the chunks as you would when you do for example "git add -p" by default, but I can't find an option to split chunks into smaller chunks as you would by choosing the "s" option when issuing commands with -p, so is it possible? | 0 | [
2,
25,
32,
938,
20,
2132,
21,
15009,
166,
653,
29,
4723,
242,
60,
800,
3726,
3726,
76,
42,
1487,
154,
1693,
4501,
42,
164,
14,
15009,
18,
28,
42,
83,
76,
42,
107,
26,
823,
13,
7,
10404,
3547,
13,
8,
306,
7,
34,
12838,
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... |
Webservice Response Ends with --UUID
===
I am using cxf framework in order to expose some web services.
When i tested it using soap-ui, it works great. But one of our customers that uses different soap client complains that the message ends with:
> /soap:Envelope>
>
>--uuid:91c5694a-93f5-404c-ab2b-8c220b7f289f--
I searched the web, and i found that this line apears not only in our system. But I couldn't figure out whether this suffix is valid and well-formed, or not.
Is there any reference that document this issue?
Is it really valid?
How can I remove it?
Thanks! | 0 | [
2,
2741,
11449,
1627,
3451,
29,
13,
8,
8,
19612,
1340,
800,
3726,
3726,
31,
589,
568,
272,
396,
410,
6596,
19,
389,
20,
13833,
109,
2741,
687,
9,
76,
31,
7631,
32,
568,
6447,
8,
5661,
15,
32,
693,
374,
9,
47,
53,
16,
318,
52... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
For Assembly.Location, what determines if value is local or UNC path?
===
I'm trying to get the physical path of an assembly and am using Assembly.Location[ \[MSDN\]][1]. My question is what determines whether a local or UNC path is returned?
[1]: http://msdn.microsoft.com/en-us/library/system.reflection.assembly.location.aspx | 0 | [
2,
26,
1475,
9,
19032,
15,
98,
3746,
18,
100,
1923,
25,
375,
54,
16061,
2013,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
164,
14,
1825,
2013,
16,
40,
1475,
17,
589,
568,
1475,
9,
19032,
2558,
13,
1,
2558,
79,
18,
43,
103,
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 do an ajax post of an image on an HTML page?
===
I'm using Alex Michael's fantastic javascript [filtrr library][1]
to allow me to manipulate images on an HTML page. The question I have is how do I do an ajax/jquery post of an image that has been filtered inline on the page? For instance:
<div>
<img id="myimage" />
</div>
<input type="button" onclick="filterImage();" />
Once the filtering has been done, how do I post the contents of the image with id "myimage" back to a server-side PHP script so the filtered image can be saved? The tutorials I've seen for doing ajax image POSTs have all used file uploaders, which isn't what I'm looking for. I want to post an image from the HTML DOM.
Thanks!
[1]: http://alexmic.github.com/filtrr/ | 0 | [
2,
184,
20,
107,
40,
20624,
678,
16,
40,
1961,
27,
40,
13,
15895,
2478,
60,
800,
3726,
3726,
31,
22,
79,
568,
2155,
832,
22,
18,
10356,
8247,
8741,
636,
11924,
38,
5932,
1248,
500,
2558,
165,
500,
20,
1655,
55,
20,
18468,
3502,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Convert java.sql.Timestamp to java.sql.Timestamp in another timezone
===
I am in need to manipulate on java.sql.Timestamp.
Input to the function is:
Formatted DateTime in java.sql.Timestamp
[Possible date formats are: MM/dd/yyyy hh:mm:ss aa, MM/dd/yyyy hh:mm:ss, MM/dd/yyyy hh:mm aa, MM/dd/yyyy HH:mm, MM/dd/yy hh:mm aa, MM/dd/yy HH:mm, MM/dd/yyyy, and some others]
Required Output:
java.sql.Timestamp in another Timezone the same formatted DateTime as input
So basically I need to change timezone of the DateTime in java.sql.Timestamp
I have seen other posts, which mention to use JODA, but I can't use it due to some restrictions.
I have tried
- to convert java.sql.Timestamp to java.date.Calendar,
- then change the timezone,
- then convert to it to date
- format date to the same formatted datetime
See the code below:
Timestamp ts = "2012-06-20 18:22:42.0"; // I get this type of value from another function
Calendar cal = Calendar.getInstance();
cal.setTime(ts);
cal.add(Calendar.HOUR, -8);
String string = cal.getTime().toString(); // return value is in " DAY MMM dd hh:mm:ss PDT yyyy " format i.e. Wed Jun 20 10:22:42 PDT 2012
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss"); // This could be any format required
Date date;
try {
date = formatter.parse(string); // I am getting exception here on parsing
} catch (ParseException e1) {
e1.printStackTrace();
}
Can anyone tell me what is wrong here, or is there any other way to manipulate on Timezone for java.sql.Timestamp ?
Thanks. | 0 | [
2,
8406,
8247,
9,
18,
22402,
9,
891,
384,
10158,
20,
8247,
9,
18,
22402,
9,
891,
384,
10158,
19,
226,
85,
11661,
800,
3726,
3726,
31,
589,
19,
376,
20,
18468,
27,
8247,
9,
18,
22402,
9,
891,
384,
10158,
9,
6367,
20,
14,
1990,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 mouseover causing flickering
===
As to be viewed at: http://jsfiddle.net/pBt38/5/ I dont know how to stop the flickering of the div.message_options_slider, its a child element so isn't it supposed to keep the mouseover active?
Also, any suggestions need to have the .live() function as this will be applied to dynamic elements.
Thanks in advance! | 0 | [
2,
487,
8190,
93,
7567,
2549,
3242,
22399,
800,
3726,
3726,
28,
20,
44,
6084,
35,
45,
7775,
6903,
728,
18,
1707,
12312,
9,
2328,
118,
13390,
38,
3665,
118,
10551,
31,
1049,
143,
184,
20,
747,
14,
22399,
16,
14,
13,
12916,
9,
384... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Changing size of NSTextView
===
I am trying to implement an `NSTextView` which resizes to fit its content. I am trying to make it so it has a maximum amount of lines. Meaning, that when this limit is reached, it will not grow any further and the user will be able to scroll it.
There seem to be a lot of people wanting this but I have not found a complete implementation of this.
The idea is to take the content size of the `NSTextView` and resize it so that it matches. I just can't figure out how to set the layout size of the `NSTextView`. It does not seem to be it's `frame` which needs to be set and which one might expect.
Can anyone please tell me how to set the frame of the `NSTextView`? | 0 | [
2,
4226,
1072,
16,
13,
2172,
11969,
4725,
800,
3726,
3726,
31,
589,
749,
20,
8713,
40,
13,
1,
2172,
11969,
4725,
1,
56,
10719,
13569,
20,
2742,
82,
2331,
9,
31,
589,
749,
20,
233,
32,
86,
32,
63,
21,
2979,
2006,
16,
1560,
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 set maximum video edited video length with UIImagePickerController
===
I am using UIImagePickerController to record a video and then upload it to Amazon S3. However, I need to set the maximum length of the (edited) video to 45 seconds. I want the user to be able to record for as long as he or she wishes and then for the video to be presented in the video trimming interface where the maximum duration is 45 seconds.
**Other info:** I have set allowsEdting to YES, but I would like to set the maximum duration of the editing to 45 seconds. I know that I can use the videoMaximumDuration property of my video view controller to set the maximum duration that the user can record for, but that just cuts off the recording once it reaches 45 seconds.
Any help would be greatly appreciated. | 0 | [
2,
184,
20,
309,
2979,
763,
4802,
763,
1476,
29,
13,
5661,
22039,
16855,
106,
12898,
1252,
800,
3726,
3726,
31,
589,
568,
13,
5661,
22039,
16855,
106,
12898,
1252,
20,
571,
21,
763,
17,
94,
71,
8294,
32,
20,
8059,
13,
18,
240,
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... |
Delete alert from TFS2010
===
I added an alert to TFS2010, that sends an email whenever someone checks in a file in a specific project. The alert works - I receive plenty of emails from the server. I want to remove the alert but cannot find any place to do it. Here is what I tried using VS2010:
- In Team Explorer right click the project collection -> Alerts Explorer. It shows an empty list. Clicking Refresh makes no difference.
- In the Team menu click Alerts Explorer. Same result as above.
- In Team Explorer right click the project -> Project Alerts... It shows "Check the alert you want to create". I don't want to create an alert. None of the items are checked.
- In the Team menu click Project Alerts... Same result as above.
- In Source Control Explorer right click the project collection -> Alert on Change... It shows "Add Alert to Folder". That is not what I want to do. The same happens when right clicking on the project.
- In Source Control Explorer right click the project -> Alert on Change... Same result as above. | 0 | [
2,
27448,
7863,
37,
13,
11720,
18,
2751,
800,
3726,
3726,
31,
905,
40,
7863,
20,
13,
11720,
18,
2751,
15,
30,
11350,
40,
8517,
6634,
737,
16602,
19,
21,
3893,
19,
21,
1903,
669,
9,
14,
7863,
693,
13,
8,
31,
2588,
7062,
16,
851... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 mobile prevent multiple handlers firing from single event
===
I've set up a multi-page html document, with sliding transitions between pages intended to be fired when the user swipes tabs on the left or right side of the page. The info on which pages the tabs should swipe to is embedded in <data- > attributes at the top of each page div.
The initial swipe works fine once, but each successive swipe seems to multiply up, so the next wipe moves up by two pages, the following one by four, and so on. So far as I can figure out, the Init function is getting called correctly once for each page, but the swipes are being multiplied.
Reading around, I suspect the answer is to unbind the swipe event the moment it fires once, and rebind it once the page transition is complete, but I can't for the life of me figure out how... I'm a newb at all this, so a simple explanation would be great!
Here's the relevant HTML:
<div data-role="page" id="intro1" class="page" data-rightTarget= "#intro2" data-
leftTarget= "#intro1">
<script>
$("body").on('pageshow', "#intro1", function() {
InitIntroSliders ();
});
</script>
...
</div><!-- /intro1 -->
<div data-role="page" id="intro2" class="page" data-rightTarget= "#intro3" data-
leftTarget= "#intro1">
<script>
$("body").on('pageshow', "#intro2", function() {
InitIntroSliders ();
});
</script>
...
</div><!-- /intro2 -->
... etc. (It seems I have to put the scripts in the div for each page rather than the overall Head in order to get them to reload the Initialisation script on each new page).
And here's the jQuery:
function InitIntroSliders (){
$(document).on("swipeleft","#righttab", function(){
var rightTarget = $.mobile.activePage.attr("data-rightTarget");
$.mobile.changePage($(rightTarget), {transition: 'slide'});
//$(document).off("swipeleft", "#righttab", function());
});
$(document).on("swiperight","#lefttab", function(){
var leftTarget = $.mobile.activePage.attr("data-leftTarget");
$.mobile.changePage($(leftTarget), {transition: 'slide', reverse:
'true'});
//$(document).off("swiperight", "#lefttab", function());
});
}
I've tried adding in the commented-out lines to turn the binding off, but all that seems to do is bring the whole thing grinding to a halt. Any ideas greatly appreciated! Giles
| 0 | [
2,
487,
8190,
93,
3241,
2501,
1886,
24641,
18,
7139,
37,
345,
807,
800,
3726,
3726,
31,
22,
195,
309,
71,
21,
1889,
8,
6486,
13,
15895,
4492,
15,
29,
7609,
4513,
18,
128,
4434,
2081,
20,
44,
3899,
76,
14,
4155,
27246,
18,
6523,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
technique to transfer xml from jsp to servlet
===
I'm making a web app (standard JSP and servlet) that will consume a certain web service. the data that the user will feed to the web service is in the form of xml file (data.xml). Let's say the user, the web app server and web service server are all in different PC1, PC2 and PC3 respectively. The user has data.xml in PC3 accessing web page from PC2 (jsp). My question is what's the better way to transfer the XML?
scenario 1:
transfer in the form of filestream (file upload) from jsp -> servlet -> web service -> servlet -> jsp
scenario 2:
jsp accesses data.xml, read the contents, store it in string object and then pass the xml string to servlet -> web service -> servlet and finally return the response as object to jsp (not xml, not string, but object).
which is better? | 0 | [
2,
4873,
20,
2617,
23504,
37,
487,
3401,
20,
13,
10321,
1336,
800,
3726,
3726,
31,
22,
79,
544,
21,
2741,
4865,
13,
5,
15566,
487,
3401,
17,
13,
10321,
1336,
6,
30,
129,
16447,
21,
1200,
2741,
365,
9,
14,
1054,
30,
14,
4155,
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... |
Drools cannot resolve functions when argument is fact
===
We recently migrated from Drools 5.1.0 to Drools 5.3.0, and all functions declared in Guvnor with arguments of type facttype, are throwing the following error when rule is activated:
Caused by: [Error: unable to resolve method using strict-mode: CorrelatorSep.NagiosDataFormatter.NagiosDataFormatter(CorrelatorSep.Nagios)]
[Near : {... NagiosDataFormatter(na); ....}]
: )
function String NagiosDataFormatter(Nagios nn) {
String formattedMsg = "";
formattedMsg += "\n IP: " + nn.getIp_address();
formattedMsg += "\n Host: " + nn.getHost_alias();
return formattedMsg;
}
The same error happens in compilation time, but only when MVEL dialect is enabled.
Any pointers?
Thanks
| 0 | [
2,
27008,
18,
1967,
9854,
3719,
76,
5476,
25,
837,
800,
3726,
3726,
95,
1989,
14204,
37,
27008,
18,
331,
9,
165,
9,
387,
20,
27008,
18,
331,
9,
240,
9,
387,
15,
17,
65,
3719,
2482,
19,
4835,
710,
4747,
29,
10553,
16,
1001,
837... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
awk split integer into several parts
===
Have this integer `20120305193821` und would like to split it into several parts `2012-03-05-19:38:21` for further usage in awk. Can anybody help? | 0 | [
2,
13,
3885,
197,
2132,
13820,
77,
238,
1341,
800,
3726,
3726,
57,
48,
13820,
13,
1,
3212,
387,
19406,
11679,
1941,
1,
3968,
83,
101,
20,
2132,
32,
77,
238,
1341,
13,
1,
3212,
8,
3601,
8,
4071,
8,
1433,
22284,
45,
1941,
1,
26,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
GCRoot array initialization in managed code
===
So I have a c++\clr class. i have a gcroot array member there of dictionaries.
i have a c++ .net class that should get this array, create it, create its dictionaries and return it.
I managed to get it compiled, but when the array comes out of the function, it is empty.
public ref class CPPNet
{
Function(array<Dictionary<String^,String^>^>^% arrDicts)
{
// initialization is done here and cannot be done out side...
arrDicts = gcnew array<Dictionary<String^,String^>^>(1);
arrDicts[0] = gcnew Dictionary<String^,String^>();
arrDicts[0]["Key"] = "Value";
}
}
class CPPManaged
{
gcroot<array<Dictionary<String^,String^>^>^> m_arrDicts;
gcroot<CPPNet^> m_obj;
public:
CPPManaged()
{
m_obj = gcnew<CPPNet^>();
m_obj->Function((array<Dictionary<String^,String^>^>^)m_arrDicts); // casting is done, otherwise i get compilation error C2664
String^ = m_arrDicts[0]["Key"]; //<- crashes - array not initialized?
}
}
I'll appreciate any ideas. | 0 | [
2,
13,
10362,
14032,
7718,
2104,
1829,
19,
1471,
1797,
800,
3726,
3726,
86,
31,
57,
21,
272,
20512,
1,
5316,
139,
718,
9,
31,
57,
21,
13,
10362,
14032,
7718,
322,
80,
16,
29783,
9,
31,
57,
21,
272,
20512,
13,
9,
2328,
718,
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... |
PHP REST do not return headers. Status code is always the same
===
I am completely new to REST so, please read with patience.
I have done very simple class which implements the following method
public function POST_action($arr){
// do something
header('HTTP/1.1 201 Created');
header('Location: /events/');
echo json_encode(array(
//some information
));
}
this method is executed when I invoke api using cUrl
$data = array(
// some data
)
$c = curl_init();
$options = array(
CURLOPT_URL => 'link to api',
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query($data)
);
curl_setopt_array($c, $options);
$data = curl_exec($c);
p($data);
curl_close($c);
The problem that I can see the result of
echo json_encode(array(
//some information
));
but the status code is always Ok 200, nevertheless I want it to be 'HTTP/1.1 201 Created'
Can anyone help me, what I am doing wrong? | 0 | [
2,
13,
26120,
760,
107,
52,
788,
157,
445,
9,
1782,
1797,
25,
550,
14,
205,
800,
3726,
3726,
31,
589,
1524,
78,
20,
760,
86,
15,
2247,
1302,
29,
13557,
9,
31,
57,
677,
253,
1935,
718,
56,
8713,
18,
14,
249,
2109,
317,
1990,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Changing the colors in progressbar
===
I am using a progressbar, yet it appears to be all in white. When I used the same code on a previous project, I got a black background and it looked perfect. How can I change it so that the background is black again. I use this code to launch the progressbar
ProgressDialog.show(this, "", "Searching...", true);
Do I need to set something in my xml file for this screen?
| 0 | [
2,
4226,
14,
5268,
19,
3455,
1850,
800,
3726,
3726,
31,
589,
568,
21,
3455,
1850,
15,
768,
32,
1780,
20,
44,
65,
19,
359,
9,
76,
31,
147,
14,
205,
1797,
27,
21,
1158,
669,
15,
31,
330,
21,
319,
2395,
17,
32,
292,
2107,
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... |
glReadPixels returning all zeros
===
I'm using the following code to get access to the iOS screen pixels:
int width = 1536;
int height = 2048;
GLubyte *buffer = (GLubyte *) malloc(width * height * 4);
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
The problem is that buffer is coming back with nothing but zeros. The screen looks fine. Any idea why it would be returning 0's and not the screen data?
glGetError() is returning 0, so I assume there is no error.
This is running on a iPad 3.
| 0 | [
2,
13,
8430,
10647,
18321,
6798,
2485,
65,
4606,
18,
800,
3726,
3726,
31,
22,
79,
568,
14,
249,
1797,
20,
164,
1381,
20,
14,
13,
7760,
2324,
18146,
18,
45,
19,
38,
9456,
800,
357,
3775,
73,
19,
38,
2947,
800,
434,
3216,
73,
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... |
Htaccess setenvif header defined
===
I was trying to make correct ajax redirect, by apache.
All request are going to index.php where they are routing,
but i want to filer ajax request by defined header,
and check it before php - via htaccess, and redirect to ajax.php.
I was reading manuals and test some days before, but this simple lang. is not so simple :(
Htaccess is looking like that:
Options +FollowSymlinks
DirectoryIndex index.php
RewriteEngine On
RewriteBase /
Options +FollowSymlinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ test/over/index.php?do=$1 [L,QSA] | 0 | [
2,
13,
9020,
20604,
309,
219,
710,
821,
157,
106,
2811,
800,
3726,
3726,
31,
23,
749,
20,
233,
4456,
20624,
302,
14706,
15,
34,
17140,
9,
65,
3772,
50,
228,
20,
4348,
9,
26120,
113,
59,
50,
19880,
15,
47,
31,
259,
20,
3893,
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... |
c# code for cropping an image using AsyncFileUpload control
===
**I am using an AssyncFileUpload tool for uploading images in a registration form. But, I have a problem in that, if anyone will try to upload a photo larger than 30kb, the size of database may increased. So I would like give a provision for users to upload their large photo uising the AssyncFileUpload control and provide a cropping mechanism. If anyone know the idea, please tell me.**
*thanks* | 0 | [
2,
272,
5910,
1797,
26,
4880,
5574,
40,
1961,
568,
21,
9507,
150,
16877,
576,
8294,
569,
800,
3726,
3726,
13,
1409,
49,
589,
568,
40,
28,
9507,
150,
16877,
576,
8294,
5607,
26,
71,
16866,
3502,
19,
21,
8587,
505,
9,
47,
15,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 success/failure messages with ajax?
===
I'm using MailChimp's API and I can successfully subscribe an email address by passing an email address to a specific URL. Once the email is submitted, MailChimp echoes a success or failure code.
Example: myurl.com/subscribe.php?email=example@gmail.com
**What I need help with**
My form isn't displaying the success/failure messages that I've based on MailChimps returned codes. What am I doing wrong?
http://jsfiddle.net/WarrenBee/c4MWX/ | 0 | [
2,
184,
20,
788,
1280,
118,
24910,
4221,
7561,
29,
20624,
60,
800,
3726,
3726,
31,
22,
79,
568,
4216,
1594,
2554,
22,
18,
21,
2159,
17,
31,
92,
3673,
13,
20330,
40,
8517,
3218,
34,
2848,
40,
8517,
3218,
20,
21,
1903,
287,
6362,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 choose my new career? to be a SW developer? to be a SW tester?
===
I did electronics design and embedded software (e.g. Linux driver) in the past several years. Now I have a chance to change the direction of my career. And I decided not to do HW design any more and applied some SW positions. In fact, to be a SW developer is my dream!
Recently I may get a high level tester position (architect level), and it allows me to study the whole system. I was told there is also programming work. But I really want to be a SW developer: I like the feeling to create something and grasp more and more programming skills.
I feel very contradictory! I don't know how to make the decision.
Hope to get your feedback!
BR | 4 | [
2,
184,
20,
3538,
51,
78,
545,
60,
20,
44,
21,
8783,
10058,
60,
20,
44,
21,
8783,
1289,
106,
60,
800,
3726,
3726,
31,
144,
7956,
704,
17,
12138,
2306,
13,
5,
62,
9,
263,
9,
13024,
2425,
6,
19,
14,
640,
238,
122,
9,
130,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 : Use Command Prompt instead of Eclipse console
===
When I run a project in Eclipse, my project will run on Eclipse console, and I have met some errors.
Because my experience with NetBean, I think my problem will be fixed if I run on Command Prompt (Windows Console) each time I run a project, but I don't know how to do this.
I can do this easily on Netbean, but in Eclipse, it might hard. Please help me.
Thanks :) | 0 | [
2,
11652,
13,
45,
275,
1202,
11443,
4417,
700,
16,
11652,
8650,
800,
3726,
3726,
76,
31,
485,
21,
669,
19,
11652,
15,
51,
669,
129,
485,
27,
11652,
8650,
15,
17,
31,
57,
798,
109,
11908,
9,
185,
51,
1496,
29,
4275,
863,
210,
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... |
OAuthSerivce with James Ferreira Fusion Table Example
===
I am busy implementing James Ferreira's Fusion Table example from his excellent book, 'Google Script'. However, Google Apps Script has been updated to include shareable libraries since then, and James has also created a shareable fusion tables library at googlescriptexamples.com.
I am able to add the library to my project easily enough, and the autocompletion recognizes the "searchFusion" calls, but when I try to deploy and run, I get "You do not have access to library OAuthService, used by your script, or it has been deleted."
Any ideas on how to get authorized? I have created the required Fusion Table, and included the FUSION_ID as a project property, as required... | 0 | [
2,
635,
1346,
96,
870,
9655,
1105,
29,
586,
26765,
11117,
859,
823,
800,
3726,
3726,
31,
589,
4394,
17333,
586,
26765,
22,
18,
11117,
859,
823,
37,
33,
5977,
360,
15,
13,
22,
16111,
4875,
3884,
22,
9,
207,
15,
8144,
4865,
18,
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... |
forward declaring a derived class to be used in a base class causes a missing default constructor error
===
Had a complicated program that kept throwing up the missing default constructor error, and after much tinkering, i found the exact same scenario that gives the same error. What's wrong with this?
class B;
class A
{
public:
A() {instance = new B;}
virtual ~A() {delete instance;}
private:
A*instance;
};
class B : public A
{
public:
B(){}
}
can't forward declare a derived class to be used within the base class? | 0 | [
2,
917,
15594,
21,
3981,
718,
20,
44,
147,
19,
21,
1000,
718,
4047,
21,
2863,
12838,
6960,
248,
7019,
800,
3726,
3726,
41,
21,
8343,
625,
30,
1025,
6033,
71,
14,
2863,
12838,
6960,
248,
7019,
15,
17,
75,
212,
25438,
68,
15,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Cocos2d light when entity gets hit
===
Abused topic considering the posts (e.g [this][1] or [this][2]) but I still don't quiet manage to get what I want.
I am working on a shooter game and I would like to light up my enemies when they get hit (as well as the player).
If I run the following my sprite doesn't get white. Is this the right direction?
-(void) gothitAnimation
{
ccColor3B originalColor = self.color;
id delay = [CCDelayTime actionWithDuration:0.4f];
[self runAction:[CCSequence actions: [CCTintTo actionWithDuration:0.01f red:255 green:240 blue:240], delay, [CCTintTo actionWithDuration:0.01f red:originalColor.r green:originalColor.g blue:originalColor.b] , nil]];
}
I have tried running only the CCTintTo action and it does work only with colours different than white.
I have found Arodius's game demo and it seem to me that there the player ship gets set multiple times to invisible and visible in a short sequence of actions when hit or in lower energy levels (see [this demo][3]). Also the enemy get a light effect when hit.
Any idea on how this has been achieved? Did the developer use the CCTintTo action or something else? I know that for the explosion he used ParticleEffects.
[1]: http://stackoverflow.com/questions/7005188/how-to-light-up-a-sprite-in-cocos2d
[2]: http://stackoverflow.com/questions/9492641/color-changing-sprites-cocos2d
[3]: http://www.youtube.com/watch?v=-6fNQBt0Mio | 0 | [
2,
22470,
18,
135,
43,
471,
76,
9252,
3049,
770,
800,
3726,
3726,
20055,
8303,
5154,
14,
9868,
13,
5,
62,
9,
263,
636,
1565,
500,
2558,
165,
500,
54,
636,
1565,
500,
2558,
135,
500,
6,
47,
31,
174,
221,
22,
38,
2401,
4705,
20,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Simulator keeps crashing in Xcode 4.4
===
When ever I run my app in Xcode 4.4 the simulator fails to open, "iOS Simulator quit unexpectedly." It runs on perfectly on the device though. | 0 | [
2,
24565,
8968,
14604,
19,
993,
9375,
268,
9,
300,
800,
3726,
3726,
76,
462,
31,
485,
51,
4865,
19,
993,
9375,
268,
9,
300,
14,
24565,
13614,
20,
368,
15,
13,
7,
7760,
24565,
6489,
16044,
9,
7,
32,
1461,
27,
5759,
27,
14,
3646... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Making Google Custom Search display results on a new tab
===
I am developing [a website][1] which has custom Google search bar embedded into it. My client wants a functionality that when a user searches something into that search box, a new page should open where he should be shown the result of his search. The current Google search bar displays the result just below it. Is there any way I can change to display the results in a new tab? Please help out. Thanks
[1]: http://widgetsinabottle.com/widget/demo/effect.html#.UBK6qmEe5K3 | 0 | [
2,
544,
8144,
5816,
2122,
3042,
1736,
27,
21,
78,
6523,
800,
3726,
3726,
31,
589,
3561,
636,
58,
2271,
500,
2558,
165,
500,
56,
63,
5816,
8144,
2122,
748,
12138,
77,
32,
9,
51,
6819,
2846,
21,
18548,
30,
76,
21,
4155,
19994,
301... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
show X button only when text is entered in the textbox
===
I am using the plugin available [here][1] to remove the text in the textbox by clicking on the X button. How do I modify the code so that the X button shows up only when text is entered in the text box?
I tried setting condition on the return starement in JavaScript code: `if ($('#search').val().length != 0)` but it dint work.
Here is the code I tried:
$(document).ready(function(){
if ($('#search').val().length != 0){
$('#search').clearable();
$('.divclearable').show();
}
else{
$('.divclearable').hide();
}
});
Any help would be highly appreciated.
[1]: http://viralpatel.net/blogs/clearable-textbox-jquery/ | 0 | [
2,
298,
993,
5167,
104,
76,
1854,
25,
1297,
19,
14,
1854,
5309,
800,
3726,
3726,
31,
589,
568,
14,
10922,
108,
904,
636,
6836,
500,
2558,
165,
500,
20,
4681,
14,
1854,
19,
14,
1854,
5309,
34,
25590,
27,
14,
993,
5167,
9,
184,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
JAX-RS CXF Exception wrapping
===
I would like to add an ExceptionMapper to CXF (2.6.1) which not only communicates the Response code, but also ships the exception in the payload format (I'm using JSON for now).
@Provider
public class CustomExceptionMapper
implements
ExceptionMapper<MyException>
{
...
@Override
public Response toResponse(MyException mex)
{
//I need something here which can convert mex object to JSON and ship it in response
// I want this to be de-serialized on client
//the following returns the status code
return Response.status(Response.Status.BAD_REQUEST).build();
}
...
}
Is there a way to do this ? | 0 | [
2,
11712,
8,
1224,
272,
396,
410,
5391,
13437,
800,
3726,
3726,
31,
83,
101,
20,
3547,
40,
5391,
540,
8763,
20,
272,
396,
410,
13,
5,
135,
9,
379,
9,
165,
6,
56,
52,
104,
8709,
18,
14,
1627,
1797,
15,
47,
67,
2034,
14,
5391,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 is the use of * in C?
===
I have a this code:
#include <stdio.h>
#include <conio.h>
void main()
{
int n = 5;
clrscr();
printf("n=%*d", n);
getch();
}
The output which I got is: `n= 5`. Why is there a space? How is it generated? What is the use of `*` in the code? | 0 | [
2,
98,
25,
14,
275,
16,
1637,
19,
272,
60,
800,
3726,
3726,
31,
57,
21,
48,
1797,
45,
6926,
22640,
13,
1,
384,
6921,
9,
252,
1,
6926,
22640,
13,
1,
1126,
1963,
9,
252,
1,
11364,
407,
5,
6,
13,
1,
19,
38,
13,
103,
800,
33... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Constructing C# Lists from that what is enumerable
===
var t = new List<byte?[,]>();
var t2 = new byte?[4, 4][];
var r = new List<byte?[,]>(t);
var r2 = new List<byte?[,]>(t2); // error
I thought C# lists and arrays are both Enumerable, and that lists can be constructed from an enumerable object to create a copy of the collection.
Whats wrong with the last line from the example above?
Compile error: The best overloaded method match for 'List<byte?[*,*]>.List(IEnumerable<byte?[*,*]>)' has some invalid arguments. | 0 | [
2,
18660,
272,
5910,
7227,
37,
30,
98,
25,
1957,
723,
106,
579,
800,
3726,
3726,
4033,
13,
38,
800,
78,
968,
1,
23246,
60,
2558,
15,
500,
1,
5,
6,
73,
4033,
13,
38,
135,
800,
78,
34,
591,
60,
2558,
300,
15,
268,
500,
2558,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Googletest: combine tests in a testsuite
===
I am trying googletest.
Previously i have been using Boost test and i have been using the macro BOOST_AUTO_TEST_SUITE to group my tests into a Testsuite.
This makes the junit reports much more readable.
I have not found a hint how to do this or something similar in googletest. Is it possible? | 0 | [
2,
8144,
10543,
45,
12287,
4894,
19,
21,
1289,
12352,
62,
800,
3726,
3726,
31,
589,
749,
8144,
10543,
9,
1343,
31,
57,
74,
568,
10419,
1289,
17,
31,
57,
74,
568,
14,
9069,
10419,
1,
18042,
1,
10543,
1,
12352,
62,
20,
214,
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... |
how to read many file when pressed every listview item
===
in the name of GOD
hello
i have 2 or more different text file and want to read them when i pressed listview item's
my suggest is that when openinig new intent , we send parameter to new intent ( intent.putExtra("key","act0");)
and check them in new activity and read need file's
but when i runnig this code's , app is not show my text file !!!
where is my code is wrong ???
if you have new suggest , i tankfull if sending your suggest to me .
activity 1 :
--------------------------------------------------------------------------------------
package yaAli.package110.HoSsEiN313;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
public class adie extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// storing string resources into Array
String[] adobe_products = getResources().getStringArray(R.array.adobe_products);
// Binding resources Array to ListAdapter
this.setListAdapter(new ArrayAdapter<String>(this, R.layout.listactivity, R.id.label, adobe_products));
ListView lv = getListView();
}
//###############################################################################################################
private static final int ACTIVITY_0 = 0;
private static final int ACTIVITY_1 = 1;
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
final Intent intent = new Intent();
// Set up different intents based on the item clicked:
switch (position) {
case ACTIVITY_0:
intent.setClass(this, know.class);
intent.putExtra("key","act0");
break;
case ACTIVITY_1:
intent.setClass(this, know.class);
intent.putExtra("key","act1")
break;
default: break;
}
// Pass the item position as the requestCode parameter, so on the `Activity`'s
// return you can examine it, and determine which activity were you in prior.
startActivityForResult(intent, position);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (resultCode == RESULT_OK) {
// Perform different actions based on from which activity is
// the application returning:
switch (requestCode) {
case ACTIVITY_0:
// contents contains whatever the code was
String contents = intent.getStringExtra("SCAN_RESULT");
// Format contains the type of code i.e. UPC, EAN, QRCode etc...
String format = intent.getStringExtra("SCAN_RESULT_FO RMAT");
// Handle successful scan. In this example // I just put the results into the TextView
// resultsTxt.setText(format + "\n" + contents); break;
case ACTIVITY_1:
// TODO: handle the return of the SecondActivity
break;
default:
break;
}
}
else if (resultCode == RESULT_CANCELED) {
// Handle cancel. If the user presses 'back' // before a code is scanned.
//resultsTxt.setText("Canceled");
}
}
}
-------------------------------------------------------------------------------------
activity 2 :
-------------------------------------------------------------------------------------
package yaAli.package110.HoSsEiN313;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Environment;
import android.text.Html;
import android.view.View;
import android.widget.TextView;
public class know extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.know);
Intent intent = getIntent();
// Receiving the Data
String pos = intent.getStringExtra("key");
if (pos=="act0") {
File sdcard = Environment.getExternalStorageDirectory();
File file = new File(sdcard,"komeil.txt");
StringBuilder text = new StringBuilder();
try {
BufferedReader br = new BufferedReader(new FileReader(file));
String line;
text.append('\n');
while ((line = br.readLine()) != null) {
text.append(line);
text.append('\n');
}
}
catch (IOException e) {
//You'll need to add proper error handling here
}
TextView tv = (TextView) findViewById(R.id.TEXT313);
tv.setText(text);
}
else if (pos=="act1") {
File sdcard = Environment.getExternalStorageDirectory();
File file = new File(sdcard,"khotfa3.txt");
StringBuilder text = new StringBuilder();
try {
BufferedReader br = new BufferedReader(new FileReader(file));
String line;
text.append('\n');
while ((line = br.readLine()) != null) {
text.append(line);
text.append('\n');
}
}
catch (IOException e) {
//You'll need to add proper error handling here
}
// Font path
TextView tv = (TextView) findViewById(R.id.TEXT313);
tv.setText(text);
}
}
}
------------------------------------------------------------------------------------- | 0 | [
2,
184,
20,
1302,
151,
3893,
76,
2931,
352,
968,
4725,
9101,
800,
3726,
3726,
19,
14,
204,
16,
701,
10975,
31,
57,
172,
54,
91,
421,
1854,
3893,
17,
259,
20,
1302,
105,
76,
31,
2931,
968,
4725,
9101,
22,
18,
51,
5601,
25,
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... |
Part of jQuery not executing
===
My issue is as follows:
When I test this, the part marked as NOT BEING EXECUTED is not executed.
The rest of the code prior to that point works fine, but after that line nothing happens.
Am I missing something? I'm running Firefox with firebug and I can see that the vars (enrolled, groupcontracting and thirdparty) are being defined as 1 or 0.. but they don't see to be visible to the code below the 'NOT BEING EXECUTED' line.
$(document).ready(function() {
$('#restofform').css('display','none');
$('#pharmdata').css('display','none');
$('#form_bottom').css('display','none');
$('#nextsteps').css('display','none');
$('#group_status_message').css('display','none');
$("#Affiliation").css('display', 'none');
$("#affiliation_note").css('display', 'none');
$("#AffiliationLabel").css('display', 'none');
$("#affilitation").css('display', 'none');
var enrolled;
var groupcontracting;
var thirdparty;
$('#UserNumber').keyup(function check_enrollment(){
//get the userid
var userid = $('#UserNumber').val();
var input_length = $("#UserNumber").val().length;
function populate(frm, data) {
$.each(data, function(key, value){
$('[id='+key+']', frm).val(value);
});
}
if (input_length >= 7) {
//network enrollment check
var enlink = "enrollment_check.php?userid =" + userid ;
var gpclink = "group_contracting_check.php?userid =" + userid ;
var bncdlink = "thirdparty_check.php?userid =" + userid ;
$.getJSON(enlink, function(result) {
console.log(result);
if (jQuery.isEmptyObject(result)){
//show that the pharmacy is not enrolled
$('#enroll_status').addClass('badge badge-inverse');
$('#enroll_status').html('Not Enrolled');
enrolled = '0';
console.log(enrolled);
} else if (!jQuery.isEmptyObject(result)){
//show that the pharmacy is enrolled
$('#enroll_status').addClass('badge badge-success');
$('#enroll_status').html('Enrolled');
enrolled = '1';
console.log(enrolled);
}
});
// end of network enrollment check
// group contracting affiliation check
$.getJSON(gpclink, function(gcresult) {
console.log(gcresult);
if (!jQuery.isEmptyObject(gcresult)){
//show that the username is available
$('#group_status').addClass('badge badge-success');
$('#group_status').html('Group Affiliated');
groupcontracting = '1';
console.log(groupcontracting);
}else if (jQuery.isEmptyObject(gcresult)) {
//show that the username is NOT available
groupcontracting = '0';
console.log(groupcontracting);
}
});
// end of group contracting check
// third party contractual relationship check
$.getJSON(bncdlink, function(bdresult) {
console.log(bdresult);
if (!jQuery.isEmptyObject(bdresult)){
//show that the username is available
$('#thirdparty_status').addClass('badge badge-success');
$('#thirdparty_status').html('Third Party');
thirdparty = '1';
console.log(thirdparty);
}else if (jQuery.isEmptyObject(bdresult)) {
//show that the username is NOT available
thirdparty = '0';
console.log(thirdparty);
}
});
//end of third party check
// ***********THIS PART IS NOT BEING EXECUTED *************
// check to see what the variables are set to and display accordingly
if ((enrolled == '0') && (groupcontracting == '0') && (thirdparty== '0')){
// set hidden fields
$('input[name=enrolled]').val('0');
$('input[name=groupcontracting]').val('0');
$('input[name=thirdparty]').val('0');
//show and hide appropriate parts of forms
$('#restofform').css('display','');
$('#form_bottom').css('display','');
$('#pharmdata').css('display','none');
$('#nextsteps').css('display','');
$('#form_continue').attr('disabled', true);
$('#form_continue').css('display', 'none');
$('#form_enroll').attr('disabled', false);
$('#form_enroll').css('display', '');
// enable form fields
$('#FirstName').attr('disabled', false);
$('#LastName').attr('disabled', false);
$('#EmailAddress').attr('disabled', false);
$('#HomePhone').attr('disabled', false);
$('#FaxNumber').attr('disabled', false);
$('#CompanyName').attr('disabled', false);
$('#Role').attr('disabled', false);
$('#Comments').attr('disabled', false);
//display third party message since the Pharmacy will need to sign with them.
$('#steps').append('<li>This would be the third party statement, letting the pharmacy know that the third party will be contacting them.</li>');
} else if ((enrolled == '0') && (groupcontracting == '1') && (thirdparty== '0')){
// set hidden fields
$('input[name=enrolled]').val('0');
$('input[name=groupcontracting]').val('1');
$('input[name=thirdparty]').val('0');
//show and hide appropriate parts of forms
$('#restofform').css('display','');
$('#form_bottom').css('display','');
$('#pharmdata').css('display','none');
$('#nextsteps').css('display','');
$('#form_continue').attr('disabled', true);
$('#form_continue').css('display', 'none');
$('#form_enroll').attr('disabled', false);
$('#form_enroll').css('display', '');
// enable form fields
$('#FirstName').attr('disabled', false);
$('#LastName').attr('disabled', false);
$('#EmailAddress').attr('disabled', false);
$('#HomePhone').attr('disabled', false);
$('#FaxNumber').attr('disabled', false);
$('#CompanyName').attr('disabled', false);
$('#Role').attr('disabled', false);
$('#Comments').attr('disabled', false);
//display third party message since the Pharmacy will need to sign with them.
$('#steps').append('<li>This would be the third partystatement, letting the pharmacy know that the third party will be contacting them.</li>');
// show message to Pharmacy that they can enroll, but their group contracting entity will enroll them in products
$('#steps').append('<li>As a pharmacy currently affiliated with a group contracting entity, you will be able to enroll in the network, but enrollment in the Preferred Network will be handled by your group contracting entity.</li>');
} else if ((enrolled == '0') && (groupcontracting == '0') && (thirdparty== '1')){
// set hidden fields
$('input[name=enrolled]').val('0');
$('input[name=groupcontracting]').val('0');
$('input[name=thirdparty]').val('1');
//show and hide appropriate parts of forms
$('#restofform').css('display','');
$('#form_bottom').css('display','');
$('#pharmdata').css('display','none');
$('#nextsteps').css('display','');
$('#form_continue').attr('disabled', true);
$('#form_continue').css('display', 'none');
$('#form_enroll').attr('disabled', false);
$('#form_enroll').css('display', '');
// enable form fields
$('#FirstName').attr('disabled', false);
$('#LastName').attr('disabled', false);
$('#EmailAddress').attr('disabled', false);
$('#HomePhone').attr('disabled', false);
$('#FaxNumber').attr('disabled', false);
$('#CompanyName').attr('disabled', false);
$('#Role').attr('disabled', false);
$('#Comments').attr('disabled', false);
} else if ((enrolled == '1') && (groupcontracting == '0') && (thirdparty== '0')){
// set hidden fields
$('input[name=enrolled]').val('1');
$('input[name=groupcontracting]').val('0');
$('input[name=thirdparty]').val('0');
//show & populate and hide appropriate parts of forms
$('#restofform').css('display','none');
$('#pharmdata').css('display','');
$('#form_bottom').css('display','');
$('#nextsteps').css('display','');
$('#form_continue').attr('disabled', false);
$('#form_continue').css('display', '');
$('#form_enroll').attr('disabled', true);
$('#form_enroll').css('display', 'none');
populate('#pharmdata', result); // set as the div the fields are in and NOT the form
// disable form fields
$('#FirstName').attr('disabled', true);
$('#LastName').attr('disabled', true);
$('#EmailAddress').attr('disabled', true);
$('#HomePhone').attr('disabled', true);
$('#FaxNumber').attr('disabled', true);
$('#CompanyName').attr('disabled', true);
$('#Role').attr('disabled', true);
$('#Comments').attr('disabled', true);
// show message to Pharmacy that they should check their info before proceding
$('#steps').append('<li>If any of your information needs to be updated, please click <a href="mailto:network@company.com">here</a> to email our network support team.</li>');
//display third partymessage since the Pharmacy will need to sign with them.
$('#steps').append('<li>This would be the third party statement, letting the pharmacy know that the third party will be contacting them.</li>');
} else if ((enrolled == '1') && (groupcontracting == '1') && (thirdparty== '0')){
// set hidden fields
$('input[name=enrolled]').val('1');
$('input[name=groupcontracting]').val('1');
$('input[name=thirdparty]').val('0');
// show message to Pharmacy that they are good to go and have nothing further to do.
$('#group_status_message').html('<p class="content-p">As a pharmacy both currently a Network Member and affiliated with a group contracting entity, no further steps are required. You will be enrolled into the Preferred Network by your group contracting entity.</p>');
} else if ((enrolled == '1') && (groupcontracting == '1') && (thirdparty== '1')){
// set hidden fields
$('input[name=enrolled]').val('1');
$('input[name=groupcontracting]').val('1');
$('input[name=thirdparty]').val('1');
// show message to Pharmacy that they are good to go and have nothing further to do.
$('#group_status_message').html('<p class="content-p">As a pharmacy both currently a Network Member and affiliated with a group contracting entity, no further steps are required. You will be enrolled into the Preferred Network by your group contracting entity.</p>');
} else if ((enrolled == '1') && (groupcontracting == '0') && (thirdparty== '1')){
// set hidden fields
$('input[name=enrolled]').val('1');
$('input[name=groupcontracting]').val('0');
$('input[name=thirdparty]').val('1');
//show & populate and hide appropriate parts of forms
$('#restofform').css('display','none');
$('#pharmdata').css('display','');
$('#form_bottom').css('display','');
$('#nextsteps').css('display','');
$('#form_continue').attr('disabled', false);
$('#form_continue').css('display', '');
$('#form_enroll').attr('disabled', true);
$('#form_enroll').css('display', 'none');
populate('#pharmdata', result); // set as the div the fields are in and NOT the form
// disable form fields
$('#FirstName').attr('disabled', true);
$('#LastName').attr('disabled', true);
$('#EmailAddress').attr('disabled', true);
$('#HomePhone').attr('disabled', true);
$('#FaxNumber').attr('disabled', true);
$('#CompanyName').attr('disabled', true);
$('#Role').attr('disabled', true);
$('#Comments').attr('disabled', true);
// show message to Pharmacy that they should check their info before proceding
$('#steps').append('<li>If any of your information needs to be updated, please click <a href="mailto:network@company.com">here</a> to email our network support team.</li>');
}
}
});
// end of 3rd party contract check
// end of all checks
}); // document.ready() | 0 | [
2,
141,
16,
487,
8190,
93,
52,
25836,
800,
3726,
3726,
51,
1513,
25,
28,
2415,
45,
76,
31,
1289,
48,
15,
14,
141,
2739,
28,
52,
142,
5557,
25,
52,
5557,
9,
14,
760,
16,
14,
1797,
1313,
20,
30,
454,
693,
1123,
15,
47,
75,
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... |
jquery ui accordion - flexible header styling
===
I'm using jquery UI accordion plugin but I need to be able to style each element separately. For example, I need different colors for headers (3 different colors would be used throughout the whole list). Setting up custom css classes for those elements, eg <h3 class='red-header'>, doesn't work as it gets overwritten by UI css
Any advice? | 0 | [
2,
487,
8190,
93,
13,
5661,
20753,
13,
8,
13568,
157,
106,
23020,
800,
3726,
3726,
31,
22,
79,
568,
487,
8190,
93,
13,
5661,
20753,
10922,
108,
47,
31,
376,
20,
44,
777,
20,
1034,
206,
4520,
10714,
9,
26,
823,
15,
31,
376,
421... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 makes this checkbox works inside the GridView?
===
I am a new ASP.NET developer and trying to use a GridView control as a way for managing the employees in each division. This GridView will show all the employees in the employee table in the database. Now, I am facing the following problem:
FYI, I have the following database design:
Employee Table: Username, Name, JobTitle, BadgeNo, IsActive, DivisionCode
Divisions Table: SapCode, DivisionShortcut
***(IsActive is like a flag (bit datatype) to indicate if the employee is in an assignment or not)***
**IsActive** will be displayed in the GridView as a Checkbox. If it is checked, it means true and the employee is existed in his division. if it is not checked, it means the employee is not with the division, and it should be hidden from the GridView. **So how to do that? Also, I want to hide (True) text that appears behind the checkbox in the Edit mode. How to do that, too?**
ASP.NET code:
<asp:TemplateField HeaderText="Is Active?">
<ItemTemplate>
<%# Eval("IsActive")%>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="isActive" runat="server" Text='<%# Bind("IsActive")%>' />
</EditItemTemplate>
</asp:TemplateField>
| 0 | [
2,
184,
20,
1364,
48,
2631,
5309,
693,
572,
14,
7354,
4725,
60,
800,
3726,
3726,
31,
589,
21,
78,
28,
306,
9,
2328,
10058,
17,
749,
20,
275,
21,
7354,
4725,
569,
28,
21,
161,
26,
5616,
14,
3716,
19,
206,
460,
9,
48,
7354,
47... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
two conditions in one with css possible?
===
hello i have a question according css.
in my navigationbar i have 3 links. i use:
#p1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
line-height: 45px;
font-weight: bolder;
color: #999999;
text-decoration: none;
}
for that status that shows on which site the user is located.
if the user rolls over the other two links i have these:
#p2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
line-height: 45px;
font-weight: bolder;
color: #ECECEC;
text-decoration: none;
}
#p2:hover {
font-weight: bolder;
color: #999999;
cursor:default;
}
#p2:active {
font-weight: lighter;
color: #999999;
}
okay, the problem is that i would like to change the color from p1 when the user hovers p2. meaning something like:
#p2:hover {
font-weight: bolder;
color: #999999;
cursor:default;
#p1 {
color: #f23;
}
}
is that possible?
thanks a lot. | 0 | [
2,
81,
2039,
19,
53,
29,
272,
18,
18,
938,
60,
800,
3726,
3726,
10975,
31,
57,
21,
1301,
496,
272,
18,
18,
9,
19,
51,
8368,
1850,
31,
57,
203,
6271,
9,
31,
275,
45,
6926,
306,
165,
13,
1,
9978,
8,
13819,
45,
21,
20050,
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... |
prevent overriding postsharp attribute on derived type
===
I'm looking for how to prevent overriding a PostSharp attribute in derived type once applied on a base type. In the following example I'd like to see compilation error for the DerivedClass:
[MyAttribute]
public class BaseClass
{
virtual public void foo();
}
public class DerivedClass : BaseClass
{
[MyAttribute]
override public void foo();
}
I defined the attribute as following:
[AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
[MulticastAttributeUsage(MulticastTargets.Method, Inheritance = MulticastInheritance.Strict, AllowMultiple = false)]
public class MyAttribute : MethodInterceptionAspect
But it does not seem to work as I expected. Is there a way to configure the attribute to prevent the overriding on inheritance?
I was trying to evaluate the overriding attempt myself in the CompileTimeValidate method by using the GetCustomAttributes(true) interface of both Attribute and MethodInfo interfaces. But it also does not seem to work.
So I'd like to ask what is the recommended way to achieve this goal.
Thanks to all in advance. | 0 | [
2,
2501,
84,
5175,
68,
678,
23646,
35,
14755,
27,
3981,
1001,
800,
3726,
3726,
31,
22,
79,
699,
26,
184,
20,
2501,
84,
5175,
68,
21,
678,
23646,
35,
14755,
19,
3981,
1001,
382,
2435,
27,
21,
1000,
1001,
9,
19,
14,
249,
823,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
I have one XML file but two combo boxes I want to populate the second one depending on the first
===
I have got two comboboxes on my application. The first combobox can get all the required data (in this case it is the factory numbers) however depending on which factory is selected I want the next combo box (in this case line numbers) to automatically populate with the correct lines for that factory.
Here is my XML file - or a test data
<?xml version="1.0" encoding="utf-8"?>
<Profiles>
<Factories>
<Factory>F1</Factory>
<Factory>F2</Factory>
<Factory>F3</Factory>
<Factory>F4</Factory>
<Factory>F5</Factory>
<Factory>F6</Factory>
<Factory>F7</Factory>
<Factory>F8</Factory>
</Factories>
<Lines>
<F1>G1</F1>
<F1>G2</F1>
<F1>G3</F1>
</Lines>
</Profiles>
Here is what I have so far:
Private Sub populateComboBoxes()
Dim doc As New XmlDocument()
doc.Load("C:\TFS2010Source\ShopFloorApps\Main\Source\Components\000280LinePCBackup\000280LinePCBackup\Lines.XML")
Dim factoryList As XmlNodeList = doc.SelectNodes("/Profiles/Factories/Factory")
For Each Factory As XmlNode In factoryList
factoryComboBox.Items.Add(Factory.InnerText)
Next
End Sub
Private Sub factoryComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles factoryComboBox.SelectedIndexChanged
Dim doc As New XmlDocument()
doc.Load("C:\TFS2010Source\ShopFloorApps\Main\Source\Components\000280LinePCBackup\000280LinePCBackup\Lines.XML")
Dim lineList As XmlNodeList = doc.SelectNodes("/Profiles/Lines")
For Each line As XmlNode In lineList
If factoryComboBox.SelectedItem.ToString = line.FirstChild.Name Then
lineComboBox.Items.Add(line.FirstChild.InnerText)
End If
Next
End Sub
So What I want is when I select F1 the other combobox populates with the line G1,G2 and G3.
Thanks | 0 | [
2,
31,
57,
53,
23504,
3893,
47,
81,
22621,
8120,
31,
259,
20,
1675,
12383,
14,
153,
53,
4758,
27,
14,
64,
800,
3726,
3726,
31,
57,
330,
81,
22621,
5309,
160,
27,
51,
3010,
9,
14,
64,
22621,
5309,
92,
164,
65,
14,
1390,
1054,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Using onCheckedChanged with PopupControlExtender and want to prevent popup when unchecking
===
I am still reasonably new to this and have tried to find an answer, so hopefully I am not repeating this.
I am using ASP.NET and have a checkbox control that brings up a popup box when it's changed, using the onCheckedChanged method. This popup box has some info in it and a 'Close' button which successfully closes the popup.
What I want is to prevent the popup appearing if the checkbox is being unchecked. I currently have the onCheckedChanged calling a code behind method which cancels the extender call if the control is not checked, but the popup quickly appears before it is closed. How can I prevent it this?
This is the appropriate page code:
<div class="row" id="divDDMandate" runat="server">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:CheckBox ID="chkDDMandate" Width="20px" Visible="true" runat="server" AutoPostBack="true"
OnCheckedChanged="clientchkDDMandateChanged(this);" on />
<asp:Literal ID="ltlDDMandate" runat="server">Direct Debit Mandate (by post)</asp:Literal>
<asp:PopupControlExtender ID="chkDDMandate_PopupControlExtender" runat="server"
DynamicServicePath="" Enabled="true" PopupControlID="PanelDDMandateDownload"
TargetControlID="chkDDMandate"
Position="Bottom" OffsetX="-20" OffsetY="10" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
...and this is my code behind method:
protected void chkDDMandateChanged(object sender, EventArgs e)
{
//Cancel the panel if unchecking
if ((!chkDDMandate.Checked) && chkDDMandate_PopupControlExtender.Enabled)
{
chkDDMandate_PopupControlExtender.Cancel();
}
}
I would be grateful for any help.
Cheers | 0 | [
2,
568,
27,
12542,
69,
16229,
43,
29,
1675,
576,
12898,
1706,
38,
13630,
17,
259,
20,
2501,
1675,
576,
76,
367,
12542,
68,
800,
3726,
3726,
31,
589,
174,
19531,
78,
20,
48,
17,
57,
794,
20,
477,
40,
1623,
15,
86,
13416,
31,
58... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
UILabel animate the width
===
how do we go about animating the uilabel's width so that it increases and decreases in width only using uiview animatewithduration
thank you for your help (at this point i'm so frustrated as I've been trying to do so but it does not work
| 0 | [
2,
13,
5661,
21018,
14487,
591,
14,
9456,
800,
3726,
3726,
184,
107,
95,
162,
88,
14487,
1203,
14,
13,
5661,
21018,
22,
18,
9456,
86,
30,
32,
7104,
17,
20241,
19,
9456,
104,
568,
13,
5661,
4725,
14487,
591,
1410,
10852,
857,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Regexp : repeat matching
===
I'm trying to create a regular expression that can contain some of those three elements 0...X times :
**/cat1/var1**
**/cat2/var2**
**/cat3/var3**
This is what I got so far :
(cat1/(?P<var1>\w+))*(cat2/(?P<var2>\w+))*(cat3/(?P<var3>\w+))*
In this sample string it's only matching the first occurrence : **http://url.dev/cat1/aaaaa**/cat1/bbbbb/cat2/ccccc
In this sample there is also two occurrences of cat1, I would like to know if its possible to harvest the two values.
A few samples of what I want to match :
**http://url.dev/cat1/aaaaa/cat1/bbbbb/cat2/ccccc/cat3/ddddd/cat3/eeeee**
**http://url.dev/cat1/aaaaa**
**http://url.dev/cat2/aaaaa/cat3/bbbbb** | 0 | [
2,
7953,
6899,
13,
45,
6830,
10120,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
21,
1290,
1803,
30,
92,
3717,
109,
16,
273,
132,
2065,
713,
9,
9,
9,
396,
436,
13,
45,
13,
1409,
118,
5782,
8197,
3311,
165,
1409,
13,
1409,
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... |
Maven 3: deploying an artifact using SCP
===
Okay, I am lost with this one:
As far as I can tell, deploying a third-party binary artifact using maven is done like so:
mvn deploy:deploy-file -DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion=<version> \
-Dpackaging=<type-of-packaging> \
-Dfile=<path-to-file> \
-DrepositoryId=<id-to-map-on-server-section-of-settings.xml> \
-Durl=<url-of-the-repository-to-deploy>
Suppose that my repository is accessible using scp, so for instance in the above command
-Durl=scpexe://example.org//users/mvnrepo/maven
Using maven 3, this deployment command fails with an error message.
The workaround I used was to copy two jars: `wagon-ssh-common-2.2.jar` and `wagon-ssh-external1.0.jar` to my `$M2_HOME/lib` directory.
Hence my question: Why is it that Maven cannot retrieve the appropriate wagons by itself?
(and, how to have it do that if it is possible?)
Thanks! | 0 | [
2,
1216,
3124,
2635,
17617,
68,
40,
22929,
568,
13,
18,
7439,
800,
3726,
3726,
1705,
15,
31,
589,
529,
29,
48,
53,
45,
28,
463,
28,
31,
92,
494,
15,
17617,
68,
21,
422,
8,
9635,
14171,
22929,
568,
1216,
3124,
25,
677,
101,
86,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
iPhone netword SSID
===
I am having issues implementing the code from the answer on this question: http://stackoverflow.com/questions/5198716/iphone-get-ssid-without-private-library
I have xcode 4.2 and iOS 5.1.
#import <SystemConfiguration/CaptiveNetwork.h>
- (id)fetchSSIDInfo
{
NSArray *ifs = (id)CNCopySupportedInterfaces();
NSLog(@"%s: Supported interfaces: %@", __func__, ifs);
id info = nil;
for (NSString *ifnam in ifs) {
info = (id)CNCopyCurrentNetworkInfo((CFStringRef)ifnam);
NSLog(@"%s: %@ => %@", __func__, ifnam, info);
if (info && [info count]) {
break;
}
[info release];
}
[ifs release];
return [info autorelease];
}
I get the following errors:
![enter image description here][1]
[1]: http://i.stack.imgur.com/t1YGe.png
What am I doing wrong? | 0 | [
2,
21024,
4275,
9587,
13,
18,
18,
1340,
800,
3726,
3726,
31,
589,
452,
1549,
17333,
14,
1797,
37,
14,
1623,
27,
48,
1301,
45,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
18133,
6019,
1091,
118,
49,
7709,
8,
3060,
8,
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... |
Nginx redirect to Subdirectory on different domain
===
I am a newb at Nginx, so please help or share your thoughts.
I have a question regarding redirecting traffic from nginx from SiteA, SiteA/subdirectory to SiteB subdirectory.
Basically, if someone types siteA then it goes to our authentication server, if someone types siteA/subdirectory, then it goes to siteB/subdirectory assuming the user is already authenticated.
Any input would be appreciated it.
| 0 | [
2,
13,
2723,
108,
396,
302,
14706,
20,
972,
10197,
93,
27,
421,
4603,
800,
3726,
3726,
31,
589,
21,
78,
220,
35,
13,
2723,
108,
396,
15,
86,
2247,
448,
54,
1891,
154,
3064,
9,
31,
57,
21,
1301,
3467,
302,
14706,
68,
2227,
37,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 servlets sessions count issues
===
So I made a simple session listener - there are many on the web :
package org.blah.web.controller;
import javax.servlet.ServletContext;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
@WebListener
class SessionListener implements HttpSessionListener {
private static final int MAX_INACTIVE_INTERVAL = 1000;
// static AtomicInteger numOfSessions; // TODO : better sync - maybe
// singleton ? static ?
static int numOfSessions;
static ServletContext context;
@Override
public void sessionCreated(HttpSessionEvent se) {
HttpSession session = se.getSession();
session.setMaxInactiveInterval(MAX_INACTIVE_INTERVAL);
if (context == null)
context = session.getServletContext();
increase();
}
@Override
public void sessionDestroyed(HttpSessionEvent se) {
HttpSession session = se.getSession();
if (context == null)
context = session.getServletContext(); // this will probably hit a null
decrease();
}
private synchronized void increase() {
synchronized (this) {
++numOfSessions;
context.setAttribute("numberOfSessions", numOfSessions);
System.out
.println("SessionListener - increase - numberOfSessions = "
+ numOfSessions);
}
}
private synchronized void decrease() {
synchronized (this) {
--numOfSessions;
context.setAttribute("numberOfSessions", numOfSessions);
System.out
.println("SessionListener - decrease - numberOfSessions = "
+ numOfSessions);
}
}
}
I am on Glassfish 3.1.2 on eclipse Juno. The problem is that when I redeploy the project (on save) decrease() is called - but then when I go back to the browser and go on submitting content (it is a photo submitting site) my session is still active apparently in the browser (it is created via request.getSession() in the doPost() method in the relevant servlet which does not trigger the Listener apparently - as I don't see any increase() calls) - so when I again save the project in Eclipse and is redeployed I get :
INFO: SessionListener - decrease - numberOfSessions = -1
?!
Btw I'd like to avoid the `if (context == null)` part - would ServletContextListener do the trick ? | 0 | [
2,
8247,
13,
10321,
11045,
5763,
2468,
1549,
800,
3726,
3726,
86,
31,
117,
21,
1935,
3723,
21772,
13,
8,
80,
50,
151,
27,
14,
2741,
13,
45,
6030,
13,
5583,
9,
220,
9396,
9,
14113,
9,
12898,
1252,
73,
9010,
8247,
396,
9,
10321,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 create `<table>` dynamically from mysql query
===
I'm trying to create a page where I input a MYSQL query: `SELECT column1,column2 FROM table;`, and dynamically create an HTML table with column titles. I almost had it figured out, but realize I need some guidance.
So far what I have is:
**The form** (*somesite.php)*
`<form method="POST" action="somesite.php">`<br/>
`<input type='text' value='query' name='query' />`<br/>
`<input type='text' value='columns' name='columns' />`<br/>
`<input type='submit' value='go!' /></form>`
**The PHP** (*somesite.php)*<br/>
`// variables`<br/>
`$query = $_POST['query'] // input: "SELECT column1,column2 FROM table"`<Br/>
`$columns = explode("," , $_POST['columns']); // input: "column1,column2"`
{...connect to database...then,}<br/>
`$result = mysql_query($query);`
**?!?!**<br/>
I usually do:<br/>
`while ($row = mysql_fetch_array($result)) {`<br/>
` $column1[] = $row['column1'];`<br/>
` $column2[] = $row['column2'];`<br/>
`}`
**But I don't know what columns will be used, So how can I do this dynamically?** (i.e. if there are more than 2 columns)
**Next I'll create a table**
`echo "<table border='1'><tr>";`<br/>
`foreach ($columns as $column) {`<br/>
` echo "<td>$column</td>"; // creates the first row with column names`<br/>
`} echo "</tr>";`
<br/>**help! (again)**
I know I'll need some sort of `for` or `while` loop to get the results of the query, but again I get very confused as to how to do this dynamically
<br/>`echo "</table>";`
<br/>_________________________________________________________________________________
## HOW can I get the columns I want to search for -- (which will be in both the 'query' input as well as in a $columns array) to be dynamically placed in an html `<table>` ##
The way I envisioned it, was to use one input for the query, and then make use the other input to create the different columns.
Does anyone have any methods to make this work or am I going at this completely wrong?! Does this script already exist somewhere? THANK YOU FOR ALL OF YOUR HELP :)
| 0 | [
2,
13,
26120,
1600,
13,
1,
5924,
1,
7782,
1326,
37,
51,
18,
22402,
25597,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
21,
2478,
113,
31,
6367,
21,
51,
18,
22402,
25597,
45,
13,
1,
18,
16964,
4698,
165,
15,
716,
4404,
103,
135,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
multiply two decimals
===
Im trying to add a tax field. I have this working for whole numbers but i need to be able to enter ".5"
I have no clue haw to solve this problem maybe its because of the isNAN but i thought this would be ok here.
http://jsfiddle.net/thetylercox/eeMva/3/
My current code
$(document).ready(function() {
calculateSum();
$(".txt").keyup(function() {
$(".txt").each(function() {
calculateSum();
});
});
});
$("#tax").keyup(function() {
$('#total1').val(parseInt($(this).val()) * parseInt($('#subtotal').val()));
});
function calculateSum() {
var sum = 0;
$("#sum").val(sum.toFixed(2));
//iterate through each textboxes and add the values
$(".txt").each(function() {
//add only if the value is number
if (!isNaN(this.value) && this.value.length != 0) {
sum += parseFloat(this.value);
}
});
$("#sum").html(sum.toFixed(2));
var subtotal = document.getElementById("subtotal").value == "";
var subtotal = document.getElementById("subtotal").value = sum;
function getTax(tax) {
var taxFloat = parseFloat(tax)
if (isNaN(taxFloat)) {
return 1;
} else {
return taxFloat;
}
}
var total = getTax($('#tax').val()) * sum;
var total1 = document.getElementById("total1").value = total;
}
Thanks | 0 | [
2,
26314,
81,
26380,
18,
800,
3726,
3726,
797,
749,
20,
3547,
21,
2225,
575,
9,
31,
57,
48,
638,
26,
979,
2116,
47,
31,
376,
20,
44,
777,
20,
2830,
13,
7,
9,
264,
7,
31,
57,
90,
8906,
1458,
499,
20,
8402,
48,
1448,
913,
82... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Tinymce ImageManager Wired Up To Windows Azure Blob Storage
===
I'm considering moving from a dedicated server hosting environment to Azure. I'm using the ASP.NET Membership provider and every member has their own folder that houses their images (avatar, etc.). I have the Tinymce ImageManager wired up so that a logged-in user will only see their folder when selecting/uploading an image.
Is there a way to wire up the Tinymce ImageManager to Azure's blob storage in a similar way? | 0 | [
2,
3228,
79,
1105,
1961,
22256,
21124,
71,
20,
1936,
25715,
334,
10904,
4326,
800,
3726,
3726,
31,
22,
79,
5154,
1219,
37,
21,
2360,
8128,
10637,
2307,
20,
25715,
9,
31,
22,
79,
568,
14,
28,
306,
9,
2328,
4363,
11747,
17,
352,
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... |
ScrollSpy "Activate" event does not trigger
===
I read this question: http://stackoverflow.com/questions/9343715/how-to-use-twitter-bootstrap-scrollspy-to-execute-a-function, that said to first grab the event, then to add a certain function. First, I'm relatively new to jQuery, so I don't know how to grab an event.
Here is my code:
$(".navbar").scrollspy();
$('[data-spy="scroll"]').each(function()
{
$(this).scrollspy('refresh');
});
$("ul.nav li").on("activate", function()
{
console.log("ACTIVATED");
});
Triggering it manually runs the function, of course, but whatever I try to do, it doesn't seem to work.
Any ideas? | 0 | [
2,
12159,
18,
6448,
13,
7,
19516,
1373,
7,
807,
630,
52,
7286,
800,
3726,
3726,
31,
1302,
48,
1301,
45,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
4069,
300,
25686,
10551,
1544,
8,
262,
8,
3699,
8,
38,
13098,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
scipy: basic clarifications
===
I am not undetstanding the difference between coo_matrix, csr_matrix and csc_matrix.
The documentation does mention that coo_matrix is not efficient for arithmetic operations and we need to convert it to csr or csc. I am looking more into matrix multiplication. And I did not understand what is happening behind the scenes if I just have a coo_matrix and convert it to csr or csv matrix.
Also if I have something like
A = array([[1,2,3,0,0,5],
[5,0,0,1,2,0]])
print coo_matrix(A)
It prints
(0, 0) 1
(0, 1) 2
(0, 2) 3
(0, 5) 5
which is cool. but is there a way, i can directly input my matrix as the one which is printed. Something like define a null COO matrix and then start defining the values of the coo_matrix like how we do in matlab.
Thanks! | 0 | [
2,
9569,
6448,
45,
2125,
13,
12078,
4634,
18,
800,
3726,
3726,
31,
589,
52,
13,
12239,
38,
10465,
14,
2841,
128,
10378,
1,
540,
17224,
15,
272,
18,
139,
1,
540,
17224,
17,
272,
3862,
1,
540,
17224,
9,
14,
13945,
630,
3794,
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... |
before_destroy on a relationship model
===
I am using a has_many through association and having trouble getting the before_destroy call back to trigger. I am using a Relating class to relate models.
class Relating < ActiveRecord::Base
belongs_to :relater, :polymorphic => true
belongs_to :related, :polymorphic => true
before_destroy :unset_reminders
end
For example, a user can add TvShows to a list of favorites, User.rb:
has_many :tv_shows, :through => :relateds, :source => :related, :source_type => 'TvShow'
The problem I am having, has to do with deleting this Relating record.
I can relate users and tv shows by:
user = User.find(1)
show = TvShow.find(1)
user.tv_shows << show
But when I want to remove this association, the before_destroy is not triggered by:
user.tv_shows.delete(show)
However, if I destroy the relating record manually, it does trigger the callback:
r = Relating.find(8012)
r.destroy
How can I get the before destroy to be triggered for this?
Thanks
| 0 | [
2,
115,
1,
28764,
27,
21,
1429,
1061,
800,
3726,
3726,
31,
589,
568,
21,
63,
1,
14842,
120,
607,
17,
452,
2572,
1017,
14,
115,
1,
28764,
645,
97,
20,
7286,
9,
31,
589,
568,
21,
8456,
718,
20,
16464,
2761,
9,
718,
8456,
13,
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... |
Scraping HTML with JavaScript postbacks
===
I'm trying to scrape some HTML (with permission from the author). I was using the PHP library [suggested here](http://stackoverflow.com/a/34145/65387), and it was working well until I encountered a link that looks like this:
<a href="javascript:__doPostBack('dgItem$_ctl2$_ctl0','')">
Which I believe is some asp.net thing. When I click it, it doesn't change the URL, it just loads some new content into the page, which I'd also like to scrape.
How can I get around this?
I suppose I would need to simulate the click, but I can't do that when processing raw HTML, I'd some kind of browser/JS interpreter, no?
Is there a better suited library for this task? I'm not limited to PHP, but it's preferred. | 0 | [
2,
25611,
13,
15895,
29,
8247,
8741,
678,
1958,
18,
800,
3726,
3726,
31,
22,
79,
749,
20,
23855,
109,
13,
15895,
13,
5,
1410,
5572,
37,
14,
1314,
6,
9,
31,
23,
568,
14,
13,
26120,
1248,
636,
18,
21606,
1430,
69,
235,
500,
5,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
webGL shader errors
===
Alright, so I'm a total newbie when it comes to GLSL, but I'm willing to learn, so I hope I'll get some help. I have some shaders a friend wrote me, but I no longer talk to him, so I can't ask for his help. Anyway, these shaders work great in my game engine, but when I tried to use them with webGL they spat a whole bunch of errors at me, and I don't know what the problems are. Can anyone help me fix these shaders up?
The first error I'm getting is "ERROR: 0:21: 'for' : Invalid init declaration"
Which, I don't know why it'd think any of my 'for' loops were a init declaration.
Anyway the other errors I'm getting are as follows:
ERROR: 0:2: '' : Version number not supported by ESSL
ERROR: 0:7: 'ftransform' : no matching overloaded function found
ERROR: 0:7: 'assign' : cannot convert from 'const mediump float' to 'Position highp 4-component vector of float'
ERROR: 0:9: 'gl_MultiTexCoord0' : undeclared identifier
ERROR: 0:9: 'assign' : cannot convert from 'float' to 'varying highp 4-component vector of float'
So, can anyone help?
<script id="shader-fs" type="x-shader/x-fragment">
precision mediump float;
const float BLOOM_AMOUNT = 10.0;
// Increasing range can lower your FPS.
const int BLOOM_RANGE = 3;
uniform sampler2D composite;
varying vec4 texcoord;
varying vec4 texel;
vec4 addBloom(vec4 c, vec2 t) {
int j;
int i;
vec4 bloom = vec4(0.0);
vec2 loc = vec2(0.0);
float count = 0.0;
for( i= -BLOOM_RANGE ; i < BLOOM_RANGE; i++ ) {
for ( j = -BLOOM_RANGE; j < BLOOM_RANGE; j++ ) {
loc = t + vec2(j, i)*0.004;
// Only add to bloom texture if loc is on-screen.
if(loc.x > 0.0 && loc.x < 1.0 && loc.y > 0.0 && loc.y < 1.0) {
bloom += texture2D(composite, loc) * BLOOM_AMOUNT;
count += 1.0;
}
}
}
bloom /= vec4(count);
if (c.r < 0.3)
{
return bloom*bloom*0.012;
}
else
{
if (c.r < 0.5)
{
return bloom*bloom*0.009;
}
else
{
return bloom*bloom*0.0075;
}
}
}
void main() {
vec4 color = texture2D(composite, texcoord.st);
color += addBloom(color, texcoord.st);
gl_FragColor = color;
}
</script>
<script id="shader-vs" type="x-shader/x-vertex">
#version 120
varying vec4 texcoord;
void main() {
gl_Position = ftransform();
texcoord = gl_MultiTexCoord0;
}
</script>
| 0 | [
2,
2741,
8430,
7546,
139,
11908,
800,
3726,
3726,
11885,
15,
86,
31,
22,
79,
21,
600,
78,
5893,
76,
32,
1624,
20,
13,
8430,
18,
255,
15,
47,
31,
22,
79,
4452,
20,
2484,
15,
86,
31,
1376,
31,
22,
211,
164,
109,
448,
9,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.