Posts

Showing posts from April, 2015

winapi - Not able to delete the registry entry -

i created new registry entries. not able delete parent node. structure of registry below: hkey_current_user\software\ie_backup\internet settings below code using deleting registry entries. deletes content of node internetsettings not able delete ie_backup. void main() { //some other stuffs of code here creating new registry. bool ret = deletevaluekey(hkey_current_user, l"software\\ie_backup",l"internet settings"); } bool deletevaluekey(hkey hkeyroot, lpcwstr subkey, lpcwstr valuekey) { hkey hkey = null; bool breturn = false; if (regdeletekey(hkey, subkey ) == error_success) { breturn = true; } if (regopenkeyex(hkeyroot, subkey, 0, key_set_value , &hkey) == error_success) { if (regdeletekey(hkey, valuekey ) == error_success) { breturn = true; } } if(hkey != null){regclosekey(hkey);} return breturn; }

performance - In Oracle, does the unique constraint include an index implicitly? -

this question performance issue, example, if add unique constraint such as: alter table staffs add constraint test unique (company_name, staff_id); should add unique index performance issue? create unique index test2 on staffs (company_name, staff_id); for primary key, can see there must corresponding index in dba_indexes system table, have not seen equivalent case unique constraint "i have not seen equivalent case unique constraint" hmmmm, sure? sql> create table t23 2 (id number 3 , col1 date) 4 / table created. sql> alter table t23 2 add constraint t23_uk unique (id) 3 / table altered. sql> select index_name, uniqueness 2 user_indexes 3 table_name='t23' 4 / index_name uniquenes ------------------------------ --------- t23_uk unique sql> note can use existing index, , doesn't have unique. means index name might not match constraint name (th...

regex - phonology transformational method -

i have word list of particular language in ipa symbols . have rules in regular expressions convert input word list new word list of language in ipa symbols. how can convert that? my regular expression rules y=> j / $_ which means 'y' replaced 'j' when in first place in particular word . and input word list contains words ready converted new word list in ipa symbols.

java - <c:forEach> not working for to print List of Strings -

hi trying print list of strings stored in arraylist object using jstl, here jsp page: <%@page import="java.util.arraylist"%> <%@page import="java.util.list"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <% list<string> al = new arraylist<string>(); al.add("testing1"); al.add("testing2"); al.add("testing3"); al.add("testing4"); al.add("testing5"); system.out.println("hello"+ al); %> <c:foreach var="alla" items="${al}" > <c:out value="hello text"></c:out> <c:out value="${alla}"></c:out> </c:foreach> when see output not showing thing on browser, have printed using foreach showing result in jstl not printing ? ...

c# - foreach keeps creating blank elements -

Image
i using visual studio mvc , did c# foreach loop menu of food , using bootstrap framework. can't figure away out remove before , after elements being created , blank. here code: <div class="container"> @foreach (var mname in model) { <div class="col-md-6"> <p class="menu-list">@mname.menuname</p> </div> <div class="col-md-6"> <p class="menu-list-des">@mname.menudescription</p> </div> <div class="col-md-6"> <p class="menu-list">@mname.menutwo</p> </div> <div class="col-md-6"> <p class="menu-list-des">@mname.menutwodescription</p> </div> } </div> is there away remove elements?

objective c - Google Map Integration iOS 1.9.0 issue -

Image
please provide solution on below error google map ios integration, facing last 2 days not getting solution on this. find below log reference 2014-11-27 11:38:09.230 mappin[2279:41725] coredata: warning: unable load class named 'gmscachedtile' entity 'gmscachedtile'. class not found, using default nsmanagedobject instead. 2014-11-27 11:38:09.231 mappin[2279:41730] coredata: warning: unable load class named 'gmscachedobject' entity 'gmscachedobject'. class not found, using default nsmanagedobject instead. 2014-11-27 11:38:09.233 mappin[2279:41725] -[nsmanagedobject tilecoords]: unrecognized selector sent instance 0x7a174ac0 2014-11-27 11:38:09.235 mappin[2279:41725] * terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nsmanagedobject tilecoords]: unrecognized selector sent instance 0x7a174ac0' * first throw call stack: ( 0 corefoundation 0x03466946 exceptionpreprocess + 182...

data structures - Multiple declaration error in C using DOSBox version 0.74 -

