Posts

Showing posts from May, 2012

c - Getting cpu_subtype_t in process that runs under i386 arch -

i'm using c code generate coredump file out of mach-o based process. however, i'm getting parsing corruption while loading lldb debugger after generating coredump 32bits process : (lldb) target create --core "/tmp/core_pid_1354" core file '/tmp/x/core.1354' (unknown-mach-32) loaded. this, unknown 32 architecture issue, derived wrong cpu_subtype in struct mach_header. in order cpu_type + cpu_subtype in following method : struct current_arch cpuarch = {0}; int mib[ctl_maxname]; size_t miblen; size_t cputypesize; pid_t pid = getpid(); miblen = ctl_maxname; int err = sysctlnametomib("sysctl.proc_cputype", mib, &miblen); if (err) { log_error("coultn't mib cpu type using sysctlnametomib. err = %d ", err); return kern_failure; } mib[miblen] = pid; miblen += 0x1; cputypesize = sizeof(cpuarch.type); err = sysctl(mib, (u_int)miblen, &(cpuarch.type), &cputypesize, 0x0, 0x0); if (err) { log_error("coultn

android - how to prevent default keyboard from popping up and enable copy paste option? -

i have own custom keyboard in app . in edittext box disabled ontouch() returning true ontouchlistener otl = new ontouchlistener() { @override public boolean ontouch(view v, motionevent event) { switch (event.getaction()) { } return true; } }; this helps in preventing keyboard popup.but disables touch event, , not getting option copy paste default feature of android .this scenario happening in many app not getting way it. please help. instead of disabling touch, can setfocusable false . disable softkeyboard popping up. edittext.setfocusable(false); edittext.setfocusableintouchmode(false); and in ontouch , popup custom keyboard hope helps.

html - Marker-end do not work -

Image
i encounter problem marker-end . i try display arrow doesn't work. when directly change svg line in html code, arrow appears. when change code doesn't work. see arrow appear have directly change code in source code of page. know why? , how fix this? for example here have changed width manually make work... path.svgedgeview{ stroke: #777 !important ; stroke-width: 1.5px !important ; marker-end: url(#arrow-edge-end-marker) !important ; } <path class="svgedgeview" id="0.2916158037260175" d="m1290 80c1365 80 1515 205 1440 205"></path> i found solution. i had created svg document.createelement(tagname) instead of document.createelementns(' http://www.w3.org/2000/svg ', tagname). the svg element not created.

Hibernate-Criteria: Select distinct column from table ordered by another column -

what want achieve: list of unique ids ordered column, using hibernate criteria. my code far: criteria crt = createcriteria(); //complex method returning criteria //with joined tables, restrictions , ordering crt.setprojection( projections.distinct( projections.property( "id"))); list<integer> ids = crt.list(); what wrong: when set order column let's "date" query: select distinct id table \\join, where...\\ order date); which wrong , results in error: ora-01791: not selected expression my idea how solve it: somehow force hibernate generate query: select distinct id (select * table \\join, where...\\ order date); problems , tried: there createcriteria() method, don't want modify if it's not absolutely necessary. didn't find way use criteria detachedcriteria. you cannot put subqueries clause criteria. bug can: use hql use plain sql change query is id not unique anyw

xml - Limit the result when using following:: in XSL select -

i have complex xml input, need transform flat structure, denormelize tree in xml document repeating related nodes. source xml lookes this: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="forom%20sample.xsl"?> <customers> <customer> <id>1</id> <name>john madsen</name> <accounts> <account> <id>111</id> <name>aaa</name> <value>11234</value> </account> <account> <id>222</id> <name>bbb</name> <value>64</value> </account> </accounts> <profile> <gender>m</gender> <age>32</age> </profile> <

ruby - Rails 200 status codes change to 302 if a request takes too long? -

i have rails app fires off code assemble large report on users data. takes ages , needs come off external api (salesforce). i have code works on many records: grabbing data formatting correctly passing view , rendering pdf before refreshing page ajax. most requests end this: rendered record_requests/_get_digest.html.erb (2974.9ms) rendered record_requests/get_digest.js.erb (2983.4ms) completed 200 ok in 5957ms (views: 2770.9ms | activerecord: 222.1ms) which great! but of largest records can take 6+ minutes grab , process - @ point different occurs: ``` redirected https://[base_url]/record_requests/5 completed 302 found in 288345ms (activerecord: 2.4ms) disaster because redirect seems kick off initial request again stuck in loop... these 2 requests use same code!! why 1 getting rendered , other getting redirected? there built-in rails timeouts. soo confused, can shed light on this? this works via excellent restforce gem,the full gemfile listed here . t

LinkedIn REST API authentication suddenly stopped working Android Emulator -

i using linkedin rest api user's linkedin details , working until today(for past 1 month).i getting basic details name email only.even working till half of today , throwing error, caused by: com.google.code.linkedinapi.client.oauth.linkedinoauthserviceexception: oauth.signpost.exception.oauthcommunicationexception: communication service provider failed: https://api.linkedin.com/uas/oauth/requesttoken @ com.google.code.linkedinapi.client.oauth.linkedinoauthserviceimpl.getoauthrequesttoken(linkedinoauthserviceimpl.java:180) @ in.techchefs.talktemple.login.linkedinasynctask.doinbackground(linkedinasynctask.java:45) @ in.techchefs.talktemple.login.linkedinasynctask.doinbackground(linkedinasynctask.java:14) @ android.os.asynctask$2.call(asynctask.java:292)

c - How do I transform glOrtho clipping planes? -

i've created opengl application define viewing volume glortho(). use glulookat() transform points. problem - points fall out of clipping plane because "left behind". , end black screen. how change viewing volume still tight objects once have been transformed glulookat()? here's code better illustrate problem: vector3d eyepos = new vector3d(0.25, 0.25, 0.6); vector3d point = new vector3d(0, 0, 0.001); vector3d = new vector3d(0, 1,0); matrix4d mat = matrix4d.lookat(eyepos, point, up); gl.viewport(0, 0, glcontrol1.width, glcontrol1.height); gl.matrixmode(matrixmode.projection); gl.loadidentity(); gl.ortho(0, 1, 0, 1, 0, 1); gl.matrixmode(matrixmode.modelview); gl.loadidentity(); gl.loadmatrix(ref mat); gl.clear(clearbuffermask.colorbufferbit | clearbuffermask.depthbufferbit); gl.enable(enablecap.depthtest); gl.depthmask(true); gl.cleardepth(1.0); gl.color3(color.yellow); gl.begin(primitivetype.triangles); gl.vertex3(0.2, 0.3, 0.

c++ - Building shared ParMETIS-4.0.3 -

how can build dynamic version of parmetis? compiled shared version of metis when try compile shared parmetis linking libmetis.so (added path in make file, see makefile options below) compilation fails because parmetis tries link libmetis.a. how can force link libmetis.so? compiled static version no problem. thank help configuration options. gdb = not-set assert = not-set assert2 = not-set debug = not-set openmp = not-set prefix = not-set gklib_path = not-set metis_path = ~/bin/metis-5.0 shared = 1 cc = mpicc cxx = mpicxx i know comes bit late, faced same problem. in file cmakelists.txt , right @ root of parmetis directory, in section starting with: if(shared) you should add: set(metis_library_type shared) right after equivalent option parmetis. hope helps else, since worked around issue already.

php - How do I use variables from outside in my function? -

this question has answer here: reference: variable scope, variables accessible , “undefined variable” errors? 3 answers i saw other user here asking , tried said in answer section, nothing had worked me. i have variable: $inputs = \request::all(); $domain = $inputs['domain']; now in $domain domain-name need. this function: function searchfor ($search) { $path = '/var/www/laravel/logs/vhosts/'; $shell_exec = shell_exec("grep -c -i $search $path" . $domain . ".log"); return $shell_exec; } this haven't worked cause of course php doesn't know $domain is. now tried put global $domain; in function haven't worked either. i tried this: function anzahlsuche($search) use ($domain) { ... } but it's same, doesn't worked me. does have idea can do? i'm using laravel framework, maybe

retrieve custom char with charcode android -

i'm using custom font characters star, sun, etc. i know charcode font. i set textview font following code: public class mytextview extends textview { public mytextview(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); init(); } public mytextview(context context, attributeset attrs) { super(context, attrs); init(); } public mytextview(context context) { super(context); init(); } public void init() { typeface tf = typeface.createfromasset(getcontext().getassets(), "font/myfont.ttf"); settypeface(tf ,1); }} is there way, since know charcode, use specific characters directly in strings.xml , programmatically? you can reference characters 4 digit hexadecimal code in java : string somestring = "\u2776" or in resources : <string name="some_string_name">\u2776</string> (2776 code ❶ in default font)

javascript - How to scrape a live java script webpage in R? -

i scrape play play http://stats.statbroadcast.com/statmonitr/?id=107165 . link bring "split box" tab. interested in scraping play play tab home stats , visitors stats tab. 1 of problems no matter tab switch url never changes. if use selector gadget css-selector main contents of tabs same well, "#stats". novice @ web scraping , of time can scrape html page package rvest , unfortunately lost how should proceed javascript. have heard of json, not sure how combat issue of tabs having same url. my main goal able scrape play play, home stats, , visitor stats tab when game live. any appreciated. please let me know if should provide more info. you can use rselenuim follows: require(rselenium) rselenium::startserver() remdr <- remotedriver() remdr$open() remdr$navigate("http://stats.statbroadcast.com/statmonitr/?id=107165") now firefox window should open can browse normal. doc <- remdr$getpagesource() gives source-code of current webpag

oracle10g - Run exe using trigger from Oracle database -

i trying run exe oracle database. want fire trigger on insert or updation of table. once table updated have run exe in d drive. i have tried scheduler gives error. code follows: begin dbms_scheduler.create_program ( program_name => 'program_name', program_type => 'executable', program_action => 'd:/myproc.exe', enabled => true, comments => 'run exe' ); end; / i getting following error ora-27486: insufficient privileges ora-06512: @ "sys.dbms_isched", line 5 ora-06512: @ "sys.dbms_scheduler", line 36 ora-06512: @ line 2 i have 1 more question. which best method run exe? database or code? thanks in advance you schedule script using dbms_scheduler . depending on os (below example in windows) this: begin dbms_scheduler.create_job('my_job', job_action=>'c:\windows\system32\cmd.exe', number_of_

wxwidgets - How to judge bmp pictures from clipboard whether they are same using wxpython? -

Image
function want realize: when bmp picture clipboard changed, refresh window. if not, nothing done. question meet: every time program goes function updatemsgshownarea(), self.oldbmp diff self.bmp, have let self.oldbmp = self.bmp if different, , prints "111111". while next time program goes updatemsgshownarea(), self.oldbmp diff self.bmp again. confuses me. code follows: #!/usr/bin/env python import wx import os, sys #---------------------------------------------------------------------------- # main window class myframe(wx.frame): def __init__(self, parent, title): wx.frame.__init__(self, parent, title=title, size=(600,480)) self.panel = mypanel(self) self.createstatusbar() # statusbar in bottom of window # setting menu. filemenu= wx.menu() # wx.id_about , wx.id_exit standard ids provided wxwidgets. menuabout = filemenu.append(wx.id_about, "&about"," information program")

reactjs - ES6 arrow function binding and gulp compiling error -

i've been trying hard accomplish code segment below, reading official es6 docs , other blogs: onhomestorechange = () => (newstate) { this.setstate(newstate); } i used link . seems gulp doesn't job correctly, a semicolon required after class property error after putting 1 this still undefined . here part of gulp file uses transform. appbundler // transform es6 , jsx es5 babelify .transform("babelify", {presets: ["es2015", "stage-0", "react"]}) //.transform(babelify.configure({stage: 0})) .bundle() .on('error',gutil.log) .pipe(source('bundle.js')) .pipe(gulp.dest(builddestination)); i use react 0.14.5 , these dev dependencies. "babel-preset-es2015": "^6.3.13", "babel-preset-react": "^6.3.13", "babel-preset-stage-0": "^6.3.13", "babelify": "7.2.0", "browserify": "^12.0.1&quo

ios - JSON parsing and returning data in Swift -

i have swift code retrieving , parsing json data web. seems work fine except 1 problem facing right now. tried solve time, have check sources online. i have created global dictionary "dicofneighbours" return result of parse other class calling "func startconnection". dicofneighbours stores parsed data till goes out of closing bracket of the: "let task = session.datataskwithrequest(urlrequest) { ... }" after stores nil . , returned result nil well. i have tried pass "dicofneighbours" variable reference using inout , still returns nil result. there might solution missed. appreciate , suggestions. thanks! var dicofneighbours = dictionary<string, [int]>() func startconnection() -> dictionary<string, [int]>{ let requesturl: nsurl = nsurl(string: "http://www....data.json")! let urlrequest: nsmutableurlrequest = nsmutableurlrequest(url: requesturl) le

javascript - Node.js/MongoDB: How can I use module.exports to pass a localhost database url to server.js file? -

i have problem connection database mongoose on localhost. in server.js file have: var express = require('express'); var app = express(); //create our app express var mongoose = require('mongoose'); //mongoose mongodb var database = require('./config/database.js'); //load database config ... //configuration ===================== mongoose.connect('database.url'); //connect mongodb database ... in database.js file have: // config/database.js module.exports = { url : 'mongodb://127.0.0.1:27017/test' }; the error in node.js command prompt is: events.js:141 throw er; // unhandled 'error' event ^ error: failed connect [database.url:27017] @ null.<anonymous> (c:\*filepath*\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\server.js:540:25) @ emitthree (events.js:97:13) @ emit (events.js:175:7) @ null.<anonymous> (c:\*filepath*\node_module

ios - Access Notification Center / Today view -

the aim read values today widget (owned apple). yes, using private api's against apple's guidelines i'm testing thing. for realtime communication between widget , main app can use mmwormhole . for sharing data can use shared nsuserdefaults .

javascript - Change in copied object reflects in source cell on handontable drag -

i having object var x1 = {t1: 'test1', y1: 'testy1'}; var x2 = {t1: 'test2', y1: 'testy2'}; var x3 = {t1: 'test3', y1: 'testy3'}; var data = [ {id: 1, name: 'ted', isactive: x1}, {id: 2, name: 'john', isactive: x2}, {id: 3, name: 'al', isactive: x3} ] i bind data handontable. want modification in destination object on drag. beforeautofill = function (start, end, data) { data[0][0].t1 = 'tt1'; }; this code should change row 1, test2 tt1. but changes both rows(0 , 1) tt1. i think issue of shallow copy object of source. http://jsfiddle.net/hemantmalpote/llyd9d7s/

php - docker website opens after a while - ec2/virtualbox -

i have created docker image, tested locally. working well. after used same dockerfile - built , run on ec2. the apache webserver listening connections, have opened firewall in ec2 machine security settings, if try navigate webisite, seems opening approx 2.5 minutes. and website opens. each navigation step takes 2.5 minutes. later: i have tried replicate environment on windows machine virtual box , has same issue. website take long time , open. broke connect machine that not docker related (ubuntu dev box) can advice something? here docker file: from ubuntu run apt-get update -y run apt-get install -y apache2 php5 vim libapache2-mod-php5 php5-mcrypt run echo "servername localhost" >> /etc/apache2/apache2.conf env apache_run_user www-data env apache_run_group www-data env apache_log_dir /var/log/apache2 env apache_lock_dir /var/lock/apache2 env apache_pid_file /var/run/apache2.pid expose 80 run ln -sf /dev/stderr /var/log/apache2/error.log cmd /usr/s

uistoryboardsegue - Swift: programmatically enumerate outgoing segues from a UIVIewController -

i want list outgoing segues uiviewcontroller, described in programmatically enumerate outgoing segues uiviewcontroller , in swift. (swift 2, xcode 7, ios8+). i can do override func viewdidload() { super.viewdidload() let s = valueforkey("storyboardseguetemplates") print("switchingvc: segues: \(s)") } and produces output like switchingvc: segues: optional(( "<uistoryboardpresentationseguetemplate: 0x1754a130>", "<uistoryboardpresentationseguetemplate: 0x17534f60>", "<uistoryboardpresentationseguetemplate: 0x17534fc0>" )) but struggle produce after that. can't find definition of uistoryboardpresentationseguetemplate . how can persuade swift tell me what's inside it? how can find segue identifier ? thanks! this valueforkey("storyboardseguetemplates") undocumented property , uistoryboardpresentationseguetemplate undocumented class. beware of rejection

dynamics crm 2011 - CRM 2015 + Issue related to Translation -

i need translate views in french in crm 2015 online did following steps: created solution, added entity on view created , saved solution. selected solution , clicked export translation after export 2 files [content_types].xml , crmtranslation.xml however not locate view in crmtranslation file views "accounts follow" "contacts follow" any idea why these views not present in translation file? please the crmtranslation.xml can opened in excel. labels can not related entities, attributes etc, because specified guid s. therefore option guess location of labels need translate. just add missing translations in excel, save file , import in dynamics crm.

javascript - How Selenium IDE handle user invoked prompts and alerts? -

i trying automate testing of search functionality , using javascript code invoke prompts search term. selenium ide randomly passes through prompts/alerts or fails test. want to know specific scenario can stop ide failing on prompts. below ide command. storeeval | getsterm() | search getsterm() external function have in user-extensions.js

mysql - how to filter based by current year and lastyear? -

i have table year values ('2013','2014','2015','2016') i want filter values current year , last year results of searching current yea , last year ('2016','2015') how filter based current year , lastyear? you can use year() function: where col in (year(curdate()), year(curdate()) - 1) however, if column contains strings, should convert these strings performance reasons: where col in (date_format(curdate(), '%y'), date_format(date_sub(curdate(), interval 1 year), '%y') )

android - BroadcastReceiver is not called by alarm -

there lot of related questions , beleive i've read them twice or so. reason seem have tomatoes on eyes. not see error. i've got alarm set using alarm manager. (happy share more code if required.) private static string alarm_action = "de.klecker.bigben.alarm"; private static pendingintent creatependingintent() { intent alarmintent = new intent(getcontext(), bigbenalarm.class); alarmintent.setaction(alarm_action); return pendingintent.getbroadcast(getcontext(), 0, alarmintent, 0); } getcontext() returns reference application. public static void setalarmfromnow() { alarmmanager manager = (alarmmanager) getcontext().getsystemservice(context.alarm_service); pendingintent intent = creatependingintent(); // first cancel ongoing alarm manager.cancel(intent); manager.set(alarmmanager.rtc_wakeup, system.currenttimemillis() + (5 * 1000), intent); log.d("bigben", "alar

sed - Add text to beginning of awk result -

good day all, i running below command: netstat -an | awk '/:25/{ print $4 }' | sed 's/:25//' | paste -sd ',' - which produces 192.168.2.22,127.0.0.1 i amend result below (to parsed csv application) manuallyaddedtext 192.168.2.22,127.0.0.1 many echo -n "mytext " ; netstat...

javascript - how to remove all Mesh objects from the scene in three.js? -

i passing name of 3d model add , texture name in function , result 3d model rendered in scene. in stuck ,i want remove 3d objects scene when use scene.children objects contains light , camera want remove meshes in scene just removing 3 objects scene not enough delete them memory. have call dispose() methods on objects' geometries, materials , textures. https://github.com/mrdoob/three.js/issues/5175 after call dispose , remove methods, diagnostic (where this.renderer three.renderer): if (this.renderer && (this.renderer.info.memory.geometries || this.renderer.info.memory.programs || this.renderer.info.memory.textures)) { loge("geometries=" + this.renderer.info.memory.geometries + " programs=" + this.renderer.info.memory.programs + " textures=" + this.renderer.info.memory.textures); } if number of programs, geometries , textures isn't stable, inviting performance issues , memory leak.

ruby - How to convert a hash to string -

input: contact = {"name" => "white", "age" => 22, "country" => "india"} expected output: "age=22country=indianame=white" one way using .map contact = {"name" => "white", "age" => 22, "country" => "india"} contact.sort.map{|pair| pair.join('=')}.join => "age=22country=indianame=white" edit: didn't notice implied sorting requirement in output.

excel - Workbook name as a variable -

been trying google while , can't syntax right question! basically, @ moment have workbooka.xlsm , code directly references "workbooka.xlsm" when workbook distributed, not leaves name same , causes subscript out of range errors the answer obvious, how can declare workbook variable or similar? thisworkbook.name? my product opens seperate workbook, pulls data , places workbook - worried thisworkbook or similar might cause issues if more 1 open? sorry silly question, hope can help! this should work option explicit sub workingwithdatafromotherworkbook() 'you can dim sheet , set sheet dim masterworkbook workbook dim datasourceworkbook workbook set masterworkbook = thisworkbook 'set datasourceworkbook = workbooks.open(filename:=" full file path here") set datasourceworkbook = workbooks.open(filename:="c:\users\oosthjp\desktop\book1.xlsm") 'simple copy paste code below

query optimization - Optimize two simple MySQL queries - column indexes -

i novice in mysql query optimization , need advice on how optimize database 2 queries - indexes should set , where. below database structure , queries. create table `data_node` ( `id` bigint(20) unsigned not null auto_increment, `type` enum('node','place') default null, `name` varchar(255) default '', `source_id` bigint(20) unsigned default null, `data_id` bigint(20) unsigned not null, `data_lat` decimal(8,6) not null, `data_lon` decimal(9,6) not null, primary key (`id`) ) engine=myisam default charset=utf8; create table `data_node_tag` ( `id` bigint(20) unsigned not null auto_increment, `node_id` bigint(20) unsigned not null, `data_key` varchar(255) not null default '', `data_value` varchar(255) not null default '', primary key (`id`) ) engine=myisam default charset=utf8; first query: select * data_node n left join data_node_tag nt on nt.node_id = n.id n.type = "place" , nt.data_value "%place

jquery - How to stop executing javascript after click? -

i have javascript code automatically changing background of div. how can stop script when click on link. stop changing background , show div class="content" when click on link class="one" or class="two" . , start again changing background when click class="start" . $(window).load(function() { var = 0; var images = ['koles-3-ok.png', 'koles-3.png']; var image = $('.div1'); var imgpath = "" //the file path images //initial background image setup image.css('background-image', 'url(http://katet.eu/images/koles-3.png)'); //change image @ regular intervals setinterval(function() { image.fadeout(1000, function() { image.css('background-image', 'url(' + images[i++] + ')'); image.fadein(1000); }); if (i == images.length) = 0; }, 5000); }); $(document).ready(function() { // optional code hide divs

system verilog - RNG state not getting preserved while using get_randstate and set_randstate -

i'm trying understand why in following example, rng state not getting preserved: module test; string seed_s = "0"; int unsigned seed_i = 0; initial begin process p; p = process::self(); $display("process randstate1 = ", p.get_randstate()); seed_s = p.get_randstate(); $display("process seed_s = %s", seed_s); seed_i = seed_s.atobin(); $display("process seed_s = %s", seed_s); $display("process randstate2 = %d", seed_i); p.set_randstate(seed_s); $display("process randstate3 = ", p.get_randstate()); end endmodule here's output: process randstate1 = 0000000000000000000000000000000000001001011001101001101001011110 process randstate2 = 157719134 process randstate3 = 0x1z00zzxzx011z00x0zx01xzxz0x111xzzxzzzxzxzxzzxzzzzxzzzzxxxxxxxx i expected see randstate1 = randstate3. missing here? edit: added display string before , after atobin() process randstate1 = 000000

cordova - Using PhoneGap, Angular2 TS and Onsen UI 2 -

i'm struggling project running using phonegap, angular2 typescript and onsen ui 2. idea build app different platforms using phonegap/cordova, writing application logic angular2 , layout onsen2. however, since angular2 , onsen ui 2 still in beta couldn't find documentation/papers/tutorials/books things started. got angular2+onsen2 running, @ least little bit... , got phonegap , onsen running, 3 won't work together. have tips/tutorials how melt 3 (for pretty awesome) frameworks? feel i'm missing trick how them work together

Cannot load image from the Windows Pictures folder into Excel file using vba -

i have vba macro add image excel file. main code add file this... dim s shape set s = application.activesheet.shapes.addpicture(strfilename, msofalse, msoctrue, lngleft, lngtop, -1, -1) s .height = 60 .locked = true end lngleft , lngtop coordinates set earlier in code. target image file selected using application.filedialog(msofiledialogfilepicker) strfilename filled using following code... dim fd filedialog dim objfile variant set fd = application.filedialog(msofiledialogfilepicker) fd .buttonname = "select" .allowmultiselect = false .title = "choose logo graphic ..." .filters.add "images", "*.gif; *.jpg; *.png; *.jpeg", 1 .filterindex = 2 .initialview = msofiledialogviewdetails .show each objfile in .selecteditems strfilename = dir(objfile, vbnormal) next objfile problem: works on system , colleagues , random system. however, when our client, whom meant, uses it, cannot select image win

c# - OrderBy ignoring accented letters -

i want method orderby() orders ignoring accented letters , @ them non-accented. tried override orderby() seems can't because static method. so want create custom lambda expression orderby() , this: public static iorderedenumerable<tsource> toorderby<tsource, tkey>( ienumerable<tsource> source, func<tsource, tkey> keyselector) { if(source == null) return null; var seenkeys = new hashset<tkey>(); var culture = new cultureinfo("pt-pt"); return source.orderby(element => seenkeys.add(keyselector(element)), stringcomparer.create(culture, false)); } however, i'm getting error: error 2 type arguments method 'system.linq.enumerable.orderby<tsource,tkey>(system.collections.generic.ienumerable<tsource>, system.func<tsource,tkey>, system.collections.generic.icomparer<tkey>)' cannot inferred usage. try specifying type arguments expli

c# - XAML - Way to find which button is clicked -

i developing windows store app. i loading xaml code dynamically c# code behind file. so, not add click event buttons. is there way know button clicked using button names out click event? you should mvvm , command patterns wpf development. click event handler outdated windows forms programming. in wpf, command pattern represented icommand interface. each button has command property can bind command object.

ckfinder - Parse error: syntax error, unexpected T_STRING in CommandHandlerBase.php -

this question has answer here: php parse/syntax errors; , how solve them? 11 answers unexpected > t_string, expecting t_old_function or > t_function or t_var or '}' 1 answer i'm installing version (2.6) of ckfinder have no problem on site , getting following error: parse error: syntax error, unexpected t_string, expecting t_old_function or t_function or t_var or '}' in /ckfinder/core/connector/php/php5/commandhandler/commandhandlerbase.php on line 38 those lines are: 30 class ckfinder_connector_commandhandler_commandhandlerbase 31 { 32 /** 33 * ckfinder_connector_core_connector object 34 * 35 * @access protected 36 * @var ckfinder_connector_core_connector 37 */ 38 protected $_connector; does have ideas why

javascript - Error in Parse Cloud Code with Stripe module in Swift -

i getting error: result: typeerror: object [object object] has no method '_each' @ request (stripe.js:58:11) @ post (stripe.js:117:12) @ object.module.exports.customers.create (stripe.js:239:16) @ main.js:13:22 this swift function call: let userid = pfuser.currentuser()?.objectid let useremail = pfuser.currentuser()?.email pfcloud.callfunctioninbackground("createcustomer", withparameters: ["email": useremail!, "objectid": userid!]) this cloud code specific function: var stripe = require('stripe'); stripe.initialize('sk_test_***************'); parse.cloud.define("createcustomer", function(request, response) { stripe.customers.create({ email: request.params.email, description: 'new gyro user', metadata: { //name: request.params.name, userid: request.params.objectid, // e.g pfuser object id create

sql server - How to create a multiple variable in SQL? -

i trying calculate a, sort of, moving average data in sql server 2008, way have found using @variable. example have set of data: studydate cpty value ---------- ---- ---------------------- 2015-11-24 1 3009 2015-11-24 2 2114 2015-11-24 3 558 2015-11-24 4 121 2015-11-24 5 2515 2015-11-24 6 81 2015-11-24 7 80 2015-11-24 8 1534 2015-11-24 9 136 2015-11-24 10 5674 2015-11-25 1 2731 2015-11-25 2 2197 2015-11-25 3 550 2015-11-25 4 124 2015-11-25 5 2532 2015-11-25 6 81 2015-11-25 7 80 2015-11-25 8 1700 2015-11-25 9 122 2015-11-25 10 5788 2015-11-26 1 2666 2015-11-26 2 2175 2015-11-26 3 408 2015-11-26 4 124 2015-11-26 5 2545 2015-11-26 6 81 2015-11-26 7 81 2015-11-26 8 1712 2015-11-26 9 122 2015-11-26 10 5967 and want find moving average every day. if run query: declare @studydate date = '2015-11-26' select @studydate, cpty, avg(value) #movavg studydate > dateadd(m,-1,@

solr5 - Nutch cause error while using solrindex command -

i using nutch 1.11 (published in 07 december 2015) , using bin/crawl command me work , ok until reaches solrindex command put data solr search engine, cause error: solrindexwriter solr.server.type : type of solrserver communicate (default 'http' options include 'cloud', 'lb' , 'concurrent') solr.server.url : url of solr instance (mandatory) solr.zookeeper.url : url of zookeeper url (mandatory if 'cloud' value solr.server.type) solr.loadbalance.urls : comma-separated string of solr server strings used (madatory if 'lb' value solr.server.type) solr.mapping.file : name of mapping file fields (default solrindex-mapping.xml) solr.commit.size : buffer size when sending solr (default 1000) solr.auth : use authentication (default false) solr.auth.username : username authentication solr.auth.password : password authentication 2016-01-28 02:49:41,422 info indexer.indexermapreduce - indexermapreduce: cra

jquery 2.2: navbar fixed on scroll not working with vh-unit -

i found on topic doesn't me out here: how implement scroll fixed effect? i'm trying implement navbar, sticks top when user scrolled on header-section can seen here: https://teamtreehouse.com/community/forum-tip-create-a-sticky-navigation-with-css-and-jquery-2 however, since i'm using vh , vw units in project, got problems getting jquery work. it's working fine, if use px like ... if ($(this).scrolltop() > 400 ) ... but ... if ($(this).scrolltop() > $("#slider_part").height ... it's not working. see code below. , in advance answers! my html: <header id="slider_part"> <div>...</div> </header> <div id="main-nav" class="navbar"> <nav>...</nav> </div> css: #slider_part { height: 85vh; width: 100%; overflow:hidden; position: fixed; top: 0; z-index: -100; } #main-nav { position: relative; background: #db2f27; -webkit-box-sha

regex - Removing comments from a group of php files via command line in Windows -

i have bunch of files , send them deployment sans comments whitespace intact (so can make quick changes in production in emergency cases). the comments can either single line comments ( # , // ) or multi line syntax /**/ , @ indentation level. i want create batch file when executed directory reads php files , strips comments. i not sure try. know can fetch files .php extension , loop through them. replacing content easy enough well. stuck on how remove comments. there's multiple ways it, think efficient use regular expressions. i'm not regexp guru, know can use grep (or powerfull text editor such notepad++, sublimetext, et...) replace expressions highlighted empty string. for example, in sublime text, i've tested regular expression, find multiple lines comment : \/\*([\s\s]*?)\*/|//.*|#.* quick explanation : the regexp made of 3, or symbol inside ( pipe symbol | ) the first expression mean "something starting /*, character, or blank charac

multithreading - C++ std::map - thread safe if one thread writes and another reads with always different keys? -

this question has answer here: can access c++11 std::map entry while inserting/erasing thread? 4 answers thread writes std::map key c thread b reads std::map key d if guaranteed keys not overlap, thread safe? since std::map uses tree-structure inside, imagine there problems read while being mutated. if std::map not work, std::unordered_map better? if writing mean changing value of already existing entry associated key c, answer (i believe) yes . if writing mean (potentially) inserting new elements (or removing them), answer definitively no . although not authoritative source, www.cplusplus.com has section potential data races each function.

javascript - Blank page while trying to crawl angularjs based websites -

i trying crawl website using angularjs, when tried open, give blank page. for example,the main website of angularjs - https://angularjs.org/ here code writing - var page = require('webpage').create(); page.viewportsize = {width: 1280, height: 1024}; page.settings.useragent = 'mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, gecko) chrome/46.0.2490.86 safari/537.36'; page.settings.javascriptenabled = true; page.open('https://angularjs.org/', function(status) { if(status == 'success') { console.log("hello"); page.render('web.png'); phantom.exit(); } else { console.log("error opening page"); phantom.exit(); } });

java - Sort Arraylist containing both numbers and letters -

this current arraylist: arraylist<string> myarraylist = new arraylist<string>(); [102423;asd.com, 49952;qwe.com, 76933;rty.com, 199526;fgh.com, 139388;jkl, 25114;qaz, 155766;ghj.com, 321339;vbn.com, 210513;kol.com] and want sort them numbers. ive tried following: collections.sort(myarraylist) for(string counter : myarraylist){ system.out.println(counter); } but not working. im thinking splitting collections.sort dont know how pair them togehter again. use collections.sort(list<t> list, comparator<? super t> c) static method , supply custom comparator compare() method extracts numeric prefix 2 elements , compares prefixes. you use string.split(";") numeric prefix, example.

wordpress - Using the woocommerce API using PHP -

i'm using woocommerce api first time , need it. i thought i'll start easy , use site title returned. i read documentation @ https://woothemes.github.io/woocommerce-rest-api-docs/?php#view-index-list complex , doesn't provide details first steps need connect api. i have enabled rest api on woocommerce powered site. my questions are, how connect api ? documentation tell me run <?php print_r($woocommerce->get('')); ?> supposed run ? how authenticate myself keys generated api ? i appreciate help, thanks. this link should able youl https://www.skyverge.com/blog/using-woocommerce-rest-api-introduction/ need understand keys authentication. kind of entry password site's api. need acknowledge key within code api request followed api requirements. hope helps.

Why Not Work wear Append Multiple jQuery -

i have form client code , want display message if form must filled before form submitted. if 1 append work, after add 1 not working. is there solution? this code: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> <form id='id_form' action='signup.php' method='post'> <label for='name'>your name:</label> <input type='text' id='name' name='name' value=''/> <span class='name'></span> <br /> <label for='username'>username:</label> <input type='text' id='username' name='username' value=''/> <span class='username'></span> <br /> <input id="test" type="submit" value="submit" /> </form> <script> $('#test').click(funct

sql - Adding query inside concat for images having specific imageType such as profile or poster in MySql select -

i have image table in have 2 imagetype called profile , poster in imagetype field , have on image path storing images url. if possible want like: concat('/images/', select i.path i.imagetype='**poster**') posters concat('/images/', select i.path i.imagetype='**profile**') profiles select date_format(f.filmreleasedate,'%d %b %y')filmreleasedate, f.filmname, concat('/images/', i.path) profiles, concat('/images/', i.path) posters, f.filmdirector, url films f inner join images on f.filmid = i.filmid f.filmreleasedate >= now() group i.filmid order date(f.filmreleasedate) limit 0 , 10 you can use case select date_format(f.filmreleasedate,'%d %b %y')filmreleasedate, f.filmname, case when i.imagetype='**profile**' concat('/images/', i.path) end profiles, case when i.imagetype='**poster**' concat('/images/', i.path) end posters, f.filmdirector,

Get name of first empty input field returns "undefined" (jquery) -

i'm running problem here getting attribute name first empty input field. can't figure out, why returns "undefined" every time. <input type="text" name="test_1" value="not empty"> <input type="text" name="test_2"> <input type="text" name="test_3" value="not empty"> <input type="text" name="test_4"> <script>alert($('input[value=""]').first().attr("name"));</script> thanks alot help. the element you're looking target has no value property, hence there no elements match [value=""] selector. need include attribute, code works fine: <input type="text" name="test_1" value="not empty"> <input type="text" name="test_2" value=""> <input type="text" name="test_3" value="not empty"