2018-10-22         Bridget

Index Music Files Using Flash/HTML5/JavaScript

How can I index mp3 files on user side and create a database of file name, artist name album name etc and upload them on a server?I would like a HTML 5 solution, although Flash or JavaScript would do. So no file uploading period? Cause if you were uploading them to a server you might find the getId3 project very useful. It does the file crawling right out of the box and all you need to do is write the PHP and SQL queries in order to write it's results to a database.http://getid3.sourceforge.net/ [XXX]

 javascript                     1 answers                     76 view
 2018-10-22         Bridget

Rails5 API + devise_token_auth edit token format

so i'm using devise_token_auth gem for basic user functionalities, and I made some simple changes to the reset password flow. Basically instead of having a link in the email for the user to click and go to the reset page, I show the token, so the users has to copy it and enter manually in a field.It is working like that, but the token is to large and ugly, i'd like it to be something like 6 alphanumeric digits. It looks better and it makes things easier for the user. I don't quite know how to do it, I probably should overwrite some devise original Controller. How to do it? ...

 ruby-on-rails-5                     1 answers                     50 view
 2018-10-22         Bridget

Cannot get Camera2 API touch to focus to work

I'm unable to get the touch to focus to work properly on Camera2 API. On touching I just seem to focus for a second and then it becomes extremely blurred. The phone is a Nexus 5X. Here is my code for touch to focus.private void refocus(MotionEvent event, View view){ //Handler for autofocus callback CameraCaptureSession.CaptureCallback captureCallbackHandler = new CameraCaptureSession.CaptureCallback() { @Override public void onCaptureCompleted(CameraCaptureSession session, CaptureRequest request, TotalCaptureResult result) { super.onCaptureCom...

 android                     1 answers                     58 view
 2018-10-22         Bridget

Filter by user is not staff using Q in another model queryset

I have the following model:class APC(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True, related_name='apc', on_delete=models.SET_NULL) type= models.CharField(choices=TYPE_CHOICES, max_length=5, blank=True, null=True)I want to get APC objects that have one of two specific types, and user is not staff.I'm starting with:apcs = APC.objects.filter( ~Q(user is staff), Q(type=TYPE_CHOICES_A) | Q(type=TYPE_CHOICES_B)) Try to do it without Q:apcs = APC.objects.filter(user__is_staff=False, type__in=(TYPE_CHOICES_A, TYPE_CHOIC...

 django                     1 answers                     33 view
 2018-10-22         Bridget

Get all possible str partitions of any length

I want to find all possible partitions of a str without empty strs and must contain ever char (should not contain the original str)For example:s = '1234'partitions(s) # -> [['1', '2', '3', '4'], ['1', '2', '34'], ['1', '23', '4'] # ['12', '3', '4'], ['12', '34'], ['1', '234'], ['123', '4']] # should not contain ['1234']EDIT: Can be in any orderWhy My Question Is Not a Duplicate:I don't want permutations that is:from itertools import permutationss = '1234'permutations(s) # returns ['1', '2', '3', '4'], ['1', '2', '4', '3']...But I want the...

 python                     3 answers                     45 view
 2018-10-22         Bridget

Django Template Check user is authenticated and is present

I am creating a user login and changing the link of signin to signout .The views.py i have is:#This index is for my landing page i.e.first.html where I have Sigin link which needs to hidden on Successfuldef index(request): if 'username' not in request.session : return render_to_response('gharnivas/ghar.html', context_instance=RequestContext(request)) else: u = request.session['username'] return render_to_response('gharnivas/ghar.html',{ 'user' : u },context_instance=RequestContext(request))#This here, is the view for my check the user and create requiredd...

 django                     2 answers                     38 view
 2018-10-22         Bridget

what's the best stable editor & compiler for c++ with gui & under linux?

What's the best stable (editor & compiler) for C++ with gui that works under linux?Note: Explicitly not looking for a full IDE. I like to code with Emacs. It has a nice gui also for gdb. I recently made a snapshot while i worked on some code snippet (see below, it doesn't look like 1980 at all :).That said, there are a lot of other fine IDEs. I like Eclipse for Java development, and heard it has a nice C++ plugin too (CDT). Netbeans also works for C++ since recently. KDevelop, an IDE for KDE supporting many languages, is currently being rewritten for KDE4: KDevelop B...

 c++                     16 answers                     98 view
 2018-10-22         Bridget

How do I manage sprites in my J2ME games?

Are there any libraries for J2ME to manage bitmap sprites for games? There's actually a game API in J2ME's MIDP 2.0 standard which has a bunch of game-centric classes, including a Sprite class. Check out this Tutorial for a good overview to using the J2ME Game API.http://today.java.net/pub/a/today/2005/07/07/j2me3.html [XXX]Try using a TiledLayer, it gives you the option to manage and array of images in a more elegant way. Also it is less memory intensive. You just load one tiled image and the TiledLayer will do the job for you [XXX]There is not much to manage. Yo...

 bitmap                     3 answers                     39 view
 2018-10-22         Bridget