i'm creating simple project on dosbox version 0.74, double linked list. created 3 files: a header file dlinkedlist.h contains structure of list node , functions prototypes. dlinkedlist.c file. contains implementation of these functions. main.c file the header file included in both of other 2 files. , dlinkedlist.c included in main.c , don't dosbox says functions in dlinkedlist.c aren't defined in main() . errors solved when included .c file in main.c . now problem error error dlinkedlist.h multiple declaration of listnode this code in header file besides prototypes. typedef struct listnode{ int id; char name[size]; struct listnode *next; struct listnode *prev; }listnode; typedef struct list{ listnode *head; int size; }list; and dlinkedlist.c included in main.c. you don't include c files in other c files. the accepted practice create header file containing declarations (not definitions) , include that. what...

garbage collection - How to solve java.lang.OutOfMemoryError: GC overhead limit exceeded error in android studio -

i using android studio 1.0 rc 64 bit linux. when run application getting "java.lang.outofmemoryerror: gc overhead limit exceeded" when searched on how solve error got solutions add: -xx:-usegcoverheadlimit studio.vmoptions or studio64.vmoptions -xmx2000m studio.vmoptions or studio64.vmoptions etc. these did not work me. please help. in advance i solved issue adding dexoptions { incremental true javamaxheapsize "4g" } to android closure in build.gradle file. found answer in outofmemoryerror: gc overhead limit exceeded

What is the function to jump from Rascal to a certain Location in IDE -

