unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
it posible use a nodejs package inside meteor app?
===
it posible use a nodejs package inside meteor app on server side? It would be great to do that since nodejs has a large number of packages. | 0 | [
2,
32,
12928,
3426,
275,
21,
15421,
728,
18,
6030,
572,
17522,
4865,
60,
800,
3726,
3726,
32,
12928,
3426,
275,
21,
15421,
728,
18,
6030,
572,
17522,
4865,
27,
8128,
270,
60,
32,
83,
44,
374,
20,
107,
30,
179,
15421,
728,
18,
63... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Crop image from Gallery with predefined bitmap
===
I'm using the following code to crop my image with the standard media gallery.
public void cropImage3(boolean scale, boolean return_data, boolean faceDetection, boolean circleCrop, Bitmap btmp) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null);
intent.setType("image/*");
intent.putExtra("crop", "true");
intent.putExtra("data", btmp);
intent.putExtra("scale", scale);
intent.putExtra("return-data", return_data);
intent.putExtra(MediaStore.EXTRA_OUTPUT, getTempUri());
intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
intent.putExtra("noFaceDetection",!faceDetection);
}
i'm using the data parameter to specify a bitmap to use with the Gallery Crop Activity.
This works, however, it first shows the chooser, then i have to select a (random) image and only then it shows the predefined bitmap that i put here intent.putExtra("data", btmp);
Now my question is how i can immediatly show the predefined bitmap to show in this activity before selecting an image. | 0 | [
2,
9833,
1961,
37,
2246,
29,
782,
13439,
1142,
15022,
800,
3726,
3726,
31,
22,
79,
568,
14,
249,
1797,
20,
9833,
51,
1961,
29,
14,
1236,
941,
2246,
9,
317,
11364,
9833,
22039,
240,
5,
10858,
413,
210,
3464,
15,
9827,
413,
210,
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... |
Java Transparency rendering error
===
I am currently developing a kiosk style Java program to display weather, time, forecast etc.
The various sections are created as JPanels with the paint() method overridden. They draw in a gradient header and a semitransparent background. However, when I change the content of one of these panels, the previous content is left behind, rather than being removed. An example is shown below:
As you can see, when the time changed from 11:51 to 11:52, the numbers overlapped, and the background became lighter (because the semitransparent background was redrawn over it)
##The Graphical Error##
![Image showing the graphical error][1]
[1]: http://i.stack.imgur.com/JhmDv.png
What should I do to prevent this overlap? | 0 | [
2,
8247,
19668,
15307,
7019,
800,
3726,
3726,
31,
589,
871,
3561,
21,
28092,
1034,
8247,
625,
20,
3042,
2580,
15,
85,
15,
12718,
2722,
9,
14,
617,
4501,
50,
679,
28,
487,
3206,
6798,
29,
14,
5107,
5,
6,
2109,
84,
15267,
9,
59,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Query on facebook LIKE table not working(Till yesterdad(July 17 2012) its working fine)
===
I am using below query to fetch object Id. Which was working till yesterday. But today its stop working.
$fql_likeStatus ="SELECT object_id FROM like WHERE user_id= $user";
$param = array(
'method' => 'fql.query',
'query' => $fql_likeStatus,
'callback' => ''
);
$fqlUserDetResult = $facebook->api($param);
Its showing me below error
[error_code] => 1
[error_msg] => An unknown error occurred | 0 | [
2,
25597,
27,
9090,
101,
859,
52,
638,
5,
38,
6049,
1643,
815,
9610,
5,
7917,
369,
563,
6,
82,
638,
1123,
6,
800,
3726,
3726,
31,
589,
568,
1021,
25597,
20,
18312,
3095,
4924,
9,
56,
23,
638,
3924,
7124,
9,
47,
786,
82,
747,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Violation using Python Ctypes
===
I am trying to import and use a function from a DLL using Pythons ctypes module, but I keep getting this error:
> Windows Error: exception: access violation writing 0x0000002C
I've had a look at the other questions on similar topics on here, but none seem to be able to provide an answer that works.
My current code is as follows:
<!-- language: Python -->
from cytpes import *
dll = "./WinlicenseSDK/WinlicenseSDK.dll"
mydll = cdll.LoadLibrary(dll)
name = c_char_p("A.N. Body")
org = c_char_p("ACME")
pcID = c_char_p("APC44567")
zero = c_int(0)
licenseKey = create_string_buffer("")
mydll.WLGenLicenseFileKey(HASH, name, org, pcID, zero, zero, zero, zero, zero, licenseKey)
Context: I'm investigating licensing techniques for a piece of software. The above function generates a license key from hashing the parameters.
The last parameter for the WLGenLicenseFileKey is a string buffer that the generated key is written to.
I setting the argtypes for the function with `mydll.WLGenLicenseFileKey.argtypes = ...` but this won't work as there is not a string buffer ctypes raw type as there is for strings, ints, floats etc.
Can anybody tell me where I am going wrong?
| 0 | [
2,
1381,
12120,
568,
20059,
272,
4474,
18,
800,
3726,
3726,
31,
589,
749,
20,
9010,
17,
275,
21,
1990,
37,
21,
13,
43,
211,
568,
20059,
18,
272,
4474,
18,
12613,
15,
47,
31,
643,
1017,
48,
7019,
45,
13,
1,
1936,
7019,
45,
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... |
Rails mulitple belongs_to assignment
===
Given
User:
class User < ActiveRecord::Base
has_many :discussions
has_many :posts
end
Discussions:
class Discussion < ActiveRecord::Base
belongs_to :user
has_many :posts
end
Posts:
class Post < ActiveRecord::Base
belongs_to :user
belongs_to :discussion
end
I am currently initializing Posts in the controller via
@post = current_user.posts.build(params[:post])
My question is, how do I set/save/edit the @post model such that the relationship between the post and the discussion is also set? | 0 | [
2,
2240,
18,
6633,
242,
5106,
7034,
1,
262,
8427,
800,
3726,
3726,
504,
4155,
45,
718,
4155,
13,
1,
1348,
14953,
45,
45,
8436,
63,
1,
14842,
13,
45,
43,
20563,
18,
5757,
63,
1,
14842,
13,
45,
6962,
18,
241,
11139,
45,
718,
546... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Django matching query does not exist after object save in Celery task
===
I have the following code:
@task()
def handle_upload(title, temp_file, user_id):
.
.
.
photo.save()
#if i insert here "photo2 = Photo.objects.get(pk=photo.pk)" it works, including the view function
return photo.pk
#view function
def upload_status(request):
task_id = name = request.POST['task_id']
async_result = AsyncResult(task_id)
photo_id = async_result.get()
if async_result.successful():
photo = Photo.objects.get(pk=photo_id)
I use an ajax request to check for the uploaded file but after the celery task finishes i get a Photo matching query does not exist. The photo pk does exist and gets returned. If i query the database manually it works. Is this some sort of database lag? How can I fix it?
I'm using Django 1.4 and Celery 3.0 | 0 | [
2,
3857,
14541,
10120,
25597,
630,
52,
3182,
75,
3095,
2079,
19,
11692,
3849,
3005,
800,
3726,
3726,
31,
57,
14,
249,
1797,
45,
13,
1,
38,
20310,
5,
6,
6312,
3053,
1,
576,
8294,
5,
22235,
15,
13,
9577,
1,
16877,
15,
4155,
1,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WPF MVVM multiple data source model conception
===
I want to build an enterprise data-driven application using the following technologies :
- c#
- WPF + MVVM
- WCF for external online data transport
- Binary serialization (yes...) for an "offline cache" (sort of a local replication of the database)
- ADO.NET EF + SQL Server 2008 R2 for the ORM/database part.
The idea is to make the application published by clickonce, every client accessing mainly the data in read/write mode via the WCF webservice, and in read-only mode by deserializing the binary files.
I have some troubles figuring out the global architecture of such a project.
My guess is that I should use some DI client side to specify online/offline mode, have the WCF work directly on the EF context and giving the needed data to the viewmodel (or an extra layer between ViewModel and WCF).
As for the model, I already asked on SO and it appears I should make some mapping (with AutoMapper ?) between my EF model and some DTOs that will be known by WCF, and sent to/used by the client.
Project/assemblies speaking, I see it as :
1. View
2. ViewModel
3. Potential extra data store layer (dependency injection here, for online/offline ?). Using the services methods to get data.
4. Services (contracts for getting/storing data)
5. WCF implementing the Services, plugged into the EF layer
6. Offline layer implementing the Services, using DTO model
7. EF Layer, with the context, edmx & stuff
8. "global" DTO Model, with Validation, business rules, constraints...
In this schema, where does the mapping between the EDMX generated model and the DTOs happen ?
Any additionnal info/tips/warning regarding all this is welcome. | 0 | [
2,
619,
7721,
17967,
20147,
1886,
1054,
1267,
1061,
13315,
800,
3726,
3726,
31,
259,
20,
1895,
40,
6002,
1054,
8,
14489,
3010,
568,
14,
249,
5740,
13,
45,
13,
8,
272,
5910,
13,
8,
619,
7721,
2754,
17967,
20147,
13,
8,
11801,
410,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 block false user name and email in commits
===
i want to block those commits in the server which has false user name and email.
The authentication is via ssh. It is currently posible for me to update the config user.name and user.email to something other than mine and still commit and push to central repo. The history now shows wrong information about committer.
Any ideas, how we can prevent this? | 0 | [
2,
184,
20,
1921,
4997,
4155,
204,
17,
8517,
19,
9686,
18,
800,
3726,
3726,
31,
259,
20,
1921,
273,
9686,
18,
19,
14,
8128,
56,
63,
4997,
4155,
204,
17,
8517,
9,
14,
27963,
25,
1197,
13,
18,
1635,
9,
32,
25,
871,
12928,
3426,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why the RoleVoter should have a prefix?
===
In our application we planed to use the `RoleVoter` mechanism but we'd like to remove the `ROLE_` prefix as the security we are implementing is more *task based* than *role based*.
Technically, there is no problem for the implementation but I found in the documentation that using the `RoleVoter` with an empty prefix should be discouraged ( http://static.springsource.org/spring-security/site/docs/3.0.x/apidocs/org/springframework/security/access/vote/RoleVoter.html#setRolePrefix%28java.lang.String%29 ).
I'm wondering why?
AFAICS, the only problem is that the RoleVoter will be participating in decision that it is not meant to (such as the `IS_AUTHENTICATED_FULLY`, `IS_AUTHENTICATED_REMEMBERED`, ...) and might returns an access denied instead of an abstain.
Could you please confirm that this is the only issue with an empty prefix?
Thanks in advance
M. | 0 | [
2,
483,
14,
597,
2625,
815,
378,
57,
21,
14315,
60,
800,
3726,
3726,
19,
318,
3010,
95,
944,
69,
20,
275,
14,
13,
1,
7133,
11190,
815,
1,
6534,
47,
95,
22,
43,
101,
20,
4681,
14,
13,
1,
661,
413,
1,
14315,
28,
14,
1221,
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... |
how to change border color of colorbox
===
Hi I am using [colorbox](http://www.jacklmoore.com/colorbox) throughout my web application. I wonder if I can change the border color of my color box. I have gone through the code and see that there is a attribute
#cboxMiddleLeft:background: url("images/controls.png") repeat-y scroll left top transparent;
and when I go to images folder of color box I see a controls.png image for left and right borders of the color box and property
#cboxBottomCenter: background: url("images/border.png") repeat-x scroll 0 -29px transparent;
for top and bottom borders of the color box. Both images are in `dark grey color`.
Now what I want to ask that If I want to change the border of the color box, then should I put the `color.png and border.png` in that particular color? Can I get these images in all colors? Because its difficult to design the same images in all colors.
The color of my web application changes in many colors and I want to show borders with respect to those colors. What is the best approach for this? Is there any automated way to do this? I searched but couldn't get any thing.
Regards | 0 | [
2,
184,
20,
753,
1862,
1665,
16,
1665,
5309,
800,
3726,
3726,
4148,
31,
589,
568,
636,
11282,
5309,
500,
5,
21127,
6903,
6483,
9,
6994,
255,
13253,
62,
9,
960,
118,
11282,
5309,
6,
892,
51,
2741,
3010,
9,
31,
2666,
100,
31,
92,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Value of checkboxes
===
$alt is a value of chosen alternatives ID. I get them from
$_GET['alternative']; and [alternative] is the name of checkbox.
<input type="checkbox" name="alternative['.$row_q['question_id'].']" value="'.$row['alternative_id'].'">'.$row['alternative'].'</input>
So I get the value by writing
$alt = $_GET['alternative']; in another page.<br>
The problem is:
For example if I chose A, B, C from question 1 and B , C from question 2
Then I get print_r like this:
Array ( [1] => 40 [2] => 7 ) , you see I get only C , [1] => 40 from question 1 with it’s question id as a key, which is the last one from question nr 1. I don’t get A and B Only C from question nr 1. I mean [1] is question id and =>40 is alternative_id But the last one of chosen alternatives of question nr 1.
and I get C [2] => 7 from question nr 2 which is the last chosen of question nr 2 with it’s question id.
My target is like this:
I have a column in my question table with name alt_id.
My table of questions look like this:
Q_id, question, alt_id
Let’s question nr you chose A, B and C witch alternative id’s is 10, 30, 40
Now I want collect them with comma with implode() and write them as 10,30,40 and put them in column alt_id in row of question id nr 1
<br>
Q_id question alt_id<br>
1 Chose some equation to get 20 10,30,40<br>
2 2 What's a synonym of handsome? 60,7<br>3 .................................................. 89,6,50,30 <br>
I want them like this
ARRAY([1]=>10,30,40 [2]=>60,7 [3]=>89,6,50,30 and so on….)
Then I want to update question table like this (Ofcourse alt_id is NULL from the begining)<br>
foreach($alt AS $key=>$alternativ){
$query = 'UPDATE question SET alt_id = alternative WHERE q_id = '.$key.' ';
$result = mysql_query($query);
} <br>
So my problem is how can I get them like this ARRAY([1]=>10,30,40 [2]=>60,7 [3]=>89,6,50,30 and so on….) Thank for your commitment Octern!
| 0 | [
2,
13,
26120,
1923,
16,
2631,
5309,
160,
800,
3726,
3726,
5579,
192,
38,
25,
21,
1923,
16,
2519,
2676,
18,
4924,
9,
31,
164,
105,
37,
5579,
1,
3060,
2558,
22,
27556,
22,
12660,
17,
636,
27556,
500,
25,
14,
204,
16,
2631,
5309,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
sorting table based on a condition
===
i have to sort the employees in the EMPLOYEE table by the following rule: when their department is SALES, sort by experience, otherwise sort by SALARY
![enter image description here][1]
[1]: http://i.stack.imgur.com/dPKt5.png
this is what i have tried :
select FNAME||' '||LNAME as emp_name,salary,HIRE_DATE from employee
where dept_id=(select dept_id from department where name='SALES') order by HIRE_DATE asc;
UNION
select FNAME||' '||LNAME as emp_name,salary,HIRE_DATE from employee
where dept_id NOT IN (select dept_id from department where name='SALES') order by salary desc;
which throws an error because of two orders i think. Any solutions? | 0 | [
2,
2058,
68,
859,
432,
27,
21,
2874,
800,
3726,
3726,
31,
57,
20,
2058,
14,
3716,
19,
14,
7362,
859,
34,
14,
249,
1828,
45,
76,
66,
604,
25,
2598,
15,
2058,
34,
1496,
15,
3190,
2058,
34,
10925,
13,
187,
2558,
13679,
1961,
5318... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 notification with actions
===
I am using a jQuery plugin for showing notifications.
so i can use something like this
show_notification("Successfully Saved your data","success");
we can use `html` content as `message`.
Now i want to perform some actions
ex.
show_notification("Do you want to save your data","success");
so this is a question to the user and user need to reply by clicking `yes` or `no` [both will be passed as html message]
what i need to do is when user clicks on yes/no i need to perform some actions.
i can use `id` or `class` to attach a click event,but i have many types of actions,and need to use very different `id` or `class`.
can i use a call back function or something like that ?
Please help me or give me your valuable suggestions .
Thank you.
**Note : I know that it is not possible with current plugin and not talking about its functionalities ,i am just trying to modify the plugin.** | 0 | [
2,
487,
8190,
93,
52,
4634,
29,
3078,
800,
3726,
3726,
31,
589,
568,
21,
487,
8190,
93,
10922,
108,
26,
3187,
52,
4634,
18,
9,
86,
31,
92,
275,
301,
101,
48,
298,
1,
1270,
4634,
5,
7,
29245,
5655,
4377,
154,
1054,
7,
15,
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... |
execution time of a user process inlinux
===
How can i get the details of a process in linux.I want the total execution time,memory map of a process.in this context the process will be a simple java program.I only know the file name,not the process id.Any help will be appreciated | 0 | [
2,
5769,
85,
16,
21,
4155,
953,
19,
1226,
7147,
800,
3726,
3726,
184,
92,
31,
164,
14,
3289,
16,
21,
953,
19,
13024,
9,
49,
259,
14,
600,
5769,
85,
15,
790,
5171,
93,
2942,
16,
21,
953,
9,
108,
48,
4141,
14,
953,
129,
44,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Symfony 1.4 - How to get an yml config file parameter from another yml config file
===
I need to use an yml config file parameter into another yml config file in Symfony 1.4, and I don't know how to do this.
In app.yml I have defined parameters like "ldap ip" or "ldap domain", and theese parameters are also used in LDAPauth.yml. For that reason, I want to unify it:
**app.yml:**
all:
ldap:
ip: XXX.XXX.XXX.XXX
domain: ou=XXXXXX, ou=......
**LDAPAuth.yml:**
adLDAP:
base_dn: ou=XXXXXX, ou=......
domain_controllers:
- XXX.XXX.XXX.XXX
I tried this in LDAPAut.yml, but doesn't work:
**LDAPAuth.yml:**
adLDAP:
base_dn: %APP_LDAP_IP%
domain_controllers:
- %APP_LDAP_DOMAIN%
I would appreciate if anybody knows how to make this works.
Thanks! | 0 | [
2,
13,
7261,
10229,
93,
137,
9,
300,
13,
8,
184,
20,
164,
40,
13,
93,
8184,
13,
14093,
2816,
3893,
18906,
37,
226,
13,
93,
8184,
13,
14093,
2816,
3893,
800,
3726,
3726,
31,
376,
20,
275,
40,
13,
93,
8184,
13,
14093,
2816,
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... |
jQuery Find number of items per row in floated li's
===
Is there a way to find number of items (`li` tag) inside a `ul` which has it's **float:** set to **left**. Assume i got loads of folders which are visually represented by `li` tags. Due to floating behavior as soon as the `li` does not fit in single row they will be pushed down giving it Rows and columns look.my questions is
Using jQuery ..etc Is there a way to determine the number of `li` for each row | 0 | [
2,
487,
8190,
93,
477,
234,
16,
3755,
416,
3131,
19,
15400,
2093,
22,
18,
800,
3726,
3726,
25,
80,
21,
161,
20,
477,
234,
16,
3755,
13,
5,
1,
1210,
1,
3383,
6,
572,
21,
13,
1,
1287,
1,
56,
63,
32,
22,
18,
13,
1409,
14712,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
data structure for storing height and weight (etc) over time for multiple users in mysql
===
I am trying to develop an application for my localhost on which I can track physical attributes (ht, weight, body water, body fat, etc) over time to compare to caloric intake for the purposes of meal planning, etc. Here's what I have right now:
DB surname
TBL home
memberID (tiny int, 1, auto increment, primary key)
name (varchar, 30)
gender (char, 1) ->value should be m or f, but this isn't defined anywhere
birthdate (datetime)
for storing the physical data over time I have considered having a table with a three-column primary key (date, person, type of measurement) with regular single column indexes on each column so that I can look up all entries for a date OR for a person OR for a measurement type. Like this:
DB surname
TBL stats (or something to that effect)
date (datetime, PK1, index)
memberFK (tiny int, 1, PK2, index)
type (varchar, 3, PK3, index) -> possible values should be ht | wt | fat | wat maybe others will also become necessary
value (decimal, 4/1) -> store all values in nnn.n format in a particular system (ie metric) and do any conversions, add units, etc when the data is called
This still seems to create a lot of excess redundancy, so I thought of maybe storing each users measurements in a table in their own database, like so:
DB user1
TBL stats
date (datetime, PK1, index)
type (varchar, 3, PK2, index)
value (decimal, 4/1)
This seems to clean it slightly by removing a column from the foreign key (and the table altogether), but also prevents me from utilizing foreign keys between this table and other nutrition-related tables that are not user-specific. On the other hand, I plan on developing applications for other household topics in which there is general data and user-specific data, so maybe this is the best way if there are good ways of using data between databases like that.
So neither of these seems quite right to me, but I am at a loss as to how to make them better. I am tending towards the second example, provided I can figure out ways to retain the integrity of my data. Please make any comments of suggestions you think will help. Thank you! | 0 | [
2,
1054,
1411,
26,
25615,
2947,
17,
1763,
13,
5,
1198,
150,
6,
84,
85,
26,
1886,
3878,
19,
51,
18,
22402,
800,
3726,
3726,
31,
589,
749,
20,
2803,
40,
3010,
26,
51,
375,
11694,
27,
56,
31,
92,
792,
1825,
13422,
13,
5,
9020,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Barcode Reader for .net compact framework
===
Does anyone know where I can find barcode reading/scanning software for the .net compact framework (3.5)? Ideally it would be able to scan a barcode from a still image. I have seen a lot of software available for .net but not the cf. Price is not an issue. Thanks for the advice. | 0 | [
2,
748,
9375,
7765,
26,
13,
9,
2328,
8285,
6596,
800,
3726,
3726,
630,
1276,
143,
113,
31,
92,
477,
748,
9375,
1876,
118,
18,
1245,
2981,
2306,
26,
14,
13,
9,
2328,
8285,
6596,
13,
5,
240,
9,
264,
6,
60,
5628,
102,
32,
83,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 find string into file
===
This is the file _auth.txt_ (username password)<br>
paolo 1234<br>
luca 0000<br>
<br>
And this is my code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void onexit(char *u, char *p, char *l, FILE *f, int flag);
int main(int argc, char *argv[]){
FILE *fp;
char *tmp, *tmp2, *user, *pass, *line;
printf("Inserire utente: ");
if(scanf("%ms", &user) == EOF){
perror("scanf");
return EXIT_FAILURE;
}
printf("Inserire password: ");
if(scanf("%ms", &pass) == EOF){
perror("scanf");
onexit(user, NULL, NULL, NULL, 1);
return EXIT_FAILURE;
}
size_t max_length = strlen(user) + strlen(pass) + 3;
line = malloc(max_length);
if(line == NULL){
perror("malloc");
onexit(user, pass, NULL, NULL, 2);
return EXIT_FAILURE;
}
fp = fopen("/home/pol/auth.txt", "r");
if(fp == NULL){
printf("Errore apertura file\n");
onexit(user, pass, line, NULL, 3);
return EXIT_FAILURE;
}
while(!feof(fp)){
if(fgets(line, max_length , fp) == NULL){
perror("fgets");
onexit(user, pass, line, fp, 4);
return EXIT_FAILURE;
}
tmp = strtok(line, " ");
if(tmp == NULL){
perror("strtok");
onexit(user, pass, line, fp, 4);
return EXIT_FAILURE;
}
tmp2 = strtok(NULL, "\n");
if(tmp2 == NULL){
perror("strtok");
onexit(user, pass, line, fp, 4);
return EXIT_FAILURE;
}
if((strcmp(tmp,user) == 0) && (strcmp(tmp2,pass) == 0)){
printf("USER: %s - PASS: %s\n", tmp, tmp2);
onexit(user, pass, line, fp, 4);
return EXIT_SUCCESS;
}
else{
printf("no such user or pwd into DB\n");
onexit(user, pass, line, fp, 4);
return EXIT_FAILURE;
}
}
return EXIT_SUCCESS;
}
void onexit(char *u, char *p, char *l, FILE *f, int flag){
if(flag == 1){
free(u);
}
if(flag == 2){
free(u);
free(p);
}
if(flag == 3){
free(u);
free(p);
free(l);
}
if(flag == 4){
free(u);
free(p);
free(l);
fclose(f);
}
}
if i write `luca` into username and `0000` into password the program will stop with "no such user or pwd into db" and i don't understand why...<br>
i think the problem is that not all the file is checked but i don't know how to prevent this... | 0 | [
2,
272,
477,
3724,
77,
3893,
800,
3726,
3726,
48,
25,
14,
3893,
13,
1,
1346,
96,
9,
38,
396,
38,
1,
13,
5,
16704,
7259,
20884,
6,
1,
5145,
1,
15703,
390,
3965,
1,
5145,
1,
15820,
13,
21903,
1,
5145,
1,
13,
1,
5145,
1,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Unix command other than 'stat' and 'ls' to get file modification date
===
I am writing a shell script in which I have to find the last modification date of a file.
`Stat` command is not available in my environment.
So i am using `'ls'` as below to get desired result.
ls -l filename | awk '{print $6 $7 $8}'
But I have read in many forums that [parsing `ls` is generally considered bad practise][1]. While it (probably) works fine most of time, it's not guaranteed to work everytime.
Is there any other way to get file modification date in shell script.
[1]: http://mywiki.wooledge.org/ParsingLs | 0 | [
2,
22540,
1202,
89,
119,
13,
22,
10631,
22,
17,
13,
22,
7532,
22,
20,
164,
3893,
16135,
1231,
800,
3726,
3726,
31,
589,
1174,
21,
3593,
3884,
19,
56,
31,
57,
20,
477,
14,
236,
16135,
1231,
16,
21,
3893,
9,
13,
1,
10631,
1,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Float / Float = strange result
===
I have two values, one from user input and another from DB.
var userinput = form["someInput"];
var valuefromDB = GetValue(someNumber);
public float? GetValue(int id){
return (float?) db.table.where(p=> p.id == id).select(p=> p.Value).SingleOrDefault();
}
userinput have value "1" as string, while valuefromDB havevalue 0.001 as float.
so 1 / 0.001 = 1000
but my c# code give me 999.999939 as result;
var final = float.Parse(userinput) / valuefromDB
when i have "2" as user input value, result is correct, 2000... | 0 | [
2,
11510,
13,
118,
11510,
800,
2578,
829,
800,
3726,
3726,
31,
57,
81,
4070,
15,
53,
37,
4155,
6367,
17,
226,
37,
13,
9007,
9,
4033,
4155,
108,
4881,
800,
505,
2558,
7,
3220,
108,
4881,
7,
12660,
4033,
1923,
2665,
9007,
800,
164... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Send all options from a select list to another JSP
===
I currently have a JSP with a select that looks like this:
<select name="withoutAccess" size="5">
<c:foreach var="item" items="${obj.withoutAccess}">
<option>${item}</option>
</c:foreach>
</select>
For the sake of clarity, I'll only post the select list, as the rest works well.
Now, in my form, when I click the submit button, I want to catch all values in the select list in the other page.
I'm only managing to obtain the option that is selected in that list when I press the button.
How can I obtain the rest?
I've tried with request.getParameterValues("withoutAccess"), but it has only 1 option, the one that is selected. | 0 | [
2,
2660,
65,
6368,
37,
21,
5407,
968,
20,
226,
487,
3401,
800,
3726,
3726,
31,
871,
57,
21,
487,
3401,
29,
21,
5407,
30,
1879,
101,
48,
45,
13,
1,
18,
16964,
204,
3726,
7,
14506,
20604,
7,
1072,
3726,
7,
264,
7,
1,
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... |
Static function overloading?
===
I'll start bu saying I understand that that only nonstatic member functions can be virtual, but this is what I want:
1. A base class defining an interface: so I can use base class pointers to access functions.
2. For memory management purposes (this is an embedded system with limited ram) I want the overloading functions to be statically allocated. I accept the consequence that with a static function, there will be constraints on how I can manipulate data in the function.
My current thinking is that I may keep a light overloading function by making it a wrapper for a function that actually is static.
Please forbear telling me I need to re-think my design. This is why I am asking the question. If you'd like to tell me I'm better off using c and using callbacks, please direct me to some reading material to explain the pitfalls of using an object oriented approach. Is there a object oriented pattern of design which meets the requirements I have enumerated? | 0 | [
2,
12038,
1990,
84,
16866,
60,
800,
3726,
3726,
31,
22,
211,
799,
3183,
1148,
31,
1369,
30,
30,
104,
538,
18077,
322,
3719,
92,
44,
6599,
15,
47,
48,
25,
98,
31,
259,
45,
137,
9,
21,
1000,
718,
14684,
40,
6573,
45,
86,
31,
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... |
Simplify parsing a json response
===
To start off, here is the JSON response that I've been working on:
{ "status": "ok",
"permalinks": [
"http:\/\/localhost\/blog\/2012\/06\/",
"http:\/\/localhost\/blog\/2012\/04\/",
"http:\/\/localhost\/blog\/2012\/03\/",
"http:\/\/localhost\/blog\/2011\/10\/"
],
"tree": {
"2012": {
"06": "221",
"04": "2",
"03": "3"
},
"2011": {
"10": "3"
}
}
}
PHP is being used to format it as an HTML UL inside a DIV:
function DisplayResponse(){
$baseref = 'http://localhost/' ;
$url = $baseref . 'api/get_date_index';
$r = file_get_contents( $url ) ;
if( $r !== false ){
$r = json_decode($r,true);
$t = $r['tree'] ;
echo '<div class="sidebar">' ;
echo '<h3>Response</h3>' ;
echo '<ul class="sidebar-list">' ;
for ( $y = 0 ; $y <= 2 ; $y++ ){
if ( $y == 0 ){
for ( $m = 12 ; $m >= 0 ; $m-- ) {
$d = mktime ( 0, 0, 0, $m, 1, Date("Y") ) ;
$du = Date("Y", $d ) ;
$dm = Date("M", $d ) ;
if ( $m < 11 ){
$mm = sprintf("%02d",$m) ;
if ( $t[$du][$mm] != NULL ){
echo '<li><a href="' . $baseref . 'blog/' . $du . '/' . $mm
. '/">' . $dm . ', ' . $du . '</a></li>' ;
}
} else {
if ( $t[$du][$m] != NULL ){
echo '<li><a href="' . $baseref . 'blog/' . $du . '/' . $mm
. '/">' . $dm . ', ' . $du . '</a></li>' ;
}
}
}
} else {
for ( $m = 12 ; $m >= 0 ; $m-- ) {
$d = mktime ( 0, 0, 0, $m, 1, ( Date("Y") - $y) ) ;
$du = Date("Y", $d );
$dm = Date("M", $d ) ;
if ( $m < 11 ){
$mm = sprintf("%02d",$m) ;
if ( $t[$du][$mm] != NULL ){
echo '<li><a href="' . $baseref . 'blog/' . $du . '/' . $mm
. '/">' . $dm . ', ' . $du . '</a></li>' ;
}
} else {
if ( $t[$du][$m] != NULL ){
echo '<li><a href="' . $baseref . 'blog/' . $du . '/' . $mm
. '/">' . $dm . ', ' . $du . '</a></li>' ;
}
}
}
}
}
echo '</ul></div><div class="sidebar-bottom"></div>' ;
}
}
The output is the desired result of having month and year line item wonderfully displayed in descending on the section of a page, but how do I clean up this code so that is beautifully displayed in the source? | 0 | [
2,
28257,
2017,
18,
68,
21,
487,
528,
1627,
800,
3726,
3726,
20,
799,
168,
15,
235,
25,
14,
487,
528,
1627,
30,
31,
22,
195,
74,
638,
27,
45,
13,
1,
13,
7,
10631,
267,
7,
45,
13,
7,
3085,
7,
15,
13,
7,
1432,
540,
6258,
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... |
Ranking MongoDB search
===
Ok, this might sound simple but am not sure what to do.
I am running PHP 5.3.x and this is what I want to do. I know the find() command. but I am not sure how to rank the returned JSON.
here is how we store our blog
{
"title":"this is a title";
"body":"this is the body";
"author":"ROB"
"keywords":[{'auto';'music';'fun'}]
"country":"USA"
"dateadded":"07-11-2011";
}
what I want to do is the following order
Keyword match 100% - 0%
Author if author has talked about this keyword a lot there posts go higher up
title search score 1 (Meaning matches what user is searching
order that by date newest to oldest
please let me know if this is possible.
| 0 | [
2,
4992,
3521,
5474,
220,
2122,
800,
3726,
3726,
5854,
15,
48,
530,
646,
1935,
47,
589,
52,
562,
98,
20,
107,
9,
31,
589,
946,
13,
26120,
331,
9,
240,
9,
396,
17,
48,
25,
98,
31,
259,
20,
107,
9,
31,
143,
14,
477,
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... |
can I use 32-bit mongodb-client to connect to 64-bit mongodb-server?
===
when I'm using 32-bit mongodb ,I want to upgrade to 64-bit ,but some PC can't support 64-bit OS,so I want to know whether I can use 32-bit mongodb-client to connect to 64-bit mongodb-server? | 0 | [
2,
92,
31,
275,
2512,
8,
3326,
3521,
5474,
220,
8,
150,
18513,
38,
20,
6379,
20,
4384,
8,
3326,
3521,
5474,
220,
8,
10321,
106,
60,
800,
3726,
3726,
76,
31,
22,
79,
568,
2512,
8,
3326,
3521,
5474,
220,
13,
15,
49,
259,
20,
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... |
Macro assignment to function call
===
Is is possible to define a macro BREF(...):
struct bits
{
int b0:1;
int b1:1;
int b2:1;
int b3:1;
int b4:1;
int b5:1;
int b6:1;
int b7:1;
}
#define BREF(var,bit) ????
#define BAR 4
#define ALIAS BREF(foo,BAR)
unsigned char foo;
such that this statement:
ALIAS = 1;
expands to this:
((struct bits *)&foo)->b4 = 1;
and this:
int k = ALIAS;
to this:
int k = ((struct bits *)&foo)->b4;
So far, this is my implementation of BREF(...):
#define BREF(var,bit) (((struct bits *) &(var))->b##bit)
However, this only works if `bit` is a literal numeral. I want to be able to pass in a macro variable that expands into a number. How can I make the C preprocessor expand `bit` before concatenating it to `b`? | 0 | [
2,
9069,
8427,
20,
1990,
645,
800,
3726,
3726,
25,
25,
938,
20,
9267,
21,
9069,
4929,
410,
5,
9,
9,
9,
6,
45,
13,
10346,
10181,
13,
1,
19,
38,
334,
387,
45,
165,
73,
19,
38,
334,
165,
45,
165,
73,
19,
38,
334,
28763,
73,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Parsing Specific Input File Using Fscanf
===
i`ve been trying o use fscanf to read the an input file on my application.
This is the input file
3
Process#1 - 2Kb
3
exec 20
io 5
exec 50
Process#2 - 8Kb
1
exec 100
Process#3 - 8Kb
4
exec 50
io 50
exec 50
io 50
First of all i want to read the First "3", which i am having no problems doing so.
After that, i will need to read the information after the # (which is 1) and the number right after the "kb" string (which is 2).
Why is this fscanf failing to do so ?
fscanf(inputFile, "Process#%d - %dKb", &id, &mem );
How can i do it ?
Thanks in advance | 0 | [
2,
2017,
18,
68,
1903,
6367,
3893,
568,
398,
18,
1245,
410,
800,
3726,
3726,
31,
1,
195,
74,
749,
635,
275,
398,
18,
1245,
410,
20,
1302,
14,
40,
6367,
3893,
27,
51,
3010,
9,
48,
25,
14,
6367,
3893,
203,
953,
5910,
165,
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... |
How to change writable enumerable and configurable values of a Javascript object property?
===
From the node repl:
> foo = { bar: 'baz'};
> console.log (Object.getOwnPropertyDescriptor(foo, 'bar'))
Returned value:
*{ value: 'baz',*
*writable: true,*
*enumerable: true,*
*configurable: true }*
How do you change the writable enumerable, and configurable to false? What are these values called? Are they part of ES5.1? Are there more that the repl didn't output?
| 0 | [
2,
184,
20,
753,
20127,
579,
1957,
723,
106,
579,
17,
1065,
13549,
579,
4070,
16,
21,
8247,
8741,
3095,
1354,
60,
800,
3726,
3726,
37,
14,
15421,
302,
5727,
45,
13,
1,
4310,
111,
800,
13,
1,
748,
45,
13,
22,
969,
380,
22,
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... |
SQL Server Maximum Transactional Row Insert using Classic ASP
===
I'm running into a problem inserting rows from a file with 13,000 rows into a SQL Server 2008 database. I can take a small chunk of the file and insert it just fine. I've been able to insert as many as 4000 rows in a single transaction (yes, I'm using transactions), but when I use something higher I get a server 500 error.
Is there a limit on how many rows you can Commit or Rollback in SQL Server using an SQLOLEDB database connection in classic ASP? If so, how do I increase that?
If not, what other things should I look for in both IIS and SQL Server to ensure I can insert that many rows? | 0 | [
2,
4444,
255,
8128,
2979,
12799,
192,
3131,
14692,
568,
2732,
28,
306,
800,
3726,
3726,
31,
22,
79,
946,
77,
21,
1448,
14692,
68,
11295,
37,
21,
3893,
29,
27099,
11295,
77,
21,
4444,
255,
8128,
570,
6018,
9,
31,
92,
247,
21,
284... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Playing audio/video on-demand with overlay?
===
I'm currently busy working on a TV-station app, which I'm writing in C#. However, C# lacks (good) support for audio-video output, let alone with an overlay (logo's, "Next up: [episode]" etc.).
My question is: **is there a programming language that has good (native) support for playing back audio/video with support for overlays?**
I already tried Java + Xuggle (I can't find enough examples), C# + about 3 different plugins. | 0 | [
2,
791,
4023,
118,
14785,
27,
8,
25358,
29,
84,
4414,
60,
800,
3726,
3726,
31,
22,
79,
871,
4394,
638,
27,
21,
983,
8,
10839,
4865,
15,
56,
31,
22,
79,
1174,
19,
272,
5910,
9,
207,
15,
272,
5910,
1792,
18,
13,
5,
3264,
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... |
Get Network Strength (RSSI)
===
I am having trouble getting the RSSI or network strength on Android 4.0+. The current method i use works on any version of android below though.
Here is what i am attempting...
-----
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netInfo = cm.getActiveNetworkInfo();
if (netInfo != null && netInfo.isConnected()) {
signalStrengthTextView = (TextView) view.findViewById(R.id.signalStrengthTextView);
signalStrengthListener = new SignalStrengthListener();
((TelephonyManager)getSystemService(TELEPHONY_SERVICE)).listen(signalStrengthListener,SignalStrengthListener.LISTEN_SIGNAL_STRENGTHS);
int SIGNAL_STRENGTH_VALUE = 0;
try {
SIGNAL_STRENGTH_VALUE = Integer.parseInt(signalStrengthTextView.getText().toString());
} catch(NumberFormatException nfe) {
}
-----
The value always returns as 99 and not the correct RSSI. Any help would be awesome! | 0 | [
2,
164,
982,
2169,
13,
5,
1224,
18,
49,
6,
800,
3726,
3726,
31,
589,
452,
2572,
1017,
14,
13,
1224,
18,
49,
54,
982,
2169,
27,
13005,
268,
9,
387,
2430,
9,
14,
866,
2109,
31,
275,
693,
27,
186,
615,
16,
13005,
1021,
362,
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... |
Navigation Bar That stays over the TabBarController
===
I want to have a navigation bar with a settings button on it that stays there regardless of which tab it is on.
Sorry for the short message its late for me,
Chase | 0 | [
2,
8368,
748,
30,
16192,
84,
14,
6523,
1850,
12898,
1252,
800,
3726,
3726,
31,
259,
20,
57,
21,
8368,
748,
29,
21,
12410,
5167,
27,
32,
30,
16192,
80,
7148,
16,
56,
6523,
32,
25,
27,
9,
1875,
26,
14,
502,
2802,
82,
456,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Android equivalent of UIEdgeInset
===
I have an image with rounded corners. I need to stretch the image without warping the corners. (basically I just want to stretch the middle)
In iOS I would do something along the lines of
[[UIImage imageNamed:@"foo.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(5, 5, 5, 5)];
How would I go about doing the same on android.
| 0 | [
2,
13005,
4602,
16,
13,
5661,
8840,
108,
3554,
800,
3726,
3726,
31,
57,
40,
1961,
29,
8472,
8894,
9,
31,
376,
20,
6363,
14,
1961,
366,
176,
3181,
14,
8894,
9,
13,
5,
6093,
8438,
31,
114,
259,
20,
6363,
14,
772,
6,
19,
13,
77... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 reuse the paginationControl partial while passing different parameters to each instance
===
I'm using the paginationControl partial, and passing parameters through the 4th parameter to allow me to paginate "filtered" results. That's working fine, but I'd like to be able to use the same partial for all instances of pagination even though they'll use different parameters.
e.g. "properties" are filtered by no. bedrooms
giving a 4th paramater in the instance of the pagination control in the view script of...
array('beds' => '$beds')
and used in the partial...
$this->beds
whereas "clients" are filtered by location
giving a 4th paramater in the instance of the pagination control in the view script of...
array('location' => '$location')
and used in the partial...
$this->location
How to best accomplish this? I could access the 4th parameter as an array of keys and values, and loop over the array and build the arguments for the url view helper within the paginationControl partial IF I could work out how to access the array. But but perhaps that's not the approach to take anyway..
Thanks. | 0 | [
2,
184,
20,
302,
3699,
14,
19006,
108,
857,
12898,
7284,
133,
2848,
421,
12905,
20,
206,
4851,
800,
3726,
3726,
31,
22,
79,
568,
14,
19006,
108,
857,
12898,
7284,
15,
17,
2848,
12905,
120,
14,
268,
96,
18906,
20,
1655,
55,
20,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to install a dll when a request for a html or php page
===
I have a problem in Web page.
Problem is that When I request a page e.g. index.html then I want to install a dll on that machine from which the request is occurred.
So please guide me what should I do to accomplish it.
| 0 | [
2,
184,
20,
16146,
21,
13,
43,
211,
76,
21,
3772,
26,
21,
13,
15895,
54,
13,
26120,
2478,
800,
3726,
3726,
31,
57,
21,
1448,
19,
2741,
2478,
9,
1448,
25,
30,
76,
31,
3772,
21,
2478,
13,
62,
9,
263,
9,
4348,
9,
15895,
94,
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... |
tab delimited file data to be stored into data structure
===
i'm reading in a tab delmited file into c++, i want to manipulate the data and was wondering what is a good data structure to store it. here is my tab delmited file
Account Number Name Address Available Balance
15 Ted 20 John St. 100
30 John 30 Ted St. 200
50 Roy 55 Roy St. 520
I want to basically want to modify the fields in the text file, based on what commands i do, say i want to withdraw 50 from Ted. I would need to find Ted's account. look at the available balance and subtract 50 from it, then save it back into the text file.
Is there an efficient way to do this? all i can think of is a long and convoluted way | 0 | [
2,
6523,
121,
23012,
3893,
1054,
20,
44,
8214,
77,
1054,
1411,
800,
3726,
3726,
31,
22,
79,
1876,
19,
21,
6523,
1506,
5130,
69,
3893,
77,
272,
20512,
15,
31,
259,
20,
18468,
14,
1054,
17,
23,
5712,
98,
25,
21,
254,
1054,
1411,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Sqlite Error on Phonegap "near ".": syntax error"
===
I'm working on a phonegap application using cordova "1.9".
I have a syntax error on this statement:
db.executeSql('UPDATE Reminder SET Reminder.reminderName ="'+ reminder_name + '", Reminder.reminderDescription = "' + description +'", Reminder.cellId='+ 1 +', Reminder.timetableId ='+1+', Reminder.reminderDeadline ="' + deadline +'" WHERE Reminder.RminId = "'+reminderId+'" ');
SO, I'm wondering what am I doing wrong?
| 0 | [
2,
4444,
10601,
7019,
27,
1132,
1136,
306,
13,
7,
14114,
13,
7,
9,
7,
45,
22649,
7019,
7,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
1132,
1136,
306,
3010,
568,
5429,
3496,
13,
7,
165,
9,
518,
7,
9,
31,
57,
21,
22649,
7019,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
OrmLite pasing data do SP like object
===
Is it possible to consume store procedure with ormLite just buy passing object, without using Parameters.Add. Something like this. But this trow error Procedure or function 'SuspendUser' expects parameter '@ID', which was not supplied.
db.Query<User>("SuspendUser", new { ID = 21 });
| 0 | [
2,
54,
79,
10601,
5750,
68,
1054,
107,
3782,
101,
3095,
800,
3726,
3726,
25,
32,
938,
20,
16447,
1718,
7004,
29,
54,
79,
10601,
114,
3034,
2848,
3095,
15,
366,
568,
12905,
9,
14854,
9,
301,
101,
48,
9,
47,
48,
13,
38,
5417,
70... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
cakephp auth->loginRedirect for admin
===
I'm fairly new to cakePHP and have read all the tutorials on the cake site. I'm building a small sample app using cake 2.1 and have hit a problem. Basically, I want admin users redirected to a different page on login than what a normal user gets redirected to. I'm sure theres an easy way to do this but I'm struggling!
I have Admin routing enabled and am using the auth compounant (and the ACL componant though thats not affecting my issue). I have 2 logins one for admin - admin_login() and a login for normal users - login() - the normal non admin login works fine.
In my AppController.php I have this:
class AppController extends Controller {
public $components = array(
'Acl',
'Auth' => array(
'authorize' => array(
'Actions' => array('actionPath' => 'controllers')
)
),
'Session'
);
public $helpers = array('Html', 'Form', 'Session');
public function beforeFilter() {
//Configure AuthComponent
$this->Auth->allow('display'); // Allows access to the homepage of the app
$this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
$this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'posts', 'action' => 'add');
}
}
So as you can see the default is for users to be redirected on login to the posts controllers add() fucntion, which works fine. However, how can I set a different login redirect for my admin_login() function?
I've read a number of posts on here but most relate to older versions of cake and not cake 2.
If it helps, this is my admin_login function in the UsersController.php
public function beforeFilter() {
parent::beforeFilter();
$this->Auth->allow('logout');
}
public function admin_login() {
if ($this->request->is('post')) {
if ($this->Auth->login()) {
if ($this->Session->read('Auth.User')) {
$this->Session->setFlash('You are logged in!');
//$this->redirect($this->Auth->redirect());
// This doesnt work! Grrrrrr
//$this->redirect(array('controller'=>'pages', 'action'=>'admin_index'));
// This nearly works...
if($this->Auth->user())$this->redirect(array('controller' => 'pages', 'action' => 'admin_index'));
}
}
else {
$this->Session->setFlash('Your username or password was incorrect.');
}
}
Could anyone point me in the right direction? Thanks in advance! | 0 | [
2,
8390,
26120,
10343,
96,
8,
1,
5567,
108,
99,
14706,
26,
21,
43,
2160,
800,
3726,
3726,
31,
22,
79,
6647,
78,
20,
8390,
26120,
17,
57,
1302,
65,
14,
29724,
18,
27,
14,
8390,
689,
9,
31,
22,
79,
353,
21,
284,
5717,
4865,
56... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 get RESULT_OK before ending activity
===
I have any activity that start other other activity for getting some items ,
I have started that with
Intent inte = new Intent(actMain.this,actResults.class);
inte.setAction("calllog");
startActivityForResult(inte, CALL_LOG_REQ);
but after starting this , actResults returns Action_OK automatically , and when I send ACTION_OK , it do not works . why ?
| 0 | [
2,
31,
164,
829,
1,
3085,
115,
3119,
2358,
800,
3726,
3726,
31,
57,
186,
2358,
30,
799,
89,
89,
2358,
26,
1017,
109,
3755,
13,
15,
31,
57,
373,
30,
29,
6936,
19,
591,
800,
78,
6936,
5,
5183,
6232,
9,
1565,
15,
5183,
29955,
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... |
What is the 'mywikiLoggedOut=12345678' cookie good for?
===
While logging in via the API, I get back some cookies from the Wikimedia framework:
mywikiUserName=myusername; mywiki_session=a27c625a1babc58ad7cc11e317c9eed2; mywikiLoggedOut=20120723255540";
I wonder what the mywikiLoggedOut=20120723255540 is about?
I havn't found documentation regarding this, so any help is appreciated. | 0 | [
2,
98,
25,
14,
13,
22,
915,
17375,
19287,
1320,
3726,
918,
3965,
3776,
4130,
22,
19980,
254,
26,
60,
800,
3726,
3726,
133,
13,
13919,
19,
1197,
14,
21,
2159,
15,
31,
164,
97,
109,
19396,
37,
14,
13,
17375,
8260,
6596,
45,
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... |
Why isn't my signup form working until all of the form fields are filled?
===
A few days ago, my signup form for an app I'm building was working fine. The 'create my account' button would work even if no form fields were filled, and an error message would be displayed right away. Now, when I try to submit the form, the form only will submit or show error messages when all of the fields have been filled. If I try to submit the form without filling all of the fields, nothing happens. The signup button doesn't work correctly.
The only significant change that I made that I can think of is switching the stripe plan I was using to a free trial plan instead of a plan where the purchaser of the application pays up-front. I have no idea what could be causing this problem, so I don't know what code I should post. Any help you can provide would be appreciated.
The signup form I have in rails is as follows(minus some javascript that I'm using for Stripe):
<div class="row">
<div class="span6 offset4">
<%= form_for(@user) do |f| %>
<%= render 'shared/error_messages' %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= f.label :email %>
<%= f.text_field :email %>
<%= f.label :password %>
<%= f.password_field :password %>
<%= f.label :password_confirmation, "Password confirmation" %>
<%= f.password_field :password_confirmation %>
<%= f.label :morning_meds, "Do you take medications in the morning?" %>
<%= f.select :morning_meds, [['Yes'], ['No']] %>
<%= f.label :lunch_meds, "Do you take medications at lunch?" %>
<%= f.select :lunch_meds, [['Yes'], ['No']] %>
<%= f.label :night_meds, "Do you take medications in the evening?" %>
<%= f.select :night_meds, [['Yes'], ['No']] %>
<%= f.label :time_zone, "Choose your time zone" %>
<%= f.select :time_zone, [['Eastern'], ['Central'], ['Mountain'], ['Pacific']] %>
<%= f.label :phone_number, "Your cell phone number" %>
<%= f.text_field :phone_number %>
<div class="form-row">
<label>Card Number</label>
<input type="text" size="20" autocomplete="off" class="card-number" />
</div>
<div class="form-row">
<label>CVC</label>
<input type="text" size="4" autocomplete="off" class="card-cvc" />
</div>
<div class="form-row">
<label>Expiration Date</label>
<%= select_month nil, {add_month_numbers: true}, {name: nil, class: 'card-expiry-month' } %>
<span> / </span>
<%= select_year nil, {start_year: Date.today.year, end_year: Date.today.year+15}, {name: nil, class: 'card-expiry-year' } %>
</div>
<%= f.submit "Create my account", class: "btn btn-large btn-primary" %>
<% end %>
</div>
</div>
| 0 | [
2,
483,
2532,
22,
38,
51,
1676,
576,
505,
638,
163,
65,
16,
14,
505,
2861,
50,
1943,
60,
800,
3726,
3726,
21,
310,
509,
1464,
15,
51,
1676,
576,
505,
26,
40,
4865,
31,
22,
79,
353,
23,
638,
1123,
9,
14,
13,
22,
6037,
1373,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I prevent my website from being "hit-boosted"?
===
I am making a social site where users can post content and the content has views. Whenever a user from a different IP address views the content, the view count is incremented; multiple requests coming from the same IP address do not count. However lately someone is iterating though a list of proxies or something and artificially increasing the view counts. How can I prevent this? Is there something I can do by checking headers or something? Thanks. | 0 | [
2,
184,
92,
31,
2501,
51,
2271,
37,
142,
13,
7,
10242,
8,
10858,
10859,
7,
60,
800,
3726,
3726,
31,
589,
544,
21,
668,
689,
113,
3878,
92,
678,
2331,
17,
14,
2331,
63,
4146,
9,
6634,
21,
4155,
37,
21,
421,
15735,
3218,
4146,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 jquery plugin to animate this slider?
===
Hi guys i'm trying to convert the slider in this layout http://designinstruct.com/web-design/create-a-bright-and-sleek-web-design-in-photoshop/ but i could not find the plugin that meets my need , i've been searching 2 days for it , i found some plugins that closer to this slider but not the same .
please could anyone guide me . | 1 | [
2,
98,
487,
8190,
93,
10922,
108,
20,
14487,
591,
48,
3295,
106,
60,
800,
3726,
3726,
4148,
2776,
31,
22,
79,
749,
20,
8406,
14,
3295,
106,
19,
48,
9106,
7775,
6903,
19862,
108,
10346,
9,
960,
118,
14113,
8,
19862,
118,
6037,
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... |
Merge pop pst into exchange pst file remotely
===
I have a pst file I want to upload to an exchange server and be made a permanent part of the exchange mailbox.
Can this be accomplished by going into file->advanced->export->"import from another program" and importing the pst file?
I need to make sure the merged emails get stored on the exchange server because this isn't my mailbox and I was planning on setting up a new mail profile on my computer to do the import. | 0 | [
2,
12666,
1675,
351,
384,
77,
1950,
351,
384,
3893,
23288,
800,
3726,
3726,
31,
57,
21,
351,
384,
3893,
31,
259,
20,
71,
8294,
20,
40,
1950,
8128,
17,
44,
117,
21,
3032,
141,
16,
14,
1950,
4216,
5309,
9,
92,
48,
44,
8812,
34,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Codeigniter base_url() in whack?
===
I was trying to set up a basic log in form with a following code:
<?=form_open(base_url() . 'main/login'); ?>
However after submitting the form the url shows this:
example.com/main/http//example.com/http//example.com/main/login
So I guess in essence for some reason the base-url is printed twice before the controller/method declaration. If I clear the base url value in my config file then the application works normally. I am however curious on what could cause this. For additional information I am working on xampp with a virtualhost and I have mod-rewrite on with a .htaccess file located at the document root.
| 0 | [
2,
1797,
9693,
242,
106,
1000,
1,
911,
255,
5,
6,
19,
27189,
60,
800,
3726,
3726,
31,
23,
749,
20,
309,
71,
21,
2125,
6738,
19,
505,
29,
21,
249,
1797,
45,
13,
1,
60,
3726,
4190,
1,
10157,
5,
8436,
1,
911,
255,
5,
6,
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... |
Cell array vectorization in Matlab
===
I have a cell array that contains string.
Those individual string needs to be processed, like for example:
a = {'1,2','12';'2,3','23'}
in which, comma should be removed from the string.
I don't know if what's the speed of using for loop compared with using vectorization.
But how can I achieve that using vectorization? | 0 | [
2,
1667,
7718,
7497,
1829,
19,
4277,
9086,
800,
3726,
3726,
31,
57,
21,
1667,
7718,
30,
1588,
3724,
9,
273,
1359,
3724,
2274,
20,
44,
16697,
15,
101,
26,
823,
45,
21,
800,
13,
1,
22,
15793,
22,
15,
22,
918,
22,
73,
22,
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... |
MVC MS SQL Connection
===
I have created a Database in MS SQL and loaded the Database in my Server Explorer. In my MVC application, I wish to simply populate a single entity inside my database (Customer Name for example), does anyone know how I can send data to the database I have loaded? I can't seem to figure it out.
Any help will be highly appreciated. | 0 | [
2,
307,
8990,
4235,
4444,
255,
2760,
800,
3726,
3726,
31,
57,
679,
21,
6018,
19,
4235,
4444,
255,
17,
8572,
14,
6018,
19,
51,
8128,
8520,
9,
19,
51,
307,
8990,
3010,
15,
31,
2536,
20,
1659,
1675,
12383,
21,
345,
9252,
572,
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... |
Obj-C - NSString that saves all input using currentTitle and UILabel.text methods
===
NSString* digit = [sender currentTitle];
if (self.userIsInTheMiddleOfEnteringANumber){
NSString* currentDisplayText = [[self display]text];
NSString* newDisplayText = [currentDisplayText stringByAppendingString:digit];
self.display.text = newDisplayText;
I´ll try and explain my problem as good as I can. This line of code here takes the digit from a selection of buttons, saves it no the string "digit". "currentDisplayText"takes the digit displayed in a label. Then these two strings are appended and sent to the "display" (label)
But there is also an enter button. Which clears the display (so user can enter new number ) this is a calculator btw!
- (IBAction)enterPressed{
[self.brain pushOperand:[self.display.text doubleValue]];
self.userIsInTheMiddleOfEnteringANumber = NO;
What I want is to display a "history" label that displays all the numbers entered - I have not quite understood how I get the string I save the "history" too, to not reset like the display does. This might be bad exlained by me, but any hints are appreciated. I am still learning objective-c... | 0 | [
2,
5122,
728,
8,
150,
13,
8,
13,
2172,
11130,
30,
16815,
65,
6367,
568,
866,
22235,
17,
13,
5661,
21018,
9,
11969,
3195,
800,
3726,
3726,
13,
2172,
11130,
2483,
15611,
800,
636,
18,
13630,
866,
22235,
12660,
100,
13,
5,
8411,
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... |
Using `alias' to add a default option - e.g. `alias cd="cd -P" '
===
I've often been tempted with the idea of using an alias to modify the default behavior of a command line tool. For example, I often want to resolve the actual path after following a symlink (and have never wanted to maintain the symlink path), so I was thinking about adding something to my .bash_profile file, to make this the default behavior, e.g.:
alias cd="cd -P"
Is this bad or dangerous for any reason? If not for this example, is it a bad idea in general? It makes me feel a little dirty... | 0 | [
2,
568,
13,
1,
10060,
18,
22,
20,
3547,
21,
12838,
4255,
13,
8,
13,
62,
9,
263,
9,
13,
1,
10060,
18,
1745,
3726,
7,
6324,
13,
8,
306,
7,
13,
22,
800,
3726,
3726,
31,
22,
195,
478,
74,
19012,
29,
14,
882,
16,
568,
40,
157... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Odd behavior of Windows' GetFileInformationByHandle function
===
I'm having an odd problem with the Windows GetFileInformationByHandle function, which im using to get a unique ID for files in certain folders.
When I use the function on a file stored on a local drive or a USB external drive, the speed is pretty good. For example, running the program for 2000 files on my USB drive it will complete in about 600ms (It's also doing a bunch of other stuff but that's the total time)
However, running the program for the exact same amount of files on my network drive takes 55,000ms.
What's odd about that is that my Unix implementation, using the stat function, gives comparable times (slightly quicker) to Windows on local and USB drives, but completes exectuion on the network drive in only 5000ms (which is fine because I'm sure the bulk of that time is waiting for the drive to respond initially).
So why is it that GetFileInformationByHandle is fine for local stuff, but awful over network access and how is stat so much better at that?
I was looking at the [GetFileInformationByHandleEx](http://msdn.microsoft.com/en-us/library/windows/desktop/aa364953%28v=vs.85%29.aspx) function which seems to have an option to return just the File ID which may be faster than what i'm currently using but I was having trouble getting it to work. I dont know if i have the relevant libraries or what I'm doing wrong. (Has anyone got any C++ examples of that being used?)
Here's the code I'm using at the moment, any tips would be greatly appreciated!
#if defined __linux__ || defined __APPLE__
#include<sys/stat.h>
#endif
#ifdef _WIN32
#include <windows.h>
#endif
#include <QString>
class FileIdentifier
{
public:
FileIdentifier();
quint64 identifyFile(QString);
private:
#if defined __linux__ || defined __APPLE__
struct stat info;
#endif
#ifdef _WIN32
BY_HANDLE_FILE_INFORMATION lpFileInformation;
HANDLE fileHandle;
#endif
};
FileIdentifier::FileIdentifier()
{
}
quint64 FileIdentifier::identifyFile(QString in){
#if defined __linux__ || defined __APPLE__
int suc = stat(in.toLocal8Bit().constData(), &info);
if(!suc){
return info.st_ino;
}else{
return 0;
}
#endif
#ifdef _WIN32
fileHandle = CreateFileA(in.toLocal8Bit().constData(),FILE_READ_ATTRIBUTES, FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS,NULL);
int suc = GetFileInformationByHandle(fileHandle, &lpFileInformation);
CloseHandle(fileHandle);
if(suc){
return lpFileInformation.nFileIndexLow;
}else{
return 0;
}
#endif
}
| 0 | [
2,
4210,
3257,
16,
1936,
22,
164,
16877,
22793,
779,
3203,
413,
1990,
800,
3726,
3726,
31,
22,
79,
452,
40,
4210,
1448,
29,
14,
1936,
164,
16877,
22793,
779,
3203,
413,
1990,
15,
56,
797,
568,
20,
164,
21,
2619,
4924,
26,
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... |
Creating a listview from an async web service
===
This is a threading problem - I can feel it.
I have a webservice which has an event hung onto to to report back to a caller. The webservice retrieves some text data.
This works fine. The problem is that the listview is doesn't have the text in it.
The code looks like this (more or less)
public class GetInformation : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
int netType = base.Intent.GetIntExtra("type", 0);
selectedInfo = new List<Info>();
searchResults = new List<Contact>();;
people = new List<People>();
SetContentView(Resource.Layout.List);
listView = FindViewById<ListView>(Resource.Id.customView);
context = listView.Context;
System.Threading.Tasks.Task.Factory.StartNew(() => SetDataSources())
.ContinueWith(task =>
{
RunOnUiThread(() =>
{
if (people.Count != 0)
{
for (int n = 0; n < people.Count; ++n)
{
this.selectedInfo = new List<Info>()
{
new SelectedInfo()
{
Name = people[n].FirstName + " " + people[n].LastName
}
};
}
}
listAdapter = new CustomListAdapter(this, SelectedInfo);
listView.Adapter = listAdapter;
});
});
ViewGroup Parent = listView;
listView.ItemClick += delegate(object s, Android.Widget.AdapterView.ItemClickEventArgs e)
{
InfoClicked(s, e, Parent);
};
}
GetDataSources calls the download method
Something isn't right, but I can't for the life of me see what it is. Any help here would be appreciated.
The listview is similar to the one in Wrox's Professional Android Programming for Monodroid book | 0 | [
2,
2936,
21,
968,
4725,
37,
40,
21,
9507,
150,
2741,
365,
800,
3726,
3726,
48,
25,
21,
9322,
68,
1448,
13,
8,
31,
92,
583,
32,
9,
31,
57,
21,
2741,
11449,
56,
63,
40,
807,
3540,
1204,
20,
20,
1330,
97,
20,
21,
21326,
9,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
IIS 7 how to call script if file exists
===
Not sure if this is possible. I want to run a php script everytime a page on my website is run. So if i got to example.com/test/runme.php i want to run checkme.php then continue on to runme.php. Kind of like when there is a 404 error you can tell it to run a script, i want it to run a script on a successful file.Basically checking to see if the machine is authorized to view it. Im running 2008 r2 server iis7. Thanks for any help in advance.
| 0 | [
2,
595,
18,
453,
184,
20,
645,
3884,
100,
3893,
5636,
800,
3726,
3726,
52,
562,
100,
48,
25,
938,
9,
31,
259,
20,
485,
21,
13,
26120,
3884,
352,
891,
21,
2478,
27,
51,
2271,
25,
485,
9,
86,
100,
31,
330,
20,
823,
9,
960,
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... |
Hotmail SMTP not working with javamail
===
I am trying to write a simple Java program to send emails from my hotmail account using JavaMail API. Here is my code :
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class HotMailSend {
public static void main(String args[])
{
final String username = HOTMAIL.username;
final String password = HOTMAIL.password;
Properties props = new Properties();
props.setProperty("mail.smtp.auth", "true");
props.setProperty("mail.smtp.starttls.enable", "true");
props.setProperty("mail.smtp.host", "smtp.live.com");
props.setProperty("mail.smtp.port", "587");
Session session = Session.getInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
try {
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(HOTMAIL.username));
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(GMAIL.username));
message.setSubject("Testing Subject");
message.setText("Hey Buddy..!!!,"
+ "\n\n No spam to my email, please!");
Transport.send(message);
System.out.println("Done");
} catch (MessagingException e) {
throw new RuntimeException(e);
}
}
}
And here is the error I am getting :
> Exception in thread "main" java.lang.RuntimeException: javax.mail.MessagingException: Can't send command to SMTP host;
nested exception is:
java.net.SocketException: Connection closed by remote host
at HotMailSend.main(HotMailSend.java:45)
Caused by: javax.mail.MessagingException: Can't send command to SMTP host;
nested exception is:
java.net.SocketException: Connection closed by remote host
at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:2163)
at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:2150)
at com.sun.mail.smtp.SMTPTransport.close(SMTPTransport.java:1220)
at javax.mail.Transport.send0(Transport.java:197)
at javax.mail.Transport.send(Transport.java:124)
at HotMailSend.main(HotMailSend.java:40)
Caused by: java.net.SocketException: Connection closed by remote host
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1307)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:43)
at com.sun.mail.util.TraceOutputStream.write(TraceOutputStream.java:114)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:2161)
... 5 more
| 0 | [
2,
1047,
8079,
7613,
13726,
52,
638,
29,
8247,
8079,
800,
3726,
3726,
31,
589,
749,
20,
2757,
21,
1935,
8247,
625,
20,
2660,
8517,
18,
37,
51,
1047,
8079,
2176,
568,
8247,
8079,
21,
2159,
9,
235,
25,
51,
1797,
13,
45,
9010,
8247... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Security & Authentication: SSL vs SASL
===
My understanding is that SSL combines an encryption algorithm (like AES, DES, etc.) with akey exchange method (like Diffier-Hellman) to provide secure encryption and identification services between two endpoints on an un-secure network (like the Internet).
My understanding is that SASL is an MD5/Kerberos protocol that pretty much does the same thing.
So my question: what are the pros/cons to choosing both and what scenarios make both more preferable? Basically, I'm looking for a guidelines to follow when choosing SSL or to go with SASL instead. Thanks in advance! | 0 | [
2,
1221,
279,
27963,
45,
13,
18,
18,
255,
4611,
9233,
255,
800,
3726,
3726,
51,
3260,
25,
30,
13,
18,
18,
255,
15339,
40,
24420,
9083,
13,
5,
1403,
21,
160,
15,
1746,
15,
2722,
9,
6,
29,
21,
4237,
1950,
2109,
13,
5,
1403,
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... |
Redirect in codeigniter after login
===
Trying to do a redirect after a successful login. The login info is sent using ajax to the controller.
My controller code as below
public function login_controller_function()
{
$this->load->model('login_model');
if ($this->input->is_ajax_request())
{
$user_name=$this->input->post('username');
$user_password = $this->input->post('password');
$this->load->helper('url');
$result = $this->login_model->verify_user($user_name,$user_password);
// echo 'user_logged_in';
if(strcmp($result,'user_logged_in')==0)
{
redirect('welcome');
}
}
}
But it is not working at all. Anyone knows whats wrong? | 0 | [
2,
302,
14706,
19,
1797,
9693,
242,
106,
75,
6738,
108,
800,
3726,
3726,
749,
20,
107,
21,
302,
14706,
75,
21,
1300,
6738,
108,
9,
14,
6738,
108,
15404,
25,
795,
568,
20624,
20,
14,
9919,
9,
51,
9919,
1797,
28,
1021,
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... |
Manually generate id of document with Mongoose
===
I want to get the id of a created document without having to make a separate query to get the document after it is created. I'm thinking I'll need to manually create the id of the document before creating it. Is there a way to do this with the `mongoose` driver? | 0 | [
2,
23671,
7920,
4924,
16,
4492,
29,
3521,
839,
6641,
800,
3726,
3726,
31,
259,
20,
164,
14,
4924,
16,
21,
679,
4492,
366,
452,
20,
233,
21,
1725,
25597,
20,
164,
14,
4492,
75,
32,
25,
679,
9,
31,
22,
79,
1440,
31,
22,
211,
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... |
Incompatible library creating new project with Aptana
===
I am a ruby and rails newbie, so my abilities to debug this are somewhat limited.
I have just added the eclipse plugin which failed, then downloaded the latest aptana studio which also failed. The failure was the same in both cases.
The nature of the failure is that when I create a new rails project, I get an error message about an incompatible library version "C:/Ruby193/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5-x86-mswin32-60/lib/http11.so". The project is actually created, along with directories and files.
Google searches around this error message have only returned a couple of hits, which were not very helpful
I am wondering if this is about 64 bit libraries.
My software stack is:
- Windows 7 home premium 64bit
- Aptana RadRails, build: 2.0.5.1278709071
- Ruby1.9.3 gem 1.8.24
The console shows:
"4320"
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': incompatible library version - C:/Ruby193/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5-x86-mswin32-60/lib/http11.so (LoadError)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `block in require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:12:in `<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `block in require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:1:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.0.0/lib/rack/handler.rb:17:in `const_get'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.0.0/lib/rack/handler.rb:17:in `block in get'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.0.0/lib/rack/handler.rb:17:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.0.0/lib/rack/handler.rb:17:in `get'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rails-2.3.4/lib/commands/server.rb:45:in `<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from script/server:3:in `<top (required)>'
from -e:2:in `load'
from -e:2:in `<main>'
| 0 | [
2,
19,
20049,
1248,
2936,
78,
669,
29,
8442,
9068,
800,
3726,
3726,
31,
589,
21,
10811,
17,
2240,
18,
78,
5893,
15,
86,
51,
7009,
20,
121,
16254,
48,
50,
4131,
1317,
9,
31,
57,
114,
905,
14,
11652,
10922,
108,
56,
1702,
15,
94... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
text between lines in css
===
in CSS, how can i do something like:
---Item---
with the dash connected like a line?
i thought of :
border-bottom: 3px solid #000;
but then i can't move the line upward plus the line would be behind the text, not surrounding the text
my HTML
<ul>
<li class="sub-menu-item" ><a href="#">FACULTY&STAFF</a></li>
</ul>
(if possible, i would like to avoid touching the HTML)
is all the above possible via css or should i just use an image after all?
| 0 | [
2,
1854,
128,
1560,
19,
272,
18,
18,
800,
3726,
3726,
19,
272,
18,
18,
15,
184,
92,
31,
107,
301,
101,
45,
13,
8,
8,
8,
2119,
79,
8,
8,
8,
29,
14,
8405,
2587,
101,
21,
293,
60,
31,
289,
16,
13,
45,
1862,
8,
22389,
45,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Handle submission of forms created dynamically having same class
===
i am creating a form for users to comment on each posts displayed through a loop and the form for commenting is also in the same loop. Now i want each comment to be submitted via jquery ajax but each time its taking into account only the first form . Here is my code:-
while($row=mysql_fetch_array($result))
{ ?>
<?=$row['title']?>
<h4>Add commment </h4>
<form class="add_comment" method="post">
<div style="display:none;"><input type="text" name="id" class="id" value="<?=$row['id']?>"/></div>
<input type="text" name="comment" class="comment"/>
<input type="submit" name="submit" value="add" class="submit"/>
</form>
<?php
}
?>
And my jquery goes here
$("form.add_comment").submit(function(event) {
event.preventDefault();
var comment =$('.comment').attr('value');
var id =$('.id').attr('value');
$.ajax({
type: "POST",
url: "/add_comment",
data: "comment="+comment+"&id="+id,
success: function() {
location.reload();
}
});
return false;
});`enter code here`
i understood the error that it selects the first one by default but couldnt fix it up plz help me
| 0 | [
2,
3053,
10923,
16,
1997,
679,
7782,
1326,
452,
205,
718,
800,
3726,
3726,
31,
589,
2936,
21,
505,
26,
3878,
20,
6484,
27,
206,
9868,
6115,
120,
21,
5293,
17,
14,
505,
26,
17797,
25,
67,
19,
14,
205,
5293,
9,
130,
31,
259,
206... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
mediaplayer failure exception
===
I am working on an android application in which i have to play random sounds from my assets folder. there are some images also, when i click on any image from those images a sound must play regarding to that image from assets folder. i managed all but sometime my mediaplayer fails unexpectedly.
I am attaching my code also.
private Handler threadHandler = new Handler() {
public void handleMessage(android.os.Message msg) {
/*first*/ try{
InputStream ims1 = getAssets().open("images/" +dataAll_pic_name1);
d1 = Drawable.createFromStream(ims1, null);
rl1.setVisibility(View.VISIBLE);
img1.setImageDrawable(d1);
AssetFileDescriptor afd = getAssets().openFd("sounds/" + str_snd1);
mp2 = new MediaPlayer();
mp2.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength());
mp2.prepare();
mp2.start();
mp2.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
/*second*/ try{
InputStream ims2 = getAssets().open("images/" +dataAll_pic_name2);
d2 = Drawable.createFromStream(ims2, null);
rl2.setVisibility(View.VISIBLE);
img2.setImageDrawable(d2);
AssetFileDescriptor afd = getAssets().openFd("sounds/" + str_snd2);
mp2 = new MediaPlayer();
mp2.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength());
mp2.prepare();
mp2.start();
mp2.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
/*third*/ try{
InputStream ims3 = getAssets().open("images/" +dataAll_pic_name3);
d3 = Drawable.createFromStream(ims3, null);
rl3.setVisibility(View.VISIBLE);
img3.setImageDrawable(d3);
AssetFileDescriptor afd = getAssets().openFd("sounds/" + str_snd3);
mp2 = new MediaPlayer();
mp2.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength());
mp2.prepare();
mp2.start();
mp2.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
/*four*/ try{
InputStream ims4 = getAssets().open("images/" +dataAll_pic_name4);
d4 = Drawable.createFromStream(ims4, null);
rl4.setVisibility(View.VISIBLE);
img4.setImageDrawable(d4);
AssetFileDescriptor afd = getAssets().openFd("sounds/" + str_snd4);
mp2 = new MediaPlayer();
mp2.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength());
mp2.prepare();
mp2.start();
mp2.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
startAnimation();
//randomSoundPlay();
timer.schedule( new TimerTask(){
public void run() {
System.out.println("Wait, what........................:");
try{
AssetFileDescriptor afd = getAssets().openFd("sounds/" + dataAll_sound_name);
mp2 = new MediaPlayer();
mp2.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength());
mp2.prepare();
mp2.start();
mp2.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
vg1.setClickable(true);
vg2.setClickable(true);
vg3.setClickable(true);
vg4.setClickable(true);
btn_spkr.setVisibility(View.VISIBLE);
txtImage();
}
});
}catch(Exception e){
e.printStackTrace();
}
}
}, delay_que);
}
});
}catch(Exception e){
e.printStackTrace();
}
}
});
}catch(Exception e){
e.printStackTrace();
}
}
});
}catch(Exception e){
e.printStackTrace();
}
}
});
}catch(Exception e){
e.printStackTrace();
}
}
};
in above code random images and sound sets in my activity. now when i click on any image a sound must play but sometimes it fails.. i tried but unable to resolve this issue. help me out. thanks in advance. | 0 | [
2,
941,
14049,
2990,
5391,
800,
3726,
3726,
31,
589,
638,
27,
40,
13005,
3010,
19,
56,
31,
57,
20,
418,
5477,
2795,
37,
51,
6223,
19294,
9,
80,
50,
109,
3502,
67,
15,
76,
31,
10840,
27,
186,
1961,
37,
273,
3502,
21,
646,
491,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
GCM with Rails (Google Cloud Messaging)
===
how to use GCM Service in rails3 server? | 3 | [
2,
489,
9095,
29,
2240,
18,
13,
5,
16111,
4875,
4005,
26437,
6,
800,
3726,
3726,
184,
20,
275,
489,
9095,
365,
19,
2240,
18,
240,
8128,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Postgresql - Add Interval to Timestamp from column value
===
I need to add minutes coming from an integer column with a timestamp to compare to another column.
Here's an example:
SELECT t1.id_liame, t1.id_table, t1.periodicidade , t3.data_extracao,
CASE WHEN(NOW() < (e.data_extracao + INTERVAL t1.periodicidade || '
MINUTES'))
THEN 'yes' ELSE 'no' END
FROM table1 as t1 LEFT JOIN liame_has_extracao as t2 USING(id_liame)
LEFT JOIN extracao as t3 USING(id_extracao)
l.periodicidade is integer (minutes)
I need verify if data_extracao(timestamp) is greater of NOW() + l.periodicidade(integer - minutes).
How can i do it?
Thanks.
| 0 | [
2,
678,
6879,
18,
22402,
13,
8,
3547,
14422,
20,
436,
38,
10158,
37,
4698,
1923,
800,
3726,
3726,
31,
376,
20,
3547,
902,
880,
37,
40,
13820,
4698,
29,
21,
436,
38,
10158,
20,
11590,
20,
226,
4698,
9,
235,
22,
18,
40,
823,
45,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get PrintDialog to respond to choice
===
I am printing a multi-line TextBox with the default printer. I would like to offer a choice of printers by using the PrintDialog. When I set it up, the PrintDialog appears and you select a printer, but when you press "Ok" it always goes to the default printer. Any ideas would be appreciated. I've included the appropriate code.
private void printTreeViewToolStripMenuItem_Click(object sender, EventArgs e) //---added 6-29-12
{
textTreeView.Clear();
CreateRowsFromNode(treeView1.Nodes[0], 0, "");
//InitPrint(textTreeView.Text).Print();
printDialog1.Document = InitPrint(textTreeView.Text);
if (printDialog1.ShowDialog() == DialogResult.OK)
{
InitPrint(textTreeView.Text).Print();
}
}
Originally there was no PrintDialog and it only called InitPrint(textTreeView.Text).Print(). The printDialog1 was added as shown above.
textTreeView is the TextBox to be printed. Each line in the textTreeView textbox holds a node text value made with CreateRowsFromNode.
InitPrint looks like this:
string TextToPrint; //---added 6-29-12
public PrintDocument InitPrint(string TextToPrint)
{
this.TextToPrint = TextToPrint;
PrintDocument PD = new PrintDocument();
PD.OriginAtMargins = true;
PD.DefaultPageSettings.Landscape = true; //---added 6-29-12
PD.PrintPage += PrintPage;
return PD;
}
public void PrintPage(object sender, PrintPageEventArgs e) //---added 6-29-12
{
int Chars = 0;
int Lines = 0;
Font Font = new Font("Courier new", 9);
//Font Font = new Font("Arial", 10);
Rectangle R = new Rectangle(Point.Empty, e.MarginBounds.Size);
StringFormat SF = StringFormat.GenericTypographic;
e.Graphics.MeasureString(TextToPrint, Font, R.Size, SF, out Chars, out Lines);
e.Graphics.DrawString(TextToPrint, Font, Brushes.Black, R, SF);
TextToPrint = TextToPrint.Substring(Chars);
e.HasMorePages = (TextToPrint.Length > 0);
}
The code that reads the TreeView into textTreeView is:
private void CreateRowsFromNode(TreeNode node, int level, string L = "") //---added 6-29-12
{
string data = "";
string CurrentArrow = null;
string NextArrow = "";
//if root then no arrows needed
if (node.Parent == null) {
CurrentArrow = "";
NextArrow = "";
//if Not Last node of parent
}
else if (!(node.Parent.Nodes[node.Parent.Nodes.Count - 1] == node))
{
CurrentArrow = "├";
NextArrow = "│";
// is last node of parent
} else {
CurrentArrow = "└";
NextArrow = " ";
}
//Add the next node to the TextBox
if (node.Text.Length >= 115)
textTreeView.Text = textTreeView.Text + L + CurrentArrow + node.Text.Substring(0,115) + vbNewLine;
else
textTreeView.Text = textTreeView.Text + L + CurrentArrow + node.Text + vbNewLine;
//Add the Next Arrow to Left Part of string
L = L + NextArrow;
//Loop Through all its child nodes
foreach (TreeNode nod in node.Nodes) {
CreateRowsFromNode(nod, level + 1, L);
}
}
| 0 | [
2,
184,
20,
164,
4793,
4286,
5567,
20,
4590,
20,
1837,
800,
3726,
3726,
31,
589,
7312,
21,
1889,
8,
1143,
1854,
5309,
29,
14,
12838,
12925,
9,
31,
83,
101,
20,
1994,
21,
1837,
16,
12925,
18,
34,
568,
14,
4793,
4286,
5567,
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... |
Can Sitecore rebuild indexes in the background without wiping the existing index?
===
Whenever you rebuild a Lucene index in Sitecore the existing index is wiped prior to being rebuilt. This is unacceptable as our indexing process takes a long time (we index at least 100,000 items into a custom product search index).
Does anyone know if you can rebuild a Lucene index through Sitecore in the background then swap indexes when the indexing is complete.
I assume an additional complexity with this approach is what happens to incremental updates during an index rebuild, any insight into how this works in Sitecore would be appreciated. | 0 | [
2,
92,
689,
10375,
16128,
4348,
160,
19,
14,
2395,
366,
16740,
14,
3149,
4348,
60,
800,
3726,
3726,
6634,
42,
16128,
21,
18515,
556,
4348,
19,
689,
10375,
14,
3149,
4348,
25,
7891,
1313,
20,
142,
6465,
9,
48,
25,
24667,
28,
318,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Overlay Multiple Video's Using JQuery Tools and Flowplayer
===
Thank you in advance,
The 1st video will play just fine, I can't get the 2nd video to play. The background will popup but won't play. Below is the code, could someone help with this issue?
setup overlay style
<style type="text/css">
.overlay {
padding: 40px;
width: 576px;
display: none;
background-image: url('../ELMImgs/video_white_bkgnd.png');
}
.close {
background: url('../ELMImgs/close.png') no-repeat;
position: absolute;
top: 2px;
right: 5px;
display: block;
width: 35px;
height: 35px;
cursor: pointer;
}
#player {
height:450px;
display:block;
}
</style>
<body>
setup overlay actions to buttons
<script>
$(function() {
var player = $f("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.12.swf");
$("a[rel]").overlay({
effect: 'apple',
onLoad: function() {
player.load();
},
onClose: function() {
player.unload();
}
});
});
</script>
2 (or more) video's to play
<a rel="#overlay1" href="#">View as flash</a>
<div id="overlay1" class="overlay" style="background-image:url ('../ELMImgs/video_white_bkgnd.png')">
<a id="player" href="Video1.flv"> </a>
</div>
<a rel="#overlay2" href="#">View as flash</a>
<div id="overlay2" class="overlay" style="background-image:url('../ELMImgs/video_white_bkgnd.png')">
<a id="player" href="Video2.flv"> </a>
</div>
</body>
| 0 | [
2,
184,
20,
84,
4414,
1886,
763,
22,
18,
568,
487,
8190,
93,
4672,
17,
3312,
14049,
800,
3726,
3726,
3531,
42,
19,
3612,
15,
14,
137,
384,
763,
129,
418,
114,
1123,
15,
31,
92,
22,
38,
164,
14,
172,
706,
763,
20,
418,
9,
14,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Embed Windows Explorer in WPF User Control
===
Is it possible to embed Windows Explorer into a WPF user control (or a Windows Forms user control that could then be shown in a WPF control using a WindowsFormsHost object)?
I'm aware I could write a user control that displays the contents of a directory and navigation buttons etc. but I want it to look EXACTLY like Windows Explorer, including Favourites, Libraries, Network etc. Windows explorer also looks different depending on the operating system being used and ideally I would like this to be reflected in my application too.
I've googled around and not had any luck. The closest I came was this: http://gong-shell.sourceforge.net/ but when I tried to implement it into a WPF control it started behaving very strangely and causing controls that were completely separate to it to stop working.
I could be wrong but given that we have the OpenFileDialog, SaveFileDialog and FolderBrowserDialog windows I would have thought there'd also be a control for viewing Windows Explorer.
Thanks in advance for any help | 0 | [
2,
11911,
69,
1936,
8520,
19,
619,
7721,
4155,
569,
800,
3726,
3726,
25,
32,
938,
20,
11911,
69,
1936,
8520,
77,
21,
619,
7721,
4155,
569,
13,
5,
248,
21,
1936,
1997,
4155,
569,
30,
110,
94,
44,
1721,
19,
21,
619,
7721,
569,
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... |
Matlab sophisticated GUI
===
I want to create a GUI where there will be a main image in the center,showing a whole body MRI image and depending in which area of the body will the user take the cursor and clicks to open the equivalent gui.For exaple near the area of the brain the area/ROI will be enlighted(if this is possible) and when the user click it will open the gui Brain Analyzer etc.Does anyone has any idea of how can i create something like this ??
Thanks in advance | 0 | [
2,
4277,
9086,
13388,
9457,
800,
3726,
3726,
31,
259,
20,
1600,
21,
9457,
113,
80,
129,
44,
21,
407,
1961,
19,
14,
459,
15,
9303,
68,
21,
979,
358,
820,
49,
1961,
17,
4758,
19,
56,
217,
16,
14,
358,
129,
14,
4155,
247,
14,
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... |
How to change tabs order in vim?
===
Is there a way to change tabs order in Vim?
For example at start I following tabs order:
`A | B | C | D`
But I would like to switch to something like:
`A | C | B | D`
How to do that? | 0 | [
2,
184,
20,
753,
6523,
18,
389,
19,
1790,
79,
60,
800,
3726,
3726,
25,
80,
21,
161,
20,
753,
6523,
18,
389,
19,
1790,
79,
60,
26,
823,
35,
799,
31,
249,
6523,
18,
389,
45,
13,
1,
58,
13,
1,
334,
13,
1,
272,
13,
1,
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... |
Play Framework and JPA
===
testing Play framework and JPA.
I eclipsify my very simple test application. Import the project in eclipse and confirm that the play jar file is in my eclipse java build path: C:\play-2.0.2\repository\local\play\play_2.9.1\2.0.2\jars\play_2.9.1.jar
in my simple Item entity class, I import play.db.jpa.Model which my entity should extend
Here, eclipse is not be able to resolve the class!
Notice, the following jar file DOES NOT include the Model class - which I understand is essential in order to integrate with PLAY with JPA.
play_2.9.1.jar -> play\db\jpa\Model
the jpa only includes the following:
TransactionalAction$1.class
JPA.class
TransactionalAction.class
Transactional.class
JPAPlugin.class
JPA$1.class
what am I missing? do i include a wrong jar in my path?
where is Model.class?? | 0 | [
2,
418,
6596,
17,
487,
1060,
800,
3726,
3726,
4431,
418,
6596,
17,
487,
1060,
9,
31,
6695,
6013,
18,
8612,
51,
253,
1935,
1289,
3010,
9,
9010,
14,
669,
19,
11652,
17,
10265,
30,
14,
418,
5112,
3893,
25,
19,
51,
11652,
8247,
1895... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Writing tests for script files in F#
===
I have some functionality withing a script file, setup.fsx
I would like to test those.
xUnit and the likes needs the functions to be tested to be part of the assembly.
So I am thinking of renaming my script from setup.fsx to setup.fs extension, then loading it from another script file. But then my script depends on
#r "System.Xml"
#r "System.Xml.Linq"
which I would then have to specify in the calling script (away from where the dependency actually arises)
Are there anyway to integrate tests based on scripts in the xUnit worflow ?
What organization is suggested for writing tests for script files ?
(may be we need a visual studio extension for tests in scripts and not in assembly..)
| 0 | [
2,
1174,
4894,
26,
3884,
6488,
19,
398,
5910,
800,
3726,
3726,
31,
57,
109,
18548,
29,
68,
21,
3884,
3893,
15,
18161,
9,
11754,
396,
31,
83,
101,
20,
1289,
273,
9,
993,
15464,
17,
14,
101,
18,
2274,
14,
3719,
20,
44,
7631,
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... |
c_cflag structure in POSIX termios API
===
I recently started programming for serial ports using the POSIX termios API to read a stream of data coming from a sensor that I have. First, a few details:
My OS details: Ubuntu 11.10 64 bit system, as a virtual OS on a Windows 7 host, in VirtualBox.
As I was going through this tutorial,
http://www.easysw.com/~mike/serial/serial.html#basics
I realized that you have to create a structure of type termios, configure it as you will and then tie it to your file descriptor.
I have the following four related questions:
1) How is the c_cflag member structured? I don't understand all the bit operations that are done with the c_cflag member to configure the parity bits, stop bits and data size. How does using the OR and AND operators work?
2) What if I want a larger data size, say 16 bits instead of 8. Is that possible with termios?
3) What is the use of tcgetattr()? Can't I just create a termios structure, configure it, and use tcsetattr() to link it to the file descriptor? Why should I take in the original configurations of the file descriptor into my termios structure first?
4) Can anyone show a good link to a tutorial on the read() function and its arguments? Or maybe post on this question about it as well. I really want to just read from a serial port continuously. No writing.
I am new to serial programming in Linux, and so if my questions sound really basic, I apologize in advance. Any help is greatly appreciated.
Thanks for all your time!
| 0 | [
2,
272,
1,
150,
22868,
1411,
19,
2353,
6742,
981,
7760,
21,
2159,
800,
3726,
3726,
31,
1989,
373,
3143,
26,
5956,
9551,
568,
14,
2353,
6742,
981,
7760,
21,
2159,
20,
1302,
21,
3766,
16,
1054,
880,
37,
21,
14865,
30,
31,
57,
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 make a "Server too busy to handle your request" in PHP?
===
Right now I don't have time to optimize and to upgrade servers and once or twice a month the server reaches critical load (mysql basically) and it goes very very slow.
I want to show a static message saying the server is too busy when that happens.
How would I do that? | 0 | [
2,
184,
20,
233,
21,
13,
7,
10321,
106,
266,
4394,
20,
3053,
154,
3772,
7,
19,
13,
26120,
60,
800,
3726,
3726,
193,
130,
31,
221,
22,
38,
57,
85,
20,
22864,
17,
20,
9483,
17595,
17,
382,
54,
2088,
21,
1617,
14,
8128,
5539,
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... |
Get post data in AuthorizeAttribute?
===
**Hi,**
I am about to validate some data before letting the user in to the action and if the data do not validate, then I need to redirect to another action.
The question is how I get the post data that is sent to the action from within the AuthorizeAttribute? | 0 | [
2,
164,
678,
1054,
19,
1314,
2952,
721,
14755,
60,
800,
3726,
3726,
13,
1409,
1822,
15,
1409,
31,
589,
88,
20,
7394,
1373,
109,
1054,
115,
4252,
14,
4155,
19,
20,
14,
1028,
17,
100,
14,
1054,
107,
52,
7394,
1373,
15,
94,
31,
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... |
GTK+ 3.0: How to use a Gtk.TreeStore with custom model items?
===
I'm trying to develop a GTK application in Python and I'm really stuck with the correct usage of a [`gtk.TreeStore`](http://developer.gnome.org/gtk3/stable/GtkTreeStore.html). My main problem: I've already parsed some JSON and I have my own data structure which ist basically a Python list and two kinds of objects: One represents a collection of items (collections can't be nested) and one for representing items (which might appear in the list as well as in a collection).
I'm already familiar with the basic usage of a `TreeStore` and managed to get items correctly rendered on screen. I don't know how to deal with the fact that a treestore is only capable of storing gobject types (at this point I'm not sure because I don't know much about the gobject type system). The documentation for C lists the following, (except PixBuf) basic types which can be inserted and are automagically mapped to Python data types:
> As an example, gtk_tree_store_new (3, G_TYPE_INT, G_TYPE_STRING, GDK_TYPE_PIXBUF); will create a new GtkTreeStore with three columns, of type int, string and GdkPixbuf respectively.
Furthermore it says you may insert any [`GType`](http://developer.gnome.org/gobject/unstable/gobject-Type-Information.html#GType). The link from the documentation directly points at this paragraph:
> A numerical value which represents the unique identifier of a registered type.
My research of the topic ends here and Google finds mostly GTK 2.x tutorials and nothing about inserting other data types except `str` and `int` etc.
Questions:
- Is it possible to implement a new GType (or any other interface that will make insert custom data in a treestore possible) and how to do it?
I already tried deriving from `GObject` but it didn't help.
- How can I get rid of keeping two data structures at the same time?
Namely my parsing result and the duplicate information in a Treestore.
- How is it possible to deal with mixed content?
In my case I have collections and items with different additional information (which are mirrored in the treeview as nodes with or without children).
If above questions are resolved, I also get rid of the problem when handling selections: it is difficult to match a simple type like `str` or `int` to match an item I inserted before. Such attribute has to be a key and still you would to search the list with parsed results which is quit ineffective.
---
I thought it could be a feasible challenge to implement a custom `TreeModel` until I read this in a [tutorial for GTK 2][1]:
> However, all this comes at a cost: you are **unlikely to write a useful custom model in less than a thousand lines**, unless you strip all newline characters. Writing a custom model is not as difficult as it might sound though, and it may well be worth the effort, not least because it will result in much saner code if you have a lot of data to keep track of.
Is this still valid?
---
Thank you in advance!
**edit** I just came across http://www.pygtk.org/articles/subclassing-gobject/sub-classing-gobject-in-python.htm Can this be helpful? As many resoucres it's for PyGTK 2.0.
[1]: http://scentric.net/tutorial/sec-custom-models.html#sec-custom-models-when | 0 | [
2,
9509,
197,
2430,
203,
9,
387,
45,
184,
20,
275,
21,
9509,
197,
9,
8101,
16828,
29,
5816,
1061,
3755,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
2803,
21,
9509,
197,
3010,
19,
20059,
17,
31,
22,
79,
510,
4549,
29,
14,
4456,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
MSChart Callout horizontal alignment to datapoint
===
I'm in need of help please, I'm using MSChart for .NET4.0 in C Sharp and right now when I plot my chart the annotations are all over the place.
![Callouts are all over the place! it's really messy!][1]
What I really like is for this (I manually moved the Callouts after to make this screenshot)
![Manually positioned Callout with mouse after chart render][2]
So what I am wondering, is there a way I can make sure that ALL Callout annotations stay absolutely on top of bottom vertically of the respective datapoint anchor? I don't wish for the Callouts to move left or right....
Thanks everyone...
[1]: http://i.stack.imgur.com/0fCvF.png
[2]: http://i.stack.imgur.com/vyRx9.png | 0 | [
2,
4235,
5433,
38,
645,
1320,
10095,
12448,
20,
1054,
3132,
800,
3726,
3726,
31,
22,
79,
19,
376,
16,
448,
2247,
15,
31,
22,
79,
568,
4235,
5433,
38,
26,
13,
9,
2328,
300,
9,
387,
19,
272,
2641,
17,
193,
130,
76,
31,
3798,
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... |
java- which way is easy to implement yet secure, for end user authentication in a web app/web service
===
I am going to create an application which will have a regular web interface where a user can sign up, access some resources.
I am reading up on different means of authentication- Basic authentication, digest authentication, openid , oauth, oauth2...
What I want to know is, if I implement basic or digest authentication, then is it secure? Because in many sites that I visited, the talk was about oauth and how secure it is.
Open ID was also mentioned in some of the sites I visited...
The current usage scenario for which I am looking at end user authentication is for a web interface in a web app. Another usage scenario is for a JAX-RS based web service. Which means of authentication is secure for these 2 usage scenarios? Ideally I want to use the same means of auth in both scenarios...
| 0 | [
2,
8247,
8,
56,
161,
25,
2010,
20,
8713,
768,
4315,
15,
26,
241,
4155,
27963,
19,
21,
2741,
4865,
118,
14113,
365,
800,
3726,
3726,
31,
589,
228,
20,
1600,
40,
3010,
56,
129,
57,
21,
1290,
2741,
6573,
113,
21,
4155,
92,
1676,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why is FileNotFound bieng thrown only in Ice Cream Sandwich and JellyBean
===
I am trying to parse an icalendar file (.ics) using ical4j library, and its working fine with all versions of Android but IceCreamSandwich and JellyBean.
Can someone tell me why its throwing FileNotFound Error only in ICS and JB but not in other versions of android?
Heres my code
public class MainActivity extends Activity {
String foo = null;
TextView TextView = null;
String fileName = "ical.ics";
String URL = "https://www.google.com/calendar/ical/m0es4hhj4g9d69ibak88tvoup0%40group.calendar.google.com/public/basic.ics";
StringBuilder b = new StringBuilder();
@Override
public void onCreate(Bundle savedInstanceState) {
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView = (TextView)findViewById(R.id.Hello_World);
new Download().execute();
}
final class Download extends AsyncTask<Void, Void, Void> {
@Override
protected void onPreExecute(){
TextView.setText("Downloading");
}
@Override
protected Void doInBackground(Void... arg0) {
try {
URL url = new URL(URL);
HttpURLConnection c = (HttpURLConnection) url.openConnection();
c.setRequestMethod("GET");
c.setDoOutput(true);
c.connect();
FileOutputStream fos = openFileOutput(fileName, MainActivity.MODE_PRIVATE);
InputStream is = c.getInputStream();
byte[] buffer = new byte[1024];
int length = 0;
while ((length = is.read(buffer)) != -1) {
fos.write(buffer, 0, length);
}
fos.close();
is.close();
} catch (IOException e) {
Log.d("log_tag", "Error: " + e);
}
return null;
}
@Override
protected void onPostExecute(Void Result) {
TextView.setText("Saved...Loading Data");
new Loadicaldata().execute();
}
}
final class Loadicaldata extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... arg0) {
FileInputStream fis = null;
try {
fis = openFileInput(fileName);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
CompatibilityHints.setHintEnabled(CompatibilityHints.KEY_RELAXED_UNFOLDING, true);
CompatibilityHints.setHintEnabled(CompatibilityHints.KEY_RELAXED_VALIDATION, true);
CalendarBuilder builder = new CalendarBuilder();
try {
Calendar calendar = builder.build(fis);
b.append(calendar.getProperty("X-WR-CALNAME").getValue());
for (Object event : calendar.getComponents(Component.VEVENT)) {
if (((VEvent) event).getSummary() != null) {
b.append("\n\n");
b.append(((VEvent) event).getSummary().getValue());
b.append(": ");
b.append(((VEvent) event).getStartDate().getDate());
}
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ParserException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void Result) {
TextView.setText(b.toString());
}
}
Also , I have noticed that if I use Calendar.load(URL url) it works fine so its the saving and loading of file that is going wrong.
| 0 | [
2,
483,
25,
3893,
1270,
12235,
1732,
4367,
6027,
104,
19,
1392,
5262,
11484,
17,
18749,
863,
210,
800,
3726,
3726,
31,
589,
749,
20,
2017,
870,
40,
13,
4272,
219,
2542,
3893,
13,
5,
9,
8354,
6,
568,
13,
4272,
300,
728,
1248,
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... |
Which minimalistic python web framework to use to develop a REST api?
===
The application I need to develop has two parts, a mobile app and a web application. In the proposed architecture, the mobile app would be the interface seen by the end users.
The mobile app would send data to the web server and recive processed output from the webserver using REST api. The point is all the computations would be done on the server, the mobile app would just accept and display data to the user.
The web application would just need to interact with the database and do the computations and send data to the mobile app. It does not have an interface of any sort.
I usually develop using django but in this case I am looking for a minimal framework to inplement this web application because i dont need most of the features in django and taking out the unwanted components could be very time consuming. I dont even need templates, sessions or user authentication even though i might impliment something based on OAuth at a later stage.
I am leaning towards cherrypy with SQL alchemy from what I have read so far. The fact that cherrypy has a built in production-ready webserver with it seems to be a plus point. But the URL dispatching mechanism seems to be complicated.
Pyramid also seems to be good for my requirements. However it does not seem to have a production ready webserver with it. And would require a wsgi compatible server like apache to be installed separately.
I dont want to use a full stack framework for the same reasons I dont want to use django for this project. However I dont have much experience with minimal frameworks and am unable to make a decision. Are there other options which can be considered??
Thanks in advance for your help. | 4 | [
2,
56,
8663,
3771,
20059,
2741,
6596,
20,
275,
20,
2803,
21,
760,
21,
2159,
60,
800,
3726,
3726,
14,
3010,
31,
376,
20,
2803,
63,
81,
1341,
15,
21,
3241,
4865,
17,
21,
2741,
3010,
9,
19,
14,
2097,
2607,
15,
14,
3241,
4865,
83,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 'Title' attribute showing the word 'undefined' - eg. 'Home Pageundefined'
===
I am currently having an issue with my Web site 'title'. This is currently showing as 'Kush Koutureundefined' (please see link to screenshot - http://imageshack.us/photo/my-images/38/screenshotnpe.jpg/).
My Web site consists of a .swf (index.swf) embeded into the index.html
here is my code...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="Kush Kouture" />
<meta name="keywords" content="Kush Kouture" />
<meta name="description" content="Kush Kouture" />
<title>Kush Kouture</title>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript" src="swfaddress.js"></script>
<script type="text/javascript" src="swffit.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.url_config = "xml/configuration_site.xml";
flashvars.initServices = true;
var params = {};
params.allowfullscreen = true;
params.allowScriptAccess = "always";
var attributes = {};
attributes.id = 'flashObject';
attributes.bgcolor = '#000000';
swfobject.embedSWF("flash/index.swf", "Alternative", "100%", "100%", "8", "flash/index.swf", flashvars, params, attributes);
</script>
<style type="text/css">
/* hide from ie on mac \*/
html {
height: 100%;
overflow: hidden;
}
#flashcontent {
height: 100%;
}
/* end hide */
body {
height: 100%;
margin: 0;
padding: 0;
background-color: #ffffff;
}
p {
font-size: 10px;
font-family: Verdana;
line-height:17px;
color:#ffffff;
}
.style1 {
font-size: 11px;
font-family: Verdana;
color:#ffffff;
text-transform:uppercase;
}
</style>
</head>
<body>
<div id="flashContent>
<object id="flashObject" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=11,0,0,0" width="100%" height="100%">
<param name="movie" value="flash/index.swf" />
<param name="wmode" value="transparent" />
<param name="width" value="100%" />
<param name="height" value="100%" />
<param name="scale" value="noscale" />
<object type="application/x-shockwave-flash" data="flash/index.swf" align="" scale="noscale" wmode="transparent" width="100%" height="100%">
</object>
</object>
</div>
<div id="Alternative">
<p style="color:#999999"> Kush Kouture | You require the latest version of Adobe Flash Player in order to view this site. Please use the button below to download the latest version.</p>
<p><a href="http://get.adobe.com/flashplayer/"><img src="flash.jpg" alt="Get Adobe Flash player" /></a></p>
</div>
</body>
</html>
Any suggestions would be greatly appreciated! | 0 | [
2,
13,
15895,
13,
22,
22235,
22,
35,
14755,
3187,
14,
833,
13,
22,
1020,
13439,
22,
13,
8,
12369,
9,
13,
22,
8167,
2478,
1020,
13439,
22,
800,
3726,
3726,
31,
589,
871,
452,
40,
1513,
29,
51,
2741,
689,
13,
22,
22235,
22,
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 list of data into session context?
===
I want to store list of data into session object. My scenario is I have one gridview control inside a page. below of the gridview have two text boxes and button. When i press button than gridview will have filled with text boxes value. Every time my pressing on button it will add new row into gridview to show entered data..So, for that i have to use session context. But my issue is how to store two textboxes value into session and how to read it again..
I dont want to use temporary sql database table.
So if anyone knows about it than please help me..
Thanks in advance. | 0 | [
2,
184,
20,
309,
968,
16,
1054,
77,
3723,
4141,
60,
800,
3726,
3726,
31,
259,
20,
1718,
968,
16,
1054,
77,
3723,
3095,
9,
51,
12705,
25,
31,
57,
53,
7354,
4725,
569,
572,
21,
2478,
9,
1021,
16,
14,
7354,
4725,
57,
81,
1854,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Publishing photo to Facebook via Graph API: OAuthException: (#100) param tags must be an array
===
I'm attempting to upload a photo to Facebook via the Graph API on a test user account for my app. With just the `url, link, name` parameters present, the upload works fine returning a valid photo id.
**However, if I use the additional `tags` parameter, I end up with the following error returned:**
{
"error": {
"message": "(#100) param tags must be an array.",
"type": "OAuthException",
"code": 100
}
}
I've tried to provide the value for `tags` in almost every possible way I can think of, as I know the Graph API isn't straightforward (even the parameter `url` which is used to upload a photo from a URL isn't listed under the `photo` Graph API method);
**A single user id**
`tags=100003919104407`
**Multiple CS'd user ids**
`tags=100003919104407,100003919104408,100003919104409`
**Array with ids not as integers**
`tags=[100003919104407, 100003919104404,100003919104405]`
**Array with ids as strings**
`tags=["100003919104407", "100003919104404","100003919104405"]`
**Array containing objects, as per the Facebook Graph API documentation**
`tags=[{"id":"100003919104407"},{"id":"100003919104404"},{"id":"100003919104405"}]`
If someone could tell me the right format/another parameter through which to pass user ids in order to have them tagged in a photo, I'd be very grateful. | 0 | [
2,
3107,
3056,
20,
9090,
1197,
7210,
21,
2159,
45,
635,
1346,
96,
10066,
872,
45,
13,
5,
5910,
4031,
6,
2258,
79,
3383,
18,
491,
44,
40,
7718,
800,
3726,
3726,
31,
22,
79,
6314,
20,
71,
8294,
21,
3056,
20,
9090,
1197,
14,
7210... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 load a different kernel and jump into it from a kernel module?
===
There are some android devices (e.g. the Motorola Defy) with locked bootloaders. You can gain root rights on them, and you can even load kernel modules, but it's not possible to change the kernel that will be loaded initially. So, my question is:
Would it be possible to write a kernel module that loads another kernel into RAM, disables all interrupts, disables the MMU and then jumps into the new kernel image? Could that work, or would some already-initialized devices mess up everything? | 0 | [
2,
25,
32,
938,
20,
6305,
21,
421,
17007,
17,
3936,
77,
32,
37,
21,
17007,
12613,
60,
800,
3726,
3726,
80,
50,
109,
13005,
4690,
13,
5,
62,
9,
263,
9,
14,
2586,
2268,
6312,
93,
6,
29,
4011,
6801,
8294,
445,
9,
42,
92,
3288,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
SSRS Report ask for Credentials
===
I have report set up at reporting server. And from mvc.net through javascript . I am opening report using the below code.
function ShowSnapShot() {
window.open("http://ServerName/ReportingServerName/Pages/ReportViewer.aspx?%2fFolderName%2fSubFolderName%2fReportName&rs:Command=Render&Parameter=003532");
}
Whenever I open the report. It ask for credentials . How could I pass Credentials with url or is there any way I could open report without using Report Viewer.
Thanks. | 0 | [
2,
22118,
18,
1330,
1349,
26,
5059,
43,
10107,
18,
800,
3726,
3726,
31,
57,
1330,
309,
71,
35,
6670,
8128,
9,
17,
37,
307,
8990,
9,
2328,
120,
8247,
8741,
13,
9,
31,
589,
1214,
1330,
568,
14,
1021,
1797,
9,
1990,
1285,
325,
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... |
opencv still able to open mpeg?
===
I was wondering about that since I've upgraded to 2.3.1 and it's been a long time I opened mpeg files (extension .mpeg) with it and now I can't do so anymore. I'm not sure if it is due to the upgrade or to the changes I made to my application. Someone know? Perhpas adding some lib will help? | 0 | [
2,
368,
12732,
174,
777,
20,
368,
307,
20427,
60,
800,
3726,
3726,
31,
23,
5712,
88,
30,
179,
31,
22,
195,
9958,
20,
172,
9,
240,
9,
165,
17,
32,
22,
18,
74,
21,
175,
85,
31,
520,
307,
20427,
6488,
13,
5,
1706,
25573,
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... |
'Tag' object has no attribute 'count'
===
I keep getting this error when I go to the development server that the 'Tag' object has no attribute 'count'. I don't understand why the error comes up in line 117 when tag.count didn't generate any errors when used in the previous lines of code? Thanks!
Here's the error message:
AttributeError at /tag/
'Tag' object has no attribute 'count'
Request Method: GET
Request URL:
http://127.0.0.1:8000/tag/
Django Version: 1.4
Exception Type: AttributeError
Exception Value:
'Tag' object has no attribute 'count'
Exception Location: /Users/jonathanschen/Python/projects/skeleton/django_bookmarks/django_bookmarks/bookmarks/views.py in tag_cloud_page, line 117
Python Executable: /usr/bin/python
Python Version: 2.7.1
Python Path:
['/Users/jonathanschen/Python/projects/skeleton/django_bookmarks',
'/Library/Python/2.7/site-packages/pip-1.1-py2.7.egg',
'/Library/Python/2.7/site-packages/distribute-0.6.27-py2.7.egg',
'/Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC',
'/Library/Python/2.7/site-packages',
'/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg-info']
Server time: Mon, 9 Jul 2012 11:35:33 -0500
The code it refers back to is this:
def tag_cloud_page(request):
MAX_WEIGHT = 5
tags = Tag.objects.order_by('name')
# Calculate tag min and max counts
min_count = max_count = tags[0].bookmarks.count()
for tag in tags:
tag.count = tag.bookmarks.count()
if tag.count < min_count:
min_count = tag.count
if max_count < tag.count:
max_count = tag.count
#calculate count range. Avoid dividing by zero.
range = float(max_count - min_count)
if range == 0.0:
range = 1.0
# Calculate tag weights.
for tag in tags:
tag.weight = int(
MAX_WEIGHT * (tag.count - min_count) / range
)
variables = RequestContext(request, {
'tags': tags
})
return render_to_response('tag_cloud_page.html', variables)
| 0 | [
2,
13,
22,
8628,
22,
3095,
63,
90,
35,
14755,
13,
22,
16549,
22,
800,
3726,
3726,
31,
643,
1017,
48,
7019,
76,
31,
162,
20,
14,
522,
8128,
30,
14,
13,
22,
8628,
22,
3095,
63,
90,
35,
14755,
13,
22,
16549,
22,
9,
31,
221,
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... |
restore sql 2012 backup to sql 2008 database?
===
is there a way to restore sql 2012 database backup to sql 2008? I tried to attach file, it does not work. | 2 | [
2,
8454,
4444,
255,
563,
10119,
20,
4444,
255,
570,
6018,
60,
800,
3726,
3726,
25,
80,
21,
161,
20,
8454,
4444,
255,
563,
6018,
10119,
20,
4444,
255,
570,
60,
31,
794,
20,
19514,
3893,
15,
32,
630,
52,
170,
9,
3,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
KML & Google maps error
===
I've created a program in Java to create a KML file. The output is this:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Placemark>
<name>Evidence File</name>
<description>London</description>
<Point>
<coordinates>51.522416,-0.131836,0<coordinates>
</Point>
</Placemark>
</kml>
However, when I import it into Google maps - I have the error:
> We could not finish uploading your file. No changes have been made to
> the map.
Can anyone see any errors that I'm missing? | 0 | [
2,
401,
255,
279,
8144,
6867,
7019,
800,
3726,
3726,
31,
22,
195,
679,
21,
625,
19,
8247,
20,
1600,
21,
401,
255,
3893,
9,
14,
5196,
25,
48,
45,
13,
1,
60,
396,
8184,
615,
3726,
7,
165,
9,
387,
7,
19608,
3726,
7,
1982,
410,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Can I sync Jquery Full Calendar with Outlook, Gmail calendar and or ical?
===
is this possible? I know I can fetch appointments and jazz through json but is there any way to use PHP and this full calendar to say - take whats here and sync with such and such services? | 1 | [
2,
92,
31,
6063,
150,
487,
8190,
93,
503,
7036,
29,
19837,
15,
489,
8079,
7036,
17,
54,
13,
4272,
60,
800,
3726,
3726,
25,
48,
938,
60,
31,
143,
31,
92,
18312,
17368,
17,
2444,
120,
487,
528,
47,
25,
80,
186,
161,
20,
275,
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 change calendar cells background colour according to its event status in the database
===
i have been trying to change the background colour of my calendar cells according to its event status in my database. Basically there are 3 event status, pending, accepted and decline. If the event status for that particular event is pending then the bg colour would be orange, red for accepted and white(original colour) for decline. I have tried coding it however, somehow due to overwriting i can only change the bg colour for one event status.
Please advice or guide me what i should do to get the expected result. Advanced thanks:)
Here's what i currently coded:
Sub readDates()
Dim connectionString As String = ConfigurationManager.ConnectionStrings("GizmoDatabaseConnectionString").ConnectionString
Using blocks will automatically dispose of the object, and are
pretty standard for database connections
Using connection As New SqlConnection(connectionString)
connection.Open()
Dim sql As String = "Select eventDate From Event Where eventDate is not null and eventStatus=@status"
Dim command As SqlCommand = New SqlCommand(sql, connection)
command.Parameters.AddWithValue("@status", "pending")
Dim reader As SqlDataReader = command.ExecuteReader()
This is not needed - in fact, this line will "throw away"
the first row in the row collection
If (reader.Read()) Then
If (reader.HasRows) Then
While reader.Read()
Calendar1.SelectedDates.Add(CType(reader.GetDateTime(0), Date))
End While
End If
reader.Close()
Not needed because of the Using block
connection.Close()
End Using
Calendar1.SelectedDayStyle.BackColor = System.Drawing.Color.Orange
End Sub
Sub readDates2()
Dim connectionString As String = ConfigurationManager.ConnectionStrings("GizmoDatabaseConnectionString").ConnectionString
' Using blocks will automatically dispose of the object, and are
' pretty standard for database connections
Using connection As New SqlConnection(connectionString)
connection.Open()
Dim sql As String = "Select eventDate From Event Where eventDate is not null and eventStatus=@status"
Dim command As SqlCommand = New SqlCommand(sql, connection)
command.Parameters.AddWithValue("@status", "Accepted")
Dim reader As SqlDataReader = command.ExecuteReader()
' This is not needed - in fact, this line will "throw away"
' the first row in the row collection
'If (reader.Read()) Then
If (reader.HasRows) Then
While reader.Read()
Calendar1.SelectedDates.Add(CType(reader.GetDateTime(0), Date))
End While
End If
reader.Close()
' Not needed because of the Using block
'connection.Close()
End Using
Calendar1.SelectedDayStyle.BackColor = System.Drawing.Color.Red
End Sub
| 0 | [
2,
184,
20,
753,
7036,
2934,
2395,
4609,
496,
20,
82,
807,
1782,
19,
14,
6018,
800,
3726,
3726,
31,
57,
74,
749,
20,
753,
14,
2395,
4609,
16,
51,
7036,
2934,
496,
20,
82,
807,
1782,
19,
51,
6018,
9,
11374,
80,
50,
203,
807,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Formatting Getters and Setters differently than other functions in Eclipse
===
I am currently using Eclipse 4.2 with PDT and E-Surf's getter and setter plugin. I prefer to format my getters and setters differently than standard functions, and differently than E-Surf's plugin currently formats them. For example, the current formatting is:
getVarName()
{
return $var_name;
{
This is fine for normal functions, but I prefer my getters to look like:
get_var_name () { return $var_name;}
How can I make it so only my getters and setters are formatted this way?
| 0 | [
2,
2595,
1203,
164,
6052,
17,
309,
6052,
12670,
119,
89,
3719,
19,
11652,
800,
3726,
3726,
31,
589,
871,
568,
11652,
268,
9,
135,
29,
13,
9251,
38,
17,
13,
62,
8,
4082,
410,
22,
18,
164,
815,
17,
309,
815,
10922,
108,
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... |
Rails - Polymorphic association join table
===
I am currently trying to set up a model structure that seems quite simple, but I haven't quite got it down.
I have a model <code>payment</code> that can belong to either a <code>customer</code> or a <code>supplier</code> (which can both have many <code>payments</code>).
My question is simply whether I need to manually create an interface table to allow this, or if declaring the polymorphic associations will do this for me?
e.g. I have:
class payment < ActiveRecord::Base
belongs_to :payment_originator, :polymorphic => true
end
class customer < ActiveRecord::Base
has_many :payments, :as => :payment_originator
end
class supplier < ActiveRecord::Base
has_many :payments, :as => :payment_originator
end
Is this enough, or do I also need to use a generator to manually create the payment_originator model?
Thanks! | 0 | [
2,
2240,
18,
13,
8,
3446,
12498,
596,
607,
1865,
859,
800,
3726,
3726,
31,
589,
871,
749,
20,
309,
71,
21,
1061,
1411,
30,
2206,
1450,
1935,
15,
47,
31,
2933,
22,
38,
1450,
330,
32,
125,
9,
31,
57,
21,
1061,
13,
1,
9375,
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... |
Gantt chart control in ASP.NET Web application C#
===
I need a simple free Gantt Chart control for my ASP.NET web application database using C# (Visual Studio 2010 professional) to bind with data containing only start_date, finish_date, and title. | 0 | [
2,
7890,
38,
38,
1795,
569,
19,
28,
306,
9,
2328,
2741,
3010,
272,
5910,
800,
3726,
3726,
31,
376,
21,
1935,
551,
7890,
38,
38,
1795,
569,
26,
51,
28,
306,
9,
2328,
2741,
3010,
6018,
568,
272,
5910,
13,
5,
20893,
1120,
498,
73... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
c++ && <= float and if
===
when I use:
if(a>=0&&a<100&&b>=0&&b<200)
everything works fine but if I use:
if(0<=a<100 && 0<=b<200)
my program crahes. a and b = floats. Can somebody please tell me what's the difference? | 3 | [
2,
272,
20512,
279,
1569,
13,
1,
3726,
11510,
17,
100,
800,
3726,
3726,
76,
31,
275,
45,
100,
5,
58,
1,
3726,
387,
1569,
1569,
58,
1,
4031,
1569,
1569,
220,
1,
3726,
387,
1569,
1569,
220,
1,
4621,
6,
796,
693,
1123,
47,
100,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Titanium appcelerator module for PDFTouch crashes with null value
===
I have create a module of PDF reader having search facility. I have integrated PDFTouch ([http://www.binpress.com/app/demo/app/859][1]) framework for this. When I start the app and open a PDF, so, when executing below lines from PDF module, my app crashes.
YLDocument *document = [[[YLDocument alloc] initWithFilePath:path] autorelease];
YLPDFViewController *v = [[YLPDFViewController alloc] initWithDocument:document];
I get error regarding 'v is returned nil', so, app crashes when I try to add this view controller into navigation controller. Can anyone help why I get nil viewcontroller on these 2 lines?
[1]: http://www.binpress.com/app/demo/app/859 | 0 | [
2,
26398,
4865,
1105,
1252,
3457,
12613,
26,
13,
11124,
15725,
21563,
29,
16203,
1923,
800,
3726,
3726,
31,
57,
1600,
21,
12613,
16,
13,
11124,
7765,
452,
2122,
2646,
9,
31,
57,
5547,
13,
11124,
15725,
13,
5,
2558,
21127,
6903,
6483... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 correct way to drive a classmethod in python?
===
Recently, I encountered a problem with metaclass calling a derived classmethod.
For example, I get a simple baseclass `testA`, which has an classmethod `do1(a)`
class testA(object):
@classmethod
def do1(cls, a):
print "in testA:",cls, a
Then I build a metaclass which actually do nothing but print the cls:
class testMetaA(type):
def __init__(cls,cname,bases,cdict):
print "in testMetaA: %s"%cls
Then I could use the metaclass to build a subclass `testB`, which works as expected:
class testB(testA):
@classmethod
def do1(cls, a):
print "in testB: %s"%cls
super(testB, cls).do1(a)
__metaclass__=testMetaA
It will print: `in testMetaA: <class '__main__.testB'>`; and the `testB.do1(a)` works as expected:
>>> testB.do1('hello')
in testB: <class '__main__.testB'>
in testA: <class '__main__.testB'> hello
However, if I try to call the classmethod inside the metaclass which contains a "`super`" as following `testMetaB`, it will raise an error: `NameError: global name 'testC' is not defined`.
class testMetaB(type):
def __init__(cls,cname,bases,cdict):
print "in testMetaB: %s"%cls
cls.do1("hello")
class testC(testA):
@classmethod
def do1(cls, a):
print "in testC: %s"%cls
super(testC, cls).do1(a)
__metaclass__=testMetaB
I finally find a way to solve it by use `super(cls, cls)` instead of `super(testC, cls)`:
class testD(testA):
@classmethod
def do1(cls, a):
print "in testD: %s"%cls
super(cls, cls).do1(a)
__metaclass__=testMetaB
It will print as:
in testMetaB: <class '__main__.testD'>
in testD: <class '__main__.testD'>
in testA: <class '__main__.testD'> hello
The `testD.do1(a)` also works as expected:
>>> testD.do1('Well done')
in testD: <class '__main__.testD'>
in testA: <class '__main__.testD'> Well done
Now I am wondering which is the most correct way to use super in a classmethod? Should one always use `super(cls,cls)` instead of explicitly writing a current class name?
Thanks!
| 0 | [
2,
98,
25,
14,
4456,
161,
20,
1493,
21,
718,
5909,
1807,
43,
19,
20059,
60,
800,
3726,
3726,
1989,
15,
31,
8208,
21,
1448,
29,
7618,
1898,
2555,
21,
3981,
718,
5909,
1807,
43,
9,
26,
823,
15,
31,
164,
21,
1935,
1000,
1898,
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... |
Dotfuscator "Could not find compatible version of ildasm"
===
Have any of you had this problem before?
I'm trying to obfuscate a solution written in C#/.NET 3.5 on Visual Studio 2008 SP1 on a machine running Windows 7 Professional SP1, and keep getting the same error when using Dotfuscator Community Edition
> Could not find a compatible version of ildasm to run on assembly (valid path to solution output exe). This assembly was originally built with .NET Framework v2.0.50727
I've tried Googling and nothing much has helped so far (either that, or my Google-Fu is failing me).
I've tried re-installing the Windows SDK, and re-installing Visual Studio 2008, but neither have helped.
I'm assuming that it's Dotfuscator Community edition that's causing the problem, because a colleague is using the same xml settings file on his machine, and it obfuscates the solution no problem.
My idea is that, as it says in the error message, Dotfuscator cannot find an ildasm (the library/function used to obfuscate?) file that is compatible with .NET 3.5, only .NET 2.x. Is this a correct asusmption?
Dotfuscator had been working fine, previously. But, after a recent round of Windows updates it no longer seems to work on my machine - some of the recent Windows updates have caused havok with the network and some colleagues laptops (revoking login credentials, invalidating certain programs, the usual), that's why I'm assuming it's one of the updates that has caused this.
Of course, I'm not adverse to putting it down to user error, except for the fact that the same settings file and solution outputs are not causing Dotfuscator to fail on a colleague's machine.
Any suggestions? | 0 | [
2,
14123,
13735,
150,
3457,
13,
7,
13431,
52,
477,
14961,
615,
16,
6317,
8016,
79,
7,
800,
3726,
3726,
57,
186,
16,
42,
41,
48,
1448,
115,
60,
31,
22,
79,
749,
20,
5122,
13735,
9530,
21,
4295,
642,
19,
272,
5910,
118,
9,
2328,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Map matched data from gsub method
===
I'm looking for some way to get rid of `collection` object in `collect_data` method and return matched data directly.
def collect_data(string)
collection = []
string.gsub(/a\=\[(.+?)\](\s|$)/) { collection << $1 }
collection
end
Some example how it suppose to work
string = "a=[111] b=[555] a=[123]"
collect_data(string) # => ["111", "123"] | 0 | [
2,
2942,
11265,
1054,
37,
489,
7563,
2109,
800,
3726,
3726,
31,
22,
79,
699,
26,
109,
161,
20,
164,
6681,
16,
13,
1,
15015,
872,
1,
3095,
19,
13,
1,
15015,
1,
18768,
1,
2109,
17,
788,
11265,
1054,
1703,
9,
6312,
5543,
1,
18768... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.