Posts

Showing posts from August, 2011

python - Django - how to permanently set I18N -

i'd set permanently language site in way example .de domain opens in deutch language. have 1 code markets each has own translations. in other words i'd avoid situation when has os locale set on , can see site in english despite fact he/she connects .de domain. is there way enforce translation specific language per installation? django 1.5 thanks b. i've used langbytldmiddleware in project, worked fine. upd: might have misunderstood question. middleware useful if serve several domains same filebase, , want set default language basing on site tld. if handle .de domain , want force deutch set languages , language_code in settings.py: language_code = 'de' languages = ( ('de', u'deutsch'), )

xdebug - Problems with database links on phpmyadmin interface -

i'm having bunch of problems phpmyadmin. have been using tool years , never had problems until last week, since, can't manage make work properly. didn't changes system, apache, php, mysql , phpmyadmin not touched/changed before problems started. actual symptoms: words on links on database list don't work. if click name of database, "loading..." text in yellow background appears on middle of screen, nothing happens, , never dissappear. if click "+" sign on database list, database expands , can see tables, new table, , indexes options. if haven't clicked name of database first. from top menu, "databases" link times work , times doesn't. if copy link database on list @ left of screen , pate on address bar of browser, tries take different address, instance, link " http://phpmyadmin.local/db_structure.php?server=1&db=cosa&token=20b203d3e8b93424798c61ddb6af844e " take me " http://www.phpmyadmin.local/db_...

Share model object in java mvc -

i'm making application mvc architecture. question is: how can share istance of model between many classes in controller? it difficult 'cause i'm using listener,i call listener controller passing model: class buttonlistener1 implements actionlistener { @override public void actionperformed(actionevent e) { system.out.println(e.getactioncommand()); if(e.getactioncommand().equals("inizia")){ //call controller passing model } } } when construct button, can set model.

Checking if element exists with jQuery -

i have block of code looks this: //account number account = $(msg).find('[name=account_number]').val(); if(account){ $('#progressupdates').append('<span class="glyphicon glyphicon-ok"></span>&nbsp;&nbsp;found account number<br />'); }else{ $( '#progressupdates').append('<span class="glyphicon glyphicon-remove"></span>&nbsp;&nbsp;account number not found<br />'); } the problem is, if element being assigned account doesn't exist, throws error. tried doing : if(account.length){} but issue isn't if statement, assigning variable. there better solution this? don't call val() account = $(msg).find('[name=account_number]'); and chack length - if(account.length){

c - WRMSR on x86_64 64bit RCX register value is wrongly set -

i want write pmc1 register, want set rcx 188. the code use use wrmsr instruction attached @ end. problem pass eax , ecx value (64bit) macro, but %rcx register set eax value. #define rtxen_write_msr(eax, ecx) __asm__ __volatile__(\ "movq %0, %%rax\n\t"\ "xorq %%rdx, %%rdx\n\t"\ "xorq %%rcx, %%rcx\n\t"\ "movq %1, %%rcx\n\t"\ "wrmsr"\ :\ :"r" (eax), "r" (ecx)\ :\ ) uint64_t eax = 0x14f2e uint64_t edx = 0x188 printk("eax:%#018lx, edx:%#018lx\n", eax, edx); rtxen_write_msr(eax, ecx); when rtxen_write_msr(eax, ecx) executed, kernel panic! register information follows: (xen) cpu: 1 (xen) rip: e008:[<fff...

c# - moving web api controllers within solution -

i have visual studio mvc5 project, have telerik data access project, have created web api controllers form data access models. question is: can move created controller files (.cs) root of project folder? controllers folder example. hope makes sense , in advance. you can move controllers folder , web api framework find long controllers implement interface system.web.http.controllers.ihttpcontroller or inherit apicontroller , implements interface , common usage pattern.

Change default User login text in Drupal -

Image
i change default user login text in drupal client login? not able figure out php file has piece of text. can let me know? thanks! go block listing page admin/structure/block , , click on configure next user login block. (or go admin/structure/block/manage/user/login/configure directly) , set title want field block title .

remove index.php with alternative routing in codeigniter -

i'm working on project in codeigniter doesn't use standard routing.php file. calls functions this: test.vi/index.php/controller/function. my goal remove index.php url htaccess rewrite: rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule .* index.php/$0 [pt,l] and config.php change: $config['index_page'] = ''; my question need route controllers/functions in route.php or can done without using route.php file? first make sure enabled mod_rewrite in httpd.conf: to add/make sure exsits line loadmodule rewrite_module modules/mod_rewrite.so then create .htaccess in codeigniter root folder (next index.php file) not application folder. .htaccess directoryindex index.php rewriteengine on rewritecond $1 !^(index\.php|img|css|js|robots\.txt|favicon\.ico) rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ ./index.php/$1 [l,qsa] codeigniter take car...

python - Struct definition with typed memoryview as member -

