unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
input_ids
list
token_type_ids
list
attention_mask
list
HTML5 mobile site ipad (Version 5.1) issue === I am working on the HTML5 mobile site. I am facing one strange issue with the iPad 5.1. There is a geolocation tracking of the user whenever he comes to the application. It works perfectly on the iPhone (5.1.1) but whenever i open that application on iPad it dont ask me for the location capture message & dont update the location to current location. I was reading the article on http://www.networkworld.com/news/2012/040512-ipad-html5-257979.html http://www.macworld.com.au/news/new-ipad-complicates-life-for-html-5-developers-49816/ Code Snippet function check_connection_status() { //offline or online check if (navigator.onLine) { isOnline = true; //return true; } else { isOnline = false; //return true; } } $(document).delegate('#searchPage', 'pageinit', function (event) { check_connection_status(); if (isOnline) { navigator.geolocation.getCurrentPosition(getPosition, getPositionError); } });
0
[ 2, 13, 15895, 264, 3241, 689, 31, 8240, 13, 5, 10898, 331, 9, 165, 6, 1513, 800, 3726, 3726, 31, 589, 638, 27, 14, 13, 15895, 264, 3241, 689, 9, 31, 589, 4325, 53, 2578, 1513, 29, 14, 31, 8240, 331, 9, 165, 9, 80, 25, 21, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
obj_create not working in tasty-pie === I am trying to implement user regsitration using tastypie, everything is working fine but when ever i try to check whether user already exists using obj_create method nothing is happening ... how to call that in tastypie, is it called automatically ? from _mysql_exceptions import IntegrityError from django.db.models.query_utils import Q from tastypie.authorization import Authorization from django.contrib.auth.models import User from tastypie.authentication import BasicAuthentication from tastypie import fields from tastypie.exceptions import BadRequest from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS from tastypie.validation import Validation from apps.ecpUser.models import UserProfile class ProfileResource(ModelResource): username = fields.CharField(attribute='user__username', readonly=True) id = fields.CharField(attribute='id') class Meta: queryset =UserProfile.objects.select_related('User') resource_name = 'profile' fields = ['id'] class UserResource(ModelResource): class Meta: object_class = User queryset = User.objects.all() resource_name = 'user' allowed_methods = ['get', 'post', 'delete', 'put'] #excludes = ['email', 'password', 'is_active', 'is_staff', 'is_superuser'] filtering = { } class CreateUserResource(ModelResource): class Meta: allowed_methods = ['post'] object_class = User #authentication = Authentication() authorization = Authorization() resource_name = 'register' include_resource_uri = False fields = ['username','password','email'] def obj_create(self, bundle, request=None, **kwargs): try: bundle = super(CreateUserResource, self).obj_create(bundle, request, **kwargs) except IntegrityError: raise BadRequest('That username already exists') return bundle
0
[ 2, 5122, 728, 1, 6037, 1373, 52, 638, 19, 12892, 1084, 8, 9903, 800, 3726, 3726, 31, 589, 749, 20, 8713, 4155, 7953, 18, 242, 5946, 568, 12892, 1084, 9903, 15, 796, 25, 638, 1123, 47, 76, 462, 31, 1131, 20, 2631, 1472, 4155, 614...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Car race 3D object (not image) rotation in android === Firstly Thanks to all Who'll spent their valuable time for my problem. Actually I am a new to Android gaming development.I want to develop a car race game in which I want to rotate car object (not image) in clockwise direction at the time of car selection. After that I want to change the car object color when user drag the screen to left, like image sliding in Android. I don't know about any type of 3rd party API which is used for gaming development to make it easier. I think that the rotating car must be an animation but As I search Android only supports the animations in the form of XML. It is also probelematic for Me. Always welcome for suggession : THANKS IN ADVANCE
0
[ 2, 349, 764, 203, 43, 3095, 13, 5, 1270, 1961, 6, 9431, 19, 13005, 800, 3726, 3726, 64, 102, 3669, 20, 65, 72, 22, 211, 1111, 66, 5940, 85, 26, 51, 1448, 9, 1121, 31, 589, 21, 78, 20, 13005, 10968, 522, 9, 49, 259, 20, 2803,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Making invisible text selectable === I am making a source code display which supports line folding. While it's easy enough with CSS to ensure that the replacement text ("N lines hidden") is not selectable, I would like the hidden source code to still be selected, so the user can just select a chunk of code and not worry about whether part of it is missing due to a fold. Is there a (not-too-hacky) way to do this?
0
[ 2, 544, 8874, 1854, 5407, 579, 800, 3726, 3726, 31, 589, 544, 21, 1267, 1797, 3042, 56, 6747, 293, 14516, 9, 133, 32, 22, 18, 2010, 511, 29, 272, 18, 18, 20, 4062, 30, 14, 4610, 1854, 13, 5, 7, 103, 1560, 3689, 7, 6, 25, 52,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Objective-C, get string from text file? === I know there are a few different ways to find text in file, although I haven't found a way to return the text after the string I'm searching for. For example, if I was to search file.txt for the term `foo` and wanted to return `bar`, how would I do that without knowing it's `bar` or the length? Here's the code I'm using: if (!fileContentsString) { NSLog(@"Error reading file"); } // Create the string to search for NSString *search = @"foo"; // Search the file contents for the given string, put the results into an NSRange structure NSRange result = [fileContentsString rangeOfString:search]; // -rangeOfString returns the location of the string NSRange.location or NSNotFound. if (result.location == NSNotFound) { // foo not found. Bail. NSLog(@"foo not found in file"); return; } // Continue processing NSLog(@"foo found in file"); }
0
[ 2, 7038, 8, 150, 15, 164, 3724, 37, 1854, 3893, 60, 800, 3726, 3726, 31, 143, 80, 50, 21, 310, 421, 2847, 20, 477, 1854, 19, 3893, 15, 419, 31, 2933, 22, 38, 216, 21, 161, 20, 788, 14, 1854, 75, 14, 3724, 31, 22, 79, 5792, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
mongoid.yml sets wrong database in production === I upgrade to mongoid 3.0.1 and created the new format of mongoid.yml - my mongoid.yml looks like this : production: sessions: default: database: grbr_production hosts: - localhost:27017 options: consistency: :strong options: raise_not_found_error: false test: sessions: default: database: grbr_test hosts: - localhost:27017 options: consistency: :strong raise_not_found_error: false development: sessions: default: database: grbr_development hosts: - localhost:27017 options: consistency: :strong raise_not_found_error: false in development, I see correct db getting picked. but in production I see that "admin" database is getting picked and that breaks my app. I have set RAILS_ENV to "production" in my production machine but still I see this error.
0
[ 2, 21028, 6516, 9, 93, 8184, 3415, 1389, 6018, 19, 637, 800, 3726, 3726, 31, 9483, 20, 21028, 6516, 203, 9, 387, 9, 165, 17, 679, 14, 78, 2595, 16, 21028, 6516, 9, 93, 8184, 13, 8, 51, 21028, 6516, 9, 93, 8184, 1879, 101, 48, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 do I get all address variable from Google Maps JavaScript geocoder callback? === I want to get all address variable in the region from Google maps Javascript geocoder. But each result just have 10 object . For example,input address = 'Subway station', How to get all contain "Subway station" string of address object? function getLatLong(address) { var geocoder = new google.maps.Geocoder(); var result = ""; geocoder.geocode( { 'address': address, 'region': 'uk' }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { alert(results.length); for(var x = 0; x<results.length;x++){ alert(results[x].formatted_address); } } else { result = "Unable to find address: " + status; } storeResult(result); });
0
[ 2, 184, 107, 31, 164, 65, 3218, 7612, 37, 8144, 6867, 8247, 8741, 6389, 716, 1157, 645, 1958, 60, 800, 3726, 3726, 31, 259, 20, 164, 65, 3218, 7612, 19, 14, 632, 37, 8144, 6867, 8247, 8741, 6389, 716, 1157, 9, 47, 206, 829, 114,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
utilize xml-rpc from mssql tsql code === Currently I have nice solutions for REST (via assembly) and SOAP (via stored procedure) but XML-RPC is still a question to access directly from MSSQL TSQL code. Please advise which variants exist for this purpose. I need to avoid application layer because all logic is already in db sp and just recordset is needed to be supplied.
0
[ 2, 13151, 23504, 8, 139, 5779, 37, 4235, 18, 22402, 13, 38, 18, 22402, 1797, 800, 3726, 3726, 871, 31, 57, 2210, 6776, 26, 760, 13, 5, 5034, 1475, 6, 17, 6447, 13, 5, 5034, 8214, 7004, 6, 47, 23504, 8, 139, 5779, 25, 174, 21, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to calculate a personalized PageRank over millions of nodes? === I have a sparse graph containing about a million nodes and 10 million edges. I want to calculate a _personalized_ PageRank for each node, where by personalized PageRank at node n I mean: # x_0 is a column vector of all zeros, except a 1 in the position corresponding to node n # adjacency_matrix is a matrix with a 1 in position (i, j) if there is an edge from node i to node j x_1 = 0.5 * x_0 + 0.5 * adjacency_matrix * x_0 x_2 = 0.5 * x_0 + 0.5 * adjacency_matrix * x_1 x_3 = 0.5 * x_0 + 0.5 * adjacency_matrix * x_2 # x_3 now holds the personalized PageRank scores # i'm basically approximating the personalized PageRank by running this for only 3 iterations I tried coding this up using NumPy, but it was taking too long to run. (about 1 second to calculate the personalized PageRank for each node) I also tried changing x_0 to be matrix (by combining the column vectors of several different nodes), but this also didn't help much, and actually made the computation take much longer. (possibly because the matrix gets dense fairly quickly, and so it no longer fits in RAM? I'm not sure) Is there another suggested way to calculate this, preferably in Python? I also thought about going the non-matrix approach to PageRank calculation, by doing a kind of simulated random walk for three iterations (i.e., I start each node with a score of 1, then propagate this score to its neighbors, etc.), but I'm not sure if this would be any faster. Would it be, and if so, why?
0
[ 2, 184, 20, 18469, 21, 1319, 1333, 2478, 23083, 84, 11999, 16, 16272, 60, 800, 3726, 3726, 31, 57, 21, 23162, 7210, 3503, 88, 21, 507, 16272, 17, 332, 507, 7840, 9, 31, 259, 20, 18469, 21, 13, 1, 18160, 1333, 1, 2478, 23083, 26,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Using Autherise MVC Web API === I have used the [Authorize] attribute in a ASP.net WEB API method [Authorize] public IEnumerable<User> GetAllUsers() From the application I can access this method without a problem as my user is already authenticated. However, is there any way that I can specify the username, password to this method when calling so that I can implement a REST API? This is when calling from a standalone application or the browser.
0
[ 2, 568, 10343, 124, 11864, 307, 8990, 2741, 21, 2159, 800, 3726, 3726, 31, 57, 147, 14, 636, 10007, 2952, 500, 35, 14755, 19, 21, 28, 306, 9, 2328, 2741, 21, 2159, 2109, 636, 10007, 2952, 500, 317, 13, 660, 6336, 106, 579, 1, 16...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Why glTexParameter filter is invalid in flash video on android browser? === when I played my android pad device, I found the quality of flash video on browser worse then the pc and other android pad. I try to find out the reasons, then I found glTexParameter filter is invalid in flash video and other video player effective. I don't know why, ask everybody to help!
0
[ 2, 483, 13, 8430, 38, 1706, 6351, 7307, 11945, 25, 16671, 19, 4433, 763, 27, 13005, 16495, 60, 800, 3726, 3726, 76, 31, 257, 51, 13005, 4432, 3646, 15, 31, 216, 14, 2190, 16, 4433, 763, 27, 16495, 3105, 94, 14, 5168, 17, 89, 130...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
About Y-axis in JFreeChart === ![enter image description here][1] [1]: http://i.stack.imgur.com/WK2rR.png The left three lines of data: 0.9,2450,0.4867 in the Y-axis is shown in proportion. Right three lines (the other two data is too small to show up), how to do the left?
0
[ 2, 88, 13, 93, 8, 19676, 19, 487, 4639, 5433, 38, 800, 3726, 3726, 13, 187, 2558, 13679, 1961, 5318, 235, 500, 2558, 165, 500, 636, 165, 500, 45, 7775, 6903, 49, 9, 25325, 9, 1660, 11147, 9, 960, 118, 499, 197, 135, 5932, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 data what come back from the HTTP call in Heroku ? === <p>This question is related with problem to this - [QUESTION](http://stackoverflow.com/questions/11491352/cant-verifycheck-paypal-account) <p>I need to debug error - I'm sending request to PayPal and he should return me accountType of PayPal account(just to check if PayPal account exists). <p>I was reading this - https://devcenter.heroku.com/articles/logging, but didn't find needed information. <p>Can someone help me ?
0
[ 2, 184, 20, 164, 1054, 98, 340, 97, 37, 14, 7775, 645, 19, 36, 9266, 13, 60, 800, 3726, 3726, 13, 1, 306, 1, 1565, 1301, 25, 1597, 29, 1448, 20, 48, 13, 8, 636, 24652, 500, 5, 21127, 6903, 25325, 2549, 9990, 9, 960, 118, 246...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 custom parameters on search with YouTube API in .NET === Some queries, like `OrderBy`, are part of the `YouTubeQuery` class and are easy to set. But the general YouTube API reference mention both [HD][1] and [duration][2] parameters which I'd really like to use for my app. Since I'm using the [.NET library for the Google Data API][3] I'd prefer to use some built-in method rather than just tack on a query-string to the end of the Uri. Maybe using `YouTubeQuery.ExtraParameters` or something else, but I can't find what that would be. How do you set the [extra parameters for YouTube API in .NET][4]? [1]: https://developers.google.com/youtube/2.0/reference#hdsp [2]: https://developers.google.com/youtube/2.0/reference#durationsp [3]: http://code.google.com/p/google-gdata/ [4]: https://developers.google.com/youtube/2.0/reference#Custom_parameters
0
[ 2, 568, 5816, 12905, 27, 2122, 29, 7330, 21, 2159, 19, 13, 9, 2328, 800, 3726, 3726, 109, 9386, 2829, 15, 101, 13, 1, 7861, 779, 1, 15, 50, 141, 16, 14, 13, 1, 245, 19302, 8190, 93, 1, 718, 17, 50, 2010, 20, 309, 9, 47, 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...
Conditionally disable asset precompile in Capistrano === I've seen various convoluted and generally ineffective solutions to performing lazy asset precompile in Rails. As a backend developer I don't particularly want to recompile assets I never touch every time the program deploys, but because assets are loaded in `Capfile` via `load 'deploy/assets'`, and not by defining a task in `deploy.rb`, I can't think of a way to conditionally disable it. The behaviour I'm after is to use `cap deploy` for regular with-precompile deployment, and to use `cap deploy:no_assets` to skip asset deployment.
0
[ 2, 2874, 1326, 1460, 579, 12146, 782, 11103, 3599, 19, 2605, 702, 17555, 800, 3726, 3726, 31, 22, 195, 541, 617, 1065, 16261, 1427, 17, 1469, 19, 14659, 6776, 20, 2955, 16792, 12146, 782, 11103, 3599, 19, 2240, 18, 9, 28, 21, 97, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Error not displaying === i have this xml format: <searches> <search> <name> stephen </name> <address> box 23 </address> <sector> IT </sector> <contacts>+233247764939 </contacts> <search> <name> stephen </name> <address> box 23 </address> <sector> IT </sector> <contacts>+233247764939 </contacts> <searches> When the value for the name node in not found.i will like to display the error to the user. i have tried using the code below but it seems the echo statement is not executing hence when the name node value is empty or does not contain a value,an empty screen shows without the echo message. Any help with this code? NB: if the name has no value then it means the company does not exist. <?php $objj = @simplexml_load_string($result); $objj = processing ($term); if ($objj){ foreach(@$objj as $searches){ echo $searches -> name.'<br/>'.$searches->sector.'<br/>'.$searches ->address endforeach } else if(empty($objj)||($objj==null)|| is_null($objj)||($searches->name="")){ echo "hello company not found.try again.."; ?>
0
[ 2, 7019, 52, 17418, 800, 3726, 3726, 31, 57, 48, 23504, 2595, 45, 13, 1, 25136, 160, 1, 13, 1, 25136, 1, 13, 1, 7259, 1, 2526, 13, 1, 118, 7259, 1, 13, 1, 27950, 1, 1649, 1137, 13, 1, 118, 27950, 1, 13, 1, 18, 19932, 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 get the path/name to java binary running my application? === That is the question: my Java application is running, so how to get the path/name to the java binary that is running it? For example, 'C:\Program Files\Java\jre6\bin\java.exe' in Windows or '/usr/bin/java' in Linux. I need a platform independent solution, preferably relying only on the JDK. The context for the question is the following. I'm developing two Java applications, let's say FirstApplication and SecondApplication. The FirstApplication will start the SecondApplication using the [ProcessBuilder API][1]. The problem is that I need to tell the path to the Java binary to start the SecondApplication. For example, String cmd = "C:\Program Files\Java\jre6\bin\java.exe -cp <second application classpath> com.secondapplication.MainClass"; Process p = new ProcessBuilder(cmd).start(); Possible alternative solutions to this could be assume that there is a java binary available through the PATH system variable, or assume that the JAVA_HOME system variable is set. But this may not be always the case. Also, the final user of the application (targeting to other Java developers, as well as final users) may have more than one JVM installed on his system, and may execute the FirstApplication expliciting what JVM he wants. Ideally, the SecondAplication should run using the exact same Java binary as the FirstApplication, without relying on such system variables. Thank you [1]: http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/ProcessBuilder.html
0
[ 2, 184, 20, 164, 14, 2013, 118, 7259, 20, 8247, 14171, 946, 51, 3010, 60, 800, 3726, 3726, 30, 25, 14, 1301, 45, 51, 8247, 3010, 25, 946, 15, 86, 184, 20, 164, 14, 2013, 118, 7259, 20, 14, 8247, 14171, 30, 25, 946, 32, 60, 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 create a Chart Explorer with Java and JFreeChart? === I have created a Java desktop program , with the help of JFreeChart libraries. I can open a stock data file (symbol.txt) and have the program display a couple of indicators. I want to create an explorer in a new JFrame window that will open a folder with stock data files and check some indicator value. My problem is to find a way to open multiple files at once (at the user level) but process every file one after the other at the program level (open first file, check indicator, close first file...continue with second file). Thank you.
0
[ 2, 184, 20, 1600, 21, 1795, 8520, 29, 8247, 17, 487, 4639, 5433, 38, 60, 800, 3726, 3726, 31, 57, 679, 21, 8247, 17404, 625, 13, 15, 29, 14, 448, 16, 487, 4639, 5433, 38, 8649, 9, 31, 92, 368, 21, 2070, 1054, 3893, 13, 5, 72...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 controller finder pattern to dry up an account filter === I have the code like below throughout my controllers. This is to filter the models for a particular account (for multitenancy). Is there an easy way to DRY this up? The `current_account_id` is a controller helper method which depends on the current user. Job.with_account(current_account_id).active....... Contact.with_account(current_account_id).active....... Not sure if adding a helper method in Application controller is the best way.
0
[ 2, 2240, 18, 9919, 13, 18639, 3732, 20, 2273, 71, 40, 2176, 11945, 800, 3726, 3726, 31, 57, 14, 1797, 101, 1021, 892, 51, 9919, 18, 9, 48, 25, 20, 11945, 14, 2761, 26, 21, 1498, 2176, 13, 5, 1106, 1889, 1316, 10821, 6, 9, 25, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Facebook application instance creation not working for every users === I have the following issue that drives me crazy. I use the sample code published with the Facebook PHP SDK (https://github.com/facebook/php-sdk/) for identifying a user. It works fine for most of my test users but for some users, the instance creation does not work. I’ve tried with the same machine and different machines, it does not change anything. Each user is correctly set as test user in my dev account. What could be the cause? Many thanks in advance. require '../lib/facebook.php'; // Create our Application instance (replace this with your appId and secret). $facebook = new Facebook(array( 'appId' => 'XXXXXXXXXX', 'secret' => 'XXXXXXXXXXX', )); // Get User ID $user = $facebook->getUser(); if ($user) { try { // Proceed knowing you have a logged in user who's authenticated. $user_profile = $facebook->api('/me'); } catch (FacebookApiException $e) { error_log($e); $user = null; } } // Login or logout url will be needed depending on current user state. if ($user) { $logoutUrl = $facebook->getLogoutUrl(); } else { $loginUrl = $facebook->getLoginUrl(array( 'scope' => 'publish_stream, publish_actions', 'redirect_uri' => 'http://apps.facebook.com/xxxxx/' )); } ?> <!doctype html> <html xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <title>php-sdk</title> </head> <body> <h1>php-sdk</h1> <?php if ($user): ?> <a href="<?php echo $logoutUrl; ?>">Logout</a> <?php else: ?> <div> Login using OAuth 2.0 handled by the PHP SDK: <a href="<?php echo $loginUrl; ?>" target="_top">Login with Facebook</a> </div> <?php endif ?> <h3>PHP Session</h3> <pre><?php print_r($_SESSION); ?></pre> <?php if ($user): ?> <h3>You</h3> <img src="https://graph.facebook.com/<?php echo $user; ?>/picture"> <h3>Your User Object (/me)</h3> <pre><?php print_r($user_profile); ?></pre> <?php else: ?> <strong><em>You are not Connected.</em></strong> <?php endif ?> </body> </html>
0
[ 2, 9090, 3010, 4851, 2502, 52, 638, 26, 352, 3878, 800, 3726, 3726, 31, 57, 14, 249, 1513, 30, 10396, 55, 3328, 9, 31, 275, 14, 5717, 1797, 467, 29, 14, 9090, 13, 26120, 13, 18, 43, 197, 13, 5, 21127, 18, 6903, 10404, 20926, 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 update/create many-to-may relational data in MVC Code-first using EF? === I have pored through StackOverflow, Google and asp.net trying to find a clear cut, basic example of how to do this. So far, none of them have completely answered my question or addressed my issue(s). I am working on an MVC project with the following model: public class Article { public int ArticleId { get; set; } public string Title { get; set; } public virtual ICollection<Category> Categories { get; set; } public Article() { Categories = new HashSet<Category>(); } } public class Category { public int CategoryId { get; set; } public string Name { get; set; } public virtual ICollection<Article> Articles { get; set; } public Category() { Articles = new HashSet<Article>(); } } public class ArticleEntities : DbContext { public DbSet<Article> Articles { get; set; } public DbSet<Category> Categories { get; set; } } An article can have many categories and a category can belong to many articles. So far I can save/update/create all the article fields except the Categories. I am representing them as a checkboxes in the view. I can get the values for the selected checkboxes into the controller, but, every attempt I have made to store them in the db with the article has failed. How do I: 1) When saving an edited article, update the existing relations in the relation table? 2) When saving a new article, create the chosen relations in the relation table?
0
[ 2, 184, 20, 11100, 118, 6037, 1373, 151, 8, 262, 8, 3904, 5827, 192, 1054, 19, 307, 8990, 1797, 8, 3552, 568, 11599, 60, 800, 3726, 3726, 31, 57, 5156, 69, 120, 7566, 2549, 9990, 15, 8144, 17, 28, 306, 9, 2328, 749, 20, 477, 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...
css3 scale causes divs to become pixelated === I've noticed that when animating css3 scale it seems to pixelate every element it's used on. example: http://jsfiddle.net/PD7Vh/1/ in the above example, scale pixelates the center div when you hover over it. are my css settings wrong, or is this what scale naturally does?
0
[ 2, 272, 18, 18, 240, 3464, 4047, 13, 12916, 18, 20, 533, 18146, 1669, 800, 3726, 3726, 31, 22, 195, 2711, 30, 76, 14487, 1203, 272, 18, 18, 240, 3464, 32, 2206, 20, 18146, 1373, 352, 4520, 32, 22, 18, 147, 27, 9, 823, 45, 7775...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Flex: How to scale the results of using ImageSnapshot.captureImage on a canvas === I'm using `ImageSnapshot.captureImage(canvas, 0, jPEGEncoder)` to capture a drawing canvas to a bitmap, but I'd like the resulting jpeg much larger than the canvas itself. For example, the canvas is 100x400 but I want the resulting image of the canvas to be 2000x8000. I can't enlarge/scale the canvas up to this size because it'll mess up the UI.
0
[ 2, 14409, 45, 184, 20, 3464, 14, 1736, 16, 568, 3502, 325, 306, 7868, 9, 4666, 6418, 22039, 27, 21, 9696, 800, 3726, 3726, 31, 22, 79, 568, 13, 1, 22039, 18, 325, 306, 7868, 9, 4666, 6418, 22039, 5, 1245, 8471, 15, 713, 15, 48...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Changes to SQLite database lifecycle between Gingerbread and ICS; intermittent null pointer exception === I noticed that after I upgraded to ICS from Gingerbread my app started crashing in circumstances when it had worked satisfactorily under Gingerbread. The app's main activity (activity A) has a menu option which opens a ListActivity (activity B) populated from a database; when an entry in the list is clicked a third activity (activity C) is opened. When activity C is closed with the Back button activity B is supposed to be redisplayed. In Gingerbread (and earlier Android versions) this worked fine, and continued to work OK in ICS most of the time. However, it crashed if I navigated away from the app leaving activity C open for an extended period. On returning to the app and trying to back out of activity C to activity B the app would stop. LogCat reported "unable to resume activity" because of a null pointer exception in onResume in activity B. The offending line in the onResume method contains a reference to a DBAdapter which is defined in the onCreate method of activity A. By logging calls to activity B's various lifecycle methods I found that activity B is always (as expected) stopped when activity C is opened. Provided it is only stopped there is no problem: the DBAdapter must still be defined when onResume is called. However, if the app is left for a longer period activity B is destroyed and in these circumstances the DBAdapter (defined in the onCreate method of activity A) must also become undefined. A fix for this problem seems to be to insert `if (Global.mDBAdapter== null) {Global.mDBAdapter = new DBAdapter( this, "DatabaseName" );}` into the onCreate method of activity B. I would like to check that I have understood this correctly. Is there documentation that describes the change (between Gingerbread and ICS) in lifecycle behaviour of a SQLite database adapters/helpers?
0
[ 2, 1693, 20, 4444, 10601, 6018, 201, 12467, 128, 12101, 22852, 17, 13, 8354, 73, 19667, 16203, 454, 106, 5391, 800, 3726, 3726, 31, 2711, 30, 75, 31, 9958, 20, 13, 8354, 37, 12101, 22852, 51, 4865, 373, 14604, 19, 5072, 76, 32, 41...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 query xml value inside a xml column in SQL server === I have something like following code inside [XMLValue] column of a table called "AlgorithmLog": > <?xml version="1.0" encoding="utf-8"?> > <AdapterInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d1p1="http://schemas.datacontract.org/2004/07/Adapters.Adapter.CloudTrader" xmlns="http://schemas.datacontract.org/2004/07/Adapters.Adapter" i:type="d1p1:AlgorithmStatusReport"> <SequenceNumber>0</SequenceNumber> <TrackingGuid i:nil="true" /> <d1p1:Broker>Default</d1p1:Broker> ... <d1p1:XMLValue>&lt;?xml version="1.0"?&gt;&lt;int xmlns="http://schemas.microsoft.com/2003/10/Serialization/"&gt;1900&lt;/int&gt;</d1p1:XMLValue> </AdapterInfo> and I want to get the value "1900" inside the node `<d1p1:XMLValue>` so here is my query: WITH XMLNAMESPACES('http://schemas.datacontract.org/2004/07/Adapters.Adapter' AS x, 'http://schemas.datacontract.org/2004/07/Adapters.Adapter.CloudTrader' As p, 'http://schemas.microsoft.com/2003/10/Serialization/'as w) SELECT XMLValue.query('(/x:AdapterInfo/p:XMLValue/w:int)[1]')AS [XMLVaule] FROM AlgorithmLog But it returns nothing. Could anyone tell me where I did wrong or how I can do it? Thank you.
0
[ 2, 184, 20, 25597, 23504, 1923, 572, 21, 23504, 4698, 19, 4444, 255, 8128, 800, 3726, 3726, 31, 57, 301, 101, 249, 1797, 572, 636, 396, 8184, 15165, 500, 4698, 16, 21, 859, 227, 13, 7, 192, 6979, 242, 7015, 5567, 7, 45, 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...
DataGridTemplateColumn find no binding root === I am trying to put a user control, named simpleChart, into a DataGridTemplateColumn. I bind the DataGrid to an `ObservableCollection<Index>` (where Index is an INotifyPropertyChanged class that I created for display). But somehow, the binding cannot find the root item. To check my binding, I put a textColumn aside the templateColumn, and it works just fine. Here is the relevant code: <Window x:Class="TechniqueAnalysis.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="" Height="549" Width="1744" xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase" xmlns:local="clr-namespace:Charts" xmlns:simpleChart ="clr-namespace:ChartOnGird;assembly=ChartOnGird" WindowState="Maximized" Closing="Window_Closing"> <Grid> <DataGrid Margin="0,60,0,0" Name="dataGridWei" CanUserResizeColumns="False" ItemsSource="{Binding}"> <DataGridTemplateColumn Header="2 day" Width="100" SortMemberPath="Value"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <simpleChart:SimpleChart X ="{Binding Path=X1, diagnostics:PresentationTraceSources.TraceLevel=High}"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> <DataGridTextColumn Header="Value" Binding="{Binding Path=X1, diagnostics:PresentationTraceSources.TraceLevel=High, StringFormat=N2}"/> </DataGrid> </Grid> </Window> The databinding is through background code which binds the ObservableCollection<Index> to the datagrid's DataContext. And I get the following output for the template column: System.Windows.Data Warning: 58 : BindingExpression (hash=45649854): Default mode resolved to OneWay System.Windows.Data Warning: 59 : BindingExpression (hash=45649854): Default update trigger resolved to PropertyChanged System.Windows.Data Warning: 60 : BindingExpression (hash=45649854): Attach to ChartOnGird.SimpleChart.X (hash=40977533) System.Windows.Data Warning: 65 : BindingExpression (hash=45649854): Resolving source System.Windows.Data Warning: 68 : BindingExpression (hash=45649854): Found data context element: SimpleChart (hash=40977533) (OK) System.Windows.Data Warning: 76 : BindingExpression (hash=45649854): Activate with root item '' System.Windows.Data Warning: 106 : BindingExpression (hash=45649854): At level 0 - for String.X1 found accessor <null><Br> System.Windows.Data Warning: 106 : BindingExpression (hash=45649854): At level 0 - for EnumerableCollectionView.X1 found accessor <null> System.Windows.Data Warning: 102 : BindingExpression (hash=45649854): Replace item at level 0 with {NullDataItem}, using accessor {DependencyProperty.UnsetValue} System.Windows.Data Warning: 78 : BindingExpression (hash=45649854): TransferValue - got raw value {DependencyProperty.UnsetValue} System.Windows.Data Warning: 86 : BindingExpression (hash=45649854): TransferValue - using fallback/default value '9' System.Windows.Data Warning: 87 : BindingExpression (hash=45649854): TransferValue - using final value '9' System.Windows.Data Warning: 54 : Created BindingExpression (hash=32948864) for Binding (hash=33575416) But for the text column, I get the following warning: System.Windows.Data Warning: 58 : BindingExpression (hash=32948864): Default mode resolved to OneWay System.Windows.Data Warning: 59 : BindingExpression (hash=32948864): Default update trigger resolved to PropertyChanged System.Windows.Data Warning: 60 : BindingExpression (hash=32948864): Attach to System.Windows.Controls.TextBlock.Text (hash=6303902) System.Windows.Data Warning: 65 : BindingExpression (hash=32948864): Resolving source System.Windows.Data Warning: 68 : BindingExpression (hash=32948864): Found data context element: TextBlock (hash=6303902) (OK) System.Windows.Data Warning: 69 : BindingExpression (hash=32948864): DataContext is null System.Windows.Data Warning: 63 : BindingExpression (hash=32948864): Resolve source deferred System.Windows.Data Warning: 65 : BindingExpression (hash=8194399): Resolving source System.Windows.Data Warning: 68 : BindingExpression (hash=8194399): Found data context element: TextBlock (hash=33203677) (OK) System.Windows.Data Warning: 76 : BindingExpression (hash=8194399): Activate with root item Index (hash=33903126)<Br> System.Windows.Data Warning: 106 : BindingExpression (hash=8194399): At level 0 - for Index.X1 found accessor RuntimePropertyInfo(X1) System.Windows.Data Warning: 102 : BindingExpression (hash=8194399): Replace item at level 0 with Index (hash=33903126), using accessor RuntimePropertyInfo(X1) System.Windows.Data Warning: 99 : BindingExpression (hash=8194399): GetValue at level 0 from Index (hash=33903126) using RuntimePropertyInfo(X1): '1' System.Windows.Data Warning: 78 : BindingExpression (hash=8194399): TransferValue - got raw value '1' System.Windows.Data Warning: 82 : BindingExpression (hash=8194399): TransferValue - implicit converter produced '1.00' System.Windows.Data Warning: 87 : BindingExpression (hash=8194399): TransferValue - using final value '1.00' System.Windows.Data Warning: 65 : BindingExpression (hash=32948864): Resolving source System.Windows.Data Warning: 68 : BindingExpression (hash=32948864): Found data context element: TextBlock (hash=6303902) (OK) System.Windows.Data Warning: 76 : BindingExpression (hash=32948864): Activate with root item Index (hash=49245678) System.Windows.Data Warning: 105 : BindingExpression (hash=32948864): At level 0 using cached accessor for Index.X1: RuntimePropertyInfo(X1) System.Windows.Data Warning: 102 : BindingExpression (hash=32948864): Replace item at level 0 with Index (hash=49245678), using accessor RuntimePropertyInfo(X1) System.Windows.Data Warning: 99 : BindingExpression (hash=32948864): GetValue at level 0 from Index (hash=49245678) using RuntimePropertyInfo(X1): '1' System.Windows.Data Warning: 78 : BindingExpression (hash=32948864): TransferValue - got raw value '1' System.Windows.Data Warning: 82 : BindingExpression (hash=32948864): TransferValue - implicit converter produced '1.00' System.Windows.Data Warning: 87 : BindingExpression (hash=32948864): TransferValue - using final value '1.00' It seems that the templatecolumn fails to find a correct root item. The question is what is a proper way to help it to find the proper one? I tried to add an RelateSource but did not figure out how. My class "Index" is under the MainWindow class. Please help me. I have spend 2 days on it. I believe I am almost there but there is just something that I cannot figure out without help.
0
[ 2, 1054, 16375, 9577, 6554, 716, 4404, 103, 477, 90, 8728, 5900, 800, 3726, 3726, 31, 589, 749, 20, 442, 21, 4155, 569, 15, 377, 1935, 5433, 38, 15, 77, 21, 1054, 16375, 9577, 6554, 716, 4404, 103, 9, 31, 10193, 14, 1054, 16375, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Remove a bunch of directories from one location based on a list of directories in another location? === I have two directories in totally different places in the filesystem: /path1/dir1/* /path2/dir2/* dir1 has a list of subdirectories and dir2 has a similar list of subdirectories, some of which are also in dir1 I'd like a command that can use a list of the subdirectories that are currently in dir1 and if they exist in dir2, delete them. I was able to output a list of the subdirectory names using the find command and sed together like this: find $PWD -maxdepth 1 -type d | sed -e 's\^\/path1\/dir1\///g' and that will output: subdir1 subdir2 subdir3 but I don't know how to then feed that into a command to delete (recursively) those subdirectories from another location. Do I need to use awk or xargs or something?
0
[ 2, 4681, 21, 7653, 16, 559, 1596, 37, 53, 1474, 432, 27, 21, 968, 16, 559, 1596, 19, 226, 1474, 60, 800, 3726, 3726, 31, 57, 81, 559, 1596, 19, 5139, 421, 1489, 19, 14, 3893, 10724, 45, 13, 118, 8353, 8197, 9035, 8197, 2483, 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 can I draw lines or shapes directly on the desktop or the top screen of Mac desktop === I want to draw something on desktop or top the screen of mac desktop while not draw on the app's own window
1
[ 2, 184, 92, 31, 2003, 1560, 54, 12129, 1703, 27, 14, 17404, 54, 14, 371, 2324, 16, 1572, 17404, 800, 3726, 3726, 31, 259, 20, 2003, 301, 27, 17404, 54, 371, 14, 2324, 16, 1572, 17404, 133, 52, 2003, 27, 14, 4865, 22, 18, 258, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
Java: Reflection against casting when you know superclass === I don't know exactly how to define my doubt so please be patient if the question has already been asked. Let's say I have to dinamically instantiate an object. This object will surely be instance of a subclass of a known, immutable class A. I can obtain dinamically the specific implementation class. Would it be better to use reflection exactly as if I didn't know anything about the target class, or would it be preferrable/possible to do something like: A obj = (Class.forName("com.package.Sub-A")) new A(); where Sub-A extends A ? The purpose would be to avoid reflection overhead times... Thank you in advance.
0
[ 2, 8247, 45, 9138, 149, 9087, 76, 42, 143, 1026, 1898, 800, 3726, 3726, 31, 221, 22, 38, 143, 1890, 184, 20, 9267, 51, 3063, 86, 2247, 44, 4836, 100, 14, 1301, 63, 614, 74, 411, 9, 408, 22, 18, 395, 31, 57, 20, 926, 6865, 84...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
FadeIn effect on CSS3 styled element === I'm new to use CSS3 and jQuery. I've searched alot on this problem but no luck. I'm using jQuery fadeIn function on a div, but when it is being progressed there is a weird black box around the content inside. When the fadeIn duration is over, the div is actually like what I want. Is there a good reason to this problem? I'm using CSS3 for styling of the div, radius and shadow. The browser I'm testing on is Chrome. http://i.stack.imgur.com/qelu8.png - On progress http://i.stack.imgur.com/DwvSs.png - Finished
0
[ 2, 11381, 108, 1590, 27, 272, 18, 18, 240, 1034, 43, 4520, 800, 3726, 3726, 31, 22, 79, 78, 20, 275, 272, 18, 18, 240, 17, 487, 8190, 93, 9, 31, 22, 195, 9036, 21, 5639, 27, 48, 1448, 47, 90, 5419, 9, 31, 22, 79, 568, 487,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Erase statictext in matlab === I have in my GUI a pushbuton to edit text in a static text using matlab: set(handles.med_30,'string',['Média= ',num2str(M1)]); i have other pusbuton to erase but it does not work :(( set(handles.med_30,'visible','off'); What i´m doing wrong?? :(( Can someone help me!? Thanks in advance.
0
[ 2, 23593, 12038, 11969, 19, 4277, 9086, 800, 3726, 3726, 31, 57, 19, 51, 9457, 21, 3250, 811, 218, 20, 9392, 1854, 19, 21, 12038, 1854, 568, 4277, 9086, 45, 309, 5, 3203, 1355, 9, 4688, 1, 1762, 15, 22, 11130, 22, 15, 2558, 22, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to change column name of Report Viewer report? === I am using `ASP.NET/C#`.I am using `Report Viewer` control to display a basic report.Currently the data is shown properly however the column names are the same as when selected while configuring the `Report Wizard`. **Example:** `cFirstName` is displayed as `cFirstName` in the column header of the `Report Viewer`. I would want to change it to **First Name** instead. Here is the image of the issue. ![enter image description here][1] Can anyone help me to achieve this? Any suggestions are welcome. Thanks. [1]: http://i.stack.imgur.com/1X7ua.png
0
[ 2, 184, 20, 753, 4698, 204, 16, 1330, 16812, 1330, 60, 800, 3726, 3726, 31, 589, 568, 13, 1, 472, 306, 9, 2328, 118, 150, 5910, 1, 9, 49, 589, 568, 13, 1, 17437, 16812, 1, 569, 20, 3042, 21, 2125, 1330, 9, 24947, 14, 1054, 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...
Rails + Foundation with only grid and forms === I'd like to use foundation in my Rails3 app but only the forms and grid. When I add `@import "foundation";` it all works.. But when I use `@import "foundation/forms";` it crashes with the following message: Undefined variable: "$formSpacing". Seems like some settings are missing.. Anybody here that has experience with this ? Thanks in advance!
0
[ 2, 2240, 18, 2754, 1304, 29, 104, 7354, 17, 1997, 800, 3726, 3726, 31, 22, 43, 101, 20, 275, 1304, 19, 51, 2240, 18, 240, 4865, 47, 104, 14, 1997, 17, 7354, 9, 76, 31, 3547, 13, 1, 1660, 1993, 13, 7, 12235, 857, 7, 73, 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...
Google Analytics cross domain tracking === I am trying to set up Cros domain tracking from www.able-labels.co.uk to ablelabels.netprintmanager.com Someone has set up this code for it to work but I think there maybe some incorrect syntax in the link code as when I implement it I get duplicate " and it becomes broken. <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js'type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-xxxxxx-x"); pageTracker._trackPageview(); } catch(err) {} </script> 3. Amend all the links between domains. Here is an example: <a href="http://www.yoursite.co.uk"onclick="pageTracker._link(http://www.yoursite.co.uk);return false;">Link Here</a> If anyone can see any stupid mistakes and help me out that would be great. Many thanks
0
[ 2, 8144, 26320, 919, 4603, 10353, 800, 3726, 3726, 31, 589, 749, 20, 309, 71, 4880, 18, 4603, 10353, 37, 13, 6483, 9, 579, 8, 21018, 18, 9, 716, 9, 2185, 20, 777, 21018, 18, 9, 2328, 10299, 22256, 9, 960, 737, 63, 309, 71, 48,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 combobox prevent text changed === is there any way to prevent wpf combobox from changing its text after selection changed? I have a custom control that derives from combobox and I want to be able to set the text manually after selection changed, additionally I cannot prevent the base.OnSelectionChanged from being invoked (this does the trick but it has to stay there as a part of requirements)
0
[ 2, 619, 7721, 22621, 5309, 2501, 1854, 1015, 800, 3726, 3726, 25, 80, 186, 161, 20, 2501, 619, 7721, 22621, 5309, 37, 4226, 82, 1854, 75, 3155, 1015, 60, 31, 57, 21, 5816, 569, 30, 13049, 37, 22621, 5309, 17, 31, 259, 20, 44, 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...
Difference between comparison and addition === Is addition(+) operation more complex than comparison operation (>), both in integer as well as floating point arithmetic? I would appreciate answer in the context of both microprocessor- and FPGA-based systems. My thought: I think comparison and addition are the same thing when we talk about microprocessor-based systems because comparison a>b can be solved by checking the sign bit of (a-b), i.e, an addition operation. But, in the context of FPGA-based systems, I guess the complexity of comparison operator can be reduced?
0
[ 2, 2841, 128, 6050, 17, 848, 800, 3726, 3726, 25, 848, 5, 2430, 6, 1453, 91, 1502, 119, 6050, 1453, 13, 5, 1, 6, 15, 156, 19, 13820, 28, 134, 28, 8319, 454, 21211, 60, 31, 83, 8831, 1623, 19, 14, 4141, 16, 156, 2899, 16835, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
EF MVC C#: Should I be lazy loading this? Null database exceptions === I have been looking for an answer to this for 2 days now. I'm not even sure that I know exactly what is wrong, but I think I have pinpointed the possible culprit. (Disclaimer: I am not very good at working with databases so that is probably why I am having this issue in the first place) My program is a database tracker/manager that will keep track of the equipment at my company. The user can query for, create, and edit equipment. Right now, querying the database works, but when I try to add to or update the database the program throws a null exception (I'll get into this more below). I have an equipment class that has many nullable attributes (because the user may not know many of these properties when creating a new entry, so we left almost all the attributes nullable) and is connected to (using foreign keys and lazy loading/"virtual") to a few other tables that were made to help normalize the database. Here is some abreviated code to help: Equipment Model: public class Equipment { public int EquipmentId { get; set; } //required; set when added to DB, correct? public string Company { get; set; } //required public bool Verified { get; set; } //required (...other non-required attributes...) //The following two attributes are where my problems are I believe public int PAUId { get; set; } //required and Foreign Key //This is not required (but is FK to the related table) if the user doesn't know public Nullable<int> DivisionId { get; set; } //These are the lazy loading connections to the other tables in the database public virtual Division Division { get; set; } public virtual PAU PAU { get; set; } } Division Model: This table only contains the 5 different divisions at our company and the related IDs. public class Division { public Division() { this.Equipments = new HashSet<Equipment>(); } //These are non-nullable/required fields public int DivisionId { get; set; } public string DivisionName { get; set; } public virtual ICollection<Equipment> Equipments { get; set; } } PAU Model: This model contains the PAU#s and the related description and ID. public class PAU { public PAU() { this.Equipments = new HashSet<Equipment>(); } //These are non-nullable/required fields public int PAUId { get; set; } public string PAUNumber { get; set; } public string PAUDescription { get; set; } public virtual ICollection<Equipment> Equipments { get; set; } } Equipment Controller: public class EquipmentController : Controller { TLCP_DEVEntities4 db = new TLCP_DEVEntities4(); (...) public ActionResult Edit(int id) { ViewData["divisions"] = new SelectList(db.Equipments.OrderBy(x => x.Division.DivisionName).Select(x => x.Division).ToList().Distinct(), "DivisionId", "DivisionName"); ViewData["PAUNumbers"] = new SelectList(db.Equipments.OrderBy(x => x.PAU.PAUNumber).Select(x => x.PAU).ToList().Distinct(), "PAUId", "PAUNumber"); ViewData["statuses"] = new SelectList(db.Equipments.OrderBy(x => x.Status.StatusDescription).Select(x => x.Status).ToList().Distinct(), "StatusId", "StatusDescription"); return View(db.Equipments.Find(id)); } [HttpPost] public ActionResult Edit(Equipment equipment) { if (ModelState.IsValid) { db.Entry(equipment).State = EntityState.Modified; //fails either here db.SaveChanges(); //or here (I can go into more detail of why if it would be helpful) return RedirectToAction("Maintenance"); } ViewData["divisions"] = new SelectList(db.Equipments.OrderBy(x => x.Division.DivisionName).Select(x => x.Division).ToList().Distinct(), "DivisionId", "DivisionName"); ViewData["PAUNumbers"] = new SelectList(db.Equipments.OrderBy(x => x.PAU.PAUNumber).Select(x => x.PAU).ToList().Distinct(), "PAUId", "PAUNumber"); ViewData["statuses"] = new SelectList(db.Equipments.OrderBy(x => x.Status.StatusDescription).Select(x => x.Status).ToList().Distinct(), "StatusId", "StatusDescription"); return View(equipment); } public ActionResult AddEquipment() { ViewData["divisions"] = new SelectList(db.Equipments.OrderBy(x => x.Division.DivisionName).Select(x => x.Division).ToList().Distinct(), "DivisionId", "DivisionName"); ViewData["PAUNumbers"] = new SelectList(db.Equipments.OrderBy(x => x.PAU.PAUNumber).Select(x => x.PAU).ToList().Distinct(), "PAUId", "PAUNumber"); ViewData["statuses"] = new SelectList(db.Equipments.OrderBy(x => x.Status.StatusDescription).Select(x => x.Status).ToList().Distinct(), "StatusId", "StatusDescription"); return View(); } public ActionResult AddEquipment(Equipment equipment) { try { //UpdateModel(equipment); //tried adding this but didn't seem to help at all db.Equipments.Add(equipment); db.SaveChanges(); return RedirectToAction("Maintenance"); } catch (Exception ex) { ViewData["divisions"] = new SelectList(db.Equipments.OrderBy(x => x.Division.DivisionName).Select(x => x.Division).ToList().Distinct(), "DivisionId", "DivisionName"); ViewData["PAUNumbers"] = new SelectList(db.Equipments.OrderBy(x => x.PAU.PAUNumber).Select(x => x.PAU).ToList().Distinct(), "PAUId", "PAUNumber"); ViewData["statuses"] = new SelectList(db.Equipments.OrderBy(x => x.Status.StatusDescription).Select(x => x.Status).ToList().Distinct(), "StatusId", "StatusDescription"); return View(); } } (...) } In the views I have dropdown lists that for these attributes that are populated with the possible options already in the database (stored in ViewData above). I have tried a couple different ways of storing this data into my model. They all look roughly the same though. In Views: Option #1: <%: Html.DropDownListFor(model => model.DivisionId, ViewData["divisions"] as SelectList, "")%> This way updates the Equipment's DivisionId. Option #2: <%: Html.DropDownListFor(model => model.Division.DivisionId, ViewData["divisions"] as SelectList, "")%> Updates the Division object's DivisionId. I don't think this is the way to go, but putting it out there anyways. Ok so after a lot of debugging, the problem seems to be because the lazy loaded properties have null attributes, which are not allowed in their tables. My examples will be dealing more with creating new equipment objects, though I believe the problem is the same for editing them. Division Example (using Option #1): So DivisionId in the Equipment class can be null (either user doesn't know or equipment doesn't belong to specific division), and the Equipment table/class doesn't complain about that. But when I try to SaveChanges(), the program complains becuase the virtual Division object is null (has the default DivisionId of 0 and a null DivisionName). Since Equipment.DivisionId is null, I don't want to be updating the Division table for this Equipment object. Is there a way to get around this? Should I not be lazy loading? PAU Example (using Option #1): Since PAUId is a required attribute for all Equipment objects, but as in the Division Example, PAU.PAUNumber and PAU.PAUDescription are null (and PAU.PAUId is the default 0) causing an error. This is just like the first one, but with the required attribute (so I am not sure if it needs to be handled differently). So I am not really sure how to fix this problem. - Is lazy loading the issue since I only want to connect my equipment object to those other tables if the Id/Foreign Key is not null? - Is there some method I can call that would update the equipment object's values from the other tables based on the Id's? Is it a method that I need to create myself? - If I get rid of lazy loading, could you explain how I should write my queries so I can still get access to the normalized data (like DivisionName)? I apologize for the super long post. I just didn't want to miss anything that may be important. Thank you very much for all your help! Let me know if there is more information to post.
3
[ 2, 11599, 307, 8990, 272, 5910, 45, 378, 31, 44, 16792, 12797, 48, 60, 16203, 6018, 13392, 800, 3726, 3726, 31, 57, 74, 699, 26, 40, 1623, 20, 48, 26, 172, 509, 130, 9, 31, 22, 79, 52, 166, 562, 30, 31, 143, 1890, 98, 25, 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 remove bytes from mappedbytebuffer? === I have mappedbytebuffer from which I want to remove some characters(bytes of them). After removal, I want to assign cleaned mappedbytebuffer to local class variable. To do this, private MappedByteBuffer mapSeq=null; private long length = 0; public Seq(final MappedByteBuffer map, long length) { mapSeq = map; this.length = length; } public void clean(){ byte[] arr= new byte[ (int)length]; int cont = 0, ic = 0; for(int i=0; i<length; i++) { byte get = mapSeq.get(i); if((get == 42) || (get > 64 && get <91) || (get > 96 && get < 123) ) { arr[cont++] = mapSeq.get(i); } } mapSeq.clear(); mapSeq.allocate(cont); mapSeq.put(arr); } However, I get "ReadOnlyBufferException". How can I solve removal of bytes from mappedbytebuffer? Thank you very much
0
[ 2, 184, 20, 4681, 34, 3231, 37, 20877, 23246, 2345, 6866, 60, 800, 3726, 3726, 31, 57, 20877, 23246, 2345, 6866, 37, 56, 31, 259, 20, 4681, 109, 1766, 5, 23246, 18, 16, 105, 6, 9, 75, 7797, 15, 31, 259, 20, 13952, 13143, 20877, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
auto update view in backbone.js === I use backbone.js and have a model without a collection. In the view I call fetch on the model with a callback to render the view. this.user.fetch({success: function(d) { self.randomUserView.render() }}) how can I make the view update automatically when the model change? e.g. I don't want to specify the above callback every time I call fetch. I tried to bind the view to many model events on initialize but this did not work.
0
[ 2, 3108, 11100, 1418, 19, 24036, 9, 728, 18, 800, 3726, 3726, 31, 275, 24036, 9, 728, 18, 17, 57, 21, 1061, 366, 21, 1206, 9, 19, 14, 1418, 31, 645, 18312, 27, 14, 1061, 29, 21, 645, 1958, 20, 16535, 14, 1418, 9, 48, 9, 1670...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Any way to track the internet usage in iOS? === I was wondering if is there some way for iOS to track the internet usage... I don't care if it will require private APIs, because it will be for personal use… However, if there is an "Apple " way to do it it's better than the private APIs. Thank you!
0
[ 2, 186, 161, 20, 792, 14, 2620, 7514, 19, 13, 7760, 60, 800, 3726, 3726, 31, 23, 5712, 100, 25, 80, 109, 161, 26, 13, 7760, 20, 792, 14, 2620, 7514, 9, 9, 9, 31, 221, 22, 38, 781, 100, 32, 129, 4077, 932, 21, 8954, 15, 185...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Reading STDOUT of subprocess === Hello I want to read output of command which gives progress bar like output as show below 10% |**** | 3:56 ETA I tried with following code import subprocess import sys proc = subprocess.Popen("command", shell=True, stdout=subprocess.PIPE) while True: line = proc.stdout.readline() if not line: break split = line.rstrip() print line print "\n" print "Done" This code reads output after completion of progress bar to 100%, but I want to read it at intermediate. Can any one help?
0
[ 2, 1876, 354, 43, 1320, 16, 972, 16835, 800, 3726, 3726, 10975, 31, 259, 20, 1302, 5196, 16, 1202, 56, 2352, 3455, 748, 101, 5196, 28, 298, 1021, 12476, 13, 1, 1409, 1409, 13, 1, 2635, 3776, 13, 5735, 31, 794, 29, 249, 1797, 901...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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't align vertically a .swf file to the middle === I inserted a .swf file to my page inside a div, and I tried to make it vertically aligned to the middle of this div, but it didn't work, only horizontally but that's not what I want. I tried to place this file in another div inside the main div and change the alignment of this div as well. Any suggestions?
0
[ 2, 92, 22, 38, 23389, 23300, 21, 13, 9, 18, 15263, 3893, 20, 14, 772, 800, 3726, 3726, 31, 14215, 21, 13, 9, 18, 15263, 3893, 20, 51, 2478, 572, 21, 13, 12916, 15, 17, 31, 794, 20, 233, 32, 23300, 13, 12740, 20, 14, 772, 16,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Return T-Sql Message in C# === I am building T-SQL dynamically via a library and am returning the results in XML. There is need for some optional fast_forward cursors (this is a requirement of the library; not trying to determine if set based is better as this is an optional parameter). I am using SqlInfoMessageEventArgs to return the messaging which works fine for a T-SQL script without a cursor. I am trying to avoid writing the data to temp tables. using (SqlConnection connection = new SqlConnection(_Conn)) { connection.InfoMessage += new SqlInfoMessageEventHandler(InfoMessage.InfoMessageHandler); connection.Open(); using (SqlCommand cmd = connection.CreateCommand()) { TSql = BuildTSql(); cmd.CommandText = TSql; cmd.CommandType = System.Data.CommandType.Text; cmd.ExecuteNonQuery(); TSqlOutput += InfoMessage.output; // This is the output message } } Last piece of TSql returned examp: "(SELECT * from emp where emp_id = @id for xml raw ) " + "fetch next from cur into @id \r\n " + "End \r\n " + "close cur \r\n " + "deallocate cur \r\n " + "print cast(@return_xml as nvarchar(max)) \r\n " Obviously this only returns the last row processed from the cursor. If I move the print statement up before I close the cursor it doesn't output the data using the InfoMessageHandler. I'm not sure if there are any better ways to return T-Sql output run as executenonquery.
0
[ 2, 788, 13, 38, 8, 18, 22402, 2802, 19, 272, 5910, 800, 3726, 3726, 31, 589, 353, 13, 38, 8, 18, 22402, 7782, 1326, 1197, 21, 1248, 17, 589, 2485, 14, 1736, 19, 23504, 9, 80, 25, 376, 26, 109, 12832, 1512, 1, 21216, 29588, 18,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
get Mysql database creation date with java === Using mysql 5.5.2 on windows (Wamp) I'm writing a Java application that use several databases. I want to list databases names and their creation dates. Databases have the same table's only data vary (Archives). Any trick with Java?
0
[ 2, 164, 51, 18, 22402, 6018, 2502, 1231, 29, 8247, 800, 3726, 3726, 568, 51, 18, 22402, 331, 9, 264, 9, 135, 27, 1936, 13, 5, 1608, 2554, 6, 31, 22, 79, 1174, 21, 8247, 3010, 30, 275, 238, 6018, 18, 9, 31, 259, 20, 968, 6018...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Display NCover coverage report inside TeamCity === I am running NCover 3, with TeamCity 7. TeamCity is kicking off the cover process and I can find the fullcoveragereport.html in my file directory for the build, however TeamCity is not creating a tab for the coverage. IE i cant view this Ncover fullcoveragereport.html inside of teamcity. Any ideas, or things i might have missed? Thank you
0
[ 2, 3042, 13, 103, 14069, 5245, 1330, 572, 173, 5788, 800, 3726, 3726, 31, 589, 946, 13, 103, 14069, 203, 15, 29, 173, 5788, 453, 9, 173, 5788, 25, 11228, 168, 14, 1227, 953, 17, 31, 92, 477, 14, 503, 14069, 1303, 17437, 9, 15895...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to use msg_nosignal on mac osx === I have a code which runs on mac osx or on linux and I want it to be portable, how do I make an #ifndef statement which switches `msg_nosignal` to the relevant flag under macosx?
0
[ 2, 184, 20, 275, 4235, 263, 1, 251, 11255, 192, 27, 1572, 13, 759, 396, 800, 3726, 3726, 31, 57, 21, 1797, 56, 1461, 27, 1572, 13, 759, 396, 54, 27, 13024, 17, 31, 259, 32, 20, 44, 13469, 15, 184, 107, 31, 233, 40, 6926, 821...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
download mutliple files with wget on windows === I am trying to download 50 pdf's from a webserver using wget on windows. All pdf's reside in www.abc.com/files/ and their url's are (www.abc.com/files/x.pdf, where x = 1,2,3...50 ) the batch script I have written is set "directory = http://www.abc.com/files/" for %%x in (1, 1, 50) do ( set pdfNum = %%x set "num = %directory%%pdfNum%" set "pdf = .pdf" set "file = %num%%pdf%" wget file ) but it doesn't seems to work.Help anyone. Thanks in advance....
0
[ 2, 7121, 13, 7903, 6013, 413, 6488, 29, 619, 3060, 27, 1936, 800, 3726, 3726, 31, 589, 749, 20, 7121, 1222, 13, 11124, 22, 18, 37, 21, 2741, 10321, 106, 568, 619, 3060, 27, 1936, 9, 65, 13, 11124, 22, 18, 14670, 19, 13, 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...
Unable to compile catdoc binary on Heroku build box using Vulcan === Running Rails 3.2 on Heroku Cedar stack, trying to process Microsoft Word documents with an asynchronous job. I'm using catdoc in my local OS X development environment to process Word documents but need the same functionality on Heroku. I found Vulcan https://devcenter.heroku.com/articles/buildpack-binaries which allows building binaries for packaging and use on Heroku. I have created a build box using 'vulcan create' and downloaded catdoc source from curl -O http://ftp.wagner.pp.ru/pub/catdoc/catdoc-0.94.2.tar.gz then extracted the source, running vulcan build --verbose The source is uploaded, and the build starts but hangs at the last line below and does not return. Any ideas on how to get the build to complete? $ vulcan build --verbose Packaging local directory... done Uploading source package... done Building with: ./configure --prefix /app/vendor/catdoc-0.94.2 && make install loading cache ./config.cache checking for gcc... (cached) gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... (cached) yes checking whether gcc accepts -g... (cached) yes checking whether byte ordering is bigendian... (cached) no checking for a BSD compatible install... (cached) /usr/bin/install -c checking for wish... (cached) /usr/bin/wish checking checking if wish version is 8.1 or above ... ./configure: 1: /usr/bin/wish: not found checking how to run the C preprocessor... (cached) gcc -E checking for ANSI C header files... (cached) yes checking for unistd.h... (cached) yes checking for langinfo.h... (cached) yes checking For nl_langinfo(CODESET)... yes checking for working const... (cached) yes checking whether setvbuf arguments are reversed... (cached) no checking for strdup... (cached) yes checking for strtol... (cached) yes checking for strftime... (cached) yes updating cache ./config.cache creating ./config.status creating doc/Makefile creating charsets/Makefile creating src/Makefile creating Makefile creating doc/catdoc.1 creating doc/xls2csv.1 creating doc/wordview.1 creating doc/catppt.1 creating src/config.h src/config.h is unchanged for i in src doc charsets; do\ (cd $i; make install);\ done make[1]: Entering directory `/tmp/d20120624-2-13ibi2z/input/src' ../mkinstalldirs /app/vendor/catdoc-0.94.2/bin mkdir /app/vendor/catdoc-0.94.2 mkdir /app/vendor/catdoc-0.94.2/bin /usr/bin/install -c -m 755 catdoc /app/vendor/catdoc-0.94.2/bin/catdoc /usr/bin/install -c -m 755 xls2csv /app/vendor/catdoc-0.94.2/bin/xls2csv /usr/bin/install -c -m 755 catppt /app/vendor/catdoc-0.94.2/bin/catppt make[1]: Leaving directory `/tmp/d20120624-2-13ibi2z/input/src' make[1]: Entering directory `/tmp/d20120624-2-13ibi2z/input/doc' ../mkinstalldirs /app/vendor/catdoc-0.94.2/man/man1 mkdir /app/vendor/catdoc-0.94.2/man mkdir /app/vendor/catdoc-0.94.2/man/man1 /usr/bin/install -c -m 644 catdoc.1 /app/vendor/catdoc-0.94.2/man/man1/catdoc.1 /usr/bin/install -c -m 644 xls2csv.1 /app/vendor/catdoc-0.94.2/man/man1/xls2csv.1 /usr/bin/install -c -m 644 catppt.1 /app/vendor/catdoc-0.94.2/man/man1/catppt.1 make[1]: Leaving directory `/tmp/d20120624-2-13ibi2z/input/doc' make[1]: Entering directory `/tmp/d20120624-2-13ibi2z/input/charsets' ../mkinstalldirs /app/vendor/catdoc-0.94.2/share/catdoc mkdir /app/vendor/catdoc-0.94.2/share mkdir /app/vendor/catdoc-0.94.2/share/catdoc /usr/bin/install -c -m 644 ascii.spc /app/vendor/catdoc-0.94.2/share/catdoc/ascii.specchars /usr/bin/install -c -m 644 tex.spc /app/vendor/catdoc-0.94.2/share/catdoc/tex.specchars /usr/bin/install -c -m 644 ascii.rpl /app/vendor/catdoc-0.94.2/share/catdoc/ascii.replchars /usr/bin/install -c -m 644 tex.rpl /app/vendor/catdoc-0.94.2/share/catdoc/tex.replchars for i in *.txt; do\ /usr/bin/install -c -m 0644 $i /app/vendor/catdoc-0.94.2/share/catdoc;\ done make[1]: Leaving directory `/tmp/d20120624-2-13ibi2z/input/charsets'
0
[ 2, 2343, 20, 26561, 2008, 13799, 14171, 27, 36, 9266, 1895, 1649, 568, 23514, 800, 3726, 3726, 946, 2240, 18, 203, 9, 135, 27, 36, 9266, 11083, 7566, 15, 749, 20, 953, 7099, 833, 4374, 29, 40, 21, 16023, 1291, 1205, 9, 31, 22, 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...
how to get the BigInteger to the pow Double in C#? === I tried to use `BigInteger.Pow` method to calculate something like 10^12345.123 but this method only accept integer number as exponent like this: > BigInteger.Pow(BigInteger x, int y) so how can I use double number as exponent in above method?
0
[ 2, 184, 20, 164, 14, 580, 6391, 13699, 20, 14, 14387, 1494, 19, 272, 5910, 60, 800, 3726, 3726, 31, 794, 20, 275, 13, 1, 6407, 6391, 13699, 9, 1638, 499, 1, 2109, 20, 18469, 301, 101, 332, 1, 918, 21997, 9, 918, 240, 47, 48, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Unknown error using SQLIte === I am pretty new in android development and this is my first attempt in using an SQLite database. I am facing an error that i can't understand so pleaseeeeeee help me out if you can. My application has a text view and 3 buttons, one for reading and showing the mobile's contcts, one for showing the database records and one for saving the contacts to the database. The code attached below is the main.java which takes constants from other files. Manifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="medialab.elearning" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:maxSdkVersion="17"/> <uses-permission android:name="android.permission.READ_CONTACTS"/> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:name=".DbProjectActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:id="@+id/textview" android:layout_width="fill_parent"android:layout_height="wrap_content"/> <Button android:id="@+id/btn2" android:layout_width="250dip" android:layout_height="wrap_content" android:layout_marginLeft="30dip" android:layout_marginRight="50dip" android:layout_marginTop="75dip" android:text="@+string/viewDb" /> <Button android:id="@+id/btn" android:layout_width="250dip" android:layout_height="wrap_content" android:layout_marginLeft="30dip" android:layout_marginRight="50dip" android:text="@+string/name" /> <Button android:id="@+id/btn3" android:layout_width="250dip" android:layout_height="wrap_content" android:layout_marginLeft="30dip" android:layout_marginRight="50dip" android:text="@+string/viewContacts" /> </LinearLayout> show.xml <?xml version="1.0" encoding="utf-8"?> <ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:id="@+id/showView" android:layout_width="fill_parent" android:layout_height="wrap_content"/> </ScrollView> Constants.java package medialab.elearning; import android.provider.BaseColumns; public interface Constants extends BaseColumns { public static final String TABLE_NAME= "contact"; public static final String CONTACT_NAME= "ContactName"; public static final String KEY_ID="_id"; } ContactsData.java package medialab.elearning; import static android.provider.BaseColumns._ID; import static medialab.elearning.Constants.TABLE_NAME; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class ContactsData extends SQLiteOpenHelper { public static final String DATABASE_NAME="contacts.db"; private static final int DATABASE_VERSION=1; public ContactsData(Context context){ super(context, DATABASE_NAME, null, DATABASE_VERSION); } public void onCreate(SQLiteDatabase db){ db.execSQL("CREATE TABLE " + TABLE_NAME + " (" + _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, ContactName TEXT NOT NULL);"); } public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){ db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME); onCreate(db); } } enter code here DbProjectActivity.java package medialab.elearning; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; import android.content.ContentResolver; import android.net.Uri; import android.provider.ContactsContract; import android.provider.ContactsContract.CommonDataKinds.StructuredPostal; import static medialab.elearning.Constants.TABLE_NAME; import static medialab.elearning.Constants.CONTACT_NAME; import static medialab.elearning.ContactsData.DATABASE_NAME; import static medialab.elearning.Constants.KEY_ID; import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; public class DbProjectActivity extends Activity { /** Called when the activity is first created. */ private static final String DNAME= ContactsContract.Contacts.DISPLAY_NAME; private static final Uri URI= ContactsContract.Contacts.CONTENT_URI; public String name=""; public String tableName=Constants.TABLE_NAME; public String contactName=Constants.CONTACT_NAME; public String contactname="ContactName"; public Integer savedCounter=0, addedCounter=0; private ContactsData con; Long rawId=null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView tv = (TextView) findViewById(R.id.textview); tv.setText(""); con = new ContactsData(this); try{ Button button1 = (Button) findViewById(R.id.btn2); button1.setOnClickListener(new OnClickListener(){ @Override public void onClick(View view){ showRecords(); } }); Button button2 = (Button) findViewById(R.id.btn3); button2.setOnClickListener(new OnClickListener(){ @Override public void onClick(View view){ showContacts(); } }); Button button = (Button) findViewById(R.id.btn); button.setOnClickListener(new OnClickListener(){ @Override public void onClick(View view){ TextView tv = (TextView) findViewById(R.id.textview); tv.setText(""); Bundle extras= getIntent().getExtras(); rawId = extras.getLong(Constants.KEY_ID); ContentResolver cr= getContentResolver(); Cursor cu= cr.query(URI, null, null, null, null); if(cu.getCount()>0){ cu.moveToFirst();} while(cu.moveToNext()){ name=cu.getString(cu.getColumnIndex(DNAME)); if(rawId!=null){ search(name); rawId+=1; } else{ addContact(name); rawId+=1; } } tv.setText("CONTACTS FOUND IN YOUR MOBILE: " + (addedCounter + savedCounter) + "\nALLREADY STORED IN DATABASE: " + savedCounter + "\nNEW CONTACTS ADDED IN DATABASE: " + addedCounter); addedCounter=0; savedCounter=0; cu.close(); } }); } finally { con.close(); } } @Override public void onPause(){ super.onPause(); con.close(); } @Override public void onResume(){ super.onResume(); con = new ContactsData(this); try{ Button button1 = (Button) findViewById(R.id.btn2); button1.setOnClickListener(new OnClickListener(){ @Override public void onClick(View view){ showRecords(); } }); Button button2 = (Button) findViewById(R.id.btn3); button2.setOnClickListener(new OnClickListener(){ @Override public void onClick(View view){ showContacts(); } }); Button button = (Button) findViewById(R.id.btn); button.setOnClickListener(new OnClickListener(){ @Override public void onClick(View view){ TextView tv = (TextView) findViewById(R.id.textview); tv.setText(""); Bundle extras= getIntent().getExtras(); rawId = extras.getLong(Constants.KEY_ID); ContentResolver cr= getContentResolver(); Cursor cu= cr.query(URI, null, null, null, null); if(cu.getCount()>0){ cu.moveToFirst();} while(cu.moveToNext()){ name=cu.getString(cu.getColumnIndex(DNAME)); if(rawId!=null){ search(name); rawId+=1; } else{ addContact(name); } } tv.setText("CONTACTS FOUND IN YOUR MOBILE: " + (addedCounter + savedCounter) + "\nALLREADY STORED IN DATABASE: " + savedCounter + "\nNEW CONTACTS ADDED IN DATABASE: " + addedCounter); addedCounter=0; savedCounter=0; cu.close(); } }); } finally{ con.close(); } } private void search(String name){ SQLiteDatabase db = con.getReadableDatabase(); Cursor c = db.rawQuery("select count(*) from contact where " + contactName + "=" + name, null); c.moveToFirst(); int count = c.getInt(0); if(count==0){ addContact(name); addedCounter+=1; } else{ savedCounter+=1; } c.close(); db.close(); } private void addContact(String name){ SQLiteDatabase db = con.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(Constants.CONTACT_NAME, name); db.insertOrThrow(Constants.TABLE_NAME, null, values); db.close(); } private void showRecords(){ setContentView(R.layout.show); StringBuilder builder = new StringBuilder("Saved records:\n"); SQLiteDatabase db = con.getReadableDatabase(); Cursor c=db.rawQuery("SELECT * FROM " + Constants.TABLE_NAME, null); c.moveToFirst(); while(!c.isAfterLast()) { long id= c.getLong(0); String recordName = c.getString(1); builder.append(id).append(": "); builder.append(recordName).append("\n"); } TextView text = (TextView) findViewById(R.id.showView); text.setText(builder); } private void showContacts(){ Integer contactNum=0; String contactName=""; String contactInfo=""; String contactsList=""; setContentView(R.layout.show); TextView text = (TextView) findViewById(R.id.showView); ContentResolver cr= getContentResolver(); Cursor cu= cr.query(URI, null, null, null, null); if(cu.getCount()>0){ while(cu.moveToNext()){ contactName=cu.getString(cu.getColumnIndex(DNAME)); contactInfo = contactNum + " " + contactName + "\n"; contactsList+= contactInfo; contactNum+=1; } } text.setText(contactsList); } } The buttons that display the contacts and the database record work just fine. But whenever i test the saving button i get an error on the log file that i can't understand. Please guys help me out because it's driving me insane!!!!!
0
[ 2, 2562, 7019, 568, 4444, 10601, 800, 3726, 3726, 31, 589, 1772, 78, 19, 13005, 522, 17, 48, 25, 51, 64, 1735, 19, 568, 40, 4444, 10601, 6018, 9, 31, 589, 4325, 40, 7019, 30, 31, 92, 22, 38, 1369, 86, 2247, 2851, 2851, 2851, 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...
PHP: strip_tags - remove only certain tags (and their contents)? === I use the `strip_tags()` function but I need to remove some tags (and all of their contents). for example : <div> <p> Test A </p> <span> Test B </span> <div> Test C </div> </div> Let's say, I need to get rid of the P and SPAN tags, and only keep : <div> <div> Test C </div> </div> `strip_tags` expects as a second parameter the tags that you want to KEEP. In this particular example I could use `striptags($html, "<div>");` but the html I'm scraping and the tags that need to be removed are different all the time. I searched for hours for a function that suits my needs, but couldn't find anything useful. Any idea's?
0
[ 2, 13, 26120, 45, 4998, 1, 8628, 18, 13, 8, 4681, 104, 1200, 3383, 18, 13, 5, 290, 66, 8478, 6, 60, 800, 3726, 3726, 31, 275, 14, 13, 1, 19992, 1, 8628, 18, 5, 6, 1, 1990, 47, 31, 376, 20, 4681, 109, 3383, 18, 13, 5, 290...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Postgresql SQL in Rails 2.3 === How do I write a following sql in rails 2.3 select v.tag, count(vehicle_id) AS citation_count from citations c inner join vehicles v on v.id=c.vehicle_id group by v.tag,v.id having count(vehicle_id)>5 order by citation_count desc; **Note :** **Vehicle has_many citations** **Citation belongs_to vehicle** Thank you for your help.
0
[ 2, 678, 6879, 18, 22402, 4444, 255, 19, 2240, 18, 172, 9, 240, 800, 3726, 3726, 184, 107, 31, 2757, 21, 249, 4444, 255, 19, 2240, 18, 172, 9, 240, 5407, 566, 9, 8628, 15, 2468, 5, 195, 252, 15653, 1, 1340, 6, 28, 9715, 1, 16...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
MVC4 Web API routing conflict === **ISSUE** We just switched from MVC4 Web API Beta to the RC and we're running into a `Multiple actions were found that match the request ...` exception in our service. **BACKGROUND** We have two `POST` actions defined in our `ApiController`: public class MyModelController : ApiController { ... // POST /mymodel public MyModel Post(MyModel model) { ... } // POST /mymodel/upload [ActionName("Upload")] public HttpResponseMessage UploadModelImage() { HttpRequestMessage request = Request; if (!request.Content.IsMimeMultipartContent()) { throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.UnsupportedMediaType, request)); } ... } } The first action (default `POST` action) is used to create a new `MyModel` object from the JSON passed to the service. The user of our portal has the option to upload an image as part of creating a new `MyModel` object in which case we use the second `Upload` action to save the file and persist the new object to the database. This action reads the multipart request content, parses out the properties for the model and saves the image uploaded to our CDN. Since our switch to the RC, **the upload action (http://www.myapidomain.com/mymodel/upload) goes through fine, but the regular `POST` action (http://www.myapidomain.com/mymodel/) fails** with the `Multiple actions were found that match the request ...` exception citing both the methods listed above as the conflicts. Here are our routes: routes.MapHttpRoute( "Default", // route name "{controller}" // route template ); routes.MapHttpRoute( "OnlyId", // route name "{controller}/{id}", // route template new {}, // defaults new {controller = @"[^0-9]+", id = @"[0-9]+"} // constraints ); routes.MapHttpRoute( "OnlyAction", // route name "{controller}/{action}", // route template new {}, // defaults new {controller = @"[^0-9]+", action = ActionNameConstraint.Instance} // constraints ); routes.MapHttpRoute( "DependantAction", // route name "{controller}/{principalId}/{action}/{dependentId}", // route template new {dependentId = System.Web.Http.RouteParameter.Optional}, // defaults new {controller = @"[^0-9]+", action = ActionNameConstraint.Instance} // constraints ); `ActionNameConstraint` is just a custom constraint that ensures that the `{action}` must belong to the `{controller}` **QUESTION** I've tried messing with the routes in different orders to see if that would fix the issue with no luck. I'm looking for help with any of the following solutions: 1. A potential issue in our routes. 1. An alternative solution for routing by `content-type`. The `Upload` action only needs to be called for mult-part form posts. If the content type is JSON or XML, the regular action should be used. I haven't been able to find any resources that suggest this can be done, but I'm hoping someone else has considered this. 1. A model-binding approach for reading file streams from the request content so we don't need the separate `Upload` action anymore
0
[ 2, 307, 8990, 300, 2741, 21, 2159, 19880, 2930, 800, 3726, 3726, 13, 1409, 12565, 1409, 95, 114, 6667, 37, 307, 8990, 300, 2741, 21, 2159, 8434, 20, 14, 16462, 17, 95, 22, 99, 946, 77, 21, 13, 1, 21531, 5106, 3078, 46, 216, 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...
Controlling speed of animation via a selector form === I want to make the speed of an animation selectable. I've written the following code but I cant work out whats stopping it from working. If I remove $("#speed").val(); and replace it with a value, it works fine. Any ideas will be greatly received! <div class="lowerthird"> </div> <button onclick="lowerthirdout();">Lower Third Out</button> <select id="speed"> <option value="1000">Fast</option> <option value="2000">Medium</option> <option value="5000">Slow</option> <option value="0">None</option> </select> function lowerthirdout(){ var speed = $("#speed").val(); $(".lowerthird").animate({ left: "640px", }, speed ); }
0
[ 2, 10106, 1362, 16, 6236, 1197, 21, 23946, 505, 800, 3726, 3726, 31, 259, 20, 233, 14, 1362, 16, 40, 6236, 5407, 579, 9, 31, 22, 195, 642, 14, 249, 1797, 47, 31, 2973, 170, 70, 98, 18, 7048, 32, 37, 638, 9, 100, 31, 4681, 55...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
php returning too early === I make a call to a php file using jquery's ajax function. It goes to the file, as it should and starts executing commands. I have multiple $stmt->execute(); calls, which are mysqli update queries. But only the first one will execute, and after-which it will return instead of executing the next query. What should I look for that might be causing this issue?
0
[ 2, 13, 26120, 2485, 266, 274, 800, 3726, 3726, 31, 233, 21, 645, 20, 21, 13, 26120, 3893, 568, 487, 8190, 93, 22, 18, 20624, 1990, 9, 32, 1852, 20, 14, 3893, 15, 28, 32, 378, 17, 3244, 25836, 14294, 9, 31, 57, 1886, 5579, 384,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
File created from Android app is not visible until renamed === everybody! I create a file in my android app with this code, run in UI thread: final File dir = Environment.getExternalStorageDirectory(); final File file = new File(dir, "file" + System.currentTimeMillis()); //$NON-NLS-1$ try { file.createNewFile()) } catch (Exception e) { ... } and I can't see it on my Win7 PC, until I rename the file on the phone with the file browser. I run the program on Samsung Galaxy Nexus, OS ver 4.0.2. What might be wrong? Thanks.
0
[ 2, 3893, 679, 37, 13005, 4865, 25, 52, 4560, 163, 2433, 800, 3726, 3726, 8903, 187, 31, 1600, 21, 3893, 19, 51, 13005, 4865, 29, 48, 1797, 15, 485, 19, 13, 5661, 9322, 45, 426, 3893, 13, 9035, 800, 2307, 9, 834, 11969, 106, 5025...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
iPhone xCode 4.3.3 how to add OpenEars 1.1 to xCode project? === I've just updated to xCode 4.3.3 and am trying to run the demo app OpenEarsSampleApp provided with the open ears library. The app does not work out of the box and does not compile with the error below. For some reason, I'm getting the header not found error. The framework is added to the build phase, and there' a "framework search path" set (I think)correctly in the project settings. Yet it appears that none of the framework headers can be found. **Has anyone else been unable to open the Sample app included with OpenEars 1.1? How did you resolve the issue?** ![Open ears sample app error][1] [1]: http://i.stack.imgur.com/aPs93.png
0
[ 2, 21024, 993, 9375, 268, 9, 240, 9, 240, 184, 20, 3547, 368, 10717, 18, 137, 9, 165, 20, 993, 9375, 669, 60, 800, 3726, 3726, 31, 22, 195, 114, 6372, 20, 993, 9375, 268, 9, 240, 9, 240, 17, 589, 749, 20, 485, 14, 8376, 4865...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Where is a good place to start with programing a random path on a grid? === Im not sure where to start with this, Im not asking for someone else to do it for me but im not sure how to do it so if anyone can point me in the right direction that would be great, i cant find anything using google, here is what i need: I need to create a path from one side of the grid to the other, but not in the shortest in a random way, i need to make sure that if the path is parallel to another part of the path that it is atleast 2 units apart. thanks in advance
0
[ 2, 113, 25, 21, 254, 209, 20, 799, 29, 625, 68, 21, 5477, 2013, 27, 21, 7354, 60, 800, 3726, 3726, 797, 52, 562, 113, 20, 799, 29, 48, 15, 797, 52, 3379, 26, 737, 962, 20, 107, 32, 26, 55, 47, 797, 52, 562, 184, 20, 107, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
how to add the custom elements in the RTF field of a component in SDL Tridion 2011 Sp1 === I want to add the custom elements in the source of Rich Text field in tridion. Is there any chance to add them by changing the xsl filtering in schema. Example: I have a RTF field "text" in tridion. I want to add some thing like this. <text> <customelement>the text added through the custom element</customelement> </text> Can some help on this. Thanks.
0
[ 2, 184, 20, 3547, 14, 5816, 2065, 19, 14, 761, 11720, 575, 16, 21, 5912, 19, 13, 18, 8643, 2286, 43, 872, 542, 3782, 165, 800, 3726, 3726, 31, 259, 20, 3547, 14, 5816, 2065, 19, 14, 1267, 16, 2042, 1854, 575, 19, 2286, 43, 872...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
DRM. Adobe Media Server === I have heard that Adobe Media Server 5 provides DRM security over videos even playback. I want to know your opinions guys how does it work completely? Do I need to host videos and install this app on my server or on adobe's server? How this will encrypt video contents? How it will get encrypted via adobe media player? I have done a bit research over Adobe and Google but couldn't understand what I was looking for so wanting now real time user experience. thanks, Pras
0
[ 2, 744, 79, 9, 20299, 941, 8128, 800, 3726, 3726, 31, 57, 752, 30, 20299, 941, 8128, 331, 1927, 744, 79, 1221, 84, 6610, 166, 21306, 9, 31, 259, 20, 143, 154, 11900, 2776, 184, 630, 32, 170, 1524, 60, 107, 31, 376, 20, 2015, 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...
Which framework should I use for mail application for iPad === I want to prepare the application for iPad to access the mails from the server through IMAP. I have to prepare the local storage for the mails so that all mails get accessed even without internet connection and I also have to perform the other mail services like sending, forwarding, INBOX, deletion, reply, reply all and save as draft functionality for the mails that are coming from the server. So Which framework should I have to use so that all things get possible by that framework or may create less problems by using it. So, which one is the best framework for me. Because after using some framework if found that something is not possible from the framework which I have used then it founds to be more problematic. So please advice me... if you have anything about it. It will be appreciated.
0
[ 2, 56, 6596, 378, 31, 275, 26, 4216, 3010, 26, 31, 8240, 800, 3726, 3726, 31, 259, 20, 5723, 14, 3010, 26, 31, 8240, 20, 1381, 14, 4216, 18, 37, 14, 8128, 120, 31, 15022, 9, 31, 57, 20, 5723, 14, 375, 4326, 26, 14, 4216, 18,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Magento displays errors in server after upgrade === I upgraded my magento site .the upgrading completed without errors. But when i loading site in browser i got duplicate entry errors ,So i clear the database and again take the url in browser.But now i got this error: Mage_Eav_Exception Object ( [_messages:protected] => Array ( ) [message:protected] => Maximum length of attribute code must be less then 30 symbols [string:Exception:private] => [code:protected] => 0 [file:protected] => /var/www/magento_upgrade/app/Mage.php [line:protected] => 579 [trace:Exception:private] => Array ( [0] => Array ( [file] => /var/www/magento_upgrade/app/code/core/Mage/Eav/Model/Entity/Attribute.php [line] => 158 [function] => exception [class] => Mage [type] => :: [args] => Array ( [0] => Mage_Eav [1] => Maximum length of attribute code must be less then 30 symbols ) ) [1] => Array ( [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/Abstract.php [line] => 316 [function] => _beforeSave [class] => Mage_Eav_Model_Entity_Attribute [type] => -> [args] => Array ( ) ) [2] => Array ( [file] => /var/www/magento_upgrade/app/code/community/Biebersdorf/CustomerOrderComment/sql/customerordercomment_setup/mysql4-install-0.0.3.php [line] => 49 [function] => save [class] => Mage_Core_Model_Abstract [type] => -> [args] => Array ( ) ) [3] => Array ( [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/Resource/Setup.php [line] => 624 [args] => Array ( [0] => /var/www/magento_upgrade/app/code/community/Biebersdorf/CustomerOrderComment/sql/customerordercomment_setup/mysql4-install-0.0.3.php ) [function] => include ) [4] => Array ( [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/Resource/Setup.php [line] => 421 [function] => _modifyResourceDb [class] => Mage_Core_Model_Resource_Setup [type] => -> [args] => Array ( [0] => install [1] => [2] => 0.1.3 ) ) [5] => Array ( [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/Resource/Setup.php [line] => 327 [function] => _installResourceDb [class] => Mage_Core_Model_Resource_Setup [type] => -> [args] => Array ( [0] => 0.1.3 ) ) [6] => Array ( [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/Resource/Setup.php [line] => 235 [function] => applyUpdates [class] => Mage_Core_Model_Resource_Setup [type] => -> [args] => Array ( ) ) [7] => Array ( [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/App.php [line] => 417 [function] => applyAllUpdates [class] => Mage_Core_Model_Resource_Setup [type] => :: [args] => Array ( ) ) [8] => Array ( [file] => /var/www/magento_upgrade/app/code/core/Mage/Core/Model/App.php [line] => 343 [function] => _initModules [class] => Mage_Core_Model_App [type] => -> [args] => Array ( ) ) [9] => Array ( [file] => /var/www/magento_upgrade/app/Mage.php [line] => 683 [function] => run [class] => Mage_Core_Model_App [type] => -> [args] => Array ( [0] => Array ( [scope_code] => [scope_type] => store [options] => Array ( ) ) ) ) [10] => Array ( [file] => /var/www/magento_upgrade/index.php [line] => 87 [function] => run [class] => Mage [type] => :: [args] => Array ( [0] => [1] => store ) ) ) [previous:Exception:private] => ) How can i solve this? Or what i do here?
0
[ 2, 4723, 17050, 9412, 11908, 19, 8128, 75, 9483, 800, 3726, 3726, 31, 9958, 51, 4723, 17050, 689, 13, 9, 124, 26939, 1066, 366, 11908, 9, 47, 76, 31, 12797, 689, 19, 16495, 31, 330, 19429, 2792, 11908, 13, 15, 656, 31, 1207, 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...
What is the name and location of the Nginx config file (htaccess equivalent)? === There are many [tutorials][1] on how to write Nginx rewrite rules to mimic Apache's .htaccess file but I can't confidently say I know what the name or location of this so-called Nginx config file actually is. I'm specifically looking for the Nginx config file that allows you to write server path and PHP directives. I'm using Ubuntu 12 linux and Codeigniter as my PHP framework. Here's what I know so far: 1. This file: `/etc/nginx/nginx.conf` despite its enticing name is apparently not the place for server directives. 2. This file: `/etc/nginx/sites-available/default` seems like what I need (i'm able to generate php errors specific to my app) but I can't get the Codeigniter-specific path routing correct. First of all, is this the "config" file/.htaccess equivalent everyone speaks of? Any guidance would be greatly appreciated. [1]: http://hiteshjoshi.com/linux/secure-nginx-and-codeigniter-configuration.html
2
[ 2, 98, 25, 14, 204, 17, 1474, 16, 14, 13, 2723, 108, 396, 13, 14093, 2816, 3893, 13, 5, 9020, 20604, 4602, 6, 60, 800, 3726, 3726, 80, 50, 151, 636, 2473, 9819, 192, 18, 500, 2558, 165, 500, 27, 184, 20, 2757, 13, 2723, 108, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
iAds still show test ads === I just released an app into the app store with iAds, however the app is still only showing the test ads. But the thing is it says "live" on itunesconnect. What is wrong with my ads?
0
[ 2, 31, 1283, 18, 174, 298, 1289, 16236, 800, 3726, 3726, 31, 114, 261, 40, 4865, 77, 14, 4865, 1718, 29, 31, 1283, 18, 15, 207, 14, 4865, 25, 174, 104, 3187, 14, 1289, 16236, 9, 47, 14, 584, 25, 32, 898, 13, 7, 5928, 7, 27, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
multiple linefeeds are consolidated in git commit message === I'm using msys git and one thing I've noticed is that when I am in vi and I write a commit message that contains two or more linefeeds that when it is actually committed there will only be a single linefeed. If I write this: my first commit Hello out there from the first line. Hello out there from two linefeeds below. <br> It will be committed as: my first commit Hello out there from the first line. Hello out there from two linefeeds below. <br> Does anyone using msys git notice this and how can I stop it from happening? git version 1.7.10.msysgit.1 Thanks
0
[ 2, 1886, 293, 20954, 18, 50, 10730, 19, 13, 10404, 9686, 2802, 800, 3726, 3726, 31, 22, 79, 568, 4235, 93, 18, 13, 10404, 17, 53, 584, 31, 22, 195, 2711, 25, 30, 76, 31, 589, 19, 1790, 17, 31, 2757, 21, 9686, 2802, 30, 1588, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Generate random password? === How to generate a random password of fixed length in ASP.net (no GUID) ? After generating the random password, I need to email the password to the specified user.
0
[ 2, 7920, 5477, 20884, 60, 800, 3726, 3726, 184, 20, 7920, 21, 5477, 20884, 16, 3535, 1476, 19, 28, 306, 9, 2328, 13, 5, 251, 9457, 43, 6, 13, 60, 75, 13500, 14, 5477, 20884, 15, 31, 376, 20, 8517, 14, 20884, 20, 14, 9931, 4155...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
Message Attributes and Payload in RabbitMQ === I am using AMQP Java client i want to use message attributes properties like ,Message priority,Delivery mode, Message publishing timestamp,Expiration period, etc.how to set it on channel.basicPublish();
0
[ 2, 2802, 13422, 17, 18348, 19, 8335, 79, 1251, 800, 3726, 3726, 31, 589, 568, 589, 1251, 306, 8247, 6819, 31, 259, 20, 275, 2802, 13422, 3704, 101, 13, 15, 3845, 18, 1303, 9857, 15, 29731, 93, 3740, 15, 2802, 3107, 436, 38, 10158,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
NFS server and client installation in ubuntu === I have installed NFS server and Client on separate machines. The problem is when i mount the shared directory on client side using command > mount server_addr:server_dir client_dir But it gives an error saying that > don't have permission to share this directory (can't access the server_dir) Though I have given read-write (rw) permissions to the client by updating /etc/exports file in server as > server_dir client_ip(rw,sync,no_root_squash) But still giving error as access denied on client side. Any kind of help/suggestions are appreciated.
0
[ 2, 13, 11408, 18, 8128, 17, 6819, 7758, 19, 287, 12968, 2473, 800, 3726, 3726, 31, 57, 4066, 13, 11408, 18, 8128, 17, 6819, 27, 1725, 6035, 9, 14, 1448, 25, 76, 31, 2149, 14, 2592, 16755, 27, 6819, 270, 568, 1202, 13, 1, 2149, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Cython cdef no speed increase === I finally got cython working thanks to some of the people here on stackoverflow, but now there is a problem. There really isn't a speed increase from when i don't use cdef to when i do use cdef. Don't get me wrong there was a very noticable speed increase when i compiled the python code using cython, but notsomuch when i use cdef. This is the area of the code that was slowing down the rest of the program: def tupdate(self,surf): cdef int x cdef int y for x in xrange(self.w): for y in xrange(self.h): if self.map[(x,y)].y <= 600 and self.map[(x,y)].y >= -50: self.map[(x,y)].FLAG = 1 else: self.map[(x,y)].FLAG = 0 self.map[(x,y)].y += self.speed if self.map[(x,y)].FLAG: self.map[(x,y)].rect = ((self.map[(x,y)].x,self.map[(x,y)].y),(50,25)) self.map[(x,y)].update() self.map[(x,y)].render(surf) This code *should* be getting called 60 times a second, but due to the speed of the code and my older hardware its only getting called about 30 times a second, I figured using cdef for such intensely used vars like the x and y would help. But the fps is the same before and after cdef. I'm on windows 7 64bit using 32bit python 2.7
0
[ 2, 6728, 11570, 272, 13862, 90, 1362, 1839, 800, 3726, 3726, 31, 722, 330, 6728, 11570, 638, 3669, 20, 109, 16, 14, 148, 235, 27, 7566, 2549, 9990, 15, 47, 130, 80, 25, 21, 1448, 9, 80, 510, 2532, 22, 38, 21, 1362, 1839, 37, 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...
SqlConnection On Before Close event? === I'm wondering if there's an event I could handle where the event fires just before the SqlConnection closes ie: `OnBeforeClose` ? What I want to achieve is - to call `sp_unsetapprole` in SQL Server so that when the connection is closed and returned back to the connection poll - so it has no approle attached to it. At first I thought I could handle the `StateChange` event - but I believe it's already too late. The current workaround for me is to manually call `sp_unsetapprole` on the SqlConnection caller. Much appreciated for your attention + time ! YS.
0
[ 2, 4444, 255, 25996, 872, 27, 115, 543, 807, 60, 800, 3726, 3726, 31, 22, 79, 5712, 100, 80, 22, 18, 40, 807, 31, 110, 3053, 113, 14, 807, 11327, 114, 115, 14, 4444, 255, 25996, 872, 543, 18, 13, 660, 45, 13, 1, 218, 12750, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Parse XML file and get next file === I am trying to parse a xml file and then request and get the next xml file based on the last node in the xml file. My XML looks like this: file1.xml <file> <name1> <first>Bob</first> <last>smith</last> </name1> <name2> <first>Jack</first> <last>Happy</last> </name2> <name3> <first>Joe</first> <last>Brown</last> </name3> </file> I am using the following JavaScript: function getfile(file) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } try { var first = xmlDoc.getElementsByTagName("first")[0]; first = first.childNodes.length ? first.childNodes [0].nodeValue : "" ; var last = xmlDoc.getElementsByTagName("last")[0]; last = last.childNodes.length ? last.childNodes[0].nodeValue : "" ; var htmlSelect = document.getElementById("user_list") //html select box var selectBoxOption = document.createElement("option"); //create new option selectBoxOption.value = first; //set option value selectBoxOption.text = first; //set option display text htmlSelect.add(selectBoxOption, null); //add created option to select box. } catch(err){} var url = "http://192.168.0.5/file" + file + ".xml"; // URL xmlhttp.open("POST",url,true); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; } My HTML page looks like this: <select id="user_list" name="user_list" size="21" style="width:200px;"> </select> What I am trying to do is when I request for file1 it will reply back with the xml file as per the above xml file. I want to then add the node values (first and last) from the xml file to my select box and then when it gets to the end go and request file4.xml as node 3 is the last node in the xml file. For Example: I want it to add..Bob Smith, Jack Happy, Joe Brown, to my select box then request file4.xml (as 3 nodes + 1) Then do the same, add the node values to the selectbox and then request the next xml file based on how many nodes there are + 1 I can't seem to work it out and can only come up with the above JavaScript. Anyone able to help me out? I can't use jQuery to do this and I have checked out w3schools and still can't work it out.
0
[ 2, 2017, 870, 23504, 3893, 17, 164, 328, 3893, 800, 3726, 3726, 31, 589, 749, 20, 2017, 870, 21, 23504, 3893, 17, 94, 3772, 17, 164, 14, 328, 23504, 3893, 432, 27, 14, 236, 15421, 19, 14, 23504, 3893, 9, 51, 23504, 1879, 101, 48...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Android: AsyncTask not working as expected === I have an app where there is a AutoCompleteTextView. On every text change event, the app goes on to the web to retrieve some content from the internet and populates the dropdown for the TextView. I have used AsyncTask for doing the web content read. However, if new text is typed before the content is received and populated, the app is hanging till the old content is fetched. Is there a way to get around the problem? My AsyncTask is as follows, private class GetSuggestions extends AsyncTask<String, Void, String> { @Override protected String doInBackground(String... params) { System.out.println("Suggestions Called()"); doSearch(params[0]); // reads the web and populates the suggestions ArrayList return null; } @Override protected void onPostExecute(String result) { System.out.println("Adapter Called() " + suggestions.size()); suggestionAdapter = new ArrayAdapter<String>( getApplicationContext(), R.layout.list, suggestions); searchText.setAdapter(suggestionAdapter); } } Thx! Rahul.
0
[ 2, 13005, 45, 21, 9507, 20255, 3656, 52, 638, 28, 1727, 800, 3726, 3726, 31, 57, 40, 4865, 113, 80, 25, 21, 3108, 15990, 11969, 4725, 9, 27, 352, 1854, 753, 807, 15, 14, 4865, 1852, 27, 20, 14, 2741, 20, 11917, 109, 2331, 37, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
how to pass on order argument when creating a new order through webserice using beeColonyUser.newOrder === I am using drupal 6.x with beecolony module 2.x... when creating a new order(beeColonyUser.newOrder) through webservice(java) it asks me to pass on **Session ID** and **order** how to pass the struct **order** in java ...
0
[ 2, 184, 20, 1477, 27, 389, 5476, 76, 2936, 21, 78, 389, 120, 2741, 870, 12412, 568, 12092, 12805, 1536, 16704, 9, 2681, 7861, 800, 3726, 3726, 31, 589, 568, 15708, 6720, 400, 9, 396, 29, 12092, 12805, 1536, 12613, 172, 9, 396, 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...
Which file access is the best : Webdav or FTP? === I have to develop a Java application that has to read some files on the network, edit them and put them back. The problem is that I always did (over the network) file operations through the FTP protocol. But, I recently heard about Webdav which is HTTP based. Did anyone notice a difference (in terms of speed) between them ? Which one is the best ? Why did they "invent" Webdav if the FTP is good for that ? Thanks.
0
[ 2, 56, 3893, 1381, 25, 14, 246, 13, 45, 2741, 43, 5214, 54, 1187, 306, 60, 800, 3726, 3726, 31, 57, 20, 2803, 21, 8247, 3010, 30, 63, 20, 1302, 109, 6488, 27, 14, 982, 15, 9392, 105, 17, 442, 105, 97, 9, 14, 1448, 25, 30, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Getting a float from /dev/urandom === How can I get a random float value from `/dev/urandom`? If I simply use a cast, by saying: int fd = ::open("/dev/urandom", O_RDONLY); uint32_t n; read(fd, &n, sizeof(n)); float f = n; ...I'm not sure if I have a guarantee of portability, because I don't know if large values of `n` will necessarily be unrepresentable as `f`? Is MAXUINT guaranteed to be representable as a `float`?
0
[ 2, 1017, 21, 11510, 37, 13, 118, 14438, 118, 17692, 5555, 800, 3726, 3726, 184, 92, 31, 164, 21, 5477, 11510, 1923, 37, 13, 1, 118, 14438, 118, 17692, 5555, 1, 60, 100, 31, 1659, 275, 21, 1325, 15, 34, 1148, 45, 19, 38, 398, 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...
not UTF-8 files + java + UTF-8 database === My website has plain text upload functionality. Users can upload different encoded files. I need to make some preprocessing but finally I want to save content from those files to the UTF-8 encoded text column on my database. I know that Java is really user-unfriendly in such cases, but what is the best approach to implement it?
0
[ 2, 52, 287, 11720, 8, 457, 6488, 2754, 8247, 2754, 287, 11720, 8, 457, 6018, 800, 3726, 3726, 51, 2271, 63, 3748, 1854, 71, 8294, 18548, 9, 3878, 92, 71, 8294, 421, 13665, 6488, 9, 31, 376, 20, 233, 109, 782, 16835, 68, 47, 722,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Interchangin ampersand and word and in search === Can “&” and “and” work interchangebly like synonms when doing exact match “mac & cheese” So for e.g If i were to search mac & cheese, it matches mac & cheese mac-n-cheese mac and cheese It would be great if it did when I do exact match, q="mac & cheese". Any suggestions?
0
[ 2, 1480, 16180, 108, 589, 7490, 290, 17, 833, 17, 19, 2122, 800, 3726, 3726, 92, 13, 1, 1569, 1, 17, 13, 1, 290, 1, 170, 6617, 8818, 101, 6063, 218, 79, 18, 76, 845, 5340, 730, 13, 1, 6893, 279, 7372, 1, 86, 26, 13, 62, 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...
Tutorial paperclip rails 3 === **I have a problems to save a user:** Can't mass-assign protected attributes: photo I really need help
1
[ 2, 29724, 1397, 150, 6013, 2240, 18, 203, 800, 3726, 3726, 13, 1409, 49, 57, 21, 1716, 20, 2079, 21, 4155, 45, 1409, 92, 22, 38, 1619, 8, 472, 11255, 3803, 13422, 45, 3056, 31, 510, 376, 448, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
View.OnKeyListener worked once for my activity, does not work anymore === I have an Activity that implemented `View.OnKeyListener` so that it could catch when the user hit the back button and would pop up a dialog. Previously, it worked just fine. Recently, however, it has stopped working and the app would just pretend that there was no `onKey` method to catch the Back button. I can't seem to figure out why, as I've barely touched the `onKey` method since I made the changes. I tried just using `OnBackPressed()` instead, but that didn't solve anything and in fact created weird and unpredictable behavior. Can anyone help me figure out why it seems like my app is letting the system take the reigns on the back button? Here's the important parts of my implementation: import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.SherlockFragmentActivity; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; import com.actionbarsherlock.view.MenuInflater; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.KeyEvent; import android.view.View; public class NagTasksAddTasksActivity extends SherlockFragmentActivity implements View.OnKeyListener { //various parameters public void onCreate(Bundle savedInstanceBundle) { super.onCreate(savedInstanceBundle); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); String setTheme = prefs.getString("themeselect", "Dark Overflow"); if (setTheme.toLowerCase().contentEquals("dark overflow")){ setTheme(R.style.Theme_Sherlock_ForceOverflow); } else if (setTheme.toLowerCase().contentEquals("light overflow")){ setTheme(R.style.Theme_Sherlock_Light_ForceOverflow); isDarkThemeUsed = false; } else if (setTheme.toLowerCase().contentEquals("dark menu")){ setTheme(R.style.Theme_Sherlock); } else if (setTheme.toLowerCase().contentEquals("light menu")){ setTheme(R.style.Theme_Sherlock_Light); isDarkThemeUsed = false; } setContentView(R.layout.createtasklayout); ActionBar actionBar = getSupportActionBar(); setTitle(R.string.newTask); } ... @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setCancelable(true); builder.setTitle(R.string.wait); builder.setMessage(R.string.confirmbackkey); builder.setPositiveButton(R.string.save, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //stuff dialog.dismiss(); } }); builder.setNegativeButton(R.string.discard, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { AlertDialog.Builder subBuilder = new AlertDialog.Builder(getParent()); subBuilder.setCancelable(true); subBuilder.setTitle(R.string.wait); subBuilder.setMessage(R.string.confirmdiscard); subBuilder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //more stuff dialog.dismiss(); } }); subBuilder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); dialog.dismiss(); subBuilder.create().show(); } }); builder.setNeutralButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); builder.create().show(); return true; } return false; } }
0
[ 2, 1418, 9, 218, 4237, 13891, 106, 577, 382, 26, 51, 2358, 15, 630, 52, 170, 3375, 800, 3726, 3726, 31, 57, 40, 2358, 30, 6807, 13, 1, 4725, 9, 218, 4237, 13891, 106, 1, 86, 30, 32, 110, 2949, 76, 14, 4155, 770, 14, 97, 5167...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
distutils does not install package_data on windows === i've got the following line in my `setup.py` for one of my projects (full script at bottom of question): import os from distutils.core import setup # ... setup( # ... package_data={ 'mesh.binding': ['templates/*'], 'mesh.documentation': ['templates/*'], }, # ... ) this installs the contents of `mesh/binding/templates` to the `site-packages/mesh/binding/templates` directory on Linux and OS X, but does not succeed on windows. **how do i get this to work on windows?** i'm new to `distutils`, so forgive me if i'm forgetting something important. i'm using `setuptools 0.6` and `python 2.7`. ## pertinent files ### `setup.py`: import os from distutils.core import setup version = '1.0.0' try: revision = os.environ['REVISION'] except Exception: pass else: version = revision packages = [] for root, dirs, files in os.walk('mesh'): if '__init__.py' in files: packages.append(root.replace('/', '.')) setup( name='mesh', version=version, description='A declarative RESTful API framework.', author='Jordan McCoy', author_email='mccoy.jordan@gmail.com', license='BSD', url='http://github.com/siq/mesh', packages=packages, package_data={ 'mesh.binding': ['templates/*'], 'mesh.documentation': ['templates/*'], }, classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Code Generators', 'Topic :: Software Development :: Libraries :: Application Frameworks', 'Topic :: Software Development :: Libraries :: Python Modules', ] ) ### `MANIFEST.in`: recursive-include mesh/binding/templates *.tmpl recursive-include mesh/documentation/templates *.tmpl include LICENSE include requirements.txt include *.rst recursive-include tests *.py recursive-include examples *.rst *.py include docs/conf.py docs/Makefile recursive-include docs *.rst recursive-include docs/_static *.css recursive-include docs/_templates *.html
0
[ 2, 1460, 38, 14255, 18, 630, 52, 16146, 6030, 1, 18768, 27, 1936, 800, 3726, 3726, 31, 22, 195, 330, 14, 249, 293, 19, 51, 13, 1, 3554, 576, 9, 6448, 1, 26, 53, 16, 51, 2314, 13, 5, 13727, 3884, 35, 2129, 16, 1301, 6, 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...
Google Column Chart cropping the bars === I am trying to display data using Google's Column chart. I tried displaying bars not stacked but it would not display one bar from both ends. Then i changed the property `isStacked` to `true`, it displays all the bars but it crops the bar at the both ends. ![Google Column Chart](http://i45.tinypic.com/3h4za.png) How can i fix this issue? I was playing around with the options but nothing seems to work. <script type='text/javascript'> google.load('visualization', '1', { 'packages': ['corechart'] }); google.setOnLoadCallback(drawSizeChart); var d = 0; function drawSizeChart() { $.post('/metrics/SiteResourceChart', { fnsId: "@Model.FnsId", regionId: selectedValue }, function (data) { if (Object.keys(data).length !== 0) { var tdata = new google.visualization.DataTable(); tdata.addColumn('date', 'Date'); for (var p = 0; p < data.length; ++p) { tdata.addColumn('number', data[p][0].PathName); } d = data[0].length; for (var i = 0; i < data.length; ++i) { for (var j = 0; j < data[i].length; ++j) { var date = new Date(parseInt(data[i][j].CreatedAt.substr(6))); var rCount = data[i][j].ResourceCount; if (i === 0) tdata.addRow([date, rCount, null]); else tdata.addRow([date, null, rCount]); } } var options = { title: 'Resource Count', titleTextStyle: { fontSize: 20 }, isStacked: true, bar: { groupWidth: '20%' }, chartArea: { left: '50' }, hAxis: { viewWindowMode: 'maximized' } //legend: { position: 'none' } }; var chart = new google.visualization.ColumnChart(document.getElementById('site_size_chart')); chart.draw(tdata, options); } } ); } </script>
0
[ 2, 8144, 4698, 1795, 4880, 5574, 14, 6062, 800, 3726, 3726, 31, 589, 749, 20, 3042, 1054, 568, 8144, 22, 18, 4698, 1795, 9, 31, 794, 17418, 6062, 52, 20054, 47, 32, 83, 52, 3042, 53, 748, 37, 156, 3451, 9, 94, 31, 1015, 14, 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 update database using datagridview? === how do we update tables using datagridview? assuming the datagridview is editable at runtime? any kind of help is appreciated. Dim con As New OleDb.OleDbConnection Dim dbProvider As String Dim dbSource As String Dim ds As New DataSet Dim da As OleDb.OleDbDataAdapter Dim sql As String Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load dbProvider = "PROVIDER=Microsoft.ACE.OLEDB.12.0;" dbSource = "Data Source = C:\record.accdb" con.ConnectionString = dbProvider & dbSource con.Open() sql = "SELECT * FROM StudentRecords" da = New OleDb.OleDbDataAdapter(sql, con) da.Fill(ds, "AddressBook") MsgBox("Database is now open") con.Close() MsgBox("Database is now Closed") DataGridView1.DataSource = ds DataGridView1.DataMember = "AddressBook" End Sub
0
[ 2, 184, 20, 11100, 6018, 568, 1054, 16375, 4725, 60, 800, 3726, 3726, 184, 107, 95, 11100, 7484, 568, 1054, 16375, 4725, 60, 11704, 14, 1054, 16375, 4725, 25, 9392, 579, 35, 485, 891, 60, 186, 825, 16, 448, 25, 13746, 9, 5937, 106...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Mysql, select max and match value === I have a table with dates and values. What I'm trying to do is to get the MAX() value of values and the date that corresponds to that value. i.e. dates: 2012-05-01,2012-05-02,2012-05-03,2012-04-02,2012-05-02 values 80, 50, 52, 100 , 10 The output that I want is 2012-04-02 - 100 This is my query: SELECT pdate,MAX(Score) as maxscore FROM tblpulse WHERE DID = '171488' && pdate BETWEEN '2012-05-02' AND '2012-06-26' and pdate ORDER BY pdate ASC
0
[ 2, 51, 18, 22402, 15, 5407, 2049, 17, 730, 1923, 800, 3726, 3726, 31, 57, 21, 859, 29, 4076, 17, 4070, 9, 98, 31, 22, 79, 749, 20, 107, 25, 20, 164, 14, 2049, 5, 6, 1923, 16, 4070, 17, 14, 1231, 30, 17016, 20, 30, 1923, 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...
Is there any alternate way to avoid genuine memory build up issues in c? === I have a program which reads all the file system file/dir names, size etc. and populate in tree data structure. once this is done, it will generate a report. I have a worry on this, if file system has more number of files and dir. It will end up in genuine memory build up and results memory unavailable (malloc may fail for genuine reason). Is there any way to handle this genuine memory build?
0
[ 2, 25, 80, 186, 4912, 161, 20, 2658, 10701, 1912, 1895, 71, 1549, 19, 272, 60, 800, 3726, 3726, 31, 57, 21, 625, 56, 11137, 65, 14, 3893, 329, 3893, 118, 9035, 1817, 15, 1072, 2722, 9, 17, 1675, 12383, 19, 1541, 1054, 1411, 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...
Make APScheduler run in background in web app === I have a Flask web app, that shows information from a rss feed. I want to process the rss feed regularly, e.g every 30 minutes. Extract some of the information and store it in a sqlite db. But I can't figure out how to schedule a function to certain intervals. I have used the APScheduler, and my code is the following: def main(): # Start the scheduler filename = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'tmp')) + '\\' + 'spider.log' logging.basicConfig(filename=filename, level=logging.DEBUG,format='%(levelname)s[%(asctime)s]: %(message)s') sched = Scheduler() sched.start() sched.add_interval_job(run_job, minutes=30) time.sleep(9999) I have a **run.py** function from app import app, spider spider.main() app.run(debug=True) The `app.run(debug=True)` starts the Flask web app. The problem is that the code never reaches `app.run`. So is it possible to spawn another process to handle the `spider.main()` call, and run the process in the background? Or should I use another approach? **NB:** I know I could use Flask-Celery, but for this small app, that seems too heavyweight...
0
[ 2, 233, 8442, 7526, 11203, 106, 485, 19, 2395, 19, 2741, 4865, 800, 3726, 3726, 31, 57, 21, 28972, 2741, 4865, 15, 30, 1285, 676, 37, 21, 13, 1224, 18, 4063, 9, 31, 259, 20, 953, 14, 13, 1224, 18, 4063, 4217, 15, 13, 62, 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...
most efficient way to compare short string with small dictionary (parsing) === I'm trying to optimize my simple C interpretter that I made just for fun, I am doing parsing like this - firstly I parse file into tokens inside doubly linked list, then I do syntax and semantic analysis.<br/> I want to optimize function with this prototype: bool parsed_keyword(struct token *, char dictionary[][]); Inside the function I basically call strcmp against *all keywords* and edit token type. This of course lead to 20 strcmp calls for each string that is being parsed (almost). I was thinking Rabin-Karp would be best, but it sounds to me like it isn't best suited for this job (matching one word against small dictionary). What would be the best algoritm to do this work? Thanks for any suggestions.
0
[ 2, 127, 8243, 161, 20, 11590, 502, 3724, 29, 284, 9186, 13, 5, 3574, 18, 68, 6, 800, 3726, 3726, 31, 22, 79, 749, 20, 22864, 51, 1935, 272, 11584, 815, 30, 31, 117, 114, 26, 2414, 15, 31, 589, 845, 2017, 18, 68, 101, 48, 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...
Lync sdk automation dial number === I just started to work with Lync API using SDK. Is it possible to call someone who is not in contact list using mobile phone number? Here is my code (I use automation for this): LyncClient lyncClient = LyncClient.GetClient(); var automation = LyncClient.GetAutomation(); var conversationModes = AutomationModalities.Audio; var conversationSettings = new Dictionary<AutomationModalitySettings, object>(); List<string> participants = new List<string>(); var contact = lyncClient.ContactManager.GetContactByUri("+1 (111) 1111111"); participants.Add(contact.Uri); automation.BeginStartConversation(AutomationModalities.Audio, participants, null, StartConversationCallback, automation); If user with phone `+1 (111) 1111111` exists in my contact list it works fine, but if user doesn't exist or if it is my own phone number then I can't make call. Instead of calling I see popup window "Transfer call" that allows me to chose manually one guy to call from my contact list. Have any solutions? I just want to make a call to any phone number like I do using MS Lync desktop client.
0
[ 2, 13, 102, 6897, 13, 18, 43, 197, 23217, 11601, 234, 800, 3726, 3726, 31, 114, 373, 20, 170, 29, 13, 102, 6897, 21, 2159, 568, 13, 18, 43, 197, 9, 25, 32, 938, 20, 645, 737, 72, 25, 52, 19, 2203, 968, 568, 3241, 1132, 234, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Ruby or perl or Python for webcrawler and search engine === I need to write a web crawler and search engine. I am basically from JAVA where we have a lot of libraries like crawler4j,lucene,etc. But i can't use JAVA for some reason so i need know which language is better for a web crawler in case of memory management ,efficiency etc.. Any one who has experience in perl,ruby,python languages give some feedback.
1
[ 2, 10811, 54, 416, 255, 54, 20059, 26, 2741, 24916, 106, 17, 2122, 1406, 800, 3726, 3726, 31, 376, 20, 2757, 21, 2741, 12392, 106, 17, 2122, 1406, 9, 31, 589, 11374, 37, 8247, 113, 95, 57, 21, 865, 16, 8649, 101, 12392, 106, 300...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Background image not showing up in IE7 only when served from Windows Server === I have a background image on an h2 that is showing up in IE7 when served from my Linux server but not when served from my windows server: #QandA .question h2, #QandA .question h3 { background:url(../images/nav_level2_closed.gif) no-repeat -20px -1px; padding-left : 25px; } I have tried using quotes on the url, using non-relative references, as well as made sure that the filename specified is exactly the same as the filename on the server (when viewing the file list through WS-FTP) Any ideas would be mighty appreciated.
0
[ 2, 2395, 1961, 52, 3187, 71, 19, 13, 660, 465, 104, 76, 423, 37, 1936, 8128, 800, 3726, 3726, 31, 57, 21, 2395, 1961, 27, 40, 746, 135, 30, 25, 3187, 71, 19, 13, 660, 465, 76, 423, 37, 51, 13024, 8128, 47, 52, 76, 423, 37, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
SOAP statement for WCF Service === I asked about consuming a WCF service from RPG here and received this response: Scott Klement has a presentation and examples: http://www.scottklement.com/presentations/#HTTPAPI I used SoapUI to test my service and also to get he soap statement to be used with HTTAPI. The service returnes data in SoapUI but I have been unsuccessful using it in the RPG program. SoapUI returns the following, but it seems only to work within SoapUI - it also doesn't include the path to my service which is http://ServerName/COE/CustByNameList.svc If I navigate to `http://ServerName/COE/CustByNameList.svc?wdsl,` I get the wsdl. Statement returned in SoapUI: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header/> <soapenv:Body> <tem:GetCustomerData> <!--Optional:--> <tem:CustomerNumber>1688</tem:CustomerNumber> </tem:GetCustomerData> </soapenv:Body> </soapenv:Envelope> The result looks like this: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><GetCustomerDataResponse xmlns="http://tempuri.org/"><GetCustomerDataResult xmlns:a="http://schemas.datacontract.org/2004/07/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><a:List xmlns:b="http://schemas.datacontract.org/2004/07/WebOrderEntry.Lists"><b:PartialCSTMS><b:ADR19A>3910 LAKEFIELD DR </b:ADR19A><b:ADR29A>JOHNS CREEK FACILITY </b:ADR29A><b:CITY9A>SUWANEE </b:CITY9A><b:CST_x0023_9A>1688</b:CST_x0023_9A><b:NAME9A>JOHNSON CONTROLS </b:NAME9A><b:PHON9A>770-495-9950 </b:PHON9A><b:STAT9A>GA</b:STAT9A><b:ZIPC9A>30024 </b:ZIPC9A></b:PartialCSTMS></a:List></GetCustomerDataResult></GetCustomerDataResponse></s:Body></s:Envelope> I keep getting 500 internal server errors. I've tried numerous variations of the SOAP statement based on the examples I have seen, but they date back to 2008. Has anyone been successful with calling a WCF service from RPG?
0
[ 2, 6447, 3331, 26, 11801, 410, 365, 800, 3726, 3726, 31, 411, 88, 13, 17601, 21, 11801, 410, 365, 37, 22338, 235, 17, 420, 48, 1627, 45, 1824, 11839, 1130, 63, 21, 6364, 17, 3770, 45, 7775, 6903, 6483, 9, 18, 5987, 16802, 1130, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Instantiation followed by assignment compiles, but === I want to allow the user, when searching for a Platypus, to enter either the Platypus' ID or Name (or portion of a name). The database is down right now, so I can't test this code, but the fact that I'm assigning to kvp twice doesn't seem right. Anyway, first my code: String SearchVal = textBoxPlatypusNumOrPartialName.Text.Trim(); int PlatypusID; int.TryParse(SearchVal, out PlatypusID); Dictionary<int, string> CandidatePlatypusDict = PlatypusID > 0 ? PlatypusSetupData.GetPlatypusById(PlatypusID) : PlatypusSetupData.GetCandidatePlatypusFromName(SearchVal); KeyValuePair<int, String> kvp = new KeyValuePair<int, string>(); using (var getPlatypusIDAndNameDlg = new GetPlatypusForm(CandidatePlatypusDict)) { DialogResult dr = getPlatypusIDAndNameDlg.ShowDialog(); if (dr == DialogResult.OK) { kvp = getPlatypusIDAndNameDlg.PlatypusKVP; } } ...Now, if I try this instead: KeyValuePair<int, String> kvp; // = new KeyValuePair<int, string>(); I get: "Use of unassigned local variable 'kvp'" And I can't assign null as KeyValuePair, as it is a non-nullable type. Is this instantiation of kvp followed by assignment to it okay, and if not, how can I work around it?
0
[ 2, 6322, 49, 857, 709, 34, 8427, 26561, 18, 15, 47, 800, 3726, 3726, 31, 259, 20, 1655, 14, 4155, 15, 76, 5792, 26, 21, 26138, 8032, 15, 20, 2830, 694, 14, 26138, 8032, 22, 4924, 54, 204, 13, 5, 248, 2980, 16, 21, 204, 6, 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 debug Rails application? === I'm new to Ruby on Rails and I'm facing quite a number of logical errors which I'm unaware of. Like a normal programmer, the thing to solve your errors is by debugging it first. May I know how to debug it? Because when i tried doing so, it already shows me an error: "Uncaught exception: uninitialized constant Object::ApplicationController" May I know how to solve this error and how to debug? Thanks! :)
0
[ 2, 184, 20, 121, 16254, 2240, 18, 3010, 60, 800, 3726, 3726, 31, 22, 79, 78, 20, 10811, 27, 2240, 18, 17, 31, 22, 79, 4325, 1450, 21, 234, 16, 11545, 11908, 56, 31, 22, 79, 12100, 16, 9, 101, 21, 1826, 17968, 15, 14, 584, 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...
fleXcroll custom scrollbars and Chrome === I'm using the [fleXcroll][1] JavaScript plugin on a project and noticed that only in Chrome does it have some strange rendering bugs. For elements that are absolutely positioned and have the flexcroll scroll bar applied to it, Chrome will sometimes make that element completely invisible until moused over or window resize. Has anyone else experienced similar quirks with fleXcroll? Have you discovered a solution? [1]: http://www.hesido.com/web.php?page=customscrollbar
0
[ 2, 14409, 150, 8694, 5816, 12159, 1850, 18, 17, 13, 12985, 800, 3726, 3726, 31, 22, 79, 568, 14, 636, 19752, 150, 8694, 500, 2558, 165, 500, 8247, 8741, 10922, 108, 27, 21, 669, 17, 2711, 30, 104, 19, 13, 12985, 630, 32, 57, 109...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Microsoft Security login box when downloading Word document === I've looked around online for this but can't seem to find an answer anywhere so hopefully someone can help. I'm getting a "Windows Security" popup appearing on a site I've created (and so are others which is who I need to fix it for rather than myself) when trying to download a word document or excel file. PDFs seem fine. An example page is http://www.christletonhigh.co.uk/school_information/uniform.php if you click to download the “Uniform Prices & Order Form” in the bottom right. There’s no SSL on the site and the error only comes up on IE (I'm using IE9 on Windows 7 which I've seen others mentioning online as their setup with this happeneding) and doesn’t seem to effect all files so it’s a bit confusing. Clicking cancel on the popup causes the document to open anyway. Anyone have any ideas please? The client tells me that the documents causing the problems have never been password protected.
0
[ 2, 7099, 1221, 6738, 108, 1649, 76, 7121, 68, 833, 4492, 800, 3726, 3726, 31, 22, 195, 292, 140, 2087, 26, 48, 47, 92, 22, 38, 2260, 20, 477, 40, 1623, 4922, 86, 13416, 737, 92, 448, 9, 31, 22, 79, 1017, 21, 13, 7, 27508, 18...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Using gson to parse json to java object === I want to parse a json data into a java object, then post it to a .jsp to then turn it back into a json object so I can put it into a javascript array. Here is an example of the data I want to parse: "LoanList" = [ {"Loan" : "One","Lat" : "35.65365", "Lng" : "123.1331" , "Bal" : "4565" , "Address" : "Address 1" , "Delinquency" : "True')] After reading about it, I decided to use gson to parse the data: After reading other questions about this topic, I wrote two classes. **class1.java** import java.util.ArrayList; public class JSON1 { ArrayList<innerData> Loanlst; public ArrayList<innerData> getLoanlst() { return Loanlst; } public void setLoanlst(ArrayList<innerData> Loanlst) { this.Loanlst = Loanlst; } } **class2.java** import java.math.*; public class innerData { public String loan; public BigDecimal lat; public BigDecimal lng; public BigDecimal bal; public String addrs; public String delinq; public String getLoan() { return loan; } public void setLoan(String loan){ this.loan = loan; } public BigDecimal getLat() { return lat; } public void setLat(BigDecimal lat){ this.lat = lat; } public BigDecimal getLng() { return lng; } public void setLng(BigDecimal lng){ this.lng = lng; } public BigDecimal getBal() { return bal; } public void setBal(BigDecimal bal){ this.bal = bal; } public String getAddrs() { return addrs; } public void setAddrs(String addrs){ this.addrs = addrs; } public String getDelinq() { return delinq; } public void setDelinq(String delinq){ this.delinq = delinq; } } Here is where I am stuck, Where do I create my new Gson() to parse the data before I send it. thanks for any help. let me know if you have any questions
0
[ 2, 568, 489, 528, 20, 2017, 870, 487, 528, 20, 8247, 3095, 800, 3726, 3726, 31, 259, 20, 2017, 870, 21, 487, 528, 1054, 77, 21, 8247, 3095, 15, 94, 678, 32, 20, 21, 13, 9, 728, 3401, 20, 94, 805, 32, 97, 77, 21, 487, 528, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Filter by tags in wordpress === I'm creating a video gallery in wordpress and i need to make a search filter by tags. The videos will be "wordpress posts" and will open in fancybox. Just like that: http://molho.tv/ except that in this site the videos doesn't open in fancybox. (in this case the filters are: ALL, MOTION, FILM, PRINT) There must be a theme wich i can adapt, or a search plugin that does that. Any advice would be much appreciated! Artur
0
[ 2, 11945, 34, 3383, 18, 19, 833, 5890, 800, 3726, 3726, 31, 22, 79, 2936, 21, 763, 2246, 19, 833, 5890, 17, 31, 376, 20, 233, 21, 2122, 11945, 34, 3383, 18, 9, 14, 6610, 129, 44, 13, 7, 9587, 5890, 9868, 7, 17, 129, 368, 19,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Passing type bound procedures as arguments in fortran 90 === I am trying to pass a type bound procedure as an argument to another subroutine. I want to know if this is possible in fortran 90. Here is a code snippet that shows what I am trying to do . module type_definitions type test_type integer :: i1, i2,i3 contains procedure :: add_integers_up end type test_type contains subroutine add_integers_up(this,i4,ans) class(test_type) :: this integer :: i4,ans ans = this%i1+this%i2+this%i3+i4 end subroutine add_integers_up subroutine print_result_of_subroutine(i4,random_subroutine) integer :: i4,ans interface subroutine random_subroutine(i1,i2) integer:: i1,i2 end subroutine random_subroutine end interface call random_subroutine(i4,ans) write(*,*) ans end subroutine print_result_of_subroutine end module type_definitions program main use type_definitions implicit none integer :: i1,i2,i3,i4 integer :: ans type(test_type) :: test_obj i1 =1; i2=2; i3=3 test_obj%i1 = i1 test_obj%i2 = i2 test_obj%i3 = i3 i4 = 4 call print_result_of_subroutine(i4,test_obj%add_integers_up) end program main Is this possible to do in Fortran 90? I get a compiler error when I try to compile this code using ifort.
0
[ 2, 2848, 1001, 4138, 8876, 28, 10553, 19, 26, 17685, 3151, 800, 3726, 3726, 31, 589, 749, 20, 1477, 21, 1001, 4138, 7004, 28, 40, 5476, 20, 226, 972, 8821, 7538, 9, 31, 259, 20, 143, 100, 48, 25, 938, 19, 26, 17685, 3151, 9, 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...
Store and retrieve a float[] to/from Cassandra using Hector === I have the following Cassandra schema: ColumnFamily: FloatArrays { SCKey: SuperColumn Key (Integer) { Key: FloatArray (float[]) { field (String): value (String) } } } In order to insert data that adheres to this schema I created the following template in Hector: template = new ThriftSuperCfTemplate<Integer, FloatArray, String>( keyspace, "FloatArrays", IntegerSerializer.get(), FloatArraySerializer.get(), StringSerializer.get()); To (de-)serialize the FloatArray I created (and unit tested) a custom Serializer: public class KeypointSerializer extends AbstractSerializer<FloatArray> { private static final FloatArraySerializer instance = new FloatArraySerializer(); public static FloatArraySerializer get() { return instance; } @Override public Keypoint fromByteBuffer(ByteBuffer buffer) { buffer.rewind(); FloatBuffer floatBuf = buffer.asFloatBuffer(); float[] floats = new float[floatBuf.limit()]; if (floatBuf.hasArray()) { floats = floatBuf.array(); } else { floatBuf.get(floats, 0, floatBuf.limit()); } return new FloatArray(floats); } @Override public ByteBuffer toByteBuffer(FloatArray theArray) { float[] floats = theArray.getFloats(); ByteBuffer byteBuf = ByteBuffer.allocate(4 * descriptor.length); FloatBuffer floatBuf = byteBuf.asFloatBuffer(); floatBuf.put(floats); byteBuf.rewind(); byteBuf.rewind(); return byteBuf; } } Now comes the tricky bit. Storing and then retrieving an array of floats does not return the same result. In fact, the number of elements in the array isn't even the same. The code I use to retrieve the result is shown below: SuperCfResult<Integer, FloatArray, String> result = template.querySuperColumns(hash); for (FloatArray floatArray: result.getSuperColumns()) { // Do something with the FloatArrays } Do I make a conceptual mistake here since I'm quite new to Cassandra/Hector? Right now I don't even have a clue on where it goes wrong. The Serializer seems to be ok. Can you please provide me with some pointers to continue my search? Many thanks!
0
[ 2, 1718, 17, 11917, 21, 11510, 2558, 500, 20, 118, 2665, 17825, 568, 11316, 800, 3726, 3726, 31, 57, 14, 249, 17825, 23874, 45, 4698, 13819, 45, 11510, 8576, 93, 18, 13, 1, 4729, 4237, 45, 1026, 716, 4404, 103, 1246, 13, 5, 6391, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Generic Bind with Guice === I trying to build a simple lib for persistence with guice persist and some other things. I already have a `AbstractDao<T>`, that I can easily extend and bind the concrete implementation like a boss. But, I want a kind of GenericDao, like this: public abstract class GenericDao<T extends Bean> { @Inject private Provider<EntityManager> emp; protected EntityManager em() { return emp.get(); } public AbstractDao() { } protected abstract Class<T> clazz(); // .... And if I will have just the CRUD (implemented in abstract dao) in for some bean, I want to inject `GenericDao<SomeBean>` like a boss. So, I started to try some hacks, and get the following: public abstract class AbstractPersistentModule extends AbstractModule { protected <T extends Bean> LinkedBindingBuilder<T> bindGenericDao(final Class<T> clazz) { return bind( new TypeLiteral<GenericDao<T>>(){} )./* what the hell can I do here? */; } } If I can make it work, I'll be able to do a simple: bindGenericDao(Pessoa.class); Someone know a way to do that?
0
[ 2, 12733, 10193, 29, 9457, 1105, 800, 3726, 3726, 31, 749, 20, 1895, 21, 1935, 13, 8326, 26, 28584, 29, 9457, 1105, 22084, 17, 109, 89, 564, 9, 31, 614, 57, 21, 13, 1, 2297, 18, 19915, 17104, 1, 38, 1, 15, 30, 31, 92, 2351, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Detect if spotify track is 'explicit' via the apps api or web api === Is there any way to detect if a track in spotify is explicit via the apps api or the web api?
0
[ 2, 9092, 100, 1999, 8612, 792, 25, 13, 22, 6899, 16927, 38, 22, 1197, 14, 4865, 18, 21, 2159, 54, 2741, 21, 2159, 800, 3726, 3726, 25, 80, 186, 161, 20, 9092, 100, 21, 792, 19, 1999, 8612, 25, 14990, 1197, 14, 4865, 18, 21, 21...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...