w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Fullcalendar (full calendar) Not defaulting to display the current today's date. Month shows february and not today's
it is because of the month option you are setting, it is used to set The initial month when the calendar loads. Try $(document).ready(function() { $('<?php echo $calendar ?>').fullCalendar({ header: { left: 'prev, next today, agenda', center: 'title', right: 'month, agendaWeek, agendaDay', ignoreTimezone: false }, // Multiple Sources eventSources: [ '<?php echo get_option('fc_option_feed1'); ?>', '<?php echo get_option('fc_option_feed2'); ?>', '<?php echo get_option('fc_option_feed3'); ?>' ], events: { //http://www.google.com/calendar/feeds/centre.edu_5f119bnujdfol3gs59h0driv9c%40group.calenda

Categories : Jquery

Finalizing a Cursor that has not been deactivated or closed or database not closed error
When you are done with the cursor, you need to call Cursor.close(). Leaving it not closed leads to memory leaks. E.g.: Cursor cursor = null; try { cursor = getContentResolver().query(myUri, MY_PROJECTION, null, null, null); if (cursor != null && cursor.moveToFirst()) { // moar code } } finally { if (cursor != null) { cursor.close(); } }

Categories : Android

Application gets closed when terminal is closed, how to stop this?
Use nohup to prevent child processes from being killed when the terminal closes. spawn nohup /usr/bin/firefox https://www.google.com/ I assume there's more to the script, since there's no need to use Expect just to start firefox.

Categories : Python

How to draw closed spline 3D (closed curve 3d) through unordered list of points3D. How to arrange points3D?
It sounds like you're looking for the Concave Hull of the data set. Unfortunately, I don't know of any pre-canned algorithms, but the link references a paper that another developer was starting from, as well as some sample code, so maybe that'll help you in the right direction.

Categories : C#

Two AndroidManifest.xml files, which one is relevant
This workspaceMyFirstAppin is automatically build on Build where as workspaceMyFirstApp this is your projects Manifest which you can modify and alter this is you main Manifest Note: *Bin* and Gen Contents are automatically generated You shall not bother about them you can check by Cleaning the project both got emptied and on Rebuilding or Running again Gen and Bin Contents are recreated

Categories : Android

How to add non relevant column to group by?
Just guessing, didn't try it myself. If the CASE statement is guaranteed to return only one value, you can try to wrap it in a max() function. max() also works on strings, AFAIK. max(case when ito.Rating<=25 then 'e - Very Unfavourable' when ito.rating>=30 and Rating<=45 then 'd - Unfavourable' when ito.rating = 50 then 'c - Neutral' when ito.rating>=55 and Rating<=70 then 'b - Favourable' when ito.Rating>=75 then 'a - Very Favourable' end) as ComplexFav

Categories : SQL

Links do not go to relevant page
You have e.preventDefault(); which will stop the link event from happening. You need to remove it. Or keep the code and add document.location = a.href; to the bottom. <script type='text/javascript'>//<![CDATA[ $(window).load(function(){ $('li a').click(function(e) { e.preventDefault(); $('a').removeClass('active'); $(this).addClass('active'); **document.location = $('a').attr('href');** }); });//]]>

Categories : Jquery

The underlying connection was closed: The connection was closed unexpectedly wcf service
The first thing i will do is, instead of returning the full list of candidates i will return an empty list. If that works fine, then it is very clear that the size of the data is a problem. To modify the size play with your binding parameters.

Categories : Wcf

Extract relevant address from string?
If the desired part of the address always starts with a number, try this: find the first digit in the string. get a substring from the first digit to the end of the string. you now have the address. In order to parse addresses, you need to know all possible formats. Do you need to include: Santa, North Pole. The Queen, Great Britian Captian Hootberry Bob Goldenberry, rural route 7, MN Jackie Blam, P.O. Box 78, Hootville, OH For a comprehensive address parsing solution, you will need to provide several algorithms for different address formats then determine which algorithm to use based on the input.

Categories : Validation

C bitwise operations relevant bits
Mask and combine: finalByte = (B & C) | (A & ~C); To break down how it works - the result of B & C is a byte containing all of the bits of B where bits of C are set (a normal masking operation). A & ~C yields a byte with all of the bits of A where bits of C are cleared - hence the ~ complement operation. The | combines the two into the final byte you're looking for.

Categories : C

Extract relevant sentences to entity
What you want is a Named Entity Recognizer (NER). Given an input sentence, the NER will identify the various entities in the sentence as persons, organizations, products etc. You can then check entities recognized as products, and keep or discard the sentence accordingly. One very simple possibility would be to use the named entity recognizer of NLTK in Python. Here is an example: import nltk sent = "Albert Einstein spent many years at Princeton University in New Jersey" sent1 = nltk.word_tokenize(sent) sent2 = nltk.pos_tag(sent1) sent3 = nltk.ne_chunk(sent2) print sent3 The output will be: (S (PERSON Albert/NNP) (PERSON Einstein/NNP) spent/VBD many/JJ years/NNS at/IN (ORGANIZATION Princeton/NNP University/NNP) in/IN (GPE New/NNP Jersey/NNP)) NLTK works well for th

Categories : Machine Learning

How to filter a list with relevant elements left only
Just use list comprehensions - list1 = [i for i in list1 if not(i%3==0)] Some reference on list comprehensions

Categories : Python

How to use ISeriealizeable attribute to serialize only relevant fields?
Use DataContract attribute and XmlSerializer class: [DataContract] Public MyBoard { [DataMember] pricate BoardTile[,] tiles; private bool tilesEliminated; public int blabla {get; set; } } And serialization: var board = new MyBoard(); var ser = new DataContractSerializer(typeof(MyBoard)); var sw = new StringWriter(); ser.WriteObject(sw, board); sw.Close(); var xml = sw.ToString(); It will serialize only members that are marked with [DataMember] attribute and skip the other ones.

Categories : C#

selecting only relevant columns within a file - python
>>> d=csv.DictReader(open("some.csv"),delimiter=" ") >>> fields = ["h1","h2","h3"] >>> new_rows = [[row[f] for f in fields] for row in d] >>> d=csv.DictWriter(open("new_csv.csv","w"),fields,delimiter=" ") >>> d.writerows(new_rows)

Categories : Python

Using get_success_url on a DeleteView when relevant data has been removed
In Django 1.6, the delete method has been changed so that the get_success_url method is called before the object is deleted. def delete(self, request, *args, **kwargs): """ Calls the delete() method on the fetched object and then redirects to the success URL. """ self.object = self.get_object() success_url = self.get_success_url() self.object.delete() return HttpResponseRedirect(success_url) I recommend you override your delete method as above, until you upgrade to Django 1.6. If you need to do this for multiple classes, you could create a mixin. Note that you don't need to fetch the item from the database with get_item_or_404 -- you can access it in your get_success_url method as self.object.

Categories : Django

Is compiling opencv with tbb relevant on processeur with 2 thread
this might help. TBB example works better using 2 threads even on my Megafon Mint phone that contains Intel(R) Atom(TM) CPU Z2460 @ 1.6GHz processor which has 1 core but 2 threads also. --Vladimir

Categories : Opencv

Query not outputting all relevant results from database
Based on your query, here are four possible reasons you're not seeing all statuses: You're using an inner join to tbl_photos, so any user that doesn't have a photo will be excluded. You're using an inner join to tbl_users, so any status that doesn't relate to at least one user (and the user must have a photo - see #1) will be excluded. You're filtering on tbl_photos.default_photo = '1', so any photo with tbl_photos.default_photo <> '1' will be excluded. Because of the inner joins, this will also exclude the associated user and possibly exclude the associated status. You're filtering on tbl_status.deleted = '0', so any status with delete <> '0' will be excluded. Obvious, but worth mentioning. Try this: change INNER JOIN tbl_users to LEFT JOIN tbl_users, and change INNER JOIN

Categories : Mysql

Associating changesets that are only relevant to the build definition
The default association works by linking work items to build based on builds workspace. If a changeset in workspace scope since last build is linked to workitem it will be associated with build. If you cannot limit workspace scope then you will have to introduce custom linking activity and disable the default one.

Categories : Tfs

Firebird: Convert date to relevant format?
I don't use Firebird, but from the docs, you might be able to cast a timestamp to a date (by the way, I'm surprised that you can use coalesce with different types, but... that's another problem). So either COALESCE(CAST(date1 as date), date2) or Firebird shortcut COALESCE(date date1, date2) if you got errors, you may try to see what's happening when doing select CAST(date1 as date) from ...

Categories : SQL

knockout.js - broadcast data across relevant views
I would use a Event aggregator pattern. I have made one for SignalR https://github.com/AndersMalmgren/SignalR.EventAggregatorProxy Install usign nuget Install-Package SignalR.EventAggregatorProxy If you have no use for SignalR you can then extract the relevant parts from my lib, demo here http://jsfiddle.net/jh8JV/

Categories : Database

Getting the top-K relevant document from a similarity numpy.ndarray
set diag elements to zero, then use argsort() to find the top-K index in a flatten array, and use unravel_index() convert 1D index to 2D index: result[np.diag_indices_from(result)] = 0.0 idx = np.argsort(result, axis=None)[-10:] midx = np.unravel_index(idx, result.shape) print midx print result[midx] result: (array([ 8, 14, 1, 0, 11, 17, 8, 10, 6, 8]), array([14, 8, 0, 1, 17, 11, 10, 8, 8, 6])) [ 0.2329741 0.2329741 0.2379527 0.2379527 0.25723394 0.25723394 0.26570327 0.26570327 0.34954834 0.34954834]

Categories : Python

jni compile with cl compiler has syntax error, but not relevant
There is a syntax error on this line: (*env)SetObjectField(env, jobj, fldid, greeting); You meant: (*env)->SetObjectField(env, jobj, fldid, greeting); These errors usually point to a line number that could have helped you.

Categories : Visual Studio

Moving a directory to another git repository while retaining relevant history
git filter-branch has a specialized mode for reducing a repository to a subdir. Check out the option --subdirectory-filter. It should get rid of irrelevant commits automatically, and it moves the contents of the subdir to the top level of the repo. However, it does not track/follow file renames. You're looking at a lot of manual work if you want that. After all, you'd have to include changes to the files in their old location but also rewrite the paths to the post-rename location. We don't have anything that ships with git that does this.

Categories : GIT

mysql fulltext search not returning most relevant results first
With MyISAM tables, "three" is a stopword by default, therefore it is not indexed, and it is ignored in all searches. If you are indeed using MyISAM tables, then you could specify your own custom list of stopwords, or disable the feature altogether, via the ft_stopword_file server option (MyISAM). NB: For InnoDB tables, innodb_ft_server_stopword_table is the option to look for. "three" seems no to be a stopword by default for InnoDB, but the list of stopwords may be different on your server. [edit] I totally overlooked that boolean searches do not sort results automatically by relevance (as natural language searches do). All you need to do is add an ORDER BY clause (please test it here): SELECT * FROM songs WHERE MATCH (title,artist) AGAINST ('$ser' IN BOOLEAN MODE) ORDER BY MATCH (

Categories : Mysql

An Oracle database user cannot create a DB job even with relevant privileges
When calling DBMS_SCHEDULER.create_job(...) you specify the value for job_class parameter. User must have EXECUTE privileges on CONSOLIDATE_CLASS job class to create jobs belongs this class (documentation link): grant execute on user_who_owns_class.CONSOLIDATE_CLASS to user_who_creates_job UPDATE To check if user allowed to create job with this class you can look at all_tab_privs view: select count(1) from all_tab_privs where table_name = 'PROD_DISPATCH_JOB' and table_schema = upper('<job class owner name here>') and privilege = 'EXECUTE' and grantee in ( select 'PUBLIC' from dual -- granted to public union select upper('<current_user_name_here>') from dual -- direct grant union select role from session_roles -- roles enabled for

Categories : Oracle

When we click on a particular alphabet it should display relevant image..Using JavaScript
Try this function (function iterateAlphabet(){ var alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(''), imageUrl = "http://dummyimage.com/50x50/2e2e2e/fff&text="; alpha.forEach( function(el){ var link = document.createElement('A'); link.href = imageUrl + el; link.innerHTML = el; // console.log(link); document.write(link); // you can use any code here to show the links }); })()

Categories : Javascript

Click links to load the relevant image into a container
$(function () { $("a.click").click(function (event) { //hide panel in case it's already visible because of a previously loaded image $("#hiddenPanel").fadeOut(0); //disable default link click event so page does not change if link has a href event.preventDefault(); //set links src to the src of image in the hidden panel $("#hiddenPanel img").attr("src", $(this).attr("src")); $("#hiddenPanel").fadeIn(1000); }); $("#closeButton").click(function () { $("#hiddenPanel").fadeOut(1000); }); }); FIDDLE You may want to fade out image slowly instead of fadeOut(0) if it's visible, and load the new one after fade out is complete.

Categories : Jquery

Is Passport for NodeJS relevant when no there are no immediate plans to integrate external API's?
Is there even a strategy that acts as a placeholder for future API integration if one was later required? Yes, there is passport-local. Is there any point using Passport for Node when there are no plans to integrate external API's? IMHO if you don't need it, leave it out. YAGNI. Fewer dependencies is a good thing. When you need it, it is simple enough to add. I also think social login is/was largely a fad that was pseudo-required at one point but these days many people are over it.

Categories : Node Js

Kip Irvine- Assembly Language for X86 Processors- how relevant for Linux?
From what I glean in the reviews on Amazon, that's a pretty windows-focused book. Regarding your question "Surely the operating system is just a layer of abstraction above the ASM anyway?" - that's not really how it works. Assembly language programming is just like programming in any other language - you will have to work with the interfaces the operating system gives you if you want to do anything useful. Windows system calls and linux system calls work differently, and perhaps worse for the beginner, in the 64-bit world each has a different ABI. Stick with a reference that matches the system you're trying to program on, at least while you're a beginner, or you'll regret it.

Categories : Linux

How do I find relevant deadd00d circumstances from customer devices?
Solution: introduce a special condition for deadd00d in the signal handler. Read the last 1024 bytes of logcat, jam it into the crash log. I'm getting some decent diagnostics this way. //n is the length of the file tail to read //Returns # of byte read size_t ReadLogcat(char *Buf, size_t n) { char s[sizeof(s_DataPath) + 30]; //s_DataPath contains the result of Context.getDir("Data") strcpy(s, "logcat -d -f "); char *fn = s + strlen(s); strcat(s, s_DataPath); strcat(s, "/logcat"); //Temp file for the logcat size_t r = 0; system(s); //Dump the snapshot of the logcat into the file called logcat FILE *f = fopen(fn, "r"); if(f) { fseek(f, -n, SEEK_END); //We need the end of the file r = fread(Buf, 1, n, f); fclose(f); }

Categories : Android

I would like to compare to set of text and get how similar/relevant they are to each other, I use similar_text(), but i found out its not as accurate
You can use the JS version: http://phpjs.org/functions/similar_text/ The JS code shows you the precent code (you can modify the code): return (sum * 200) / (firstLength + secondLength); I hope this will help you! EDIT: How to use similar_text in JS? Create a file named similar_text.js and copy&paste this code in it: function similar_text (first, second, percent) { // http://kevin.vanzonneveld.net // + original by: Rafał Kukawski (http://blog.kukawski.pl) // + bugfixed by: Chris McMacken // + added percent parameter by: Markus Padourek (taken from http://www.kevinhq.com/2012/06/php-similartext-function-in-javascript_16.html) // * example 1: similar_text('Hello World!', 'Hello phpjs!'); // * returns 1: 7 // * example 2: similar_text('Hello World!', nu

Categories : PHP

In Doctrine 2, which locale setting exactly is relevant for the float mapping type?
From Doctrine 2.3, class DoctrineDBALTypesFloatType: public function convertToPHPValue($value, AbstractPlatform $platform) { return (null === $value) ? null : (double) $value; } According to the PHP manual (Converting to float, Converting to integer, String conversion to numbers), it seems that this will not support input values using comma as the decimal separator, hence the locale setting of the database server is likely being referred to in the Doctrine docs. However, due to the peculiar ways PHP converts stuff into other stuff, if the database gives you "10 Little Piggies" in your supposed float column, the mapping above will "work", technically, although this is probably not what you want. I am not sure if the Doctrine DBAL maybe performs other checks to make sure the input v

Categories : PHP

Can not compile software dependent on java3d, with relevant jars on classpath
Just because you have it on your shell's classpath, does not mean it is included in the classpath that is used to build by ant. There is a <property> that can be set inside of a target specified by ant. Make sure all the jars you need are inside that classpath.

Categories : Java

Get relevant local IP address/interface for sending to a specific server
Maybe it's no possible in your case, but nevertheless: the server gets to know the IP address when the connection is being established, it therefore is more like metadata than content. It should not be a big deal to get the sender IP address.

Categories : C++

Drupal 7 theming: Highlight the relevant sub-menu when viewing an article
You can use the Menu Position module to accomplish this. After installing: Visit /admin/structure/menu-position Click "Add menu position rule" Select the parent menu item "Sports" Add a page restriction for "sports/*" This should keep the "sports" menu link active on the correct pages.

Categories : Drupal

program using up all memory from listview sql table, how to populate with only the relevant data?
Change your query to only select the 15 most recent: myCommand.CommandText = "SELECT TOP 15 * FROM Messages ORDER BY Time Desc"; TOP 15 means to select only the first 15 rows returned, and the ORDER BY makes sure they're sorted by Time (the DESC makes them sort from highest (most recent) to lowest, petting the most recent at the beginning). (You didn't mention what DBMS, so I posted one that works in SQL Server. You should include the appropriate database engine tag in future questions here, as SQL syntax and functionality can vary between them.)

Categories : C#

How do I keep J_____ methods sizes and location from keeping relevant with the JFrame?
I have figured it out. To set locations and sizes on your own you must set the layout to null or just use another layout built in to JFrame. Another way is to use: component.setPreferredSize(new Dimension(x,y));

Categories : Java

"The underlying connection was closed: The connection was closed unexpectedly"
The first request does not utilize a header that indicates the length of the result. It closes the connection when it finishes. The second request utilizes the length header, reads the designated number of bytes, then closes the connection gracefully. (under the client side control instead of server driven disconnection) -or- The url you sent caused an error on the server. Is there an error in the server log or event viewer?

Categories : C#

jQuery checking relevant checkbox by spliting id values and matching elements accordingly
You can use: check.filter("#checkbox_" + divNum).prop("checked", true); It filters down the checkboxes to just the one with the right number in its ID, and then sets the checked property to true. If you want to uncheck the other boxes first, you'll need check.prop("checked", false) before the above line to uncheck them.

Categories : Jquery

Are there relevant differences in sending many small packets or one large packet on socket.io?
I believe the following link does a good job explaining a packet's life-cycle: http://www.sdsusa.com/connections/ The obvious takeaway is that with one packet all of the states (connection, acknowledgement, establish, send etc etc) happen once, as opposed to sending multiple packets those states have to happen once per packet. More packets will most likely result in a longer send/receive time with more connections to be made and a larger chance of dropped packets and missed connections causing additional latency. Most likely it won't matter which approach you go with because the difference will probably be a few ms and unnoticeable. That being said if you are many packets from many clients then your server could be flooded while trying to process 30 or 40 packets a second. Additional

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.