currently trying struct typed memoryview work. e.g. ctypedef struct node: unsigned int[:] inds if inds not memoryview works flawlessly far can see. however, memoryview , using def testfunction(): cdef node testnode testnode.inds = numpy.ones(3,dtype=numpy.uint32) i segmentation fault. there obvious overlooking or typed memoryviews not work in structs? edit: so rewrote example little bit (due larsman's questions) clarify problem little bit: def testfunction(): cdef node testnode cdef unsigned int[:] tempinds tempinds = numpy.ones(3,dtype=numpy.uintc) testnode.inds = tempinds only last line produces segfault. don't know how check problem in more detail. me looks structs can't handle typed memory views... missing something. i using cython 0.20 (just updated now, 0.19 gave same error). updated numpy 1.8.0 well. edit 2: if similar problems reads in future: searched quite lot , can't work. else working except memor...

java - Add a mouseListener to a JTable having mysql data -

i have class,that takes values mysql database,i want add mouselistener has function: -select row or cell on jtable , modify selected value or delete selected row. -the changes made on jtable should visible in table of mysql database it possible ? thanks. import java.awt.*; import java.sql.*; import java.util.*; import javax.swing.*; import databaseconnectionsingleton.connection; import databaseconnectionsingleton.creationstatement; public class showemployee extends jframe { /** * */ private static final long serialversionuid = 1l; public showemployee() { vector<string> columnnames = new vector<string>(); vector<vector<object>> data = new vector<vector<object>>(); try { connection.getconnectioninstance(); statement st = creationstatement.getcreationstatementinstance(); resultset rs = st.executequery("select * employee"); resultsetmetadata md = rs.getmetadata(); ...

c++ - How can I reduce the debugging overhead from non-exceptional exceptions -

we using api heavily relies on exceptions returning non-exceptional results. example of (out of many) ascertain whether user in group of people, have attempt group , interpret resultant "no group" exception. furthermore, these exceptions of 1 type. we working on large , complex project using c++11 heavily multi-threaded, furthermore area working on concerns network communication, @ points have debug multiple instances concurrently. our problem, , basis of question, arises because of impact non-exceptional exceptions have on our workflow. reticent turn off first-chance exception reporting single exception type thrown api because mean if have call api coder has missed try/catch block unwind main , loose context of call. if leave exceptions on simple non-exceptional behaviour, such described in example above, can result in multiple breaks (the initial throw , potentially rethrows), , can verify in fact non-exceptional exception querying stack, of non-main thread, find ap...

web services - What is the Open-source equivalent of WebAPI? -

in past i've done webapi http service development on microsoft platform (both asp based , self-hosted) i'm beginning learn how web development outside of microsoft platform. question is: open-source equivalent of webapi? specifically, how 1 create back-end part of web application, featuring multiple controllers (or similar constructs) , each controller has own set of crud operations. example, webapi create customerscontroller, productscontroller, orderscontroller, , each 1 have get, post, dlete , put operations respective domain model. these controllers exist within same web application. so, i'm looking way create such application using open-source stack. first of all: webapi indeed open source (see http://aspnetwebstack.codeplex.com/ ). if want "deploy outside of microsoft platform": want stick .net? if want stick .net, can recommend servicestack . should @ license model first. afaik have changed mit license different. don't know if can still u...

android - baseActivity starts Activity/Dialog from Navbar. What Activity is under the dialog -

i hesitated ask question don't have code blocks show. problem more conceptual. i have baseactivity handles actionbar. baseactivity inherited across activities actionbar accessible everywhere. app shopping app , 1 of buttons on actionbar set "view shopping cart" activity in dialog theme looks popup on whatever activity running when user pressed button. within cart, want have buttons give user quick access add new items in catalog. press button, start catalog , let user shop. works fine. the problem if catalog current activity when dialog invoked, i'd dismiss dialog , go catalog - otherwise, have 1 instance of catalog running , pressing button causes instance. is possible determine activity active when dialog invoked actionbar? you might find intent flags can handle behavior looking for. example, when build intent launch catalog add: flag_activity_reorder_to_front - not create new activity if in task stack , job of bringing existing activity top ...

javascript - Avoid jQuery click function on <a href=""> elements -

this question has answer here: disable hyperlink using jquery 11 answers i have following click function on div element. inside div element links. how can stop click function on links? tried z-index doesn't work. $('.thumb.flip').click(function () { if ($(this).find('.thumb-wrapper').hasclass('flipit')) { $(this).find('.thumb-wrapper').removeclass('flipit'); } else { $(this).find('.thumb-wrapper').addclass('flipit'); } }); add code stop click propagating links dom div: $('a').click(function(e){e.stoppropagation();}) see http://api.jquery.com/event.stoppropagation/ jsfiddle example

android - Get mailto field from intent -

i have put app option share when click on email address. how can field "mailto" intent? intent { act=android.intent.action.view dat=mailto:xxxxxxx@xxxxx.xxx flg=0x3000000 cmp=net.a2system.yambing/.activities.contactschooser (has extras) } i know easy tried , can't. thanks! try use intent.getdata() method.

c# - Proposed WCF Model is this Possible? -

Image
i new wcf. below proposed wcf model possible? there components it. save files convert files i can use multiple instances of wcf in part 1 restricted use 1 instance in part 2 of wcf. is model possible. if yes, how can make part of wcf as [servicebehavior(instancecontextmode = instancecontextmode.single] and part two [servicebehavior(instancecontextmode = instancecontextmode.multiple] please me technical details.

wso2 - Extending the SCIM schema with wso2is 4.6.0 -

i new wso2is, , i'm trying add extended schema scim user management described in http://docs.wso2.org/display/is460/extensible+scim+user+schemas+with+wso2+identity+server i able enable extended schema in configuration file, claims mapping , create user extended claims, problem when request user information through /user/ or /users endpoints, can't find way have extended attributes included in result, contains standard scim schema attributes. suggestions? i think have mapped claims http://wso2.org/claims dialect. need map claims under urn:scim:schemas:core:1.0 dialect. once map these under urn:scim:schemas:core:1.0 dialect, request populate extended claims well. regards, venura

asp.net - Bundles Caching and Web farms -

i know implications of modifying bundles collection dynamically (say during load of page). tried adding new script file bundles collection (originally created in app_start). working fine in initial test, - 1 difference noticed browser not caching bundled script , style(sending new requests on every refresh). know if there way force caching of bundle script/style after initial fetch. i have static scripts , styles loaded bundles collection in app_start itself. have piece of code in master page load, check existence of page specific script or styles (for ex. lets page abc.aspx being loaded, code existence of abc.js in scripts folder , abc.css in styles folder). if exists it'll loaded page header. tried adding bundles. best approach make these conditional scripts/styles part of default bundle collection? my production environment web farm. there should have url v hash remain same across servers? i'd read comment "hao kung" here , explaning bundle caching issu...

php - Close connection PDO -

i using php-mysql-pdo-database-class / db.class.php project not able close connection in this. here trying: $hpsb = new selectmodel(); $hpsb->find('1'); echo $hpsb->model; $close = new db(); echo $close->closeconnection();// connection should close here echo $hpsb->id;// getting output here connection not closed please the connection remains active lifetime of pdo object. to close connection, need destroy object ensuring remaining references assign null variable holds object. $hpsb = null if don't explicitly, php automatically close connection when script ends.

php - inserting multiple photos into mysql database -

here code, has connection database included: session_start(); require 'config2.php'; require_once 'user.class.php'; $target = "uploads/"; $target1 = "uploads/"; $target = $target . basename( $_files['photo']['tmp_name']); $target1 = $target1 . basename( $_files['photo1']['tmp_name']); //this gets other information form $login = $_session['login']; $name=$_post['name']; $name1 =$_post['name1']; $pic=($_files['photo']['name']); $pic1=($_files['photo1']['name1']); $id=$_session['id']; // connects database print_r($_post); print_r($_files); print_r($_session); print_r($_get); //$op = mysql_query("select id users id = '$id' "); //writes information database mysql_query("insert users (name, photo, name1, photo1) values ('$name', '$photo', '$name1', '$photo1') login = '$login...

asp.net - WebForm and MVC Project running side by side. Unobtrusive validation not working -

i have webform project want add mvc 5 new stuff developed mvc. 1 of features use in mvc unobtrusive client side validation. can't seem make work in scenario. validation works in server side not work on client side. inspecting tags notice attributes not being generated. don't have javascript error showing in browser console. if in pure mvc5 project works fine. have idea how can make work? missing something? the way have been testing is: i create webform project( using framework 4.5). i add nuget mvc5 project. create area. add arearegistration.registerallareas(); global.asax can use areas. add nuget: jquery validation microsoft jquery unobtrusive validation create controller in previous created area , add view. in web.config of view folder add appsettings: then create model , add validation. view index: @model merda.areas.branchen.models.testmodel @{ viewbag.title = "index"; } <h2>index</h2> <script src="~/scripts/jque...

jquery - Select inputs from only one form -

i have 2 forms on page: <form id="form2070" name="form2070" class="myform"></form> <form id="formu2070" name="formu2070" class="myform"></form> from first form, i'd select input fields. if (sw 2070, checked): var child = $('#form'+sw+' input'); it selects input-fields on page, second form. doing wrong (obviously, what?) secondly, need type='text' fields form. i'm looping trough array find them: $(child).each(function(){ if( $(this).prop('type')=='text' ){ //do } } i tried using $('#form1 input[type="text"]') didn't work. there way filter them out in 1 statement? [update][solved] problem solved. altough both forms propperly closed, left 1 <div> inside first form without corresponding </div> , messing up. thanks suggestions , help! try this, $('document').ready(function(){ ...

tweets - How to get "bigger-size" user image with Twitter API 1.1? -

i'm trying last 5 tweets person. did it, profile picture not looking normal, resolution corrupted. that. ! http://i.hizliresim.com/wlqejz.jpg var $twitter = $('#twitter'); $.getjson('http://www.demo.net/twitter.php?username=yeniceriozcan&count=5', function(data){ var total = data.length, = 0; $twitter.html(''); // önce içindekini temizle sonra tweetleri yazdır. ( i; < total; i++ ){ var tweet = data[i].text; // tweet var date = parsetwitterdate(data[i].created_at); // tarih var image = data[i].user.profile_image_url; // profil resmi var url = 'https://twitter.com/' + data[i].user.screen_name +'/status/' + data[i].id_str; $twitter.append('<div class="tweet"><a target="_blank" href="' + url + '"><img src="' + image + '" alt="" class="profile...

How to load the DLL from the main project c++ -

i have created project uses 2 dll's play against each other (a dll player). game first player picks number , second player picks number, , playround function compares 2 numbers. problem not sure how load dll (run/load time). created first dll (simple.dll) has pick function returns "int 2" simplicity: #include "stdafx.h" #define asexport #include <iostream> #include "player.h" using namespace std; int pick(int round, int mymoves[], int opponentmoves[]) { return 2; } this project have header (player.h) following code: #ifndef asexport #define dllimportorexport dllimport #else #define dllimportorexport dllexport #endif _declspec(dllimportorexport) int pick(int round, int mymoves[], int opponentmoves[]); not sure include code include in main or in function: hinstance hinstlib; myproc procadd; bool ffreeresult, fruntimelinksuccess = false; // handle dll module. //hinstlib = loadlibrary(text(player2name)); ...

Firebase REST api filtering -

looking @ data in firebase structure so /debugevents/0/ /debugevents/1/ /debugevents/2/ under each of levels actual data objects. i know can make requests /debugevents/0/ & /debugevents/ all, if wanted filter /debugevents/0/ & /debugevents/2/ ignore /debugevents/1/ ? is possible? thanks credit @andrewlee "not currently, no. you'd need request items individually"

excel - VBA Form Completion across multiple worksheets -

i have standard template i've designed in wkbk 1 using grade teachers. wkbk 1 has 15 different worksheets, or 1 per teacher. in wkbk 2 , have table using keep scores on different functions. i'm using macro (or attempting to) extract data in wkbk 2 , dump in wkbk 1 . when attempt loop macro throughout worksheets, macro pulling teacher 1 , assigning scores teachers 2-15. sub scorecard() dim current worksheet each current in worksheets range("teacherytd") = "='[teacher formula.xlsx]sheet1'!r3c2" range("b7:c7").select range("teachercco") = "='[teacherformula.xlsx]sheet1'!r3c3" range("f6").select next end sub i using 'define' point 1 cell across workbooks. not sure if preferred way, direct beginner vba programmer. can me figure out how "step" next row gather proper teacher's scores? try below. it's rough , untested , you'll ...

bash - How to save the result of grep to variable x? -

#!/bin/bash in *.pdf; echo $i x= pdfinfo "$i" | grep "title" # nothing stored in variable x echo $x if [ ! -z $x ]; echo $x # print null cp $i "$x" fi done nothing stored in variable x — why not , how do it. add parentheses or backquotes: x=$(pdfinfo "$i" | grep "title") or x=`pdfinfo "$i" | grep "title"` note latter solution should avoided now, historical way of doing , replaced $(...) . $(...) solution more readable in particular in case of nested substitutions.

php - Simple HTML form with Select Option disabled, is allowed to submit in Chrome and IE. Works fine in Firefox -

i have simple html form submits page. select options being used 1 being 'disabled' , 'selected'. in chrome , internet explorer form allowed submitted, in firefox works correctly , tells me select option. code: <form name=cars method=post action=submit.php> <select required> <option value="volvo" disabled="disabled" selected>volvo</option> <option value="saab">saab</option> <option value="vw">vw</option> <option value="audi">audi</option> <input type=submit value=submit name=submit> </select> </form> in firefox, expected, when hit submit button, message: "please select item in list." on ie , chrome tries submit submit page. above solution work in browsers except ie 7-8-9, required attribute; ie 10: works fine. ie 9: required attribute doesn't trigger validati...

parse.com - Parse Android SDK, saveAll subclass objects? -

i'm using parse sdk on android. there doesn't seem documentation on using parseobject.saveall(list<parseobject>) method. have subclass called test extends parseobject . i've been able use parseobject methods far, save whole list using saveall method, requires list<parseobject> , won't accept list<test> . ideas? your parseobject model may this class person extends parseobject { public static string name = “name”; public static int age = “age”; public void setname(string name) { put(name,name); } public void setage(int age) { put(age,age); } public stirng getname() { return get(name); } public int getage() { return get(age); } } now,person subclass of parseobject. can use parseobject.saveall(list personlist) person person1 = new person(); person1.setname("mike"); person1.setage(18); person person2 = new person(); person2.setname(...

c# - The Door Game Random Number Program -

this question exact duplicate of: how can correctly write c# program? [closed] 1 answer i want create program able function using priorities have set in algorithm! user can select random number until specified number found correct answer...it has 1 error @ moment, need improvising solution until compiles correctly.. using system; using system.collections.generic; using system.linq; using system.text; namespace door_game_remade { class program { static void main(string[] args) { int keynum = 5; // int correctnum = 0; int correctkey= 5; int mindoors = 1; int maxdoors = 10; random getdoor = new random(); int door = getdoor.next(mindoors, maxdoors); console.writeline(" please enter key unlock door: {0}", keynum); (int = keynu...

Grails list max results -

i have controller below returns 100+ results , want able pass 10 results json call , sort of method if more results desired request should made i'm not sure how go doing this. here's except of controller def list(){ def results = domain.list(max: 10) withformat { json (render results json) } } can point me in write direction can read on documentation or see sample codes might this. thanks! the default scaffolding templates place show how pagination in list action. how this: def list(){ // max 10 unless else requested if(!params.max) params.max=10 def results = domain.list(params) withformat { json (render results json) } } to request next page of results you'd use .../list?offset=10&max=10 , next use offset=20 , etc. refer docs list() method on how pagination parameters work.

linux - Configure postfix to view catch-all address in mail header -

i configured catchall postfix follows:- "#vim /etc/postfix/virtual @example.com test" so if send mail xyzjsdv@example.com delivered test@example.com. but problem shows same user name in mail header "test@example.com". created script checking mail header, need particular user@example should display @ mail header since need differentiate users. please me how configure postfix, outcome. sudden answers appreciated not answer - questions have no rep can't put comments on. what version of postfix running? i'm doing similar thing on 2.8, , working expected, ie: message (not "envelope") has correct headers - ie: message unmodified. what test message sending? suggest testing simple, using telnet run following, eg: telnet <server> 25 connected <server>. escape character '^]'. 220 mail.example.com esmtp helo test.com 250 nbb-dev.safenetbox.biz mail from:<somewhere@example.com> 250 2.1.0 ok rcp...

java - Super Fast File Storage Engine -

i have 1 big gigantic table (about 1.000.000.000.000 records) in database these fields: id, block_id, record id unique, block_id not unique, contains 10k (max) records same block_id different records to simplify job deals db have api similar this: engine e = new engine(...); // method must thread safe fine grained locked (block_id) improve concurrency e.add(block_id, "asdf"); // asdf 1 kilobyte max // must concatenate added records added block_id, , won't need bigger 10mb (worst case) average <5mb string s = e.getconcatenatedrecords(block_id); if map each block file(haven't done yet), each record line in file , still able use api but want know if have peformance gain using flat files compared tunned postgresql database ? (at least specific scenario) my biggest requirement though getconcatenatedrecords method returns stupidly fast (not add operation). considering caching , memory mapping also, don't want complicate myself before asking if the...

c - File Written in Chinese (I think?) -

i have assignment create own version of unix ar, in c. broke assignment several pieces , trying write file names file(which archive file) @ point. can create file, , when use printfs make sure i'm getting proper arguments command line, file names correct. when open file have created suppose hold file names, in asian language. i've researched problem , haven't found go on. thing did find files being encoded differently, i'm pretty confused @ point. #include <stdlib.h> #include "ar.h" #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> int main (int argc, char **argv) { char *file_name, *archive_name; size_t count = 50; int i, fd, num_written; //command line options later //argv[1] //get archive name archive_name = argv[2]; //get file names add archive (i = 3; i<argc; i++) { file_name = argv[i]; } //create...

java - Get URL(link) of a public S3 object programmatically -

i storing 1 public object in aws s3 bucket using given java api in server need return public url of s3 object client till have'nt found api call can return public url(or link field) of s3 object is there way url?? s3url = s3client.getresourceurl(bucket, s3relativetobucketpath);

multithreading - Java Fork Join Pool getting stuck -

i have data migration service reads stuff 1 database in chunks migrates database. to work through 'chunks' of data- trying use recursiveaction , fork join pool. there reason work execute work on these "chunks" in parallel, chunk, execute, chunk, etc. what's happening process stops. see no exceptions in logs, , see no deadlocked threads. code below, questions are: am missing in worker? need return value or call method free resource? is dumb me using recursiveaction here? should using different parallelize chunks of work? i have 1 worker thread in thread dump seems waiting- normal or indicator of problem? forkjoinpool-1-worker-18 id=12191 state=waiting - waiting on <0x1b5ca93e> (a java.util.concurrent.forkjoinpool) - locked <0x1b5ca93e> (a java.util.concurrent.forkjoinpool) @ sun.misc.unsafe.park(native method) @ java.util.concurrent.locks.locksupport.park(locksupport.java:186) @ java.util.concurrent.forkjoinpool.tryawaitwork(...

python - SSL error installing pycurl after SSL is set -

just information start: i'm running mac os 10.7.5 i have curl 7.21.4 installed (came dev tools believe) i have python 2.7.1 i've been trying pycurl installed, every time try run it, get: importerror: pycurl: libcurl link-time ssl backend (openssl) different compile-time ssl backend (none/other) i first installed pycurl using setup: python setup.py install which didn't work (since ssl wasn't configured). i have since uninstalled pycurl ( sudo rm -rf /library/python/2.7/site-packages/pycurl* ) before attempting: export pycurl_ssl_library=openssl easy-install pycurl and again before trying: python setup.py --with-ssl install however, i'm still getting same error ssl not compiled in. it's if instructions ignoring attempts. setup.py doesn't complain @ when installing, easy install prints message after set pycurl_ssl_library env var: src/pycurl.c:151:4: warning: #warning "libcurl compiled ssl support, configure not determine ...

Prolog Ancestor with List -

i searched around , couldn't find answer. i'm having trouble making genealogy list. so, have is_a relations, example: is_a(cow, animal). is_a(calf, cow). is_a(dog, animal). .... etc. i want have procedure following: toanimal(cow, x). outputs x= [calf, cow, animal]. basically, if give input(cow), go cow until animal , add every step list. so far, have this: toanimal(a, b) :- is_a(a,b). toanimal(a, b) :- is_a(a, x), toanimal(x, b). the output of be x= cow; x = animal; false how become list? edit: descend(x,y) :- is_a(x,y). descend(x,y) :- is_a(x,z), descend(z,y). toanimal(x,y):- findall(x, descend('animal', x), y). i have updated after looking @ suggestion. however, how list print? i'm still new prolog. findall page said return list, not doing me. toanimal(calf, y) outputs: false. edit: it returns empty list. i'm not sure issue here. have not changed code @ all, output should not change has. edit: thanks mrbratch response. ...

javascript - What does "XMLHttpRequest.timeout cannot be set for synchronous http(s) requests made from the window context" mean? -

i'm getting timeouts on synchronous xml http request in safari on mac. workaround, tried adding timeout so: req.open(this.method, fullurl, this.isasync); req.setrequestheader('content-type', 'application/x-www-form-urlencoded'); var params = this.envelopeform(); req.setrequestheader("content-length", params.length); req.timeout = 60000; //get timeut cannot set here req.send(params); //without above, timeout here in safari with .timeout = 60000 i'm getting timeout on .send. with .timeout=60000, i'm getting "xmlhttprequest.timeout cannot set synchronous http(s) requests made window context." i'm not clear on "xmlhttprequest.timeout cannot set synchronous http(s) requests made window context" means. found in mozilla's documentation phrased so: note: may not use timeout synchronous requests owning window. is there work-around this? on msdn site found following statement regardin...

rdf - What is the difference between DatatypeProperty, ObjectProperty, & FunctionalProperty, and when should I use them? -

when writing ontology, there several commonly used types, including: datatypeproperty objectproperty functionalproperty inversefunctionalproperty the first 3 kinda they'd used in particular set of ways, find idea of them being challenged how i've seen them used in foaf. when should each of them used or not used? the first 2 of these, datatypeproperty , objectproperty, describe kind of values triple property should have. datatype properties relate individuals literal data (e.g., strings, numbers, datetypes, etc.) whereas object properties relate individuals other individuals. hasage typically datatype property, since age number, hasmother object property, since mother individual. the last 2 of these, functionalproperty , inversefunctionalproperty, used put constraints on values of properties individuals. functional property means given individual can have @ 1 value it. logically, means if p functional property, ∀ x, y, z.( [p(x,y) &wedge;...

php - How do you fix this notice: Uninitialized string offset: 0 with stripslashes? -

when upload theme wordpress, notice in options page: uninitialized string offset: 0 this code: function name_of_function ( $args ) { extract( $args ); $option_name = 'the_theme_options'; $options = get_option( $option_name ); switch ( $type ) { case 'text': $options[$id] = stripslashes( $options[$id] ); $options[$id] = esc_attr( $options[$id] ); echo "<input class='regular-text$class' type='text' id='$id' name='" . $option_name . "[$id]' value='$options[$id]'>"; echo ( $desc != '' ) ? "<br><span class='description'>$desc</span>" : ""; break; when save, notice goes away. i tried adding isset, (i getting notice:undefined index @ first): $options[$id] = stripslashes( isset( $options[$id] ); the errors go away fails save. then added isset following lin...

jQuery delay and javascript settimeout won't work with facebook button -

i'm using socialite.js put social buttoms on page, social buttons inside div id="social". div hidden (display: none;). i'm calling socialite.load($('#social')); , nextly want show div after delay, i tried: $('#social').delay(4000).fadein(400); and: timeoutid = settimeout(function(){ $('#social').fadein(400)}, 3000); it doesn't matter method use, ie , ff shows g+ , twitter buttons, fb button missing, chrome shows 3 buttons. except without timeout: $('#social').fadein(400); this works great in every browser. any idea, please? facebook button won't load if container div hidden. try this: set opacity 0.0 , after fb button loaded, change 1.0 , hide div. can show or hide whenever want. timeoutid = settimeout(function(){ $('#social').css("display", "none"); $('#social').css("opacity", "1.0"); $('#social').fadein(500) }, 3...

php - Netbeans Error on $_SERVER -

i have following code: <?php defined('root') or define('root', $_server['document_root']); ?> netbeans returns: do not acces superglobal $_server array directly. i updated netbeans, in previous versions didn't have message, safe ignore it? print index of $_server array code : <?php $keyy=array(); // while(key($_server)){ array_push($keyy,key($_server)); next($_server); } foreach($keyy $ke) echo '<a style="color:red;" >'.$ke.'</a> '.$_server[$ke].' <br>'; ?> if print errors don't access $_server on server... security permission $_server['remote_addr'] $_server['http_accept_encoding'] $_server['http_host'] $_server['http_user_agent'] enough!!!

php - How to get package name in script? -

i'm doing short post package install/update script copy files vendor directory public one. following example of composer site when execute error: fatal error: call undefined method composer\dependencyresolver\operation\updateoperation::getpackage() in s:\projects\composer-scripts\filecopy.php on line 17 the code is: namespace composer-scipts; use composer\script\event; class filecopy { public static function postpackageinstall( event $event ) { $packagename = $event->getoperation()->getpackage()->getname(); echo "$packagename\n"; } public static function postpackageupdate( event $event ) { $packagename = $event->getoperation()->getpackage()->getname(); echo "$packagename\n"; } } can please advise? following further testing have identified issue, due 2 different interfaces having same/a similar method different signatures. thusly have ended with: public...

sql - MySQL: JOIN sum of multiple values -

i have query calculates invoice table invoice . invoice has taxes associated located in tax_recv table. tax_recv have multiple rows tied invoice in invoice table. i have query calculates 12 months worth of invoices , orders them corresponding date. here query: select invoice_amount + late_fee + sum(c.tax) amount, tollfree_json, date_generated invoices left join csi_tax_recv c on c.invoice_number = i.id date_format(date_generated,'%y-%m') < date_format(now(),'%y-%m') , date_format(date_generated,'%y-%m') >= date_format(now() - interval 12 month,'%y-%m') order date_generated the problem query, is returning 1 row? not sure why. minute remove left join , sum(c.tax) (which think causing issue), query works great. the end result should this: invoice_amount + total_taxes_for_invoices, tollfree_json, date_generated cheers. as people said, need group fields want sum of taxes , make calcul...

c - error using struct in reading from a text file -

i beginner in c programming , trying use struct store related variables , later use them in main program. however, when run same program without using struct, running fine. the code presented below, doesn't show compilation errors no output except segmentation fault. #include<stdio.h> struct test { char string1[10000]; char string2[10000]; char string3[10000]; char string4[10000]; }parts; int main() { file *int_file; struct test parts[100000]; int_file=fopen("intact_test.txt", "r"); if(int_file == null) { perror("error while opening file.\n"); } else { while(fscanf(int_file,"%[^\t]\t%[^\t]\t%[^\t]\t%[^\n]",parts->string1,parts->string2,parts->string3,parts->string4) == 4) { printf ("%s\n",parts->string3); } } fclose(int_file); return 0; } the input file "intact_test.txt" has following line: aaaa\tbbbb\tcccc\tdddd\n each instance of struct test 40k so ...

arrays - How to parse json into android to compare users location to nearest 10 locations? -

im getting server response store locations , master array dictionaries: [ masterarray : {name = main, lat = 15.948 long= 88.853 }, {name = 5th street, lat = 15.294 long= 88.743 }, {name = cannes blvd, lat = 15.235 long= 88.765 }, ] i need loop through each store, lat/long, compare users location, create new array top 5 nearest locations. ive got far: try { //get master array of locations jsonarray jsonarray = new jsonarray(arrays.aslist(contentasstring)); //loop through each dictionary in array (int = 0; < jsonarray.length; i++) { //get lat&long jsonobject sys = jsonarray.getjsonobject("master"); name = sys.getstring("name"); latitude = sys.getstring("lat"); longitude = sys.getstring("long"); //create locat...

rackspace - Exception claiming messages from Cloud Queues in fog -

i've been running process consumes messages off of rackspace cloud queue time now. while ago, started seeing exception in logs @ line creating claim: undefined method `split' nil:nilclass /home/ash/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/fog-1.19.0/lib/fog/rackspace/models/queues/claim.rb:112:in `create' /home/ash/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/fog-1.19.0/lib/fog/rackspace/models/queues/claim.rb:46:in `save' /home/ash/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/fog-1.19.0/lib/fog/rackspace/models/queues/claims.rb:36:in `create' what's changed? fog problem, or there wrong cloud queues? it turns out that, after server upgrade, cloud queues started use lowercase http headers in of responses. specifically, location location , content-type changed content-type . http specifies http headers case-insensitive, of 1.19.0, fog's header access not. this fixed in master , can depend on latest code adding gemfile : gem ...

javascript - Jasmine Testing - Priority -

is there way in jasmine define proirity of failure of test? for example, service 500'ing worse simple content not displaying on page. thanks! thats not way unit or integration tests work. ether test failing or not. , should not have failing test in suite, otherwise whole approach not make sense.

r - nPLot x-axis Date variable and default stacked Bar plot in rCharts -

Image
i using nplot, x-axis date variable, want date in data 'yyyy-mm-dd', tilted vertically (90 degrees). want nplot show chart stacked default. please me out. output$testchart = renderchart({ testchart = nplot(count~date, data = df, group = 'category', type = 'multibarchart') testchart$chart(reducexticks = f) testchart$xaxis(staggerlabels = t) testchart$chart(stacked = t) testchart$xaxis(tickformat = "#! d3.time.format('%y-%m-%d') !#") return(testchart) }) and in server.r output$mytabs = renderui({ tabs = tabsetpanel( tabpanel('tab1', h5("tab1"), fluidrow(showoutput("testchart")) ) ) mainpanel(tabs) }) in ui.r uioutput('mytabs') suppose stored plot in object n1 . here how can customize seek. n1$chart(stacked = true) n1$xaxis( tickformat = "#! d3.time.format('%y-%m-%d') !#", rotatelabels = 90 ) n1 ...

How to display the documentation for the support libraries inside Android Studio? -

when use command 'quick documentation' in android studio in class comes 1 of support libraries (e.g. actionbaractivity), ide not show documentation class. if use on 1 of classes from, say, android api 19 (e.g. activity), ide displays complete documentation shown in reference page on https://developer.android.com/reference/packages.html . is there way add documentation support libraries android studio can accessed through 'quick documentation' well? when android studio has opened decompiled jar class, click on "download..." blue link @ top right, download jar javadoc , save in : /.idealibsources rebuild project if necessary, doc available. tested on android studio 2.0 preview 4.

jquery - Country / State Javascript -

i after country select box text box below state , provinces of countries. however, if or canada chosen in select box, text box replaced new corresponding select box either or canada state or province options. (depending on choice) basically, if united states chosen, show new select states... if canada chosen, show new select canadian provinces... if other country chosen, show text box can enter area. after bouncing around site, have came reasonably close code shown below. divs display properly, if put in select box in either united states div or canada div, breaks it. so, display propose, left text in example have working example. in finding out why breaks select box inside , canada divs appreciated. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jquery show hide using selectbox</title> <style type="text/css"></style> <script type="text/javascript" src="htt...

css3 - Accordion using AngularJS and CSS animations -

using angular js animate , css animation, trying create expand/collapse (accordion) similar bootstrap collapse seen here: http://getbootstrap.com/javascript/#collapse i have issue expandable items, pop , forth depending on height of expanded "show" content. see plunker more visual my work far: var expandcollapseapp = angular.module('expandcollapseapp', ['nganimate']); expandcollapseapp.controller('expandcollapsectrl', function ($scope) { $scope.active = true; $scope.active1 = true; }); http://plnkr.co/edit/wbysfm?p=info you should use ui bootstrap accordion . component written in pure angularjs.

Unable to setup remote connections MYSQL Ubuntu -

i'm having trouble opening mysql server remote connections. have followed many online guides , appear have wrong. perhaps provide guidance? server details follows: ubuntu 12.04 server, mysql ver 14.14 distrib 5.5.34, debian-linux-gnu (x86_64) using readline 6.2 /etc/mysql/my.cnf: other stuff too, importantly bind-address... bind-address = 0.0.0.0 my.conf has following permissions: -rw-r--r-- 1 root root 3516 jan 31 17:12 my.cnf the server isn't blocked because: telnet mydomain.com 3306 prompts native mysql password. mysql queries create user 'myuser'@'%' identified 'mypassword'; grant insert on db.table_v 'myuser'@'%' identified 'mypassword'; flush privileges; permissions from show grants 'myuser'@'%'; grant usage on . 'myuser'@'%' identified password '****************' grant insert on db . table_v 'myuser'...