Selectize.js: Populate with default values

I have a modal, opens with an ajax request to get stuff to populate, Selectize is one them.Ajax gets an array of objects to populate the Selectize :let optionsToPopulate = [{id: 6, name: "Foo"},{id: 1, name: "Bar"}]And i am passing the above array as :$("#selectize").selectize({ options: optionsToPopulate, items: optionsToPopulate, valueField: 'name', labelField: 'name', searchField: ['name'], plugins: ['remove_button'], persist: false, createOnBlur: true, maxItems: 10, create: true});But its not working, What am i missing ? You need to populate items with an a...

 javascript                     1 answers                     24 view
 2018-10-22         Bridget

How to return fields in query based on an other query

Here is my situation, I have a grid in an angular app which displays data. All works fine and I am able to let the user select which column's are displayed in the grid, but since I hide them on client I still get some blank column's. To fix that I have to remove the undesired columns from my returned query. So much to prefix here is what i have. Query one will return me all column a user wants to see in query.DECLARE @Txt1 VARCHAR(MAX)SET @Txt1=''SELECT @Txt1 = @Txt1 + tblA.column_name +','FROM [tbl_gridcolumns] as tblAleft join [dbo].[tbl_griduser] as tblBon tblA.guid =...

 sql                     2 answers                     68 view
 2018-10-22         Bridget

Listing all keys in a IBM COS S3 bucket using Python

I am looking to keep track of the list of keys that are stored in a cos bucket. I am using Python and currently my code is: files = cos.Bucket('bucketname').objects.all() for file in files: data[file.key] = 'not processed' data_array.append(data)This is extremely slow for me as there are quite a lot of 1M+ keys in my bucket at the moment. Is there a better way? I'm currently looking at https://alexwlchan.net/2018/01/listing-s3-keys-redux/But I am having trouble since the ibm-cos-sdk returns an s3 resource and not a client when establishing the connection. Any tips ...

 python                     1 answers                     84 view
 2018-10-22         Bridget

What are the bare minimum security configuration recommendations when using Windows Server to hosts websites

I am using Windows Server 2003 to host a few websites. I have the Windows Firewall enabled along with Remote Desktop and FTP. I am considering installing AVG Free for basic protection. Is this enough? Should i install anti virus on my production server?Can anyone give any tips on bare minimum standard security setup? The Security Compliance Toolkit will probably help you out a lot in getting your security up to par. [XXX]

 windows                     1 answers                     81 view
 2018-10-22         Bridget

How to pass metadata to QnAMaker Request

I am trying pass metadata filter to my QnAMakerDialog request but cannot figure out how to do it. I have tried adding the values to the dialog that is forwarded but this did not work.LuisDialog.cs method that calls QnAMakerpublic List<Metadata> _metadataFilter { get; set; }[LuisIntent("")][LuisIntent("None")]public async Task NoneIntent(IDialogContext context, IAwaitable<IMessageActivity> message, LuisResult result){ string filterValue = context.UserData.GetValue<string>("filter"); var messageToForward = await message; var qnaDialog = new QnADial...

 c#                     1 answers                     97 view
 2018-10-22         Bridget

xamarin forms windows unexpectedly exited

I'm using xamarin forms after my update windows app is exited unexpectedly what should be the solutionThe actual problem is happening when the list view getting populated i cant catch the actual error but all my json data is loading in view model i think the problem is happening inside the view if any one know how to resolve please help me public class StringToImageConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var filename = (string)value; return ImageSource.FromFile(fi...

 c#                     1 answers                     91 view
 2018-10-22         Bridget

__attribute__((constructor)) how it change entry point?

I know that from the point of view of the C programming languagemain() is the entry point of the program.But from the point of view of the operating system is __start at ctrt0 startup routines which are linked into a program that performs any initialization work required before calling the program's main() function (correct me if wrong here).So we have some attributes which we can use for our functions, one of them isconstructor attribute which is called before main(), who is responsible to call this function?__attribute__((construtor))void foo(void){ puts("Construc...

 c                     1 answers                     75 view
 2018-10-22         Bridget

how to get javascript class properties list

I have javascript this class :class Student { constructor(name, birthDate) { this.name = name; this.birthDate = birthDate; } get age() { return 2018 - this.birthDate; } display() { console.log(`name ${this.name}, birth date: ${this.birthDate}`); }}console.log(Object.getOwnPropertyNames.call(Student));The issue is that you're using Object.getOwnPropertyNames wrong. You don't need to use call on it, you just call it.* And you need to pass an instance of Student; the class object itself doesn't have any properties. The properties a...

 javascript                     1 answers                     19 view

Page 1 of 143  |  Show More Pages:  Top Prev Next Last