if have rascal visualization location information (e.g. start/endline of java method), how can jump ide , highlight selected lines? so how can same behavior clicking on printed loc in rascal console? e.g: onmousedown(bool (int butnr, map[keymodifier,bool] modifiers) { jumpintoeclipsehighlightloc(loc); } probably looking edit functions in util::editors .

eclipse - How to execute the go test file in the goeclipse IDE -

Image
how create eclipse launch file execute test file or run configuration in goeclipse ide this enhancement pending: issue 5 i thinking more along line of adding menu item ("test go application") in " run as " context menu. right if select go test file , click "run go application" "run as" context menu nothing executed (no main). a "test go application" "go test" on file instead of "go run"... for now, there option "enable continuous testing":

bubblesort ctype sort Python -

for homework i'm trying make ctype array , pass bubble sort , return array. created array fine arrsize = int(input("how many numbers? ")) nums = (arrsize*ctypes.py_object)(*range(arrsize)) random.shuffle(nums) print(nums[:]) and when pass bubble sort get: < main .py_object_array_15 object @ 0x0000000003949bc8> here bubblesort code. def bubblesort(array): in range(len(array)): k in range(len(array) -1, i, -1): if (array[k] < array[k-1]): swap(array, k, k-1) return array def swap(a, x, y): tmp = a[x] a[x] = a[y] a[y] = tmp the code run make work "sorta" result = bubblesort(nums) print(result) does know im going wrong ive been looking @ ling i'm going cross eyed if getting <main.py_object_array_15 object @ 0x0000000003949bc8> as result only problem , should print (list ( result))

PHP IMAP fetch partial email message from Email service provider -

hello using php imap retrieve emails various email-service providers gmail, outlook etc my question these service providers in every single email body send new message @ top along email-chain(old-messages/conversation) @ end of email. when try retrieve individual email message content see both new message content entire conversation content, question there anyway can distinguish between new message content , conversation is there anyway can use php imap find out new message content in single email ps:- when conversation-content referring entire email conversation gets appended automatically @ end of every email

ssh - Git pull fatal error[could not read remote repository] -

i want pull , push code openshift. using gitbash. when pull got error: $ git pull fatal: '~/git/app.git/' not appear git repository fatal: not read remote repository. please make sure have correct access rights , repository exists. how solve it. i suppose remote named origin doesn't reference opehshift repo. type: git remote -v if url of remote repo wrong, change with: git remote set-url origin /url/openshift/repo see " using git repository " of getting started openshift online doc rhc specific commands.

c# - How to localized app tile title in app list? -

i want localize app tile title in windows phone 8 app .for using msdn sample , implemented of functionality according msdn sample neutral app title display.it not support language. while app data localized.in app list other app title changed according different language. you must create resource-only dll each display language application targets. here have @ this: http://www.cnblogs.com/promise-7/articles/2270760.html

continuous scrolling. AJAX, PHP, JAVASCRIPT, MYSQL -

i creating forum. so, there "order by" dropdown box i.e select tag in html. user selects order time or like, etc. ajax function called dynamically brings content page mysql database. select menu <select name="orderby" onchange="showposts(this.value)"> <option value="1" selected>by time</option> <option value="2">by genuine count</option> <option value="3">by dubious count</option> </select> showposts function function showposts(str){ orderby=str; if (window.xmlhttprequest) { // code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); } else { // code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4 && xmlhttp.status==200) { document.getelementbyid("pos...

email - PHP mail() changing some characters to htmlentities? -

my php mail() script changes ! exclamation mark on email clients such hotmail %21 when ! in tag in email body. here's script $to = "myemail@outlook.com"; $subject = "password reset"; $body = "<a href=\"http://example.com/#!/page\">link 1</a> <br><br> without href: http://example.com/#!/page - regular text "; $headers = "from: no-reply@example.com\r\n"; $headers .= "reply-to: no-reply@example.com\r\n"; $headers .= "return-path: no-reply@example.com\r\n"; $headers .= "x-mailer: php5\n"; $headers .= 'mime-version: 1.0' . "\n"; $headers .= 'content-type: text/html; charset=utf-8' . "\r\n"; mail($to,$subject,$body,$headers); so in script above, ! changed %21 when it's link, regular text keeps /#!/ instead of transforming /#%21/ how go fixing issue doesn't change %21 ? some characters encoded bec...

Migrating older Visual Studio solutions to 2013 -

i'm working on application contains 300 solutions visual studio 2005 2012. i've migrate these solutions visual studio 2013. there tool available scans older solutions in application folder recursively , migrate potential ones 2013? if not i'm ready write small utility i'm not sure start. provide guidance achieve that?

c# - String format TimeSpan in xslt 1.0 -

i have xml data contains timespan duration. present duration in number of minutes xslt transformation. use xslt 1.0. have answer ? data : <rds_tm_timespan>pt1m15.981s</rds_tm_timespan> xslt : <xsl:value-of select="((n:rds_tm_timespan) div 1000) div 60"/> the result nan i found solution using script, , without manipulate string. <ms:script language="c#" implements-prefix="user"> <![cdata[ public string timespanformat(string p_duration){ return xmlconvert.totimespan(p_duration).tostring(@"hh\:mm\:ss"); } ]]> </ms:script>

accessing scope data outside ng-view in AngularJs -

i have spa , body of index.html below: <body> <div id="wrapper"> <div data-ng-include src="'partials/header.html'"></div> <div data-ng-view=""></div> <div data-ng-include src="'partials/footer.html'"></div> </div> <script src="js/jquery.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="js/jquery.datatables.js"></script> </body> the header partials has many links mapped controllers , ng-view populated corresponding partial file. have display logged in username in header.html file not able access scope data inside header.html file. populating username inside controllers , putting same inside scope. please let me know how access scope data inside header.html can display username. code snipper inside contr...

Liquibase/SQLite syntax error -

so have sqlite database. game (c#) able open , run quite nicely. however, maintainability , potential conflict reasons, more manageable format. our project manager suggested liquibase. i'm not sure if it's out of date or what, not convert me, , i'm not sure why. here's got: running on windows 8.1 liquibase version 3.3.0 ( http://www.liquibase.org/download/index.html ) sqlite database made using sqlite manager demo version 4.3.5 ( http://www.sqlabs.com/sqlitemanager.php ) java version 8 update 25 sqlite-jdbc-3.8.7 ( https://bitbucket.org/xerial/sqlite-jdbc ) the command enter is... liquibase --classpath=sqlite-jdbc-3.8.7.jar --driver=org.sqlite.jdbc\ --url="jdbc:sqlite:gamedata.sqlite" --changelogfile=gamedb-canges.xml\ --username=username --password=password generatechangelog and error is... unexpected error running liquibase: liquibase.exception.databaseexception: liquibase.exception.databaseexception: java.sql.sqlexception: [sqlite_err...

Access 2007 vba - how do I count number of records in one of several tables and show total on form so it updates automatically? -

first of all, apologies - i'm beginner , third vba form. i'm having problems counting number of records field not null. we have records have been read in machine dbo_measquestimport, form allows user add batch name records on date, several different criteria - "checked x", "checked y" , records added manually "no paperwork". i show total number of records transferred table - called me.numrecordstorcards number on form - frmrcards2 . as dbo_measquestimport growing new records being read in, want count records batch name not null... the batch name added operator begins rec, if try count number of records start rec doesn't work…. the following don't work - please advise doing wrong? i'm doubtless doing stupid…! tried: me.numrecordstorcards = dcount("recno", "dbo_measquestimport", ["batch"] = "rec*") also: if dbo_measquestimport.checked "x" or "y" if dbo_...

linux - Nagios /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg -

when i'm running following command: [root@ssbpops01 libexec]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg i got next error: nagios core 4.0.4 copyright (c) 2009-present nagios core development team , community contributors copyright (c) 1999-2009 ethan galstad last modified: 03-14-2014 license: gpl website: http://www.nagios.org reading configuration data... read main config file okay... **error: not open config directory '/usr/local/nagios/etc/servers' reading. error processing object config files!** ***> 1 or more problems encountered while processing config files... **check configuration file(s) ensure contain valid directives , data defintions. if upgrading previous version of nagios, should aware variables/definitions may have been removed or modified in version. make sure read html documentation regarding config files, 'whats new' section find out has changed.** can please assist? ...

ruby - Dashing does not run on Heroku -

i'm trying deploy dashing heroku. everthing runs on localhost. deploying instructions provided github page it seems backports gem. below heroku log files 2014-11-26t21:12:22.141799+00:00 heroku[web.1]: state changed crashed starting 2014-11-26t21:12:32.932667+00:00 heroku[web.1]: starting process command `bundle exec thin start -r config.ru -e production -p 23294` 2014-11-26t21:12:40.618062+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/backports-3.6.0/lib/backports/1.9.1/io/open.rb:2:in `close': bad file descriptor - /app/vendor/bundle/ruby/2.0.0/gems/backports-3.6.0/lib/backports/1.9.1/io/open.rb (errno::ebadf) 2014-11-26t21:12:40.618144+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/backports-3.6.0/lib/backports/1.9.1/io/open.rb:2:in `<top (required)>' 2014-11-26t21:12:40.618185+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/backports-3.6.0/lib/backports/tools.rb:343:in `require_with_backports' 2014-11-26t21:12:40.618165+00:00 ...

git - Can I Use GitHub for Managing Directories and Files in my External Hard Disk? -

i on windows 7 i want use github or similar software manage external hard disk there movies , serials in external hard disk can make record of added new movies or deleted movies can github or suggest other software ? it seems there no current utility program can run on external hard disk , log past modification on it. this program should made constructor , not giving such service. all can keep traking thses information keep script history of modifications in it. exemple : nov 27, 2014 - fumbo - adding new serie : flash nov 27, 2014 - fumbo - removing film : frozen.mkv to can make python script take parameters , create log line. python logging.py add-serie "the flash" python logging.py rm-film "frozen.mkv" that script utility limitless. or can keep track of hand in file, think usage of git here much. hope helped you.

c++ - Always run test cases using CMake -

this question has answer here: cmake add_custom_command not being run 2 answers i using cmake , linux run test cases cmakelists.txt using following command: add_custom_command( target tests post_build command ${cmake_current_binary_dir}/tests ) this executes if code has been changed, there anyway run binary? for solution, had this: add_custom_command( output tests.a post_build command ${cmake_current_binary_dir}/tests ) add_custom_target( runtests dpeends tests.a ) use add_custom_target instead. executed @ every build. http://www.cmake.org/cmake/help/v3.0/command/add_custom_target.html add_custom_target( run_test command ${cmake_current_binary_dir}/tests )

ruby on rails - How do I pass a parameter to a form partial that is shown via CSS? -

so form partial loaded in div id="secondary" , hidden on first page load. when user hits button class called togglesidebar , _form.html.erb shown. i have overridden partial display new form (even if update pressed) when user not logged in this: <%= simple_form_for(post.new, html: {class: 'form-horizontal' }) |f| %> as opposed regular version looks this, , included in if statement on same partial: <% if current_user , current_user.has_any_role? :editor, :admin %> <%= simple_form_for(@post, html: {class: 'form-horizontal' }) |f| %> the real issue in view, when goes update , happens when user logged out: <%= link_to "update", "#", class: "togglesidebar" %> this perfect, executes css , shows empty form partial perfectly. however, when user logged in, want send parameter parent_id: @post execution of sidebar being toggled. this how looks normal new_post_path view (i.e. non-si...

ios - Trying to access id class method from swift -

i'm trying access following method soundcloud ios sdk swift code without success (the method seems not accessible , autocomplete not show too). hint? + (id) performmethod:(screquestmethod)amethod onresource:(nsurl *)resource usingparameters:(nsdictionary *)parameters withaccount:(scaccount *)account sendingprogresshandler:(screquestsendingprogresshandler)progresshandler responsehandler:(screquestresponsehandler)responsehandler; in bridging header file included #import "scapi.h" and make class methods call scsoundcloud.* or screquest.* , autocomplete fine. did add soundcloud libraries under build phases -> link binary libraries?

Search Widget doesn't open action view in ActionBar Android -

i trying achieve uniform action bar across app. trying add search widget. app displays magnifying glass, icon, , overflow menu icon in actionbar. i haven't yet added search functionality trying icon display how want it. the problem have on launch page magnifying glass displayed, , if clicked field entering search term appears. if user goes activity magnifying glass still appear in action bar if clicked nothing happen. difference other activities display "up" arrow left of android logo in action bar don't think reason search widget isn't working. how can fix user can enter search term page? below xml code: <item android:id="@+id/action_search" android:icon="@drawable/ic_action_search" android:title="@string/search_title" android:showasaction="collapseactionview|always" app:showasaction="always" android:actionviewclass="android.widget.searchview" /> my o...

asp.net mvc - MVC Kendo Grid Hyperlink column -

i want first column 'name' should 'hyperlink' template .but value should binded model hyper link each link have different name comes property of model. how this? tried in following way working .!! but getting rows first column's hyperlink text "show product details". want model values. don't want same columns @(html.kendo().grid<cutomers.model.customerdatamodel>() .name("grid") .columns(columns => { columns.bound(p => p.name).clienttemplate("<a href='" +url.action("productdetails", "product") +"/#= filename #'" +">show product details</a>"); columns.bound(c => c.createddate).width(70); columns.bound(c => c.createdby).width(70); }) .htmlattributes(new { style = "height: 350px;" }) .scrollable() .groupable() .sortable() .pag...

php - $session data returns only 0 -

i'm trying put script math user. works fine when try put in session , try show value user return 0 if set 0. know did wrong? <?php session_start(); if( isset( $_server['http_x_requested_with'] ) ){ $class1 = filter_var($_post['class1'], filter_sanitize_string); $class2 = filter_var($_post['class2'], filter_sanitize_string); $class3 = filter_var($_post['class3'], filter_sanitize_string); $class4 = filter_var($_post['class4'], filter_sanitize_string); $class5 = filter_var($_post['class5'], filter_sanitize_string); $class1c = $class1 * 35; $class2c = $class2 * 5; $class3c = $class3 * 7.5; $class4c = $class4 * 26; $class5c = $class5 * 2.5; $totaal1 = $class1c + $class2c + $class3c + $class4c + $class5c; $res = array($class1c, $class2c, $class3c, $class4c, $class5c, $totaal1); foreach($res $name => $var) { $_session[$name] = $var; } $result = array("error" => false, "html" => null); $...

Very slow Vagrant SSH port forwarding -

i've installed new vagrant box local development using puphpet, , while connection through vagrant box local ip fast, port-forwarded 1 slow, taking 3-5 seconds complete. this considerably impacts phpunit testing, i'm running through phpstorm ide. i've tried disabling usedns , gssapiauthentication in sshd_config, no improvements. any idea else can checked? you wrote tried editing sshd_config. sshd server, try editing client file (without 'd'). set gssapiauthentication=no in /etc/ssh/ssh_config . when want test without root-access, cp file local_file , use ssh -f path/to/local_file ....

Visual Studio 2013 and Oracle 11g express : how to connect? -

i'm trying reach oracle database through visual studio server explorer. i've installed oracle 11g express edition , i've downloaded sql developer tool. default, "system user" created , we've give password , did it. when comes connect db via vs 2013, choose oracle provider , i'm asked enter server name, username , password. guess username , password system credentials server name? how can find it? xe default? because when i'm trying that, i'm getting error : ora-12154: tns: not resolve connect identifier specified thanks help. it's expecting oracle net setup i.e. tnsnames.ora clients , listener.ora server. use oracle net manager set these up. or use thin driver , connect directly listener (usually port 1521) http://www.oracle.com/technetwork/developer-tools/visual-studio/overview/index.html

javascript - First time using node.js - "ReferenceError: node is not defined" -

i installed node.js. tried writing node -v should check version - , it's not working. output: > node -v referenceerror: node not defined @ repl:1:2 @ replserver.self.eval (repl.js:110:21) @ interface.<anonymous> (repl.js:239:12) @ interface.emit (events.js:95:17) @ interface._online (readline.js:202:10) @ interface._line (readline.js:531:8) @ interface._ttywrite (readline.js:760:14) @ readstream.onkeypress (readline.js:99:10) @ readstream.emit (events.js:98:17) @ emitkey (readline.js:1095:12) > i opened using git - command: node i tried running using "git", thought maybe that's issue , exact same output. i using windows 8 if it's relevant - followed tutorial till now: https://www.youtube.com/watch?v=tlnte8fe6u4 http://youtu.be/fqmiyth9wsg how make work? it looks have entered node repl , typed node -v the news means node working! to check version here can type process.version node version. alternativ...

Django and query string parameters -

assuming have 'get_item' view, how write url pattern following php style of url? http://example.com/get_item/?id=2&type=foo&color=bar (i not using standard 'nice' type of url ie: http://example.com/get_item/2/foo/bar not practical) specifically, how make make view respond when user types above in browser, , how collect parameters , use in view? i tried @ least id part right no avail. view won't run when type in browser http://example.com/get_item?id=2 my url pattern: (r'^get_item/id(?p<id>\d+)$', get_item) my view: def get_item(request): id = request.get.get('id', none) xxxxxx in short, how implement php's style of url pattern query string parameters in django? make pattern this: (r'^get_item/$', get_item) and in view: def get_item(request): id = int(request.get.get('id')) type = request.get.get('type', 'default') though normal detail views etc. ...

javascript - AngularJS: Factory and filters - factory is not working -

i have code, , works: var app = angular.module('twitterapp', ['twitterapp.services', 'ngsanitize']); app.filter('clearimage', function () { return function (text) { var str = text.replace(/_normal./g, '.'); return str; }; }); app.filter('links', function () { return function (text) { var str = text.replace(/@([^ ']+)/g, function(u, screen_name) { var link = '<a target=blank href="http://twitter.com/intent/user?screen_name=' + screen_name + '">' + u + '</a>'; return link; }); str = str.replace(/#([^ ']+)/g, function (t, hash) { var link = '<a target=blank href="https://twitter.com/hashtag/' + hash + '?src=hash">' + t + '</a> '; return link; }); return str; }; ...

jquery - How to get value from input element as a number in decimal -

i wnat values input elements numbers , count them jquery. i'm trying, result not on decimal. how fix problem ? html <input name="test1" value="1.77" type="hidden" /> <input name="test2" value="1.23" type="hidden" /> jquery var = parseint($( "input[name='test1']").val(), 10); var b = parseint($( "input[name='test2']").val(), 10); alert( + b ); // should 3, 2 here example -> jsfiddle example use parsefloat decimals , not parseint (which integers)! e.g. var = parsefloat($( "input[name='test1']").val(), 10); var b = parsefloat($( "input[name='test2']").val(), 10); var c = ( + b ); $('#result').append( c ); jsfiddle: http://jsfiddle.net/trueblueaussie/87tdj7z3/5/

sql - Query to get intersect -

i solving problems spj database. s(snum, sname) [supplier] p(pnum, pname) [part] j(jnum, jname) [project] spj(snum, pnum, jnum, q) the query is: pairs of projects have @ least 100 parts in common. have written code far: select x.jnum, y.jnum spj x, spj y 100 <= (select count(pnum) (select pnum spj spj.jn=x.jn intersect select pnum spj spj.jn=y.jn)); i think solution correct. there other way solve problem? simply same-part combinations, see how many matches per project pair: select spj1.jnum jnum1, spj2.jnum jnum2 spj spj1 join spj spj2 on spj1.pnum = spj2.pnum , spj1.jnum < spj2.jnum group spj1.jnum, spj2.jnum having count(distinct spj1.pnum) >= 100;

swift - How to use String object in the String format class method -

suppose have string object in swift , want use string format class method combine , several other objects this: var foo = 0 var str = "str" string(format: "%d (%s)", foo, str) this example doesn't work expected because %s can't handle string objects. how can then? thanks in advance. string(format:) bridged -[nsstring initwithformat] method , accepts same format specifiers, such %@ objects. string bridged nsstring automatically, therefore can use %@ swift strings well. note swift int type corresponds long in c: var foo = 0 var str = "str" let result = string(format: "%ld (%@)", foo, str)

mysql - match against query numeric value not found -

i have problem match against query. getting 0 result in query when pass onlu numeric value here query : select * tbl1 match( sub_name ) against('+praga*' in boolean mode) , match( sub_address ) against('+203*' in boolean mode) // result 0 row found select * tbl1 match( sub_name ) against('+praga*' in boolean mode) , match( sub_address ) against('+203 s*' in boolean mode) // result found when use numeric in (203) 0 result use char 203 s result found, , address field value "203 surat" its because wildcard * in boolean mode returns matches start word appended to. in case no word starts 203 suppose. hence have specify word/letter acts starting part of match. in case 's' refer the asterisk serves truncation (or wildcard) operator. unlike other operators, should appended word affected. words match if begin word preceding * operator.

python - Sorting a list inside dictionary keys -

i have dictionary has student names key , list 3 scores test stored inside. i need output keys in alphabetical order having list sorted in order high low. any massively appreciated. def task3(): import pprint classlist = {} classsearch = input("which class interrogate? ") try: open("answers " + classsearch + ".txt", 'rb') handle: classlist = pickle.loads(handle.read()) except ioerror error: print ("sorry, file not exist") sortoption = int(input("would sort students in alphabetical order? enter 1")) if sortoption == 1: #how sort list in order, guess have loop on dictionary able access keys pprint.pprint(classlist) i think want achieve : dictionary = {'louis': [2, 10, 1], 'john': [6, 1, 16] } name in sorted(dictionary.keys()): print name print sorted(dictionary[name], reverse=true) ...

javascript - the callback function doesn't see 'this' -

my callback function doesn't see 'this' here code of binding keypress: initialize: function () { $(document).bind('keyup', this.keypress); _.bindall(this, 'rotate'); }, rotate: function (event) { //smth... } here function keypress: keypress: function(event) { console.log(event.keycode); var pagex = 0, pagey = 0; var ev = new object(); ev.pagey = pagey; ev.pagex = pagex; func = this.rotate; func(ev); //also tried this: //this.rotate(ev); } it error: "uncaught typeerror: undefined not function" i can't it. i appreciate help, thank you! the problem here in jquery, bind adds event listener, not set context of 'this' you need bind method context, using underscore. e.g. initialize: function () { $(document).bind('keyup', _.bind(this.keypress, this)); _.bindall(this, ...

android - configure Button programmatically doesn't work -

i go button: <button android:id="@+id/dialog_menu_topic" style="@style/dialog_menu_topic"/> with style reference: <style name="dialog_menu_topic"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:layout_alignparentright">true</item> <item name="android:layout_alignparenttop">true</item> <item name="android:text">@string/menu_button</item> <item name="android:onclick">menubuttonclicked</item> <item name="android:visibility">visible</item> this activity declared dialog: <style name="dialog_style" parent="@android:style/theme.dialog"> <item name="android:windownotitle">true</item> and if do: @overr...

python - Return binary and parametric data from bottle web service -

i trying write web service performs data processing. requests contain data vector binary file, , meta-data , processing parameters form data. example using python requests: import numpy np import requests url = 'http://localhost:8080/pp' payload = {'param_a': 4, 'param_b': -2.1} file = {'binary_data': ('file_name.bin', bytes(np.random.randn(1000))} r = requests.post(url, data=payload, files=file) now on service side, have: import bottle import numpy np @bottle.post('/pp') def pp(): file_path = '/home/generic_user/howhaveyou.bin' return_file_path = '/home/generic_user/finethanks.bin' bin_file = bottle.request.files.get('binary_data') bin_file.save(file_path, overwrite=true) param_a = float(bottle.request.forms.get('param_a') param_b = float(bottle.request.forms.get('param_b') data_vector = np.fromfile(file_path) processed_data_vector = (data_vector-para...

qt - How to implement a tree-based QComboBox -

how can implement qcombobox allows choose tree structure, akin qtreeview ? i came following class ( treecombobox ) using two-part recipe @ developer.nokia.com ( part 1 , part 2 ): from pyqt5.qtcore import * pyqt5.qtwidgets import * pyqt5.qtgui import * class treecombobox(qcombobox): def __init__(self, *args): super().__init__(*args) self.__skip_next_hide = false tree_view = qtreeview(self) tree_view.setframeshape(qframe.noframe) tree_view.setedittriggers(tree_view.noedittriggers) tree_view.setalternatingrowcolors(true) tree_view.setselectionbehavior(tree_view.selectrows) tree_view.setwordwrap(true) tree_view.setallcolumnsshowfocus(true) self.setview(tree_view) self.view().viewport().installeventfilter(self) def showpopup(self): self.setrootmodelindex(qmodelindex()) super().showpopup() def hidepopup(self): self.setrootmodelindex(self.view().c...

javascript - Why the play stop pause buttons and progressBar are not displaying at all? -

Image
this jsfiddler issue big images wanted add buttons play stop pause , progressbar on big images: jsfiddler when i'm doing inspect element don't see errors in red. took code of jquery: automatic slideshow timer, play-, pause-, previous- , next- and before used coolcarousels jquery: cool responsive image slider thumbnail carousel cool responsive image slider and code have now: in html file: <!doctype html> <!-- --> <html> <head> <link rel="stylesheet" type="text/css" href="carousel.css"> <link rel="stylesheet" type="text/css" href="glow-effect.css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery.caroufredsel/6.1.0/jquery.caroufredsel.packed.js" type="text/javascript...

node.js - I am unable to convert http.get image into base 64 -

app.getimage = function() { var image = meteor.http.get("https://turtlerock-discourse.global.ssl.fastly.net/user_avatar/talk.turtlerockstudios.com/takran/45/879.png", { }); var prefix = "data:image/png;base64,"; var imagebase64 = new buffer(image.content, 'binary').tostring('base64'); imagebase64 = prefix + imagebase64; console.log(imagebase64); return imagebase64; } but not seeing results, help? dummy text error. a pure meteor solutions: var response = http.call('get', url,{npmrequestoptions: { encoding: null }}) var data = "data:" + response.headers["content-type"] + ";base64," + new buffer(response.content).tostring('base64');

Scheduled Tasks not running - Coldfusion Server Administration -

i have series of scheduled tasks run @ various times of day. since migration coldfusion version 7 10, these tasks have stopped running. when check box, outputs results file, text file says nothing more "connection failure". have tried imaginable regarding username , password task. makes no difference. when run cfm page in browser, page works correctly , generates email should. can't make run scheduled event. is scheduled task folder has check session or anything? mean scheduled task folder accessible without login? please try removing redirect rules application. might work.

asp.net mvc 4 - Store and Sync local Data using Breezejs and MVC Web API -

i want use breezejs api storing data in local storage (indexdb or websql) , want sync local data sql server. but failed achieve , not able find sample app of type of application using breezejs, knockout , mvc api. my requirement is: 1) if internet available, data come sql server using mvc web api. 2) if internet shutdown, application retrieve data cached local storage (indexdb or websql). 3) internet on, local data sync sql server. please let me know can achieve requirement using breezejs api or not? if yes, please provide me , links , sample. if no, other can use achieving type of requirement? thanks. please me meet requirement. you can this, suggest using localstorage. basically, every time read server or save server, export entities , save local storage. then, when need read in data, if server unreachable, read data localstorage , use importentities manager , query locally. function getdata() { var query = breeze.entityquery .f...

opencv - BOW with more 2-classes SVMs of one multiclass SVM -

because opencv's forum has problem, want post question here too. in example of bow opencv, there trained 2-classes svm classifier each class. why isn't use multi-class svm instead? if this, then, supposing have x classes, have load x svms , predict x times image. because code large , uses large dataset, takes long doing research. [ have managed start training first svm classifier opencv's bow example, says: 143 positive training samples; 2356 negative training samples i wondering if not bad classifier... maybe train_auto find needed parameters not bad. think? ]

jquery - Delete all javascript from ajax modal on close/hidden -

i'm making website music , lyrics. when song playing users can click on lyrics button , modal live lyrics appears. if click lyrics 1 song works perfect close modal , click on lyrics of song overlap both lyrics. this because javascript previous modal still in code. how can delete data including javascript when modal hidden/closed. <div> <a id="lyrics" href="" data-toggle="ajaxmodal" title="lyrics"> <i class="fa fa-list-alt"></i> </a> </div> sorry bad english :$ using pure js, can use . innerhtml method clear contents of object. example: <div id="scripts"><script>//your scripts here</script></div> then var oscripts = document.getelementbyid("scripts"); oscripts.innerhtml = ""; but don't think work scripts, because once script loaded doesn't matter if delete dom. removing script tag specific...

haskell - How can I make this Sudoku algorithm get unstuck after the first fail? -

im playing around sudoku solver shown below. problem i'm having don't know how use backtracking solver go after fails first try. shown in last code snippet algorithm stops when hits first illegal solution , returns nothing . how can make go , try solution until finds one? -- updates specific sudoku value @ specific position update :: sudoku -> pos -> maybe int -> sudoku -- returns blank possitions in sudoku blanks :: sudoku -> [pos] -- checks size correct 9x9 issudoku :: sudoku -> bool -- checks if legal sudoku, no number twise on line col or box isokay :: sudoku -> bool -- checks if there no empty cells in sudoku issolved :: sudoku -> bool solve :: sudoku -> maybe sudoku solve s | not $ issudoku s && isokay s = nothing | otherwise = solve' $ pure s solve' :: maybe sudoku -> maybe sudoku solve' nothing = nothing --there no solution solve' (just s) | issolved s = pure s -- found solution | otherwise = solve...