Posts

Showing posts from September, 2012

Spring Batch annotation partitioner issue -

i trying create spring batch application using annotation based approach partitioner, triggered quartz scheduler, getting following issues. when job triggered each partition executed sequentially instead of parallelly i.e if have 10 partitions instead of 10 getting triggered/processed process 1 one. when more 1 instance of job(this needed per requirement) gets triggered it's not getting synchronized i.e when 2nd instace started uses 1st instance data , 1st instance stop processing active. following configuration/class files. batchconfiguration.java - @configuration @enablebatchprocessing public class batchconfiguration { @autowired private jobbuilderfactory jobbuilders; @autowired private stepbuilderfactory stepbuilders; @bean @stepscope public jdbccursoritemreader reader(@value("#{stepexecutioncontext[someparam]}") string someparam) { jdbccursoritemreader jdbccursoritemreader = new jdbccursoritemreader(); jdbccursoritemreader.setdatasource(getdat...

c# - MSMQ Multicast queue on different server -

i want send message pc msmq multicast queue on server in same network. reason don't seem able that, also, in internet, couldn't find 1 sample of this. is possible send message 1 computer computers msmq multicast queue? troubleshooting simple. set multicast queue on same machine sending application. if messages don't arrive here, you've either got format wrong or not configured queue correctly. once working, set multicast queue on machine. if can't receive messages, windows firewall or network routers blocking multicast traffic.

javascript - Jest/React - How to use global object in unit tests? -

i use commonjs modules require() except react, global: // don't want require react in every module: // var react = require("react"); var mycomponent = react.createclass({ // react global here }); when running unit test on mycomponent, jest can't find react. there way tell jest insert global react object? (i use npm , gulp-browserify.) works me following settings. // package.json "jest": { "scriptpreprocessor": "preprocessor.js", "unmockedmodulepathpatterns": [ "react" ], "setupenvscriptfile": "before_test.js" } // preprocessor.js var reacttools = require('react-tools'); module.exports = { process: function(src) { return reacttools.transform(src); } }; // before_test.js react = require("react"); // global react object

Using a compiled python regex pattern in a case unsensitive comparison -

i have: reyada = re.compile(u'^yada$', re.u) at point need perform case insensitive comparison using compiled pattern. did as: re.match(reyada.pattern, 'yada', re.ignorecase) is there way same without .pattern (ie using compiled pattern) ? looking through api of regular expression object ( python 2.7 , python 3.4 ), class of compiled regex object returned re.compile , none of methods allows specify flag. flags attribute read-only. therefore, it's not possible change flags of compiled regex object. method have in question, extract pattern , recompile new flag, way go it. allowing change behavior of compiled regex changing flags requires compiled object include code path different (combination of) flags, more or less (depending on effect of flag) bloat compiled regex unused code paths of use cases.

PHP: File cannot be downloaded ("404 Not Found" message) -

i working on website of client didn't write code. have troubles making files downloadable. it subdomain users can download course files. website files contained in folder "courses" (on root level). the file displaying downloadable course files contained in "courses/displayfiles.php". the downloadable files contained in folder in "courses/downloadfolder". inside folder, each user has own files folder name has user id. displayfiles.php: following code displays files can downloaded logged-in user: $path = "downloadfolder/" . $_session['userid'] . "/"; $files = array(); $output = @opendir($path) or die("$path not found"); while ($file = readdir($output)) { if (($file != "..") , ($file != ".")) { array_push($files, $file); } } closedir($output); sort($files); foreach ($files $file) { echo '<a class="imtext" href="downloadfold...

javascript - How to add pop-up window/modal to dynamically created tables -

