Posts

Showing posts from September, 2010

debian - How can I use the kernel function in my C code? -

first, want apologize english, it's not mother language best. i'm new developer in debian, before cross-plateform code. since cross-plateform isn't in constraint anymore, want close possible kernel. for example, want use aes crypt file. aes exist in kernel , prefer use aes kernel rather aes (i trust more kernel source code). there way use kernel function in user space ? more precisely, exist method, or documentation ? if want have doc of c function, "man function". there equivalent kernel ? i hope doesn't make mistake question. thank reading, stack overflow me dozen , dozen time in past, thank you. edit : sorry, edit post , hope it's better time. is there way use kernel function in user space? no, kernel function cannot called directly user space. you can write kernel module, calls desired function responce request user space.

Ruby on rails tutorial chapter 10...account activation not matching route -

trying go through ruby on rails tutorial on chapter 10. have pretty decent understanding of routing far. here issue: account activations send token email performs hash on , tries verify (after link clicked). have route set /account_activations/:id/edit and url sending: account_activations/$2a$10$gtxhcostrwnvmdmwawljk.wm1xgnicwxupkymin5orqvwrib%2ftnxy/edit?email=me%40gmail.com i have verified hash correct in several different testing scenarios. tells me cannot find route it. quoting closest thing (in terms of priority) as: edit_account_activation_path /account_activations/:id/edit(.:format) account_activations#edit the path in routes.rb looks like: resources :account_activations, only: [:edit] looks me should match though :id should act wildcard string. if needs more info let me know. understand why isn't working. thanks.

iOS : How to make a CGRect as visible rect for UIView? -

i drawing line graph in uiview width of 1200pixels. can visible 320pixels. how can make rectangle starting x=880 , width = 320 visible?. you can draw graph @ 880px using following way. step 1 : take uiscrollview width = 1200 . step 2 : add uiview in uiscrollview having x position = 880 , width = 320; now can draw graph on uiview . received output same want. hope you.

How to use serilog with latest asp.net 5? -

if have both "microsoft.framework.logging.console": "1.0.0-*, and "serilog.framework.logging": "1.0.0-*" in project.json , i'm getting following conflict: the type iloggerfactory exists in both microsoft.framework.logging.abstractions , microsoft.framework.logging.interfaces the type ilogger exists in both microsoft.framework.logging.abstractions , microsoft.framework.logging.interfaces looks have mixed old , new packages in project.json. take @ announcement , can see in aspnet 1.0.0-beta5 packages renamed. so,for example, microsoft.framework.logging.console depends on old microsoft.framework.logging.interfaces , serilog.framework.logging depends on new microsoft.framework.logging.abstractions, @ project.lock.json dependency details. try update packages beta6 version in project.json, not forget dnvm upgrade dnx. hope ) thanks

angularjs - How to test promise in jasmine & karma -

i have test case follow: it("should have valid structure", function(done){ var data; module(app_module_name); inject(function(_metaservice_){ metaservice = _metaservice_; }); metaservice.fetchentitymeta('person').then(function(data){ expect(data.status).tobe( true ); done(); }); }); but getting following error: error: timeout of 2000ms exceeded. ensure done() callback being called in test. i have increased jasmine.default_timeout_interval not use. following code work. settimeout(function(){ expect(true).tobe(true); done(); }, 5000); so, understanding having problem promise. question how can check data returned promise. you not calling done() callback anywhere in test. change last statement to metaservice.fetchentitymeta('person').then(function(data) { expect(data.status).tobe(true); done(); }); another option is metaservice.fetchen...

asp.net - How to disable query execution plan caching per query in Entity Framework? -

is there chance disable query execution plan caching using entity framework? i know in objectquery disable per query: https://msdn.microsoft.com/pl-pl/library/system.data.objects.objectquery.enableplancaching(v=vs.110).aspx ) don't see such option in dbquery. i know there interceptors in ef 6 , attach option (recompile) can't find solution how attach 1 exact query not every query in context.

java - Sobel operator doesn't work with rectangle images -

