Posts

Showing posts from June, 2014

javascript - How to reduce Image file size without losing quality or resolution using php or any other language? -

i have 1 mb hd resolution image. want file size reduce 50% min (512kb). have tried using php it's not working me. if 1 knows please me. like https://tinyjpg.com/ website. $filename = "image.jpg"; // 1 mb image file header('content-type: image/jpeg'); list($width_orig, $height_orig) = getimagesize($filename); $width = $width_orig; $height = $height_orig; $ratio_orig = $width_orig / $height_orig; if ($width / $height > $ratio_orig) { $width = $height * $ratio_orig; } else { $height = $width / $ratio_orig; } $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); imagejpeg($image_p, "image_resized.jpg", 100); function compress_image($source_url, $destination_url, $quality) { $info = getimagesize($source_url); if ($info['mime'] == 'image/jpeg') $image = image

android widget click event -

i trying create app widget create wifi hot spot , have problem click event. i have button , can't use onclicklistener. searched in google , here, , understand need send intent other class analyzes it, have problem this. this mainactivity code: http://pastebin.com/pjhlkxgh this wifiwidget code: http://pastebin.com/4nyt3u5u and xml file is: http://pastebin.com/9cuurlbb thank much! it'd been easier developers stuff widgets through using objects instead of pendingintents. can quite tricky if coding first time. public class mywidgetprovider extends appwidgetprovider { public static string widget_button = "com.anbe.turboandroid.widget_button"; private static final string sync_clicked = "automaticwidgetsyncbuttonclick"; @override public void onupdate(context context, appwidgetmanager appwidgetmanager, int[] appwidgetids) { remoteviews remoteviews; componentname watchwidget; remoteviews = new remotev

.htaccess - htaccess maintenance mode with relative url -

i using following in .htaccess place site in maintenance mode: ################################################## rewriteengine on rewritebase / rewritecond %{remote_addr} !^11\.111\.111\.111 rewritecond %{request_uri} !^/maintenance\.html$ rewriterule ^(.*)$ http://domain.com/maintenance.html [r=307,l] ################################################## my question how make relative rather absolute, don't need http://domain.com part? thanks! i specify location of maintenance.html relative root without having include domain. have single .htaccess file can drop project without having change it perhaps, use http_host variable don't have hardcoded domain. rewriteengine on rewritebase / rewritecond %{remote_addr} !^11\.111\.111\.111 rewritecond %{request_uri} !^/maintenance\.html$ rewriterule ^(.*)$ http://%{http_host}/maintenance.html [r=307,l]

ios - How to populate the UITableView contents for the first time? -

i have uitableview in viewcontroller . first time run application, table empty. table filled, when go through other views , view(which has uitable). use following solution, not work. put part of code in viewwillappear , viewdidload , not working. dispatch_async(dispatch_get_main_queue(), ^{ [self getthetablecontentfromserver]; [self.tableview reloaddata]; // reload selected cell }); anyone knows how can populate content of table first time? here getthetablecontentfromserver method: -(void)getthetablecontentfromserver{ nsurl *url = [nsurl urlwithstring:@"http://exampledomain.com/data"]; config = [nsurlsessionconfiguration defaultsessionconfiguration]; nsurlsession *session = [nsurlsession sessionwithconfiguration:config delegate:nil delegatequeue:[nsoperationqueue mainqueue]]; [[session datataskwithurl:url completionhandler:^(nsdata *data, nsurlresponse *response, nserror *error) { data= [nsjsonserialization jsonobject

android - action bar not showing options menu in jelly bean -

action bar not show options menu in jelly bean,while shown in lollipop. here styles.xml` <resources> <!-- base application theme. --> <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <item name="colorprimary">#00796b</item> <item name="colorprimarydark">#004d40</item> <item name="coloraccent">#c51162</item> <item name="android:textcolorprimary">@color/abc_primary_text_disable_only_material_dark</item> </style> </resources>` here app gradle compilesdkversion 22 buildtoolsversion "22.0.1" defaultconfig { applicationid "com.example.dell.syncytium" minsdkversion 16 targetsdkversion 22 versioncode 1 versionname "1.0" } my mainactivity extends appcompatactivity. please me.thanks in advance @override public boolean oncreateoptionsmenu(menu men

php - Submitted URI too large! The length of the requested URL exceeds the capacity limit for this server. The request cannot be processed -

does know how can fix error? "submitted uri large! the length of requested url exceeds capacity limit server. request cannot processed." thanks in advance! here php code if (php_version >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();} //declare 2 session variables , assign them $_session['mm_username'] = $loginusername; $_session['mm_usergroup'] = $loginstrgroup; if (isset($_session['prevurl']) && true) { $mm_redirectloginsuccess = $_session['prevurl']; } header("location: " . $mm_redirectloginsuccess ); } ?> note: did process via dreamweaver , insert php code itself. without knowing exact url, suppose submitted large form request. there limits this, , exact character limits depending on browser , webserver using. you should consider using post requests.

delphi - LiveBindings, alter data at runtime -

im struggling flowing. i'm trying use livebindings own classes. so wrote: procedure tformsearchofferte.abssearchcreateadapter(sender: tobject; var abindsourceadapter: tbindsourceadapter); begin myoffertelist := getlistofoffertes(cbopenstaand.checked); abindsourceadapter := tlistbindsourceadapter<tofferte>.create(self, myoffertelist); end; procedure tformsearchofferte.cbopenstaandclick(sender: tobject); var abindsourceadapter: tbindsourceadapter; begin abindsourceadapter := tlistbindsourceadapter<tofferte>.create(self, nil); abssearchcreateadapter(self.parent, abindsourceadapter); strgrdlist.refresh; end; my stringrid (strgrdlist) showing list of offertes. if uncheck combobox, reloads data. myoffertelist contains new data. stringgrid isn't. stringgrid connected abssearch. my stringgrid still shows old data. what missing? call abssearch.refresh after reloading data.

linux - Python retrieve RUID? -

i using version of python prior 2.7 on linux , wondering how retrieve ruid? 2.7 , later have getresuid the os package cant seem find equivalent 2.6 you can try use psutil library. try uids function: uids()[source] real, effective , saved user ids of process namedtuple. same os.getresuid() can used every process pid. availability: unix

How to delete obsolete Plunker versions? -

is there way delete obsolete plunker versions, keep latest version? there few lines pasted in original version of plunk hide. it not possible delete versions of plunk without deleting entire plunk.

java - How do I test my WebSocket which is developed in JavaScript -

i have created websocket.js unfortunately unable test due unavailability of data. requirement data comes various sources have multiple sockets that. note: want particularly test socket.onmessage behaves different sockets. please find code snippet below: var websocket; var txqueue = []; var defaultreconnecttimeout = 1000; //will multiplied 2 , saved reconnecttimeout on each try var reconnecttimeout = defaultreconnecttimeout; var registerwebsockethandlers = function(websocket) { websocket.onclose = function(){ settimeout(service.reopen, reconnecttimeout *= 2); }; websocket.onopen = function(e) { reconnecttimeout = defaultreconnecttimeout; //reset deferredsend(); }; websocket.onerror = function(e) { throw new error("[websocket] error occured " + e); }; } var uniqid = function() { return (new date().gettime()).tostring(16); } var deferredsend = function() { if(!service.isopen()) { $timeout(deferre

java - JBPM 6.2 Audit Log can't establish JTA Transaction -

when getting process instance variables audit log, following error: caused by: java.lang.illegalstateexception: unable find jta transaction. @ org.jbpm.process.audit.strategy.standalonejtastrategy.jointransaction(standalonejtastrategy.java:45) [jbpm-audit.jar:6.2.0.final] @ org.jbpm.process.audit.jpaauditlogservice.jointransaction(jpaauditlogservice.java:370) [jbpm-audit.jar:6.2.0.final] @ org.jbpm.process.audit.jpaauditlogservice.executequery(jpaauditlogservice.java:378) [jbpm-audit.jar:6.2.0.final] @ org.jbpm.process.audit.jpaauditlogservice.findvariableinstances(jpaauditlogservice.java:275) [jbpm-audit.jar:6.2.0.final] @ za.co.symbiotics.jbpm.runtime.processmanager.getprocessinstancevariables(processmanager.java:53) [process-service-ejb.jar:] any assistance appreciated. per previous question, have verified transaction-type="jta" in persistence.xml code snippet: list<?> variablelist = processfactory.getauditservice().findvariableinstan

c# - pull data from the database with the aspx div -

i want data database div structure in below code. example, when there 5 records in database composed of 5 pieces of panel. using sql , aspx. panel structure; <div class="panel panel-default text-center"> <div class="panel-heading"> <span class="fa-stack fa-5x"> <a href="#"><img src="/images/aa.png" width="100" height="125" /></a> </span> </div> <div class="panel-body"> <h4><a href="#">yayın adı</a></h4> <p>0. sayı</p> <p>0 görüntülenme</p> <a href="#" class="btn btn-primary">oku</a> </div> </div> if want use jquery, it's pretty simple: create web service exposes function perform database query add scriptmethod attribute function , scriptserivce tag class

VS 2015 Typescript modules support -

Image
has had luck new modules support in vs2015 , typescript 1.5? wrote quick example has 1 module "main.ts" importing "lib" , calling 2 test functions. when compile in vs2015 gives me compiler error on lib.ts need specify --module flag. lib.ts export function func1() { console.log("func1 called"); } export function func2() { console.log("func2 called"); } main.ts import * thelib "lib"; module main { export function someworkhere() { console.log("someworkhere called"); thelib.func1(); thelib.func2(); } } i have verified module system "on". (i tried amd, commonjs, umd) same compiler results. so: tried running tsc (typescript compiler) command line , compiles fine! has experienced this? ideas on how bend ide will? when adjust project settings, need each configuration running. you'll change in "debug" , when switch "release"

jsf - Homegrown authentication, how do I remember and get the logged in user -

i made filter , authentication in application jsf works i'd current user , have no idea how that. me? this method authenticates public string authenticates() { facescontext fc = facescontext.getcurrentinstance(); entitymanager manager = getmanager(); persondao dao = new persondaojpa(manager); if (dao.login(getperson().getemail(), getperson().getpassword())) { externalcontext ec = fc.getexternalcontext(); httpsession session = (httpsession) ec.getsession(false); session.setattribute("userlogged", true); getcurrentuser(); return "/index.xhtml" + "?faces-redirect=true"; } else { facesmessage ms = new facesmessage("email or password incorrect"); ms.setseverity(facesmessage.severity_error); fc.addmessage(null, ms); return "/account.xhtml"; } } you're setting boolean in session indicate if user logged in or not. if (user

bash - Simplest way to "forward" script arguments to another command -

i have following script #!/bin/bash docker exec my_container ./bin/cli and have append arguments passed script command inside script. example executing ./script some_command -t --option should run docker exec my_container ./bin/cli some_command -t --option inside script. looking simplest/most elegant way. "$@" represent arguments , support quoted arguments too: docker exec my_container ./bin/cli "$@"

wsh - VBScript / WshShell - Click Button with no name, id, or class -

This summary is not available. Please click here to view the post.

c# - Prism ViewLocator : How to fix "Your views must implement IView" -

i'm starting wpf application. use prism , viewlocator . it implies when i've view has have viewmodel bound it, i've indicate on mvvm:viewmodellocator.autowireviewmodel="true" and make implements iview interface, did, in code behind. in small test application, every thing works fine, viewmodel, set datacontext of view. the issue everyplace i'm using mvvm:viewmodellocator.autowireviewmodel="true" , error in "error list": "your views must implement iview" from understanding, issue xaml editor doesn't seems check if code behind class implement interface. so how avoid error? in fact prism 6, has been released yet, remove need of having iview , don't have message anymore :)

sql - Incomplete/Malformed cursor -

i have pl/sql script perform aggregation tasks. having compilation errors, logic not top priority @ moment can changed once errors resolved. script follows : set serveroutput on; alter session set nls_date_format = 'dd-mon-yy'; create or replace procedure updatefeatureperformancetable (noofdays in number, rundate in date, timespan in varchar2) cursor c_feature_performance select distinct mkt_id,dow,device_type,feature_name gfmdev.feature_performance timespan = 'one_day' , feature_performance_day >= to_date('17-aug-15','dd-mon-yy'); rowsextracted c_feature_performance%rowtype; extractdate date; timespan_test varchar2(20); begin open c_feature_performance; extractdate := rundate - noofdays; timespan_test := timespan; loop fetch c_feature_performance rowsextracted; exit when c_feature_performance%notfound; dbms_output.put_line(extractdate || ' '

scala - Spark driver disassociated and removed by the master -

i have cluster made 2 slaves , 1 master , set , submit jar (scala) spark master (192.168.1.64): spark-submit --master spark://spark-master:7077 --class tests.elements target/scala-2.10/zzz-project_2.10-1.0.jar after quite sometime running fine stops abruptly last lines on terminal being ... 15/08/19 17:45:24 info scheduler.taskschedulerimpl: adding task set 411292.0 6 tasks 15/08/19 17:45:24 warn scheduler.tasksetmanager: stage 411292 contains task of large size (2762 kb). maximum recommended task size 100 kb. 15/08/19 17:45:24 info scheduler.tasksetmanager: starting task 2.0 in stage 411292.0 (tid 1832, 192.168.1.64, process_local, 2828792 bytes) 15/08/19 17:45:24 info scheduler.tasksetmanager: starting task 0.0 in stage 411292.0 (tid 1833, 192.168.1.62, process_local, 2310009 bytes) 15/08/19 17:45:24 info scheduler.tasksetmanager: starting task 3.0 in stage 411292.0 (tid 1834, 192.168.1.64, process_local, 2669188 bytes) 15/08/19 17:45:24 info scheduler.tasksetmanager: start

Monit not working with Redis -

i configuring monit monitor redis , redis sentinel. every time monit run, logs both redis , redis sentinel not running , tries run them although both of them done. fails in starting redis processes. whereas working system checks , nginx , other processes. versions: redis: redis server v=2.8.4 sha=00000000:0 malloc=jemalloc-3.4.1 bits=64 build=a44a05d76f06a5d9 monit: version 5.6 here configuration of monit redis (redis sentinel has same configuration): # redis check process redis pidfile /var/run/redis-server.pid group cache group redis start program = "/etc/init.d/redis-server start" stop program = "/etc/init.d/redis-server stop" if failed host 127.0.0.1 port 6379 restart if totalmem > 500 mb alert if cpu > 60% 2 cycles alert if cpu > 98% 5 cycles restart if 2 restarts within 2 cycles alert depend redis_bin depend redis_rc check file redis_bin path /usr/bin/redis-server group redis include /etc/monit/templates/root

CSS3 animation with keyframes and transform -

i make similar move css animations: http://truthlabs.com/ i created file i'm working keyframes , not work well. i wish circles able make full turn on axis , starting fixed point in center. thanks. html file: <ul> <li style="animation: move1 2s infinite;"></li> <li style="animation: move2 2s infinite;"></li> <li style="animation: move3 2s infinite;"></li> <li style="animation: move4 2s infinite;"></li> <li style="animation: move5 2s infinite;"></li> <li style="animation: move6 2s infinite;"></li> <li style="animation: move7 2s infinite;"></li> <li style="animation: move8 2s infinite;"></li> <li style="animation: move9 2s infinite;"></li> <li style="animation: move10 2s inf

jquery - Banner not closing and staying closed with link -

hey guys have banner developed mootools library. banner appears on smartphones can see via chrome dev tools using toggle device mode. here link banner my issue banner has "do not show again" link , not working. this part of code using. using cookie. can let me know why not firing off. i've looked , looked , can't figure out. /* not show window again */ window.addeventlistener('load', function() { if ($('#appnotice')) { var appnoticecloseelems = $$('.appnoticeclose'), appnoticecloseperm = $$('.appnoticecloseperm'), appnotice = $('#appnotice'), appnoticeheight = appnotice.height(), appnoticepaddingtop = math.abs(appnoticeheight.toint() - 5000), bypassappnotice = cookie.read('bypassappnotice'); appnotice.css('padding-top', appnoticepaddingtop); function appnoticeopen() { console.log('appnoticeope

database - How to create tables in Oracle DB from the set of *.sql files -

i have set of *.sql files (>200) contains scripts of tables creation. how can apply of them automatically oracle db? i use oracle sql developer environment just create "driver" sql file, , call sqlplus - example, if have script1.sql, script2.sql, create file, "driver.sql" , include: @script1.sql @script2.sql ...etc...

ios - shadow in navigationbar when pushing -

please help. when pushing view controller navigation bar shadow. there way remove shadow, please? i used push/pop animations yes. tried [uiview animatewithduration:1.2 animations:^{ self.view.frame = cgrectmake(320, 0, 320, 480); }]; but nothing. thank you. there tone of ways modify navigation bar appearance, can see examples here: www.appcoda.com/customize-navigation-status-bar-ios-7 in particular case, can set empty image navigation bar shadow image: [uinavigationbar appearance].shadowimage = [uiimage new];

c# - Stress testing .NET program throws exceptions on Windows 10 -

i have method stress testing program wrote: void udpstress(ipendpoint destination) { byte[] data = new byte[] { 255 }; socket s = new socket(system.net.sockets.addressfamily.internetwork, sockettype.dgram, protocoltype.udp); while (true) s.sendto(data, destination); } after running method, following exception in less 1 second: system.net.sockets.socketexception: operation on socket not performed because system lacked sufficient buffer space or because queue full i ran on windows 8 , worked fine. i upgraded windows 10 2 weeks ago , doesn't work. suspect has modified socket api in windows 10, or something. so, error coming from? , why happen in windows 10, didn't happen @ in windows 8? edit: answers on other question don't solve problem. suggest things port exhaustion, might possible never happened me before upgraded windows 10. program worked fine on windows 8 now, reason i'm struggling understand, doesn't work on windows 10

c++ - Create a vector as a function call parameter -

i have no idea have in situation.. class build_using_vector : public { private: int thing; vector<int> list_elem; public: build_using_vector(int tthing, vector<int> llist_elem); }; ok not prob... second part still not prob: build_using_vector::build_using_vector(int tthing, vector<int> llist_elem) : another() { thing = tthing; list_elem = llist_elem; } as said not prob. the prob there, in "main". in case not "main" class... think same... int main() { build_using_vector foo(5, ???) // don't know how build multiple of element example 5,6,7) return 0; } thank you you can use list initilization . build_using_vector foo(5, ???) be build_using_vector foo(5, {5,6,7}) i suggest use member initialization constructor , change build_using_vector::build_using_vector(int tthing, vector<int> llist_elem) : another() { thing = tthing; list_elem = llist_elem; } t

javascript - make div 100% of browser height depending on length of content -

i have 2 divs, navigation , main content in bootstrap grid system. length of either can vary depending on amount of content. need them both styled fill 100% of browser window if neither has content reach bottom naturally. if @ least 1 of divs has more content length of browser window, need able scroll down page styles of both divs remaining in tact , both have height of longer of 2 divs. i'm using javascript resize function seems work not in case neither div long enough fill height of browser window. suggestions? html <div class="row"> <div id="nav" class="col-xs-2"> variable height navigation </div> <div id="main" class="col-xs-10"> variable height content </div> </div> javascript function resize() { var h = (document.height !== undefined) ? document.height : document.body.offsetheight;

java - How does this pre increment on arrays work -

++frequency[2] ; i thought default value of array hasn't been initialized 0. imo, means evaluate frequency[2] 0 , add 1 , assign index 2. pls can explain how output code gotten. been hitting head real hard on this. public static void main(string ars[]) { int responses[] = {1,2,4,4}; int freq[] = new int[5]; for(int answer = 1;answer < responses.length;answer++){ ++freq[responses[answer]]; } ( int rating = 1; rating < freq.length; rating++ ) system.out.printf( "%6d%10d\n", rating, freq[ rating ] ); //output 1 0 2 1 3 0 4 2 yes, are. int[] frequency = new int[3]; system.out.println(frequency[2]); system.out.println(++frequency[2]); system.out.println(frequency[2]); prints: 0 1 1 edit: lurker said here how pre increment on arrays work , answer valid java, might not other languages.

c# - Best way to read IDataReader for WebApi -

i have webapi action returns dynamic result based on sql query. using following function convert idatareader works fine, creates dictionary object each row. wondering if there better way that. private ienumerable readresult(idatareader reader) { var names = new string[reader.fieldcount]; var values = new object[reader.fieldcount]; (var = 0; < reader.fieldcount; i++) { names[i] = reader.getname(i); } while (reader.read()) { reader.getvalues(values); var record = names.todictionary(i => i, s => values[array.indexof(names, s)]); yield return record; } } you can try approach (don't know how play webapi, still worth try): var record = new expandoobject() idictionary<string, object>; foreach(var name in names) record[name] = values[array.indexof(names, name)]; yield return record;

jersey - How can I get rid of the namespace prefix from MOXy json output? -

java 7, jersey 2.17 + jersey-media-moxy 2.17 all jaxb classes have same namespace. findresponse , apipeapipe classes in different package, package-info class both packages has same annotation: @javax.xml.bind.annotation.xmlschema(namespace = "xmlapi_1.0", elementformdefault = javax.xml.bind.annotation.xmlnsform.qualified) the findresponse class has @xmlelementroot, @xmlaccessortype(xmlaccesstype.field) @xmltype(name = "", proporder = { }) @xmlrootelement(name = "findresponse") public class findresponse { while apipeapipe class @xmlaccessortype(xmlaccesstype.field) @xmltype(name = "apipe.apipe") public class apipeapipe extends vllvll { the objectfactory findresponse: public findresponse createfindresponse() { return new findresponse(); } the objectfactory apipeapipe: @xmlelementdecl(namespace = "xmlapi_1.0", name = "apipe.apipe") public jaxbelement<apipeapipe> createapipeapipe(apipeapipe va

HTML variable and text value transfer to PHP/javascript? -

so have in html: <p><br><form name="edit" method="post"> <div><select name="edi" id ="edi" > <option selected="selected">select</option> <option value="1.php">apple</option> <option value="1.php">bannana</option> <option value="2.php">carrot</option> </select> <input onclick="return edit();" type="submit" value="edit"/></div> </form> here corresponding javascript: function edit(){ if(document.forms['edit'].edi.value == "select") { alert("please select edit field"); return false; } else { window.open(edi.options[edi.selectedindex].value); return true; } } here problem. can see both option apple, , bann

javascript - How to visualize data with chart.js properly? -

i making program, data array , make array. array needs visualize via chart.js in line chart, goes wrong there... code: <html> <head> <title>visualize data beautifully using js charts</title> <link href="css/style.css" media="screen" rel="stylesheet"> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/1.0.2/chart.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script> </head> <body> <center> <form> <p>first value:</p> <input type="text" name="firstname" id="first"> <br/>last value: <br/> <input type="text" name="secondname" id="second"> <br/>

javascript - jquery ajax call "metho" instead of "method"? -

i have script.js uses jquery's ajax function query string php file, works expected find odd must use "metho" sintax instead of "method", @ this, this works script.js $.ajax({ url: 'php/printers.php', metho: 'post', data: { data: c, orderby: d, }, success: function(output) { $('.results').html(output); var tbody = document.getelementsbyclassname('results'); var rows = tbody[0].getelementsbytagname('tr'); ajax.applyclass(rows); } }); this doesn't $.ajax({ url: 'php/printers.php', method: 'post', data: { data: c, orderby: d, }, success: function(output) { $('.results').html(output); var tbody = document.getelementsbyclassname('results'); var rows = tbody[0].getelementsbytagname('tr'); ajax.applycla

.htaccess - RewriteCond %{ENV:REDIRECT_STATUS} 200 Not Working -

i writing 301 redirect first time... objective i have redirect url www.example.com/product/cat/item/product-item www.example.com/brand/cat/item/product-item www.example.com/cat/item/product-item to: www.example.com/product/item item can have values iphone-6-black-3g (having hyphen in them) htaccess-code i have made test project , following in htaccess file: rewriteengine on rewritebase /test/ rewritecond %{env:redirect_status} 200 ### have tested ^. rewriterule ^ - [l] rewriterule ^(.+)/([^\-]+)-(.+)/?$ $2/$3.php?cat=$2&item=$3 [l,r=301] if redirect test.php?cat=$2&item=$3 showing correct values in $2 , $3 . problem but if redirect $2/$3.php weird things happen. since new url generated satisfy rule think loop occurs continue until no more match.... to break loop have added %{env:redirect_status} 200 , looks not working. i getting crazy... solution coming head change item format apple_iphone-t etc... having first underscore , hyphen

sublimetext3 - No such file 'haxe' sublime text 3 -

i'm trying compile haxe in sublime text 3 error: [errno 2] no such file or directory: 'haxe' [cmd: ['haxe', 'build.hxml']] [dir: /home/bob/desktop] [path: /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/bob/.local/bin:/home/bob/bin] [finished] i'm running fedora 22 , have haxe tar extracted in home folder , ctrl+shift+p , installed haxelib , haxe packages. 2 files heloworld.hx class helloworld { static public function main() { trace("hello world"); } } and build.hxml generated: # autogenerated build.hxml # hellowworld (js:hellowworld.js) -main hellowworld js hellowworld.js why isn't haxe build system option or not compiling @ all? i found out needed add haxe exacutables /usr/bin/ because paths commonly looked on linux. problem occurs no matter if class name lower case or not error: error: not process argument haxe -main helloworld class name must start uppercase character build faile

c# - How to add extension to route ASP.NET -

this question has answer here: how add extension .html in url asp.net mvc 4? 1 answer i know if there way add extension end or uri in asp.net. normally, routeconfig configured this: url: "{controller}/{action}/{id}" , so, result this: http://example.com/home/testpage/1 , add extension end of uri (just fun, , know it), http://example.com/home/testpage/1.extension , possible do? , how can it? you can use regular expression constraint parameter, {id:^.*\.(extension1|extension2)$}

c# - WMI Query DNS CNAME in subdomains -

i trying write following powershell script in c# using wmi queries. get-dnsserverzone -computername [dns server] | ? {$_.zonename} | get-dnsserverresourcerecord -computername [dns server] -rrtype cname | ? {$_.hostname -like "$dnscname*"} | format-table this snippet query dns , return zones , pipe results get-dnsserverresourcerecord return records alias name (and it's variants) exists in. for example: $dnscname='abcxyz' the results are: abcxyz.domain1.com abcxyz123.subdomain.domain1.com abcxyz456.subdomain.domain2.com unfortunately following wmi query not work me. "select * microsoftdns_resourcerecord ownername '%abcxyz%'" is there way write wmi query return same results powershell script? i'm 99% provider doesn't support filtering way (but can't find reference). you'll have of them , filter them in code, incidentally what's happening in powershell code (you're letting cmdlet, thin wrap

git - Remote branch on Visual Studio online doesn't appear on Visual Studio 2015 Team Explorer -

Image
i have created new git repository on visual studio online. have cloned on computer , have added project. after that, have created new branch called develop on visual studio online, , have tried check out creating new local branch doesn't appear on team explorer. this visual studio online: and visual studio 2015 team explorer: why develop branch doesn't appear on team explorer? you can now in visual studio going synchronisation tab (sync in team drop down menu) , clicking fetch @ top.

html - Keep last word and image on same line -

with css, there way break both last word , image new line @ narrower width? http://jsfiddle.net/2koc2deo/3/ .text-two { width: 125px; } .text { font-size: 16px; } <div class="text text-one"> <p><a href="#">customer service&nbsp;<img src="http://lorempixel.com/15/15/" alt=""></a> </div> <div class="text text-two"> <p><a href="#">customer service&nbsp;<img src="http://lorempixel.com/15/15/" alt=""></a> </div> i added negative right margin <a> elements, match image width. prevents images triggering line wrap. line wrap if text doesn't fit. this works best in contexts right overflow of container still visible. .text { font-size: 16px; } .text-two { width: 118px; } .text { margin-right: -15px; } <div class="text text-one"> <

c++ - How to get LAPACK working in 64 bit windows with Visual Studio 2012 -

i using lapack 3.5.0 visual studio c/c++ 2012. install followed instructions given in answer question: how install lapack msvs 2010 on windows? i proceeded link blas , lapack libraries in "linker > input > additional dependencies" , copied , pasted .dll files folder .exe located. after doing this, 32 bit version of program works expected. 64 bit version won't compile. following error: 1>link : warning lnk4098: defaultlib 'libcmt' conflicts use of other libs; use /nodefaultlib:library 1>pic_effective_index.obj : error lnk2001: unresolved external symbol dstevx_ basically, tried 64 bit version work mimic did 32 bit version. is able correct me on going wrong?

jsf - How to initialize omnifaces manually to avoid omnifaces.GenericEnumConverter not found? -

i changed web.xml metadata-complete="false" metadata-complete="true" , got following error: javax.faces.facesexception: expression error: omnifaces.genericenumconverter not found. i'm using tomcat 8.0.24, jsf mojarra 2.2.12, primefaces 5.2 , omnifaces 1.11. is possible initialize omnifaces manually? explicitly register below in webapp's own faces-config.xml . <converter> <converter-id>omnifaces.genericenumconverter</converter-id> <converter-class>org.omnifaces.converter.genericenumconverter</converter-class> </converter>

AngularJS - Unit test with header response -

my backend retrieves me 'x-token' when user log in on web. on frontend simple validation, getting token , setting: $rootscope.authenticated = true; if token not present on header response reason frontend sets: $rootscope.authenticated = false; my controller signinservice .signin(datafromform) .then(function (data) { if ( $mytokenmanager.save(data.headers('x-token')) ) { $rootscope.authenticated = true; } else { $rootscope.authenticated = false; // unit test sent here :( } }); this working perfect, need unit test method, test not generating or setting header response properly. doing wrong on test? describe('testing controllers', function() { describe('mycontroller unit test', function() { var $httpbackend, $rootscope, createcontroller, authrequesthandler, datafromform; beforeeach(module('myapp')); beforeeach(inject(function($injec

ruby - Deal with Array of Hashes or single Hash ( from an API Response) -

i have api responding either: an array of hashes results = [{a: 1, b: 2}, {a:2, b:3}] a single hash, if 1 result results = {a:1, b:2} or nil i'm trying work out elegant way deal situation can add parameter it's present. e.g. situation 1: results.map!{|h| h.update(c:3) } situation 2: results[:c] = 3 situation 3: (don't anything) i've tried if results.is_a?(array) results.map!{|h| h.update(c:3) } elsif results.is_a?(hash) results.update(c:3) end but looks ugly, messes code around (and i've got bug can't pin down)... is there more elegant way this? hopefully should work you. # api simulator def call_api # lets return randomly - 1 of 3 results [ [{a: 1, b: 2}, {a:2, b:3}], {a: 1, b:2}, nil ].sample end 5.times r = [] r << call_api p r.flatten.compact.map { |h| h.update(c:3) } end above code can written below: 5.times p [call_api].flatten.compact.map { |h| h.update(c:3)} end