html <div class="wrapper"> <div class="profile"> <div id='entrydata'></div> </div> </div> javascript <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script> $(function() { var dmjson = "data.json"; $.getjson(dmjson, function(data) { $.each(data.records, function(i, f) { var $table = "<table border=5><tbody><tr>" + "<td>" + f.clue + "</td></tr>" + "<tr><td>" + f.answer + "</td></tr>" + "<tr><td>" + f.status + "</td></tr>" + "<tr><td> " + f.views + "</td></tr>" + "</tbody>&nbsp;&nbsp;&nbsp;</table>" ...

javascript - how to display records selected from mysql database in jquery dialog popup in php.? -

i have display file edit button, when user click on edit button 1 window should popup data database. i want above written functionality in application. so please me. here code below. edit button code. <a id="edit_docid" href="edit_doctor.php?id=<?php echo $tmpdocid;?>" data-target="#edit_doctor" >edit</a> edit functionality code. <div id="edit_doctor" > <?php include("db.php"); $tmpid = $_request["docid"]; $result = mysql_query("select * doctor doctor_id = '$tmpid'") or die(mysql_error()); $row = mysql_fetch_array($result); if (!$result) { die("error: data not found.."); } $doctor_name = $row['doctor_name']; $doctor_email = $row['doctor_email']; $user_name = $row['username']; $doctor_password = $row['doctor_password']; $doctor_address = $row['doctor_addres...

css - button with image at left and text center aligned -

i trying make button image in , text. want image align @ left , text centered. text should centered @ width of whole button , not @ remaining width cause image. i tried span no success <a href=#><button class="lightgray-btn rightbuttons"><span class="demoimage"><img class="btnimg" src="..." alt="" /></span><span class="demotext">"some text</span></button></a> i want avoid background-image:url because in mobile afraid text on image thank you this work you. button { position: relative; padding: 15px 40px; text-align: center; } .btnimg { position: absolute; left: 6px; top: 50%; transform: translatey(-50%); } <button class="lightgray-btn rightbuttons"> <img class="btnimg" src="http://lorempixel.com/output/food-q-c-27-24-8.jpg" alt="" /> text </button...

python - How to count the occurrences of keywords in code but ignore the ones in comment / docstring? -

i quite new in python. want find occurrences of python keywords ['def','in', 'if'...] in code below here. however, keywords found in string constants in code need ignored. how can count keywords occurrences without counting ones in string? def grade(result): ''' if if (<--- example test if word "if" ignored in counts) :param result: none :return:none ''' if result >= 80: grade = "hd" elif 70 <= result: grade = "di" elif 60 <= result: grade = "cr" elif 50 <= result: grade = "pa" else: #else (ignore word) grade = "nn" return grade result = float(raw_input("enter final result: ")) while result < 0 or result > 100: print "invalid result. result must between 0 , 100." result = float(raw_input("re-enter final result: ")) print ...

How to apply spring security on specific urls and leave some others using java config? -

i using java config apply spring security , able apply security on particular urls want default login page of spring security whenever hits urls other url not secured. here code of securityconfig: import javax.sql.datasource; import org.springframework.beans.factory.annotation.autowired; import org.springframework.context.annotation.configuration; import org.springframework.http.httpmethod; import org.springframework.security.config.annotation.authentication.builders.authenticationmanagerbuilder; //import org.springframework.security.config.annotation.method.configuration.enableglobalmethodsecurity; import org.springframework.security.config.annotation.web.builders.httpsecurity; import org.springframework.security.config.annotation.web.configuration.enablewebsecurity; import org.springframework.security.config.annotation.web.configuration.websecurityconfigureradapter; import org.springframework.web.bind.annotation.requestmethod; @configuration @enablewebsecurity public class se...

php - Add a property to a child entity in an association with Doctrine's QueryBuilder -

i'm working symfony 2.3 , doctrine 1.2 i have following entity structure, product, tag , tagcategory. product has manytomany relationship tag, , tag has manytoone relationship tagcategory product class: class product { /** * @var arraycollection list of tags * * @orm\manytomany(targetentity="tag", inversedby="products") * @orm\jointable(name="tags_productos", * joincolumns={@orm\joincolumn(name="cod_pro", referencedcolumnname="cod_pro")}, * inversejoincolumns={@orm\joincolumn(name="cod_tag", referencedcolumnname="id")} * ) */ protected $tags; } tagcategory class: class tagcategory extends basetagcategory { /** * @orm\onetomany(targetentity="tag", mappedby="category", orphanremoval=true) */ protected $tags; } tag class: class tag extends basetag { /** * @assert\notblank() * @orm\many...

elusive c function declared in header -

here c file: http://simul.iro.umontreal.ca/rng/well19937a.c (i uncommented, l'ecuyer told to) here c header: http://simul.iro.umontreal.ca/rng/well19937a.h the question is: double (*wellrng19937a) (void) in c file? i don't see it. exists. code works on tigcc yields 0. #include "well44497a.h" #include <tigcclib.h> void _main(void) { unsigned int u=33337; initwellrng44497a(&u); //this function wants array of seeds don't have them. double = wellrng44497a() ; clrscr(); printf("%f",a); ngetchx();//wait keyboard input } deleting initwellrng44497a(&u) makes throw sigsegv (which assures me other function exists) i greatful if tell me function. more, if tell me how use function. ps. have nothing clarify anymore. stupid question, has been answered right. reason function giving zeroes time different. double (*wellrng19937a) (void) pointer double funcname (void) function. in first function void initwellrng19937a ...

google cloud messaging - How to determine the source of GCM broadcast notification? -

i have existing handling push notification directly sent our backend server. now, want support urban-airship push delivery without breaking existing flow. have defined intentreceiver ua notification (besides existing gcmintentreceiver). problem is, both receivers getting invoked. how can determine , skip particular callback depending upon delivery method used? the easiest way use 2 different senders. create new sender urban airship , set 'gcmsender', add existing sender 'additionalgcmsenderids' in urban airship config. allow urban airship register both senders application, , ua handle intents form 'gcmsender'. in existing gcm intent receiver need filter out intents urban airship sender id checking "from" on intent. string sender = intent.getstringextra("from"); if (app_sender.equals(sender)) { // gcm intent existing sender }

jquery ui draggable scroll auto -

i want implement draggable on container fixed height , width has scrolls on demand mimics infinite surface. here css .drag { width: 100px; height: 100px; border: 1px solid black; cursor: pointer; border-radius: 10px; text-algin: center; background-color: lightpink; } here html. box container fixed width , height has overflow auto. <div id="box" style="width:500px;height:300px;border:1px solid black;background-color:lightgreen;overflow:auto;"> <div id="dragx" class="drag"><p>drag me</p></div> </div> here javascript. $(function () { $("div[id='dragx']").draggable({ containment: "#box", scroll: true }); }); full running example can found @ http://jsbin.com/tafof/2/edit?html,output basically when drag div extreme down or extreme right scroll bars show , allow me drag far possible. doesn't allow me drag outsid...

ios - Objective-C : validating text field with number -

i'm new ios development. want know how can validate text field if contains number specific range, 10 contact number ? there predefined function available ? thank you. + (bool) validatepassword:(nsstring *)password { nsstring *passwordregex = @"^[a-za-z0-9]{6,20}+$"; nspredicate *passwordpredicate = [nspredicate predicatewithformat:@"self matches %@",passwordregex]; return [passwordpredicate evaluatewithobject:password]; }

SharePoint: Efficient way to retrieve all list items -

i retrieving items list containing around 4000 items. seems take longer time fetch items ~15 ~22 seconds. is there best way fetch items list in negligible time? following code using fetch items: using (spsite spsite = new spsite(site)) { using (spweb web = spsite.openweb()) { list = web.lists["listname"]; spquery query1 = new spquery(); string query = "<view>"; query += "<viewfields>"; query += "<fieldref name='id' />"; query += "<fieldref name='title' />"; query += "</viewfields>"; query += "<query>"; query += "<where>"; query += "<eq>"; query += ...

IIS and Chrome - corrupted Javascript from IIS (looks ok in Fiddler) -

i have simple website i've migrated iis (7.5), , while works in ie javascript corrupted in chrome, looking chinese characters according dev tools. a fiddler trace shows identical both browsers i'm v confused! start of js in fiddler: // comment $(function(){ start of js in chrome dev tools: ⼯䌠浯敭瑮␊昨湵瑣潩⡮笩ਊ瘉牡映汩浥湡条牥㴠␠✨昮汩浥湡条牥⤧ਬउ牢慥捤畲扭⁳‽⠤⸧牢慥捤畲扭 maybe sort of unicode thing? changing file didn't (added comment @ top), , response headers ok: http/1.1 200 ok content-type: application/x-javascript last-modified: thu, 14 may 2015 06:37:44 gmt accept-ranges: bytes etag: "c7bdb97b108ed01:0" server: microsoft-iis/7.5 date: thu, 14 may 2015 06:48:28 gmt content-length: 8273 it doesn't work on mobile safari can't see content tell if it's same problem. thanks advice.

eclipse - Issues in setting up Authentication Flows project -

i tried different ways import " https://github.com/ohadr/authentication-flows " project eclipse, none of import type working. it of great if can guide me same. thanks, harika "authentication-flows" maven project. after clone it, find pom.xml in root directory (authentication-flows/client). if want import eclipse, click file -> import... -> maven -> existing maven project. hth

Fetch DateTime column from mysql in java -

in mysql last reading timestamp column of datetime. want fetch aggreagteusage based on last reading timestamp. last reading timestamp in yyy-mm-dd hr:min:se format (ex:2015-03-02 09:15:36) sql = "select aggregateusage sensorhourlyaggregates sensorid=250 , lastreadingtimestamp =?"; preparedstatement prepstmt; prepstmt = (preparedstatement) conn.preparestatement(sql); timestamp sbegin = new java.sql.timestamp(date.gettime()); prepstmt.settimestamp(1, sbegin); sbegin in yyy-mm-dd hr:min:se.nanosec format (ex:2015-03-02 09:15:36.00) i not able fetch data since both formats differ. how remove miliseconds time stamp. tried clendar.clear(calendar.miliseconds) unable fetch you have convert time-stamp date, following code may you. timestamp sbegin = new timestamp(/* pass timestamp db */); date date = new date(sbegin.gettime()); system.out.println(date);

javascript - Custom search filter in angularjs -

i using inbuilt search filter of angular js this- <!--header starts--> <input class="form-control fs-mini search" ng-model="search.name" type="text" placeholder="&#xe80a search"> <!--header ends--> <!--content area--> <div ng-repeat="user in users | filter:search"> {{ user.name }} {{user.l}} {{user.time}} </div> <!--content area ends--> now removed header template codes , created header directive. <!--header starts--> <div site-header> </div> <!--header ends--> <!--content area--> <div ng-repeat="user in users | filter:search"> {{ user.name }} {{user.l}} {{user.time}} </div> <!--content area ends--> site-header.js: 'use strict'; ...

how to call woocommerce product description in a post in wordpress -

i want display product description in post. have tried shortcode in post: [product_decrption id="1022"] but nothing showning in post.can please me. there function needed work this? as per knowledge, don't think there in-built shortcode that. but can make own 1 this: function rohils_product_description_function( $atts, $content=null ) { extract(shortcode_atts( array('id' => ''), $atts)); $product_data = new wc_product($id); $content = $product_data->post->post_content; return $content; } add_shortcode( 'product_decrption', 'rohils_product_description_function' ); and use : [product_decrption id="8"]

javascript - WebRTC - Record Video Conference Media Stream in Single File -

i trying make video conference application conference recording functionality using webrtc . new video conferencing things , client-server connection scenarios. i have created demo application video conferencing using peer-to-peer connection. works perfectly. need record whole conference (video + audio of both parties) in single file. what looked in webrtc demos, didn't such method that. not sure if can merging webrtc other tool or using webrtc custom logic. please me on this, open use other open source tool if provide such functionality. full disclaimer: work sightcall we offer video conferencing sdk (toolkit) built on webrtc. 1 of features have recording. use webrtc, build application call our js api, instead of calling webrtc directly. our cloud sets call , uses webrtc natively in browser. when record conference call (two or more users) create movie file in s3. creation of movie requires processing , transcoding, , setting software isn't straight...

actionscript 3 - Go to Web Page and Hand Cursor when rolling over movie clip on Adobe Flash Cs5 -

please want add web page link adress on ad area movie clip google adsense .swf ads, , want show hand cursor when movie clip rolling on over adobe flash cs5 action script 3.0, please help, in advance. just create button on top of everything, full size. have hand cursor. or create movieclip/sprite, , use: clip.buttonmode = true;

html - Trying to add 24 hours to a date which is stored in a variable. PHP -

i have variable holding output of datepicker input tag. want add 24 hours it. as stands, if var_dump variable is: string(10) "dd/mm/yyyy" how go adding 1 day it? i have tried: $finishdate2 = date('d-m-y',strtotime($finishdate . "+1 days")); but seem weird dates. $date="10/05/2015"; $date1=str_replace("/","-",$date); $tomorrow=date('d/m/y',strtotime($date1 . "+1 days")); you can try this

bash - Parsing and manipulating log file with embedded xml -

i have log file has embedded xml amongst normal stdout in follows: 2015-05-06 04:07:37.386 [info]process:102 - application submitted ==== 1 <application><firstname>test</firstname><studentssn>123456789</studentssn><address>123 test street</address><parentssn>123456780</parentssn><applicationid>2</applicationid></application> 2015-05-06 04:07:39.386 [info] process:103 - application completed ==== 1 2015-05-06 04:07:37.386 [info]process:104 - application submitted ==== 1 <application><firstname>test2</firstname><studentssn>323456789</studentssn><address>234 test street</address><parentssn>123456780</parentssn><applicationid>2</applicationid></application> 2015-05-06 04:07:39.386 [info] process:105 - application completed ==== 1 my objective parse file , replace occurences of personal data ***. therefore, desired output after script above ...

rest - HTTP-based API vs. Scripting language-based API, Performance -

according post how-can-i-write-a-set-of-functions-that-can-be-invoked-from-almost-any-program there discussions how write api can run on of programming languages. me there 2 interesting ways http-based api scripting language-based api where http-based api people talked rest on http (implementating language might c, java or etc) , scripting language-based api or command-line based api people talked lua, python, perl, etc. and @sk-logic mention "if performance , call latency not issue, consider providing comprehensive command line interface" so, lead me wondering of performance between http-based api , scripting language-based api. if want make cross-language api solution should use? anyway if have ideas or suggestions cross-language api can post on answer below.

android - Google Places Error -

i'm trying perform search using google places api in app i'm getting error. my code: public class googleplaces { /** global instance of http transport. */ private static final httptransport http_transport = new nethttptransport(); private static final string api_key = ""; // google places serach url's private static final string places_search_url = "https://maps.googleapis.com/maps/api/place/search/json?"; private static final string places_details_url = "https://maps.googleapis.com/maps/api/place/details/json?"; private double _latitude; private double _longitude; private double _radius; /** * searching places * @param latitude - latitude of place * @params longitude - longitude of place * @param radius - radius of searchable area * @param types - type of place search * @return list of places * */ public placeslist search(double latitude, double longi...

mysql - My sql statement has two parts attached with 'union all'. I want the second part to exceecute only when some condition is true -

my query big paste here , refers @ least 15 tables, pasting small example explain problem select city, country customers country='germany' union select city, country suppliers country='germany' order city; i want union part of query execute when condition true ( comes ui in parameter), e.g. boolean combo=true . thanks what this: select city, country customers country='germany' union select city, country suppliers country='germany' , @combo = true order city; it still runs second part of union return records if @combo true. saves lots of if else statements. helps if have many queries in union each query can have it's own @combo variable.

java - JSCH: No such file error -

i have windows machine running ssh server. know path on machine. let d:/folder1/folder2 . i'm creating sftp channel using jsch. when try cd d:/folder1/folder2 , "no such file: 2" error throwed. can please help? may need convert path? i've solved problem using channelexec opening exec channel. worked me. hope work others too. ... java.util.properties config = new java.util.properties(); config.put("stricthostkeychecking", "no"); jsch ssh = new jsch(); session = ssh.getsession(sshsolrusername, sshsolrhost, 22); session.setconfig(config); session.setpassword(sshsolrpassword); session.connect(); channel = session.openchannel("exec"); ((channelexec)channel ).setcommand("cd " + sourcepath); exec.setinputstream(null); ((channelexec)channel ).seterrstream(system.err); inputstream in = channel .getinputstream(); channel .connect(); int status = ch...

python - Importing cython function: AttributeError: 'module' object has no attribute 'fun' -

i have written small cython code is #t3.pyx libc.stdlib cimport atoi cdef int fun(char *s): return atoi(s) the setup.py file is from distutils.core import setup cython.build import cythonize setup(ext_modules=cythonize("t3.pyx")) i run setup.py using command python setup.py build_ext --inplace this gives me compiling t3.pyx because changed. cythonizing t3.pyx running build_ext building 't3' extension x86_64-linux-gnu-gcc -pthread -dndebug -g -fwrapv -o2 -wall -wstrict- prototypes -fno-strict-aliasing -d_fortify_source=2 -g -fstack-protector- strong -wformat -werror=format-security -fpic -i/usr/include/python2.7 -c t3.c -o build/temp.linux-x86_64-2.7/t3.o t3.c:556:12: warning: ‘__pyx_f_2t3_fun’ defined not used [-wunused-function] static int __pyx_f_2t3_fun(char *__pyx_v_s) { ^ x86_64-linux-gnu-gcc -pthread -shared -wl,-o1 -wl,-bsymbolic-functions -wl,-bsymbolic-functions -wl,-z,relro -fno-strict-aliasing -dndebug -g -fwr...

ios - Efficiently convert an area to matrix in Sprite Kit -

i new sprite kit. looking way convert area matrix, , put objects inside matrix. let assume, have *skspritenode matrix of size 100 x 100 i.e height , width both 100.i want turn 10x10 matrix out of 100 x 100 size. have turn matrix, , put objects within matrix of size 10x10. what best way of converting grid, other objects can placed of size of 10 x 10 anywhere in matrix? in objective c you should create object , give properties column, row. this algorithm of creating puzzle game candy crush :d -(void)createrandomly { (int row = 0; row < rows; row++) { (int col = 0; col < columns; col++) { float dimension = self.frame.size.width / columns; int randombubble = arc4random() % valuescount; bubble *node = [[bubble alloc] initwithrow:row column:col size:cgsizemake(dimension, dimension)]; [self.scene addchild:node]; } } } i recomend watch tutorial: https://www.youtube.com/watch?v=kpfwm8cz10u...

java - Spring mvc with jdbc template -

i want implements simple login spring mvc , jdbc template. getting null pointer exception. have included spring-core.jar,spring-jdbc.jar,spring-txn.jar,spring-web.jar.. ****complete stack trace:**** may 17, 2015 6:54:54 pm org.apache.catalina.core.standardwrappervalve invoke severe: servlet.service() servlet [login] in context path [/mvcwithjdbc] threw exception [request processing failed; nested exception java.lang.nullpointerexception] root cause java.lang.nullpointerexception @ com.mvc.dao.logindaoimpl.getlogindetails(logindaoimpl.java:25) @ com.mvc.controller.logincontroller.handlerequest(logincontroller.java:30) @ org.springframework.web.servlet.mvc.simplecontrollerhandleradapter.handle(simplecontrollerhandleradapter.java:48) @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:771) @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:716) @ org.springframework.web.servlet.fra...

javascript - jquery validation to select atleast one checkbox -

i have written following code select multiple checkbox , need validate atleast 1 checkbox selected . in following code data submission database working if removed onsubmit="return validate_form()" , want validate atleast 1 checkbox selected. following code-> <?php $link=mysql_connect("localhost","root","") or die("cant connect"); mysql_select_db("country_ajax",$link) or die("cant select db"); extract($_post); $check_exist_qry="select * language"; $run_qry=mysql_query($check_exist_qry); $total_found=mysql_num_rows($run_qry); if($total_found >0) { $my_value=mysql_fetch_assoc($run_qry); $my_stored_language=explode(',',$my_value['language_name']); } if(isset($submit)) { $fname=$_post['fname']; $sname=$_post['sname']; $all_language_value = implode(",",$_post['language']); if($total_found >0) { //update ...

php - Lumen MySQL query not handling UTF8 value as expected -

Image
i'm working against database using utf8 encoding , has many user names contain special characters, such "Ғђ ▫ sony" when querying user table, lumen responds incorrect data. i've tried querying same table using mysqli , pdo , receive expected results. set sample route test it: $app->get("charset", function() { $mysqli = new mysqli("localhost", "user", "password", "database"); $res = $mysqli->query("select name users id = 1"); $dbh = new pdo('mysql:host=localhost;dbname=database', "user", "password"); $stmt = $dbh->query("select name users id = 1"); $lumen = db::select("select name users id = 1"); return response()->json([ "mysqli" => $res->fetch_assoc(), "pdo" => $stmt->fetchall(pdo::fetch_assoc), "framework" => $lumen ]); }); when accessing...

c++ - Installed freetype through homebrew, can't seem to include headers correctly -

on xcode project, added dylib of freetype project link binary phase. i ensure /usr/local/include , /usr/local/lib in search paths in build settings. i include: #include <freetype2/ft2build.h> #include ft_freetype_h but error freetype.h not found. ideas? tried including <freetype2/freetype.h> directly, leads more compile problems include paths in other freetype files. looking @ demo programs in "freetype2-demos", see: #include <ft2build.h> #include ft_freetype_h also, think need compiler command-line include -i (path freetype includes) . for example... g++ -i (...)/freetype2 myfile.cpp here instructions . suggestion there compile like... g++ $(freetype-config --cflags) myfile.cpp ...which, if system configured correctly, incorporate -i option mentioned.

c# - editing the iteration value in a foreach loop -

situation i'm trying design simple remove method deletes object if incoming id parameter matches id on record: for instance, if race had id "123" find race had id "123" , set null, removing it. i've looked @ few methods online , yeah, seems recurring problem foreach specifically, i'd way if possible. public void removerace(string raceid) { foreach (baserace br in races) { //if id entered method parameter matches id on record. if (raceid == br.raceid) { //set current id null, deleting record. //br = null; } } } problem my code, br = null; doesn't work, since foreach loop won't let me edit iterator. how can solve issue in way? list<t> provides method that: public void removerace(string raceid) { races.removeall(br => raceid == br....

python - Double Validation Error, How to fix? -

`import time warriorspellone, warriorspelltwo, warriorspellthree, warriorspellultimite = ("slash"), ("hammer down"), ("flame strike"), ("ragnarok") magespellone, magespelltwo, magespellthree, magespellultimite = ("fireball"), ("lightning strike"), ("necromancy"), ("mutation") archerspellone, archerspelltwo, archerspellthree, archerspellultimite = ("tri-shot"), ("aimed shot"), ("snare"), ("arrow rain") rougespellone, rougespelltwo, rougespellthree, rougespellultimite = ("backstab"), ("smoke bomb"), ("blade toss"), ("shadow wars") spellone, spelltwo, spellthree, spellultimite = ("n/a"), ("n/a"), ("n/a"), ("n/a") warriorhealth, warriorattack, warriormana = int(200), int(10), int(100) magehealth, mageattack, magemana = int(75), int(10), int(200) archerhealth, archerattack, archermana = in...

vba - Copy emails from my Sent Folder in Outlook 2010 to an Excel file -

i need make record of emails i've sent on last couple years, , include sent to, date, , body of message. exporting outlook not carry date, , reason access won't import data outlook on company computers i came across macro export outlook excel, of information need, pulls inbox: http://officetricks.com/outlook-email-download-to-excel/ i searched office vba website commands make export sent items folder instead of inbox, kept getting run-time error 438 "object doesn't support property or method" @ receivedbydate , cc lines (under command below). happens sent emails. tried moving them separate folder , inbox, macro fails when reads emails sent me. sub mail_to_excel() ' ' mail_to_excel macro ' copies emails outlook excel file ' add tools->references->"microsoft outlook nn.n object library" ' nn.n varies per our outlook installation dim folder outlook.mapifolder dim irow integer, orow integer dim mailboxname str...

Where to immediately request data, parse it and save in Rails app? -

new ruby , rails. i'm working on first app parse information xml hosted on server (i able through net/http). need able save parsed data sqlite database root of app loaded because i'll need access it. i'm not entirely sure should initiate parse , save database in order have available root page loads up. should go in controller points root index (or should handled model somewhere)? if there better/faster/more efficient way access , save data (as opposed parsing, seeing if information in database date , saving if not) appreciate suggestions. thank you! you need use delayed_jobs https://github.com/collectiveidea/delayed_job in initializer folder create file looks (this mine) delayed::worker.destroy_failed_jobs = false delayed::worker.sleep_delay = 2 delayed::worker.max_run_time = 5.minutes delayed::worker.read_ahead = 10 delayed::worker.default_queue_name = 'default' if delayed::worker.delay_jobs begin scheduledworker.new.schedule re...

python - Calculate Numeric Value inside a String within a Pandas Column -

i have pandas dataframe , can select column want @ with: column_x = str(data_frame[4]) if print column_x, get: 0 af1000g=0.09 1 af1000g=0.00 2 af1000g=0.14 3 af1000g=0.02 4 af1000g=0.02 5 af1000g=0.00 6 af1000g=0.54 7 af1000g=0.01 8 af1000g=0.00 9 af1000g=0.04 10 af1000g=0.00 11 af1000g=0.03 12 af1000g=0.00 13 af1000g=0.02 14 af1000g=0.00 ... i want count how many rows contain values af1000g=0.05 or less there are. rows contain values af1000g=0.06 or greater. less_than_0.05 = count number of rows af1000g=0.05 , less greater_than_0.05 = count number of rows af1000g=0.06 , greater how can count these values column when value in column string contains string , numeric content? thank you. rodrigo you can use apply extract numerical values, , counting there: vals = column_x.apply(lambda x: float(x.split('=')[1])) print sum(vals <= 0.05) #number of rows af1000g=0.05 , less print sum(vals ...

java - Noob Null Pointer Exception error -

this question has answer here: creating array of objects in java 4 answers i'm getting nullpointerexception error , cant figure out why. i've included 3 classes i'm working on , made ////note eclipse saying error coming in main method (two locations apparently). i'm new coding , understand happens when trying pass considered null, believe i'm trying pass newly created fish earlier in code. i'm sure error caught experienced eye. thank you! import java.util.scanner; public class fishtankmanager { private static scanner stdin = new scanner(system.in); private static int userinput, userinput2; private static fishtank[] tanks = new fishtank[10]; public static void main (string[] args) { while (true){ system.out.println("welcome new fish tank manager!\n"+ "what do?\n"+ ...