Posts

Showing posts from May, 2013

python - Printing Simplified Corpus to Json File -

i'm trying print out brown corpus simplified tagset file. code i'm using, , ending blank file. import json import nltk nltk.corpus import brown brown_sents = nltk.corpus.brown.tagged_sents(tagset="universal") sent in brown_sents: open('brown_corpus.txt', 'a') outfile: json.dumps(sent, outfile) json.dumps() meant returning str , not writing open file. use json.dump(sent, outfile) instead, , should fine.

python - NLTK: Package Errors? punkt and pickle? -

Image
basically, have no idea why i'm getting error. perform following: >>> import nltk >>> nltk.download() then when receive window popup, select punkt under identifier column locatedin module tab.

html - Centering CSS using Zurb Foundation CSS Framework -

i having hard time centering elements on site. i'm using foundation css , on documentation page, able center text. copied same css onto page can see, nothing on page centered. relevant html: https://infinite-oasis-2303.herokuapp.com/ <div class="row"> <div class="small-3 small-centered columns">first line</div> </div> <div class="row"> <div class="small-6 large-centered columns">second line</div> </div> <div class="row"> <div class="small-11 small-centered columns"> <h1>the club</h1> <p/>there <%= investor.count %> investors. <%= 50 - investor.count %> places left!</p> </div> </div> <div class="row"> <div> <iframe width="700" height="400" src="https://www.youtube.com/embed/4mlzr691of0" fra...

java JDialog draw called double -

Image
i've got problem makes me go crazy. call method via line of code: private void btngetfoldermouseclicked(mouseevent e) { messagecontroller.showalert(alertbox.alerttype.ok); } and method called: public class messagecontroller { public static void showalert(alertbox.alerttype alerttype) { alertbox alertbox = new alertbox("test12345678910dfkjsdgmdgbu<xdfg<bdxgj ghfhftz rgdx", alerttype); alertbox.getrootpane().setopaque(false); //alertbox.getcontentpane ().setbackground (new color(0, 0, 0, 0)); //alertbox.setbackground (new color(0, 0, 0, 0)); alertbox.setvisible(true); // bdialog dialog = new bdialog(); // dialog.setvisible(true); system.out.println("nach box"); //alertbox.invalidate(); } } and here jdialog class: public class alertbox extends jdialog { private imageicon downside = new imageicon(getclass().getresource("/alertbox/down_side.png")); private imageicon leftdowncorner = new imageic...

twig - Symfony form theme avoid block output and use custom variables in block -

a. want render form , use form theme . block created outputted directly before doctype hidden input field created. want render in form(form) function. b. can't use {{ template }} variable inside block or other variables created outside block? template variable created controller. {# form theme #} {% form_theme form _self %} {% block _my_form_example__token_widget %} {% set type = type|default('hidden') %} <input data-test="is-this-render" type="{{ type }}" {{ block('widget_attributes') }} value="{{ render_esi( controller( 'mycontroller:form:token', { 'form': template } {# template variable can't accessed here?? #} ) ) }}" /> {% endblock %} <!doctype html> <html> <head> <title>basic form</title> </head> <body> <h1>basic form {{ template }}</h1>{# output wor...

Assigning one Variant to Another in Excel VBA -

so have 2 (not adjacent) columns of data on excel worksheet, different numbers of entries. load data 2 variants called arr1 , arr2. in processing follows, want refer columns fewest , entries, define 2 variant variables called shortarr , longarr, , assign arr1 , arr2 them according ubound() larger. questions are: is legal assign 1 variant another, "shortarr = arr1"? if is, variants need have same bounds first? will memory usage doubled if this, or shortarr , arr1 pointers same array? thanks in advance! is legal assign 1 variant another, "shortarr = arr1"? if is, variants need have same bounds first? yes quite normal. can assign till time, second array not dimensioned. option explicit sub sample() dim arr1(1 2), arr2() arr1(1) = 2: arr1(2) = 3 arr2 = arr1 msgbox arr2(2) end sub will memory usage doubled if this, or shortarr , arr1 pointers same array? yes. pointers different array.