Image
i try implement sobel operator in java result mix of pixels. int i, j; fileinputstream infile = new fileinputstream(args[0]); bufferedimage inimg = imageio.read(infile); int width = inimg.getwidth(); int height = inimg.getheight(); int[] output = new int[width * height]; int[] pixels = inimg.getraster().getpixels(0, 0, width, height, (int[])null); double gx; double gy; double g; for(i = 0 ; < width ; i++ ) { for(j = 0 ; j < height ; j++ ) { if (i==0 || i==width-1 || j==0 || j==height-1) g = 0; else{ gx = pixels[(i+1)*height + j-1] + 2*pixels[(i+1)*height +j] + pixels[(i+1)*height +j+1] - pixels[(i-1)*height +j-1] - 2*pixels[(i-1)*height+j] - pixels[(i-1)*height+j+1]; gy = pixels[(i-1)*height+j+1] + 2*pixels[i*height +j+1] + pixels[(i+1)*height+j+1] - pixels[(i-1)*height+j-1] - 2*pixels[i*hei...

javascript - codeigniter calendar: how to get the selected date? -

Image
i trying modify codeigniter calendar in order give separate add button every cell. when add button clicked pop displayed particular date auto filled in pop up. want selected date when click add button. my calendar this. i used following model function create calendar function mycal_model() { $this->conf = array( 'show_next_prev' => true, 'next_prev_url' => base_url() . 'index.php/dashboard/index/' ); $this->conf['template'] = ' {table_open}<table cellpadding="1" cellspacing="2" class="calendar">{/table_open} {heading_row_start}<tr>{/heading_row_start} {heading_previous_cell}<th class="prev_sign"><a href="{previous_url}">&lt;&lt;</a></th>{/heading_previous_cell} {heading_title_cell}<th colspan="{colspan}">{heading}</th>{/heading_title_cell} {he...

jquery - How to add Highcharts low and high data series using javascript -

i trying create graph represents schedule of our store using highcharts. that, use columnrange start , end time store open. but i'm stuck on how can push data using array , json. here's want achieve. made mock-up hard coded data; jsfiddle: http://jsfiddle.net/rds_a/lscqugbp/3/ code: $(function () { window.chart1 = new highcharts.chart({ chart: { renderto: 'container1', type: 'columnrange', inverted: false }, title: { text: "store schedule" }, xaxis: { categories: ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'yesterday','today'] }, yaxis: { min: 0, max: 24, categories: ['01','02','03', '04','05', '06','07', '08', '09','10', '11',...

python - PyQt4: How to auto adjust size of a widget not in layout -

Image
i want implement gui program blueprint editor in unreal game engine pyqt4. here example of blueprint editor: first create simple container widget place components(the rectangles). in order allow user place rectangles wherever want(by drag & drop), can't place widgets in layout. when content of rectangle changed, rectangle widget can't auto adjust size itself. following example code: import sys pyqt4 import qtcore pyqt4 import qtgui class changeablechild(qtgui.qwidget): def __init__(self, parent=none): super(changeablechild, self).__init__(parent) self.setlayout(qtgui.qvboxlayout()) def addwidget(self, widget): self.layout().addwidget(widget) class mainwidget(qtgui.qwidget): def __init__(self, child, parent=none): super(mainwidget, self).__init__(parent) child.setparent(self) def main(): app = qtgui.qapplication(sys.argv) changeable_child = changeablechild() button = qtgui.qpushbutton("ad...

jQuery dialog box not closing till a function is executed -

i'm using jquery dialog box alert user deleting record in table. following code: $('#deletebutton').click(function () { if($(this).attr('disabled')=='disabled'){ //do nothing } else{ var isdeleteyes = false; $('#delete-confirm').dialog({ height : 150, width : 400, autoopen : true, close: function( event, ui ) { //alert(closed) }, buttons : { "yes" : function () { isdeleteyes = true; $(this).dialog("close"); deletefunction(); }, "no" : function () { isdeleteyes=false; $(this).dialog("close"); ...

android - How parse.com Local Datastore Work? -

i know few thing parse local datastore link store objects in local datastore on android device. useful temporarily storing data can synced later. my question how store data locally in android database , how synced later on when connect internet. think data store in android sqlite database temporary , later on when connect network data going synced cloud. is right? i want store database on local database , when connect internet synced. , if update in cloud database synced in local db. can parse useful or not? please me if know. yes, can use parse purpose. start tutorial here. gives step step procedure exact requirement yours. https://www.parse.com/tutorials/using-the-local-datastore . hope helps.

Ionic angularjs Android App -

Image
i developing android app using ionic framework. trying build basic fileupload system. <form action="" enctype="multipart/form-data" method="post"> <fieldset> <input type="file" name="image"> <input type="submit" value="upload"> </fieldset> </form> after selecting image, doesnot show original filename. shows random filename without extension. here screenshots. have selected images-2.jpeg thanks all

java - Getting an unmarshaling exception in Jaxb -

i have implemented rest web services using apache cxf (no spring framework) , marshaling have used jaxb. when use url in web browser, fine , got object representation in xml format when used client call web service , try unmarshal response in xml format list of object had on server. getting following exception javax.xml.bind.unmarshalexception: unexpected element (uri:"", local:"html"). expected elements <{}abc>,<{}xyz> @ com.sun.xml.bind.v2.runtime.unmarshaller.unmarshallingcontext.handleevent(unmarshallingcontext.java:662) @ com.sun.xml.bind.v2.runtime.unmarshaller.loader.reporterror(loader.java:258) @ com.sun.xml.bind.v2.runtime.unmarshaller.loader.reporterror(loader.java:253) @ com.sun.xml.bind.v2.runtime.unmarshaller.loader.reportunexpectedchildelement(loader.java:120) @ com.sun.xml.bind.v2.runtime.unmarshaller.unmarshallingcontext$defaultrootloader.childelement(unmarshallingcontext.java:1063) @ com.sun.xml.bind.v2.runt...

sql - Inner Join Statement Java -

the sql code runs fine in mysql, , other statements in application work 1 saying table dosn't exist when does, made sure syntax right don't understand why not working, code posted below private void salesreportbtnactionperformed(java.awt.event.actionevent evt) { try { con = drivermanager.getconnection(url, user, password); stmt = con.createstatement(); result = stmt.executequery("select prod_srv_id , `the_organizations_organization_name` ," + " `prod_srv_details` , `prod_srv_price` , `prod_srv_discount` `contracts_contract_number` ," + " `shipment_completed`\n" + "from product_and_services\n" + "join product_contract_line on product_and_services.prod_srv_id =" + " product_contract_line.product_and_services_prod_srv_id"); int tempname = 4; sales...

javascript - why row click event not work properly in angular? -

i trying expand , collapse row on row click .but in demo clicked on row open last row why ?in other words trying show , hide row description on row click when click show description of third row ,not demand on row clicked .it expand third row . here code angular.module('app',['ionic']).controller('apptes',function($scope){ $scope.toogle_item=false; $scope.obj=[{ number:"123", name:"bil" },{ number:"547", name:"till" },{ number:"123223", name:"test" }] $scope.clickrow=function(){ $scope.toogle_item=!$scope.toogle_item; } }) there 2 problems you need have 1 item-body / item tabs per each item in array, in code outside of ng-repeat there 1 set of those. solve i've moved ng-repeat layer up since want show 1 item @ time, can opt index based solution given below so angular.module('app', ['ionic']).controller('apptes'...

ios - Detect push notifications tap -

i know can use code handling notifications : - (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo{ if ( application.applicationstate == uiapplicationstateinactive || application.applicationstate == uiapplicationstatebackground ) {//opened push notification when app on background } } but isn't reliable loops number of current notifications shows view controller hundres of time so question : is there other "good" way can use handle tapped notification ?

html - Wordpress footer hacked -

at end of our wordpress page (when check source code) have little gem </body> </html><html> <div style='left: -3565px; position: absolute; top: -4812px'> <a href="http://www.coachoutletsonline.cc">coach outlet in jackson nj</a> <a href="http://www.louisvuitonoutlet.us.com">louis vuitton outlet</a> <a href="http://www.cheapnfljerseyschina.us.com">cheap nfl jerseys china</a> <a href="http://picklex20.com/cheap-soccer-jerseys-china.html">cheap soccer jerseys china</a> <a href="http://www.tiffanyandcooutlet.us.com">tiffany , co engagement rings</a> <a href="http://www.jerseycheap.us.com">cheap jerseys</a> <a href="http://www.rogervivieroutlet.us.com">roger vivier shoes outlet</a> <a href="http://www.redbottomsshoes.us.com">red bottom shoes</a> <a href="http://www....

html - Auto Adjusting the Size of Images and/or Icons On the Same Line -

imagine social media icons/images (e.g. facebook, twitter, linkedin) lined next each other on same line. how can make size of icons/images auto adjust when add additional icons/images line? right jump next line. want where, if add icons/images, smaller, stay on same line; if take icons/images away, larger fit width of container. thank help! update: <div class="padding"><a href="http://www.facebook.com"><img class="image" src="images/black_white_facebook.png" alt="facebook icon" /></a></div> <div class="padding"><a href="http://www.twitter.com"><img class="image" src="images/black_white_twitter.png" alt="twitter icon" /></a></div> <div class="padding"><a href="http://www.linkedin.com"><img class="image" src="images/black_white_lin...

c# - List values by key in deserialized json object -

so define public class globals { public list<object> var { get; set; } } my json i'm sending so {"var":[{"test1":"1","test2","2","test3","3"}],"morejson":"blahblahblah} so lets have , pretend appendtextbox writing textbox in separate thread void getmedata() { var commands = jsonparser.deserialize<globals>(json); appendtextbox(commands.description[0].tostring()); appendtextbox(commands.description.count.tostring()); } appendtextbox(commands.description.count.tostring()); works , shows count however cannot seem print values preferably key. way set gives following output system.collections.generic.dictionary`2[system.string,system.object]` any suggestions? you can use list of dictionary use instead of object access using : public class globals { public list<dictionary<string, string>> var { get; set; } } then, json ...

c# - How to create a custom format to webgrid column helper? -

i need create custom format in webgrid helper. i'm trying way, not working. if (fieldtype == fieldtype.currency && format == null) format = x => string.format(cultureinfo.currentculture, "$ {0}", x.reductionvalue); this.columns.add(new gridcolumn() { columnname = columnname, header = displayname, format = format, style = stylecolumn, cansort = cansort }); i need result be: $ myvalue example: $ 1.000,00 how can this? i had same doubt, when trying format column of webgrid. i did this, think same want do: public void addcurrencycolumn(expression<func<t, decimal?>> expression) { func<t, decimal?> compiledexpression = expression.compile(); this.columns.add(new webgridcolumn() { columnname = "id", header = string.empty, format = (item) => string.format(sys...

java - imagehtmlemail sending as text/plain -

we have code uses imagehtmlemail, apache commons. machines works perfectly, sends out html email embedded image - machines - same code, same smtp server, , inside same networks - sends multipart email normal - each of parts marked text/plain - opposed having text/html , text/plain section when works. , of course users page full of html markup result. i can't see how possible. in code using sethtmlmsg of course - , other machines same code works - must environmental or configuration on machine - nothing can determine. ideas of either problem, or should check? we upgraded apache commons library , problem went away - must have been bug :(

paypal - Is the Payout (REST api) functionality meant to replace Mass Pay (classic merchant api)? -

it appears though newish payout (including batch) endpoints more or less match older masspay functionality. fee structures seem match up, payouts having advantage transfers within us. of events logged masspay . appears practical purposes payouts meant replace masspay . what haven't been able find definitive statement paypal effect. have looked announcement when payouts introduced, through technical , general support documentation, , in every place think of. obviously, lack of such statement on own. doesn't seem should case. has seen official statement can refer to? or, if paypal folks listening, such statement possible? something along lines of, "paypal encouraging developers build new systems needing masspay functionality using payout endpoints of rest api" thanks! the payouts api brand new rest-based api replaces mass payments classic apis. payouts has more features compared mass payments. businesses need send disbursements 500 recipien...

ajax - Bacon.retry not retrying on 'Access-Control-Allow-Origin' errors -

i have buggy web service sporadically sends 500-error "xmlhttprequest cannot load http://54.175.3.41:3124/solve . no 'access-control-allow-origin' header present on requested resource. origin ' http://local.xxx.me:8080 ' therefore not allowed access. response had http status code 500." i use bacon.retry wrap ajax call. when fails, it'll retry. however, notice stream won't produce value when server fails. it's if bacon.retry doesn't retry (which in fact what's happening, when under hood in dev console). i'm using baconjs 0.7.65. the observable bacon.retry looks this: var ajaxrequest = bacon.frompromise($.ajax(//...)); var observable = bacon.retry({ source: function() { return ajaxrequest; }, retries: 50, delay: function() { return 100; } }); the code calls observable looks this: stream.flatmap(function(valuesorobservables) { return bacon.fromarray(valuesorobservables) .flatmapcon...

XML really slow compared to sites using the same API (PHP, Wordpress, Supercontrol) -

i'm using api booking engine supercontrol in wordpress build here: http://ukshortbreaks.com.s191529.gridserver.com/accommodation/ it's taking such long time load! can't use caching because each search unique. i've tried limit nodes it's loading doesn't seem making difference @ all. is there i'm missing? sitting doing else before goes looking through xml? i'm not getting errors, there's maybe weird going on. two other websites using same api super fast mulberry cottages , sykes cottages (my rep low post links). any advice on how speed appreciated. sorry if amateur hour!

Where does Visual Studio 2015 display error indicators in the solution? -

Image
i checking out visual studio 2015 rc. visual studio 2015 display error indicators in solution? if in cs file compiles fine the solution has compile errors, how find out glancing @ ide without opening windows? looking similar r#'s solution wide analysis indicator or redgate's net demon bar (in vs 2013). the exact thing you're looking isn't available in visual studio 2015 out of box. there's few options. built in: error list the error list has been enhanced, , it's more dynamic due roslyn, can see warnings & errors code (without having recompile). you have more control on what's shown too; can filter entire solution, open documents, current project or current document, combinations of intellisense or build feedback: if pin error list somewhere visible, of real-time feedback want. productivity power tools extension microsoft's productivity power tools extension visual studio has solution explorer errors feature gives visual...

ruby - Developing Multiple Rails Plugins with Dependencies -

i'm starting build series of plugins , engines in project i'm developing , i've run issue of having list paths dependencies in of gemfiles main application , plugins/engines if want rake work. rake works fine main application because it's gemfile lists relative paths plugins/engines want, when plugin/engine dependent on , not have relative paths listed, using rake rdoc i'll error following (presumably i'll same error trying run tests/the dummy application/etc): bundler not find compatible versions gem "user": in gemfile: auth (>= 0) ruby depends on user (>= 0) ruby not find gem 'user (>= 0) ruby', required gem 'auth (>= 0) ruby', in of sources. rather having use paths, i've tried specifying git repository in plugins/engines so: # user engine gem 'user', git: 'https://localhost/git/project/user.git', branch: 'master' and using bundler config local.user /path/to/local/repo...

android - ActionBarActivity is deprecated Eclipse -

this question has answer here: why actionbaractivity deprecated 3 answers i new android-programming. installed sdk , added library , when create new project error: actionbaractivity deprecated i use android support library 22.2 , android 5.1.1(api 22). package com.example.ww; import android.support.v7.app.actionbaractivity;//problem import android.os.bundle; import android.view.menu; import android.view.menuitem; public class mainactivity extends actionbaractivity { //problem @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); return true; } @ov...

javascript - Why is my variable unaltered after I modify it inside of a function? - Asynchronous code reference -

Image
given following examples, why outerscopevar undefined in cases? var outerscopevar; var img = document.createelement('img'); img.onload = function() { outerscopevar = this.width; }; img.src = 'lolcat.png'; alert(outerscopevar); var outerscopevar; settimeout(function() { outerscopevar = 'hello asynchronous world!'; }, 0); alert(outerscopevar); // example using jquery var outerscopevar; $.post('loldog', function(response) { outerscopevar = response; }); alert(outerscopevar); // node.js example var outerscopevar; fs.readfile('./catdog.html', function(err, data) { outerscopevar = data; }); console.log(outerscopevar); // promises var outerscopevar; mypromise.then(function (response) { outerscopevar = response; }); console.log(outerscopevar); // geolocation api var outerscopevar; navigator.geolocation.getcurrentposition(function (pos) { outerscopevar = pos; }); console.log(outerscopevar); why output ...

DotNetNuke call to wcf service to GetModule(ModuleId) fails - Objects reference null exception -

i working on dotnetnuke version 7.4. in setting.ascx client side code of module i'm creating, have jquery ajax call wcf service supposed module information moduleid pass method of service. when creates new instance of modulecotroller, factory property inside modulecontroller null. trying getmodule fails following error: "object reference not set instance of object" dotnetnuke.entities.modules.modulecontroller modulecontroller = new dotnetnuke.entities.modules.modulecontroller(); if (modulecontroller != null) { var requestedmodule = modulecontroller.getmodule(moduleid); } i have added nesseary config info required dotnetnuke dlls. can please guide me i'm missing. i don't quite understand trying do, want use modulecontroller factory return instance this: var modinfo = dotnetnuke.entities.modules.modulecontroller.instance.getmodule(moduleid, tabid, false);

sql server - Change the initial size of log files -

i changing initial size of log files goes previous size. can please let me know need gets new size? thanks try this.. use [master] go alter database [my_db] --<-- db name modify file ( name = n'my_db_log' --<-- logical name of log file , size = 2048 ) go

rdf - Extract the superclass of a owl:unionOf list -

is possible superclass of owl:unionof list? have following: ex:a rdf:type owl:class ; owl:unionof (ex:pet ex:animal1 ) . ex:b rdf:type owl:class ; owl:unionof (ex:pet ex:animal2) . what i'm trying simple this: select ?x { ?x superclass ex:pet } where results should ex:a , ex:b . if ex:pet replaced ex:animal1 , result ex:a . the relationship should other way around: if sparql endpoint supports inferences, select ?x {ex:pet subclassof ?x. }; should work.

javascript - "Uncaught TypeError: $ is not a function" with instafeed -

this question has answer here: jquery - $ not defined 34 answers i using instafeed images instagram , show them on website. here's code: <script type='text/javascript' src='/js/jquery/jquery.js?ver=1.11.2'></script> <script type="text/javascript"> var feed = new instafeed({ get: 'tagged', tagname: 'test', clientid: '0000000000000000000', limit: 6, after: function () { var images = $("#instafeed").find('a'); $.each(images, function(index, image) { var delay = (index * 75) + 'ms'; $(image).css('-webkit-animation-delay', delay); $(image).css('-moz-animation-delay', delay); ...

php - Combine 3 SQL SELECT into one statement -

i have 3 tables : teams (id_team, name, id_season) seasons (id_season, name, nbr_teams) teams_stats (id_stats, id_game, id_team, victory, defeat, draw) i have 3 queries working fine individually : select t.name, count(ts.victory) wins teams t join seasons s on t.id_season = s.id_season , s.name = '2015' left join teams_stats ts on ts.id_team = t.id_team , ts.victory = 1 group t.name order t.name select t.name, count(ts.defeat) losses teams t join seasons s on t.id_season = s.id_season , s.name = '2015' left join teams_stats ts on ts.id_team = t.id_team , ts.defeat = 1 group t.name order t.name select t.name, count(ts.victory) draws teams t join seasons s on t.id_season = s.id_season , s.name = '2015' left join teams_stats ts on ts.id_team = t.id_team , ts.draw = 1 group t.name order t.name i wondering how can can same result within 1 query. can't ? maybe can throw light ... i appreciate, thanks. you can use conditional agg...

android - Lifecycle of Fragment that holds a ViewPager -

i have has me stumped. have fragment (fragment a) has viewpager contains 3 fragments (for swiping left/right). so, if within fragment, in onbackpressed() method, getfragmentmanager().popbackstack() call, fragment again visible (with viewpager of sub-fragments) desired state. however, there no method fragment or within viewpager indicates fragment a/viewpager again visible. none of fragment methods referenced in fragment lifecycle ( http://developer.android.com/guide/components/fragments.html ) should called when "the fragment returns layout stack" or of methods called within onpagechangelistener (yes, call viewpager.setonpagechangelistener(this) within fragment a's oncreateview). thoughts on look? i have app viewpager added layout, later replaced fragment, change added transaction stack. have log statements in each of lifecycle methods of pager. when button pressed , pager returned layout, logcat output shows these methods called pager: oncrea...

c++ - building the ta-lib library fails with undefined references from libm.so -

trying make ta-lib library (ta-lib-0.4.0-src.tar.gz) following error: /home/me/ta-lib/src/.libs/libta_lib.so: undefined reference `sinh' /home/me/ta-lib/src/.libs/libta_lib.so: undefined reference `sincos' /home/me/ta-lib/src/.libs/libta_lib.so: undefined reference `ceil' ... for large number of maths functions. the failing command looks this: gcc -g -o2 -o .libs/ta_regtest (... .o files) -l/home/me/ta-lib/src \ /home/me/ta-lib/src/.libs/libta_lib.so -lm -lpthread -ldl the offending library (ta_lib) looks this: objdump -tc libta_lib.so | grep " d \*und\*" 0000000000000000 d *und* 0000000000000000 sinh 0000000000000000 d *und* 0000000000000000 sincos 0000000000000000 d *und* 0000000000000000 ceil ... for same maths functions (the grep excludes defined functions , have "w" (presumably weak) flag) a map lists libraries included, among them: load /usr/lib/gcc/x86_64-li...

salesforce - Could one field be added to different record types? -

i know if 1 field added multiple record type ? do need trigger or related salesforce record type system? record types used different business processes use different pagelayouts , picklist values. there nothing worry fields independent recordtypes.

c# - How do I loop back to the start of an 'if' branch? -

i want loop beginning of 'if' condition if 'else' condition met. i'm new c# programming , struggling quite bit if i'm honest. sorry if has been asked before, did search found nothing. here's (messy) code: using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; namespace tinkering { class program { static void main(string[] args) { { console.writeline("let's go on adventure shall we?\n\nlet's start name:"); string username = console.readline(); console.writeline("\nhi " + username); console.writeline("\nis girls' name?\n"); console.readline(); console.writeline("\ni see\n"); console.writeline("well anyway, let's started shall we?\n"); console.writeline("w...

java - Why does a non-empty List throw a Null Pointer Exception? -

i have list array 'details'. list<historydetails> details where historydetails object containing strings. when check size gives me positive value. details.size() but when try access element throws null pointer exception. details.get(0).getfirstelement(); attempt invoke virtual method 'java.lang.string com.historydetails.getfirstelement()' on null object reference i invoking element @ next line check size. hence, nothing should reset. wrong? a list details having many items can have first item null object. before using item check null. if(details.get(0)!=null){ details.get(0).getfirstelement(); }

assembly - Modding hardcoded calculations (Victoria 2) -

i modder* of victoria 2** , have come across problem. there hardcoded calculation in value divided value. want change calculation division, subtraction. i have downloaded program called ollydbg ( http://www.ollydbg.de/ ), able turn game's .exe assembly code. i have checked coded divisions (marked 'div' there) , found 256. there several div dword cases, understand double words , not thing searching for, there 62 div ecx cases think thing should looking at. how figure out division 1 searching for? there easier way or more or less hopeless try this? hope community can provide answers. note: not have experience assembly language , new me. *(for few don't know) person creates edited version of game **a grand strategy pc game edit: should note know 2 values used calculations, both dynamic , depend on situation in game. possible use cheat engine find addresses values have , use find code want change?

json - What is the Regex for this case -

i want "superhouse" value "house" expression json return. tried "house":"(.+?)" didnt work. { type: "benefits" members: [1] 0: { type: "benefits2" house: { color: "red" name: "superhouse" category: "big hoses" } } } what regex? "house":"(.+?)" doesn't work because value of house property not surrounded quotes , there space between value , : . these things have consider when constructing regex values out of json properties. if json looks , need specific value 1 time, can use "house": (.*) . you should using json parser whatever platform working with. many languages/platforms have built-in json parsers including javascript , php. others java have popular libraries gson , jackson if need in bash/command line, recommend jsawk

bioinformatics - populating a matrix with a list, where each vector in the list may be 1 - 7 elements [R] -

say have ';' separated information in vector, want split apart, using strsplit. data contains information looks this: [1] "k__fungi; p__ascomycota; c__eurotiomycetes; o__unidentified; f__unidentified; g__unidentified; s__eurotiomycetes sp" [2] "k__fungi; p__basidiomycota; c__agaricomycetes; o__agaricales; f__mycenaceae; g__unidentified; s__mycenaceae sp" [3] "k__fungi; p__ascomycota" [4] "none" [5] "k__fungi; p__glomeromycota; c__glomeromycetes; o__glomerales; f__glomeraceae; g__glomus; s__glomus macrocarpum" [6] "k__fungi; p__basidiomycota; c__agaricomycetes; o__agaricales; f__inocybaceae; g__inocybe" i use strsplit separate out information this: list<- strsplit(data,...

ios - Using if statements in Swift? -

whats best way execute code if optional isn't nil? clearly, obvious way directly check if value nil: if optionalvalue != nil { //execute code } i've seen following: if let _ = optionalvalue { //execute code } the second 1 seems more in line swift since it's using optional chaining. there advantages using 1 method on other? there better way it? better mean "more in line swift", whatever means. optional binding should used if need unwrapped value. shortcut longer expression, , think should thought in terms. in fact, in swift 1.2 optional binding expression: if let unwrapped = optional { println("use unwrapped value \(unwrapped)") } is syntactic sugar code (remember optionals are, under hood, instances of optional<t> enumeration): switch optional { case .some(let unwrapped): println("use unwrapped value \(unwrapped)") case .none: break } using optional binding , not assigning unwrapped value...

java - Find duplicate value in large amount of data -

i must test application generate random keys. keys generated state of system. there 1,7668470647783843295832975007429e+72 states possible. state change pseudo random. how can find first duplicated value state of system? i have made tries, i'm far of solution. use sqlite stock data because catch out of memory exception if try system memory. sqlite it's slow.. use sqlite text field (primary key) containing state of system. i'm searching idea on how find first duplicated value generated system. you! that's big enough state space guess unlikely run duplicated value, want avoid having store of intermediate values. i'd try based on 1 of two-pointer cycle detection algorithms: https://en.wikipedia.org/wiki/cycle_detection

objective c - Mailcore2 iOS Test sample duplicating emails when loading more -

Image
i using mailcore2 email library in ios app. following "ios test" sample mail core project. when click on "load 10 more" option @ bottom of email table view, emails getting duplicated in table "ios test" sample project. want integrate , not getting how fix this, tried comment out line [combinedmessages addobjectsfromarray:strongself.messages]; in loadlastnmessages function, not helped. please advise me how solve duplicate email listing in table view issue? screenshot duplicating email date being displayed when loading more mails. i have same problem. step reproduce: 1-load email message (account a). 2-send email "account b" "account a". 3-load more messages. if change strongself.messages = nil before execute code " combinedmessages addobjectsfromarray:strongself.messages];" . not duplicate. it's not working if account doesn't receive new email.

java - How to get objects from criteria query in List in order of ids provided -

i have list of ids [3,80,5,1] and have records in database , person class objects. is there way person objects in same order of ids provided. i mean result should give me values person(id : 3), person(id : 80), person(id : 5), person(id : 1), person.getall(3, 80, 5, 1) here how getall() works. result list bear same order of id's in list. it accepts list argument, so: person.getall([3, 80, 5, 1]) should good, or in general: list ids = [3, 80, 5, 1] person.getall(*ids) should well.

android - How to make an interactive activity which can be updated regularly? -

i want make ui can updated regularly without updating app (i want make event announcer meaning every event admin make activity should updated latest event) well have idea how making page on website , view using webview. question is? there better way other this? suggest how or link me website or give me keyword search it. everything appreciated. as question ambiguous! handlers. define fixed interval can refresh ui giving delayed messages!

Exporting Data from Access Database into .csv File -

my company planning migrate our current database (ms access) new one. i'm being asked our consulting firm provide them .csv file containing of existing data. question is... there way export of existing data access database single .csv file? we're running ms office 2007, if matters. any guidance can offer appreciated. in advance assistance! best regards, john of course no. can export 1 csv per table .

python - Optimize this function with numpy (or other vectorization methods) -

Image
i computing python classic calculation in field of population genetics. aware there exists many algorithm job wanted build own reason. the below paragraph picture because mathjax not supported on stackoverflow i have efficient algorithm calculate fst . moment manage make loops , no calculations vectorized how can make calculation using numpy (or other vectorization methods)? here code think should job: def fst(w, p): = len(p[0]) k = len(p) h_t = 0 h_s = 0 in xrange(i): bar_p_i = 0 k in xrange(k): bar_p_i += w[k] * p[k][i] h_s += w[k] * p[k][i] * p[k][i] h_t += bar_p_i*bar_p_i h_t = 1 - h_t h_s = 1 - h_s return (h_t - h_s) / h_t def main(): w = [0.2, 0.1, 0.2, 0.5] p = [[0.1,0.3,0.6],[0,0,1],[0.4,0.5,0.1],[0,0.1,0.9]] f = fst(w,p) print("fst = " + str(f)) return main() there's no reason use loops here. , shouldn't use numba or cython stuff - li...

ios - Access static variable from non static method in Swift -

i know cannot access non static class variable within static context, other way around? have following code: class myclass { static var myarr = [string]() func getarr() -> [string] { return myarr } however, when try compile this, error myclass not have member named myarr . thought static variables visible both static , non static methods, don't know going wrong. i on macbook running os x yosemite using xcode 6.3. you need include class name before variable. class myclass { static var myarr = [string]() func getarr() -> [string] { return myclass.myarr } }

java - Creating a 2D array and finding max -

i have write program creates 2d array , asks user row , column size. create 2-d array m : ask user input row , column sizes keyboard (use scanner) assuming last digit of ssn number n, if user input column size bigger n+5 ask user reinput column size fill arrays elements double numbers in range of (4.0 , 11.0) using of random object pass above array m , call following 2 methods findmaxcol(m) returnavg(m) print out avg of array m in findmaxcol(double[][]array), find , print largest sum of columns in 2 d array in returnavg(double[][] array find average of elements in array , return average i having hard time getting random class post double , finding max column average. scanner console=new scanner(system.in); findmaxcoumn(); returnavg(); double random =new random().nextdouble(); int lastdigit=8; system.out.println("write row"); int n=console.nextint(); system.out.println("write column"); int y=console.nextin...

c++ - Creating a discrete distribution in Visual Studio -

i want create own discrete distribution in visual studio 121 integers. here code trying: std::vector< int> weights(121); (int = 0; < 121; i++) { weights[i] = (teamdata[i]).s(); // numbers program data } std::discrete_distribution<> dist(weights.begin(), weights.end()); i intellisence error: 1 intellisense: no instance of constructor "std::discrete_distribution<_ty>::discrete_distribution [with _ty=int]" matches argument list argument types are: (std::_vector_iterator<std::_vector_val<std::_simple_types<int>>>, std::_vector_iterator<std::_vector_val<std::_simple_types<int>>>) and when compile get: error 1 error c2661: 'std::discrete_distribution::discrete_distribution' : no overloaded function takes 2 arguments know fix this? http://en.cppreference.com/w/cpp/numeric/random/discrete_distribution/discrete_distribution you initializing iterators need use constructor ...