java - How can I get rid of divider on android.support.v7.widget.Toolbar? -

Image
how can rid of divider on android.support.v7.widget.toolbar? i have linearlayout below android.support.v7.widget.toolbar . both have same color. how can rid of devider between them?

php - Sortable post metabox -

i trying create sortable posts metabox. have custom post type "ba-product" in have created metabox manually select related posts , want create manually post order. stuck here how can save order metabox apply on foreach loop metabox not main posts.i don't know if possible. <div id="related-products"> <ul id="rp-list"> <?php $products = get_posts(array('post_type' => 'ba-product', 'numberposts' => '-1', 'orderby' => 'none')); foreach($products $product) { ?> <li id="<?php echo $product->post_name.'-'.$product->id; ?>" class="related-products"> <h3 class="hndle">move</h3> <div class="inside"> <label class="selectit"> <input id="<?php echo $product->id; ?>" value=...

calculate milliseconds with timer Tick in c# -

i want display milliseconds in label timer_tick event. if initialize timer.interval 1, cant actual millisecond. windows , c# not created realtime environment. timer not guaranteed trigger on exact millisecond set in properties. aside that, typical lcd displays, nowadays run on 60 hz. refresh interval larger 1 millisecond. means cannot display milliseconds in label on display has refresh rate smaller 1000 hz.

Android Interstitial ad -

i have problem interstitial ad in android. when application launches, ad shows , when user moves activity , returns main activity, ad shows again. should ad shows once in main activity , never shows again till next restart if user move activity? thank you! code: public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.tabpmnth_xm); // create interstitial. interstitial = new interstitialad(this); interstitial.setadunitid("ca-app-pub-xxxxxxxxxxxx8x/x2xxxxxxxx"); adrequest aadrequest = new adrequest.builder() .build(); // begin loading interstitial. interstitial.loadad(aadrequest); interstitial.setadlistener(new adlistener(){ public void onadloaded(){ displayinterstitial(); } }); public void displayinterstitial() { if (interstitial.isloaded()) { interstitial.show(); } } create application class app , this ...

java - RecyclerView with Pictures and Strings as Data Types -

i making app recyclerview needs display 2 image views, , 3 text views. follows tutorials on developers.android.com website, , worked. tried edit adaptor , activity doesn't work. here adaptor .java file: package com.winansbros.soccerpredictor; import android.graphics.drawable.drawable; import android.support.v7.widget.recyclerview; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.imageview; import android.widget.linearlayout; import android.widget.textview; public class myadapter extends recyclerview.adapter<myadapter.viewholder> { private string[] mdataset1; private string[] mdataset2; private string[] mdataset3; private drawable[] mdataset4; private drawable[] mdataset5; // provide reference views each data item // complex data items may need more 1 view per item, , // provide access views data item in view holder public static class viewholder extends recyclerview.viewholder { // each data ite...

mysql - Php filter system -

i want make php filter system 4 variables: echo"<form action='' method='get' class='form-inline' role='form'>"; $query = "select naam soortmaaltijd"; //alle soortmaaltijden ophalen $result= mysql_query($query) or die(mysql_error()); echo"<div class='row'>"; echo"<div class='form-group' >"; echo"<label for='soortmaaltijd'>soort maaltijd</label></br>"; echo"<select name='soortmaaltijd' class='form-control' id='soortmaaltijd'>"; echo"<option value=''>alle</option>"; while($row=mysql_fetch_array($result)) { echo"<option value='$row[soortmaaltijdid]'>$row[naam]</option>"; } echo"</select>"; echo"</div>"; $query = "select * soortgerecht"; //alle soort...

javascript - how can I get this a tag to go to the link exluding the following code -

i have awesome animation runs on page startup/entry when use page , stuff in website want have tag goes index.html page without cool animation... upset people using website. here tag: <a href="index.html"><div id="logo-title"></div></a> and here code want link remove when clicked: $(document).ready(function() { settimeout(function() { $("#loader-wrapper .loader-section, #textbit, #logo, #wrapper").hide("slow"); $("#wrapper").unwrap(); }, 10000); }); how rid of code when link clicked same page? found solution, check out here: http://transitiontest.comeze.com/test4/index.html to achieve need use document.referrer check page user came from. if page same 1 viewing, animation not play. in case like: js $(document).ready(function() { var referrer = document.referrer; if (referrer == "............/index.html") { // stuff } ...

javascript - How to avoid seconds in datetimepicker? -

Image
i want avoid seconds in datepicker dropdown. have following html content: <link href="<c:url value='/resources/css/bootstrap-datetimepicker.min.css'/>" rel="stylesheet"> <script type="text/javascript" src="<c:url value='/resources/js/bootstrap-datetimepicker.min.js'/>"></script> ... <div id="starttimediv" class="input-append right-date-input"> <input id="starttime" name="starttime" data-format="hh:mm:ss" type="text" value=""> <span class="add-on"> <i data-time-icon="icon-time" data-date-icon="icon-calendar"> </i> </span> </div> and following js: $('#starttimediv').datetimepicker({ pickdate: false, timefo...

Communication between objects in C++ -

i have 2 classes , b defines follows: class { public: void *connector; }; class b { public: void *connector1; void *connector2; }; to start, let assume create 3 objects c1, c2 , c3 based on these classes, a c1; b c2; c3; and use following code connect them c1.connector = &c2; c2.connector1 = &c1; c2.connector2 = &c3; c3.connector = &c2; so @ moment have this: c1 <-> c2 <-> c3 (first example). important: reason using void pointers inside classes because cannot predict right start how objects connect. example,the answer question should valid if create fourth object , make these connections (c1 , c2 same before): b c3; c4; c1.connector = &c2; c2.connector1 = &c1; c2.connector2 = &c3; c3.connector1 = &c2; c3.connector2 = &c4; c4.connector = &c3; which corresponds c1 <-> c2 <-> c3 <-> c4 (second example). i tried , searched everywhere simple solution implement communicati...

Extracting top 5 maximum values (based on group) in excel -

i have excel file 3 columns corresponding team name, player name, , score. extract top 5 players based on score in each team. found solution when there's not grouping team involved solution top 5 . i tried add "if" statement filter teams (like "if(team_column=team_names_constants, score_column, 0), doesn't seem work. =index($b$2:$b$28,match(1,index(($a$2:$a$28=large($a$2:$a$28,rows(d$1:d1)))*(countif(d$1:d1,$b$2:$b$28)=0),),0)) i suggest creating pivottable team name , player name in rows , score in values, use value filter "top 10..." (which can changed integer) display 'top scorers'. add team name filters view each team separately.

android - Tasker variable editing add commas -

i need edit string value in variable. so, 00343755932 should converted to: 0,0,3,4,3,7,5,5,9,3,2 because must define each number variable array readable 1 one. if i'm right trying create array string. use following code string val = "00343755932"; int[] numberarray = new int[val.length()]; matcher match = pattern.compile("[0-9]").matcher(val); int = 0; while(match.find()) { system.out.println(match.group()); numberarray[i] = integer.parseint(match.group()); i++; }

database - MySQL query to get all (additional) symptoms and diseases -

i have database contains main symptoms, additional symptoms , diseases. need replace 2 queries because sure first query not efficient , 2nd not correct @ all. hope can me because new area.. database explanation: the database being used medical app: the user selects specific bodypart the app lists main symptoms of specific bodypart the user selects main symptom (common or less common) the app lists diseases of selected main symptom. there appear 2 checkboxes (additional symptoms) can checked user. order of listed diseases (d_weight) depends on age, gender, selected main symptom , boxes user has checked. disease d_weight <= 5 considered common disease. disease d_weight > 5 considered less-common. possibilities of user input (age, gender, bodypart, main symptom) stored in symptom_disease_combi table. asa_id id of symptom apply (addtional symptoms checked user) asc_id id of possibilities of additional symptoms belong specific main symptom. example, asc_id = 0,...

java - Custom FEST Assertions : Displaying readable message with -

i have created custom fest condition verify actual string either matches or equal expected string public class stringmatchesorisequalto extends condition<string>{ private string expectedstringorexpression; public stringmatchesorisequalto(final string expectedstringorexpression){ this.expectedstringorexpression = expectedstringorexpression; } @override public boolean matches(string value) { return value.matches(expectedstringorexpression) || value.equals(expectedstringorexpression); } } whenever conditon fails want display message shows me original , expected string currently display string actual value:<'some string'> should satisfy condition:<stringmatchesorisequalto> is there way message displays match made against ? i tried overriding tostring method in class @override public string tostring() { return "string matches or equal : " + expectedstringorexpression; } but...

RingCaptcha SDK import into android studio shows two app icons -

i have added ringcaptcha sdk using android studio in app. after adding ring captcha sdk app shows 2 icons(my app , ringcaptcha sample). how can remove second app icon? have added following maven repository(url ' http://ringcaptcha.github.io/ringcaptcha-android '). added dependencies (compile 'com.thrivecom:ringcaptcha:1.0.7@aar') thanks in advance. launcher icons added app specifying <category android:name="android.intent.category.launcher" /> in androidmanifest.xml. if have launcher specified 2 different activities 2 launcher icons. take in androidmanifest.xml 2 activities this: <activity android:name=".mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> ...

sql - Select rows WHERE any row in column is equal to 1 or if not, column is equal to 2, but not both -

i have got translation table text like: table: todos day | text_id ------------- 0 | 1 1 | 2 1 | 1 table: translations lang | text_id | text --------------------- deu | 1 | laufen eng | 1 | running eng | 2 | swimming now want lookup todos in german (deu). problem is, don´t have translation (e.g.) text_id 2: swimming in german. my default query be: select todos.day, translations.text inner join translations on todos.text_id = translations.text_id translations.locale = 'deu'; i get: day | text -------------- 0 | laufen 1 | laufen but want: day | text -------------- 0 | laufen 1 | swimming 1 | laufen how can missing rows? first should needed rows with: select todos.day, translations.text inner join translations on todos.text_id = translations.text_id translations.locale = 'deu' or translations.locale = 'eng'; and remove 'eng' duplications - how? sorry terrible title, don´t kn...

Facebook API PHP, get page feed -

i feel i've been on facebook documentation hours of google searching , cannot figure out. of found years old; before facebook switched api version i'm getting confused ton of things. it seems business pages have apps created them, i'm trying feed page. here code far, , i'd know next. $facebookapp_id = 'there valid id'; $facebookapp_secret = 'there valid secret'; require 'facebook/autoload.php'; use facebook\facebooksession; use facebook\facebookrequest; use facebook\graphuser; use facebook\facebookrequestexception; facebooksession::setdefaultapplication($facebookapp_id, $facebookapp_secret); $session = facebooksession::newappsession($facebookapp_id, $facebookapp_secret); try { $session->validate(); } catch (facebookrequestexception $ex) { // session not valid, graph api returned exception reason. echo $ex->getmessage(); } catch (\exception $ex) { // graph api returned info, may mismatch current app or have expired. e...

vb.net - Replace integers in a string using Visual Basic -

i trying replace integers in string using visual basic , can't seem right. this have: lblnewpassword.text = txtorigpassword.text.replace("[0-9]", "z") i have tried: lblnewpassword.text = txtorigpassword.text.replace("#", "z") and: lblnewpassword.text = txtorigpassword.text.replace("*#*", "z") you have use regex object this: c# string input = "this t3xt n4mb3rs."; regex rgx = new regex("[0-9]"); string result = rgx.replace(input, "z"); vb dim input string = "this t3xt n4mb3rs." dim rgx new regex("[0-9]") dim result string = rgx.replace(input, "z") update : if want change vowels x can add: rgx new regex("[a-za-z]") result = rgx.replace(result, "x")

angularjs - How to add a text box on submit in angular -

i pretty new angular , documentation on official site , using plunkr able figure out use ng-repeat , push method add new dom if not wrong. i trying go through example found on docs: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>example - example-ngcontroller-production</title> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script> <!--<script src="app.js"></script>--> <script> angular.module('controllerasexample', []) .controller('settingscontroller1', settingscontroller1); function settingscontroller1() { this.name = "john smith"; this.contacts = [ {type: 'phone', value: '408 555 1212'}, {type: 'email', val...

List of different types in C# (Inventory system) -

so, i'm building inventory system in unity3d using c# scratch , i've faced following problem: i have 3 types of inventory objects: weapons, equipments , consumables. so, example: // weapon class class weapon : equipable { public int damage } // equipment class class equipment : equipable { public equipmenttype equipmenttype; public enum equipmenttype { helmet, armor } } // consumable class class consumable : item { public consumablestat stat; public int factor; public enum consumablestat { life, mana } } // equipable class class equipable : item { public int durability } // item class class item { public string name; } now, player has list inventory. this list, should store weapons, equipments , consumables i've tried: public list<t> inventory but receive following error on console: the type or namespace name `t' not found. missing using directive or asse...

ASP.NET Web API - Response with status code "Redirect (302)" doesn't work on Internet Explorer 10 -

i create request response status code "redirect (302)" without url redirect. private httpresponsemessage verify(httpactioncontext actioncontext) { ... return actioncontext.request.createresponse(httpstatuscode.redirect, "credentials not found!"); } the response on internet explorer 10 return status "(abort)" rather "redirect" , in other browsers (chrome , firefox) returns correctly.

python - Regex for uppercase and underscores between percentage signs -

regex has never been strong point. in python i'm attempting build expression matches substrings such this: %match% %match_1% $this_is_a_match% it extracted %match% or %like_this% i ended (logically, not seem work): %[a-z0-9_]*$% so going wrong on this? you can use simple regex this: [%$]\w+[%$] <-- notice put $ because of sample on other hand, if want uppercase can use: [%$][a-z_\d]+[%$] if want match content within %, use: %.+?% python code import re p = re.compile(ur'[%$]\w+[%$]') test_str = u"%match%\n\n%match_1%\n\n$this_is_a_match%" re.findall(p, test_str) btw, problem regex below: %[a-z0-9_]*$% ^--- remove dolar sign

How can I traverse a multi level php object and unset the deepest node dynamically -

i have object in form: commentid: [ "userid": userid, "status": "active/deleted", "datetime": "datetime", "comment": "commenttext", "likes": [ userid: datetime of like, userid: datetime of like... ], "comments": [same parent] ] this means, have multiple levels of comments -> comment on comment on comment. if want delete comment, view full chain of commentids... parent commentid, sub-parent, sub-sub.. etc.. how can unset particular comment. something this: imagine following: 1;2;3 1 commentid of parent, 2 commentid of child of parent , 3 commentid of child of child. this comes me variable in php. i unset 3.. ideally, i'd write, unset($object->{1}->{2}->{3}); , work. but, can't assume number of levels. have somehow loop through comment id's , figure out way. without example of have, i'm assuming have array ...

osx - mac Terminal app:what is the shortcut for "goto next tab"? -

in terminal app,when enter "command + {" or "command + {",it go next or before window, not next tab,who can tell me ,why? you entered cmd [ , cmd ] accidentally, since change window. make sure enter cmd shift [ , cmd shift ] produce cmd { , cmd } respectively. this because shift [ = { , etc., depending on keyboard layout. (just press shift [ type { , provided you're using english or similar keyboard layout.)

c# - How to get root layout in Xamarin using android? -

i`m using xamarin android. know can assign id root layout , via code : <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/root" and in c# use : var mlayout = (linearlayout)findviewbyid(resource.id.root); what need method root layout without needing id. this: var mlayout = getrootlayout(); in activity call window.decorview.findviewbyid (android.resource.id.content) .

How to check if an element is clickable or not using Selenium WebDriver -

i have container, contains number of elements.i looping thru elements. question syntax checking if element not clickable. the existing methods, isdisplayed , isenabled cannot check whether element clickable or not. if want wait element till clickable , click it, may this: selenium webdriver - determine if element clickable (i.e. not obscured dojo modal lightbox) actually, may difficult check whether element clickable or not without clicking it.

html - Menu Bar only works using nth-child (1) span -

i have -90deg menubar submenu work using code question can example1 on codepen , work example 2 jsfiddle using nth-child, way can make submenu using nth-child(4) in advance, btw can ignore codes, shown in codepen , , jsfiddle css nav { height: 50px; line-height: 50px; background: #ff00ff; position: fixed; top:50; right:0; width: 100vh; transform-origin:top right; transform:translatex(-50px) rotate(-90deg); } http://codepen.io/paulie-d/pen/ejxddy but issue info not work on site im trying work on , code work on site. css #right_menu a:nth-child(1) span { display:block; position:absolute; top:40px; left:-40px; width:130px; color:#fff; -webkit-transform:rotate(-90deg); -moz-transform:rotate(-90deg); -ms-transform:rotate(-90deg); transition:left .3s ease; } https://jsfiddle.net/nyjhfr8g/2/

jquery - php header forwarding issue using Ajax -

form :- <form name="form"> <div class="formfieldcontainer"> <label> email :</label> <div class="login_wrapper logincontainer"> <span> </span> <input type="email" id="email" required name="user_email" autofocus="autofocus" placeholder="enter email address"/> </div> </div> <div class="formfieldcontainer"> <label> password :</label> <input type="password" name="user_password" placeholder="enter password"/> ...

oracle adf - Common Reset button for both form and table -

i have page form , table created using same view object, possible have single reset/clear button reset form table? i tried this: public string clear_action() { bindingcontainer bindings = genericutility.getbindings(); operationbinding operationbinding = bindings.getoperationbinding("createinsert"); object result = operationbinding.execute(); if (!operationbinding.geterrors().isempty()) { return null; } dcbindingcontainer dcbindings = genericutility.getdcbinding(); dciteratorbinding searchiter; searchiter = dcbindings.finditeratorbinding("regionmasterviewcrieria1iterator"); searchiter.clearforrecreate(); richinputtext dd = (richinputtext)facescontext.getcurrentinstance().getviewroot().findcomponent("regpt1:regit1"); dd.setdisabled(false); return null; } but problem if click on row (say 2nd row) in table, corresponding values updated in form. if try reset both form , table, not able...

How to put file from android app to pc in LAN network -

i have little problem android app. i'm developing android app should read .txt file pc, , path "e:/sharing/hello.txt". shared folder on pc. how can file , read on android app. there solution, or have example how that? it can in many ways here: you need write 2 app, 1 in android [as client], on in desktop [as server] this way, need connect android server app, , let server app handle find files , transfer android app easier way, need use data's storage service, such google drive, dropbox, microsoft onedrive, etc. to let them auto sync file , put in site, then, need (install app in android or) download file directly site. easiest way, desktop, send file android's register email. after download google gmail i suggested, 2 , 3 (even if doesn't relate programming) because easier 1 alot, , many people accepted used in real-life

facebook login/logout issue in website -

i’ve taken below code facebook developer, while login fb it's showing logout button not showing user name , profile logout button. possible add our own button instead of facebook login button? <html> <head><title>facelogin<title></head> <body> <script> window.fbasyncinit = function() { fb.init({ appid : '478566162309261', status : true, // check login status cookie : true, // enable cookies allow server access session xfbml : true // parse xfbml }); // here subscribe auth.authresponsechange javascript event. event fired // authentication related change, such login, logout or session refresh. means // whenever logged out tries log in again, correct case below // handled. fb.event.subscribe('auth.authresponsechange', function(response) { // here specify response anytime event occurs. if (resp...

sql server - I had assigned Varchar for date and It's not working when I select between range of dates -

create table table_name([date] varchar(100)); standard 105. insert table_name values('18-01-2015'); insert table_name values('19-01-2015'); insert table_name values('20-01-2015'); insert table_name values('21-01-2015'); insert table_name values('22-02-2015'); insert table_name values('22-03-2015'); insert table_name values('22-04-2015'); insert table_name values('22-05-2015'); select [date] table_name [date] >= '18-01-2015' , [date] <= '20-01-2015' select [date] table_name [date] between '18-01-2015' , '22-01-2015' result date 18-01-2015 19-01-2015 20-01-2015 21-01-2015 22-02-2015 22-03-2015 22-04-2015 22-05-2015 this c# code how date.! label17.text = datetime.now.tostring("dd-mm-yyyy"); if try insert date or datetime datatype., following error throws., conversion failed when converting date and/or time character string. this why supposed use varchar. this...

Amazon remote log-in (PHP cURL) | Cookies -

i'm trying make remote log-in amazon. basically, user log-in through our local form. , if filled in correct, logged in @ amazon. ` if(isset($_post['submit'])) { $account = $_post["account"]; $pass = $_post["pass"]; $ch = curl_init("https://www.amazon.com/ap/signin?_encoding=utf8&openid.assoc_handle=usflex&openid.claimed_id=http%3a%2f%2fspecs.openid.net%2fauth%2f2.0%2fidentifier_select&openid.identity=http%3a%2f%2fspecs.openid.net%2fauth%2f2.0%2fidentifier_select&openid.mode=checkid_setup&openid.ns=http%3a%2f%2fspecs.openid.net%2fauth%2f2.0&openid.ns.pape=http%3a%2f%2fspecs.openid.net%2fextensions%2fpape%2f1.0&openid.pape.max_auth_age=0&openid.return_to=https%3a%2f%2fwww.amazon.com%2fgp%2fyourstore%2fhome%3fie%3dutf8%26ref_%3dnav_ya_signin"); curl_setopt($ch, curlopt_post, true); ...

java - Math Vector Matrix multiplication -

as far know opengl viewport's coordinate system 2dimensional , ranges between -1 , 1 in x , y direction.to map 3dvector's position "world space" viewport coordinates write f.e "gl_position=umodelviewprojectionmatrix * vposition " in fragment shader. my question how can multiply 3dvector 4d matrix , 2dvector result , - more important - there funktion on cpu side (especially libary/ class java in android) just clarifying few terms: the viewport region within window you're drawing to. it's specified in pixels. the rasterizer needs coordinates in normalized device coordinates -1 1. maps these viewport area. gl_position must take 4d vector in clip space . space triangles clipped in (for example , particularly if intersect near plane). separate normalized device coordinates because perspective divide hasn't happened yet. doing pos /= pos.w , loses information opengl needs clipping, depth , interpolation. this brings me answer...

c++ - Trimesh - leak memory -

i'm using trimesh library compute curvature on each vertex of triangulated mesh. do, make: trimesh *m = trimesh::read(this->fichier); m->need_curvatures(); float *degres= new float[nbr_vertices]; for(int i=0;i<nbr_vertices;i++) { degres[i]=m->curv1[i]; // curvature } delete [] degres; m->clear(); delete m; the problem leak memory detected clear , delete "* m". leak memory detected "valgrind". this output of valgrind : 912 bytes in 3 blocks possibly lost in loss record 5 of 13 ==4239== @ 0x4c2cc70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==4239== 0x4012e54: _dl_allocate_tls (dl-tls.c:296) ==4239== 0x5174da0: pthread_create@@glibc_2.2.5 (allocatestack.c:589) ==4239== 0x599c905: ??? (in /usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0) ==4239== 0x4c67d2: trimesh::trimesh::need_normals() (in /home/spin/spin) ==4239== 0x4b203d: trimesh::trimesh::need_curvatures(...

apache - .htaccess file causes 500 Internal Server Error -

my .htaccess file causes 500 internal server error options -indexes adddefaultcharset utf-8 #defaultlanguage bg serversignature off <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{request_uri} !webroot rewriterule ^$ webroot/ [l] rewriterule (.*) webroot/$1 [l] </ifmodule> the mod_rewrite module on , think line causes problem one: rewriterule ^$ webroot/ [l] if drop rewriterule lines file works add them 500 error. have basic knowledge of .htaccess files tips , explanations more welcome. thank you! edit: reference, here's .htaccess file in webroot folder, requested in comments: options -indexes adddefaultcharset utf-8 #defaultlanguage bg serversignature off <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^(.*)$ index.php [qsa,l...