Posts

Showing posts from April, 2013

mysql - Create Eloquent model from complex raw SQL-query -

i thinking right design of method gives user list of clients who's last appointment long time ago. so have 2 table (simplified): clients (id, first_name) appointments (id, client_id, datetime) what trying do: list of 3 clients who's last appointment long time ago. so do: select users oldest appointments , return them (with complex sql query). create models them. is design case? use illuminate\database\eloquent\collection; class clientrepository { /** * clients no appointments in near history (sort date of last appointment asc) * * @todo make better way find falling clients (more laravelish maybe?) * @param $count how many clients should method return * @return illuminate\database\eloquent\collection */ static public function getlost($count=3) { //this sql looks long works charm //solution based on http://stackoverflow.com/questions/1066453/mysql-group-by-and-order-by $sql = " s...

php - Calling token_get_all from c program -

i'm trying write c program can analyse php scripts various reasons. need call token_get_all php core library, i'm struggling mightily it. i've compiled php7 master branch statically , linked program. i'll post couple of code snippets i've tried many ways of calling function , keep running errors of 1 type or another. this snippet gets farthest when execute it: int main(void) { zval function_name, params[1], return_value, param; zval_new_str(&function_name, zend_string_init("token_get_all", strlen("token_get_all"), 1)); printf("got here\n"); zval_new_str(&params[0], zend_string_init("<?php $x = 1;", strlen("<?php $x = 1;"), 1)); int ret; printf("calling function\n"); ret = call_user_function(cg(function_table), null, &function_name, &return_value, 1, params tsrmls_cc); printf("%i", ret); } when gets call_user_function, segfaults. ...

wpf - What wrong with this Template -

i using datatrigger change datatemplate based on enum. <treeview > <treeview.resources> <hierarchicaldatatemplate datatype="{x:type model:card}" itemssource="{binding reqs}"> <stackpanel verticalalignment="center"> <textblock text="{binding label}" fontweight="bold" foreground="gray" horizontalalignment="stretch" verticalalignment="center" fontsize="15"/> <textblock text="{binding reqs.count}" fontweight="ultralight" foreground="gray" horizontalalignment="stretch" verticalalignment="center" fontsize="10"/> </stackpanel> </hierarchicaldatatemplate> <datatemplate datatype="{x:type model:reqcard}"> <contentcontrol> <contentcontrol.style> ...

matlab - To find Coherence between matrix for compressed sensing -

i working on compressed sensing.i have 2 vectors 1 of size 200 x 800,and other of size 800 x 800. is there way find coherence between these 2 using matlab?(coherence measures maximum correlation between 2 elements of 2 different matric)

google spreadsheet - Importrange() where the source columns/rows change -

i have importrange("key", "sheet1!d" & targetrow) formula, need column of importrange() dynamic in case add/delete columns in source data: e.g. importrange("key", "sheet1!" &targetcolumn &targetrow) i researched query() language being forced use col1 , col2 etc instead of named column identifiers makes useless i'm trying achieve. can me this? easiest way column letters without script? much. i've figured out inelegant workaround: =importrange("key", "sheet!" & importrange("key", "dept") & targetrow) where "dept" single-cell named range contains column letter of column want. the column letter (e.g. 'k') result of following formula: =substitute(address(row(k6), column(k6),4), row(k6),"") is there no easier/more robust way of doing this? used calculate bonuses it's critical spreadsheet.

playframework - Play 2 Compiler Error: bad symbolic reference to scala.xml (IntelliJ 14.1.4 + Play 2.4.2) -

i created new play 2.4.2 application in intellij 14.1.4 of instructions intellij on play site (i have scala plugin installed , enabled). instead of scala selected java project. when try run created app, following error: error:play 2 compiler: bad symbolic reference scala.xml encountered in class file 'basescalatemplate.class'. error:play 2 compiler: cannot access term xml in package scala. current classpath may error:play 2 compiler: missing definition scala.xml, or basescalatemplate.class may have been compiled against version that's error:play 2 compiler: incompatible 1 found on current classpath. error:play 2 compiler: (note: looks scala-xml module missing; try adding dependency on "org.scala-lang.modules" : "scala-xml". see http://docs.scala-lang.org/overviews/core/scala-2.11.html more information.) bad symbolic reference scala.xml encountered in class file 'basescalatemplate.class'. error:play 2 compiler: (note: looks ...

class - Java. Method Inner Object as return type -

can return method local inner object method? public class myclass { public mymethodinnerclass getmethodinnerclassobject() { class mymethodinnerclass { } mymethodinnerclass mymethclass = new mymethodinnerclass(); return mymethclass; } } throws compilation error. if can't return method-local inner class object, how can save after method returns? how can reference object future usage? exception thrown: exception in thread "main" java.lang.error: unresolved compilation problem: methodinnerclass cannot resolved type and also, i'm aware, local variables in method stored in stack , deleted after method exists. the scope of class inside method only. can however public object getmethodinnerclassobject() { or static class mymethodinnerclass { } public mymethodinnerclass getmethodinnerclassobject() { return new mymethodinnerclass(); }

Cannot connect to mysql from visual studio 2015 -

Image
so have spent 2 days trying fix this. have succeeded in fixing on workplace pc , can't work on home pc. have read dozen articles , oracle forums articles , whatnot still not work. i have 1.2.4 msql visual studio supposed release works on vs2015. have installed mysql connector 6.8.6 , have first tried add mysql project via nuget after not being able find 6.8.6 version (there 6.8.3 , 6.9.7 1 package , again else other...) have referenced c:\program files (x86)\mysql\mysql connector net 6.8.6\assemblies\v4.5 , have taken 4 files there , have copied them ove whole fkin computer. have pasted everywhere. vs2013 private assembly, packages folder not reference anyway , think vs2015 folder. have ran search mysql.data , have pasted these files in every folder came result. have rebuilt solution 100-200 times , have cried @ least 20 minutes. what have new ado.net entity data model generated? i keep getting stupid image , have absolutely no idea next. want code every time start doing...

shell - Ctrl-F no longer works to accept suggestions. Why? -

i enabled vi mode adding fish_vi_mode config. since did ctrl + f no longer works complete suggestions, have use right arrow instead. the keybindings forward-char same or without fish_vi_mode enabled. according fish_config , are: forward-char right arrow forward-char right arrow forward-char ctrl - f why doesn't ctrl + f work fish_vi_mode enabled? in vi mode, run bind , \cf , it's here: bind -m insert \cf forward-word that's what's going on: control-f going forward word. can restore non-vi behavior: bind -m insert \cf forward-char which go forward 1 character, or accept autosuggestion if cursor @ end (which admittedly sort of weird). or if want accept autosuggestion, can run after fish_vi_mode : bind -m insert \cf accept-autosuggestion now accepts autosuggestion @ point, not @ end. btw, these functions accept-autosuggestion or forward-char can listed via bind --function-names edit : harder ought due #2254 . simplest ...

visual studio - How can we get the T4 template to generate code based on a .cs file that the user is editing? -

i'm trying create t4 template save our developers creating lot of boilerplate code that's necessary in our framework. let's developer creates interface , marks our custom attribute. interface marked custom attribute enhanced additional methods, means t4 template have generate partial classes on fly. however, automatic generation happens on fly , seamlessly, preferably when internal automatic compilation that's used intellisense happens. know how when create new class in visual studio , switch source file , start using class didn't have save or compile it, intellisense able see new class created right away? i'd same automatic behavior code generated t4 template. thoughts? you cannot want easily, here options ordered easiest want (hardest). create code snippets create visual studio item template use castle dynamicproxy create bits @ run time. create separate project hold t4 generated classes described in my answer here as pre-step project buil...

jquery - Rails 4 Autocomplete with Simple Form - class parameter ignored -

i using simple form, along rails autocomplete gem. i have straightforward form control, autocomplete working intended: <%= f.input :practice, as: :autocomplete, url: autocomplete_practice_name_shifts_path, id_element: '#shift_practice_id', class: 'form-control' %> this works perfectly, except class: 'form-control' parameter not being translated onto form. if remove autocomplete parameters so: <%= f.input :practice, id_element: '#shift_practice_id', class: 'form-control' %> the class carries through correctly; such, seems autocomplete option overriding class. can advise correct way set class on input is? well, pass : input_html: { class: 'form-control' }

c++ - How do I get my Qt console app to communicate with another Qt gui app? -

my project needs have 2 parts it. first part input taken qt console window. input processed , signal sent qt gui app (the second part) accordingly updates ui. how implement this? can these part of same app, or need keep 2 separate , communicate between two? please direct me specific classes , functions have use. i've had @ qprocess wasn't sure whether serve purpose. i think not possible run both console , gui application in qt. can try create .exe file console , .exe gui application. to run console gui application should use qprocess have specify absolute path console executable. more information qprocess can found here .

sql server 2008 - How we find Latest Date value and update in another column in Sql? -

i have thee column date values there have update fourth column latest date value so please me write update query in sql server: date1 date2 date3 latest date 11/24/1991 1/14/2003 11/24/1991 1/14/2003 try this update tablename set latestdate = ( select case when date1 >= date2 , date1 >= date3 date1 when date2 >= date1 , date2 >= date3 date2 when date3 >= date1 , date3 >= date2 date3 else date1 end ) and don't forget add condition

Different name google map in my website -

i integrating google maps v3 javascript api in website arab company. every thing working except "arab gulf" appearing "persian gulf" in website shows "arab gulf" in maps.google , driving them crazy why appearing diferent in website? , there way change ? use localization in google maps javascript api. localization you may localize maps api application both altering default language settings , setting application's region code, alters how behaves based on given country or territory.

c# - How to stop loading the whole HTML page in registration form ? - ASP.NET -

i'm working asp.net web application . have done registration form whenever user type username or email loads whole first_home page ! how can stop loading whole page ? have setup constraint in database username , email avoid duplication. the html code: <table align="left" class="auto-style8" dir="rtl"> <tr> <td class="auto-style13">username </td> <td class="auto-style10"> <br /> <asp:textbox id="textboxusername" runat="server" autopostback="true" height="25px" width="223px" forecolor="#990033" ontextchanged="textboxusername_textchanged"></asp:textbox> <br /> </td> <td class="auto-style11"> <asp:requiredfieldvalidator id="requiredfieldvalidator2" runa...

How to convert php string with backslashes to json array -

i want produce json array using php {"to": "/topics/foo-bar"} but if use code : $topic = "/topics/foo-bar"; $g_topic= array( 'to' => $topic ); echo json_encode($g_topic ); it returning {"to": "/topics/foo-bar"} i have tried stripslashes() , addslashes() , none of methods worked it right there in the manual json_encode() function : echo json_encode($g_topic, json_unescaped_slashes); will yield: {"to": "/topics/foo-bar"}

java - Tibco EMS : not acknowledge message -

i have n tombcat servers listening tibco ems queue. have send n messages each must treated specific server (message 1 must treated tomcat server 1, ..., message n must treated server n) as messages received random machine, need refuse message n on server n-1 example , , return queue, until treated server n.. what i've done, throw exception on message handler when receiving message destinated queue, don't know if message returned queue , , forwarded other instances? is there time / number of retry limit on tibco ems when not acknowledging message? first : have considered using either : - 1 queue per server ? or b - system based on message selector ? (name of destination server n written sender in jms property "destname", , each tomcat server subscribes same queue, message selector "destname=mytomcatid"). if none of above possible, keep in mind jms transactions must used, if want uncommitted message rollback queue... , next server reading...

ggplot2 - R: Shiny ggplot renders upside down online, but not offline -

Image
i made small shiny app visualizes simple data in set of barplots. 1 of charts barplot showing time intervals plotted against date. renders expected when running app offline in r, when publish shinyapps.io, bars oddly inverted , run top of plot down towards x-axis. examples: offline online i have set of similar barplots not based on time-data seem work fine both published , unpublished. app entangled in reactive elements, i'm not sure how provide minimal reproducible example, on server side, plot rendered using: output$dayplot <- renderplot({ p <- ggplot(myplotdata(), aes(day, var, fill=state, color=state)) + geom_bar(stat="identity") + xlab("day") + ylab(input$yvar) + scale_x_continuous(breaks=pretty_breaks(10)) + scale_y_datetime(breaks = date_breaks("1 hour"), labels = date_format("%h:%m")) + coo...

Is it possible to extract/export just the value from a cell from an excel online spreadsheet into a web page? -

i hope have used right tags on question - i'm helping client research question , our biggest challenge lack of knowledge of excel , client's lack of knowledge of front-end web languages - getting stuck somewhere in middle: basically, trying find way automatically update content on web page value 1 specific cell in excel online spreadsheet. cell contains chunk of html want include on our page. i see how can "embed" single cell tools excel online provides, interested in getting contents of cell, without excel spreadsheet embed container or other formatting. would happy use javascript or php or iframe accomplish this, have not found examples or similar questions in our research. is possible? , how go if so? thanks much!

c++ - Getting 400 Bad Request when trying to connect to website via winsock socket -

i made socket i've been adding on week , i've come across problem. set port on local 127.0.0.1 ip address allow me connect own computer , when recieve response computer says "400 bad request. request badly formed.". think has http header information send via send(); function. sendbuf contains header information sent. here's code: #include <windows.h> #include <winsock2.h> #include <conio.h> #include <stdio.h> #include <iostream> using namespace std; #define sck_version2 0x0202 #define default_buflen 2000 #define default_port 27015 namespace globals{ extern string input = ""; } using namespace globals; void username() { { printf("username: \t"); getline(cin, input); if ( input == "user name" ) { break; } } while(true); } void password() { { printf("password: \t"); getline(cin, input); ...

c++ - Cannot convert from stringw to string / char -

i have been trying convert irr::stringw (irrlicht game engine core string) can explode string @ delimiter create array / list. however, cannot convert stringw, not compatible normal functions. so, split stringw list have following: vector<stringw> split(stringw str, char delimiter){ vector<stringw> internal; std::string tok; std::string std_s(str.c_str(), str.size()); while (getline(std_s, tok, delimiter)) { internal.push_back(tok); } return internal; } however errors here are: str.c_str() says no instance of constructor "std::basic::string matches argument list. argument types (const wchar_t*, irr:u32) on getline method error: no instance of overloaded function "getline" matches argument list. argument types are: (std::string, std::string, char). i have been trying hours number of ways split stringw @ delimiter of ";" (semi colon) nothing working. advice? there 2 main issues here, first...

image - VB.Net Create a ImageGenerator process -

i want know how can make process.. im doing this: timecount = 0 timer.start() dim count integer = 1, next boolean each datarow datarow in database.rows nextimage = false while nextimage = false try dim ext string = ".png" if rbjpg.checked = true ext = ".jpg" generateimage(datarow, imagefrom, fbd.selectedpath, ext, count) nextimage = true catch ex exception timer.stop() dim result dialogresult = messagebox.show(ex.message, "error", messageboxbuttons.abortretryignore, messageboxicon.error) if result = windows.forms.dialogresult.ignore timer.start() nextimage = true elseif result = windows.forms.dialogresult.retry timer.start() ...

javascript - If statement works on resize, not ready? -

i trying accomplish 2 things: the main content div dynamically sized fit exact height of window. accomplish goal function: $(document).on( 'ready', function() { panelsresize(); $(window).on( 'resize', panelsresize ); }); function panelsresize() { var screenheight = $(window).height(); var screenwidth = $(window).width(); if (screenwidth > 768) { $( ".panels" ).css( "height", screenheight ); } }; the class .panels applied main content area. this works swell. i trying fill .panels images in .large . these images need retain aspect ratio while being scalable. have based code on answer . this works, not on ready. have resize screen, dropping below media query switches display .large none. when resize higher media query, switching display block, functionality works perfect. any ideas? here's function (and markup): $(document).on( 'ready', function() { bgresize...

java - Pendulum simulation only performing one period -

i making simulation of pendulum, performs 1 swing before sending close random positions bob at. essentially, not go backwards. i have tried change direction using goingforward boolean, still doesnt work. public class animationpane extends jpanel { // start changeable variables private double startangle = -60.0; // degrees private double mass = 1; // kilogrammes private int radius = 10; // m private double gravity = 9.80665; // m/s^2 // on earth: 9.80665 // end changeable variables private bufferedimage ball; private bufferedimage rope; private int pointx = 180; private int pointy = 50; private double endangle = math.abs(startangle); // absolute value of startangle private double angle = startangle; // current angle private double circum = (2 * math.pi * radius); // m private double distance = 0; // m private double velocity = 0; // m/s private double totalenergy = ((radius) - (math.cos(math.toradians(angle)) * rad...

Android text selection text color is off -

Image
i have toolbar text color should white. however, want theme light theme. here's how accomplish that: activity_main.xml <android.support.v7.widget.toolbar android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/toolbar" android:minheight="?attr/actionbarsize" android:background="@color/primary" android:theme="@style/actionbar"/> styles.xml <style name="actionbar" parent="theme.appcompat.light.noactionbar"> <item name="android:textcolorprimary">@color/abc_primary_text_material_dark</item> <item name="android:textcolorprimaryinverse">@color/abc_primary_text_material_dark</item> <item name="actionmenutextcolor">@color/abc_primary_text_material_light</item> <item name="android:textcolorsecondary">@color/abc_primary_text_material_...

arrays - vb.net for each loop counter -

i trying make program organize folders full of random stuff. want put each file type folder describes in it. have arrays of file types inside array can loop through. it can move file types specified in array fine, when tried make put each type seperate folder, says array index out of bounds. it works fine if replace index of names number, can't change automatically. here code using: dim extensions array = {audio, video, image, document, plaintext, batch, powershell, vb, diskimage, compressed, excutable, model, code, web, registry} dim names string() = {"audio", "videos", "pictures", "documents", "text documents", "batch", "powershell", "visual basic", "diskimages", "compressed files", "excutables", "3d models", "code", "web", "registry"} dim number integer = 0 each type string() in extensions number += 1 ...

Google Maps API Places Service (types) -

i have looked @ google's preset list of place types. found 1 'establishment' want populate markers popular places visit in city example. problem 'hospital' displayed under category want remove. there way accomplish this, or there free tourist attractions api works google maps? a single place can have 1 or many types. have list types, test one's want. if find 1 don't want don't use it, you're gonna have test each possible type don't want. another way that, instead of using 'establishment' main type (this common type), select places "museum", "point_of_interest", , many others. take @ the full list here. for each place get, use getplacetypes() return list of types, can test desired type.

Java reflection get runtime type when using generics -

i wondering how can runtime type written programmer when using generics. example if have class main<t extends list<string>> , programmer write main<arraylist<string>> main = new main<>(); how can understand using reflection class extending list<string> used? i'm curious how can achieve that. main.getclass().gettypeparameters()[0].getbounds[] i can understand bounding class (not runtime class). as comments above point out, due type erasure can't this. in comments, follow question was: i know generics removed after compilation, wondering how classcastexception thrown runtime ? sorry, if stupid question, how knows throws exception if there isn't information classes. the answer that, although type parameter erased type , still remains in bytecode . essentially, compiler transforms this: list<string> list = new arraylist<>(); list.add("foo"); string value = list.get(0); into this: ...

Cast int to enum in Python for my program? -

how can int cast enum in python? if want flexibility convert between int , enum, can use enum.intenum import enum class color(enum.intenum): green = 1 blue = 2 red = 3 yellow = 4 color_code = 4 # cast enum color = color(color_code) # cast int color_code = int(color) note: if using python<3.4, enum has been backported, need install it, e.g. via pip install enum more on enums in python - https://docs.python.org/3/library/enum.html

cakephp - How to define FlashHelper/Component element for general authError message -

after updating cakephp 2.6.2 2.7.2 missing key error when auth flash message created. how can define element template default autherror ? since sessioncomponent::setflash() has been deprecated added flashcomponent in app/controller/appcontroller.php , modified flash messages this: // controller $this->session->setflash('done', 'succeed'); $this->session->setflash('there error', 'failure'); $this->session->setflash('please log in', 'auth'); // view (default layout) echo $this->session->flash(); echo $this->session->flash('auth'); to this: // controller $this->flash->succeed('done'); $this->flash->failure('there error'); $this->flash->auth('please log in'); // view (default layout) echo $this->flash->render(); echo $this->session->flash(); // keep temporarily? echo $this->session->flash('auth'); // keep temporari...

linux - Centos shell script - Group files starting with the same string -

i have directory many pdf files. each file name starts numeric id (5 chars fixed length), follows: 11111-2014.pdf 11111-2015.pdf 22222-2015.pdf 33333-2013.pdf 33333-2014.pdf 33333-2015.pdf i'm trying figure out how write shell script in centos reads files in such directory , list them depending on id. shell script should return following output (on 3 rows) following: 11111-2014.pdf 11111-2015.pdf 22222-2015.pdf 33333-2013.pdf 33333-2014.pdf 33333-2015.pdf and assign each row variable name (ie: $rowstring). i group in string files starting same id, , attach them same email using mutt email client command line. so, following above example: for each unique $rowstring command be: mutt -s "subject" $rowstring -- abc@domain.com < body.txt where $rowstring (the attachments) should follows first email: -a 11111-2014.pdf -a 11111-2015.pdf for second email: -a 22222-2014.pdf for third email: -a 33333-2013.pdf -a 33333-2014.pd...

apache spark - mapPartitions returns empty array -

i have following rdd has 4 partitions:- val rdd=sc.parallelize(1 20,4) now try call mappartitions on this:- scala> rdd.mappartitions(x=> { println(x.size); x }).collect 5 5 5 5 res98: array[int] = array() why return empty array? anonymoys function returning same iterator received, how returning empty array? interesting part if remove println statement, indeed returns non empty array:- scala> rdd.mappartitions(x=> { x }).collect res101: array[int] = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20) this don't understand. how come presence of println (which printing size of iterator) affecting final outcome of function? that's because x traversableonce , means traversed calling size , returned back....empty. you work around number of ways, here one: rdd.mappartitions(x=> { val list = x.tolist; println(list.size); list.toiterator }).collect

how to launch startActivity(new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS")); on Samsung Galaxy phones? -

Image
i have app requesting notifications access permission users. in order take users directly screen give access, launch following intent: startactivity(new intent("android.settings.action_notification_listener_settings")); in stock android (also in moto x), brings following screen. guess samsung's specific oem rom not support intent. on motox, can screen following way: settings -> sound & notification (under device) --> notification access question is - how launch notification access screen on samsung galaxy s5/s6, i.e. galaxy phones?

excel - Code takes too long to run , ends up crashing at times -

hi there have code run after few moments. stops responding , run again .need run faster without crashing. here code sub deletecells() dim r range 'set rng = nothing on error resume next set r = application.inputbox("select cells deleted", type:=8) dim rng range dim rngerror range set rng = sheets("sheet3").range("a1:g100") set rngerror = rng.cells.specialcells(xlcelltypeformulas, xlerrors) if typename(r) <> "range" exit sub else r.delete end if each cell in rng if cell.text = "#ref!" cell.entirecolumn.delete end if 'delete means cells move after deleting entire row 'rngerror.entirerow.clearcontents means contents clear, leaving blank cell entire row next end sub you deleting cells in loop can make slow. trying? should fast... ( untested ) sub deletecells() dim rng range, rngerror range, delrange range dim long, j long ...

java - The method DataOutputStream(OutputStream) is undefined for the type -

i followed lot of tutorials make progress project. following tutorial create google cloud messaging server using json , jackson library. i somehow got right jackson library of libraries on internet. error appeared title of question. this code: import java.io.bufferedreader; import java.io.dataoutputstream; import java.io.ioexception; import java.io.inputstreamreader; import java.net.httpurlconnection; import java.net.malformedurlexception; import java.net.url; import org.codehaus.jackson.map.objectmapper; public class post2gcm { public static void post(string apikey, content content){ try{ //1. url url url = new url("https://android.googleapis.com/gcm/send"); //2. open connection httpurlconnection conn = (httpurlconnection) url.openconnection(); //3. specify post method conn.setrequestmethod("post"); //4.set headers conn.setrequestproperty("...

image - AngularJS ng-src and ng-attr-src don't work in IMG tag -

i'm attempting load image url in data being returned mongodb. on user's profile editing page, can edit details email address, , user profile image. email address data binding well, ng-src profile image never resolves, it's blank, though user object contains correct url should binding. html in question: <div ng-controller="userctrl"> <img ng-src="{{currentuser.profileimage}}" src="{{currentuser.profileimage}}" class="img-responsive" alt="profile image"/> <input name="name" type="text" placeholder="enter name" class="form-control" ng-model="currentuser.name"/> </div> angularjs call init data in controller: function userctrl($scope, $routeparams, $timeout, userservice) { $scope.init = function() { userservice.getcurrentuser().then(function(dataresponse) { if (dataresponse.data) { dataresponse.data.profileimage = "i...

Can fail2ban run in a separate docker container while somehow still implement iptables rules for nginx? -

i'd "containerize" fail2ban in own container suspect it's not possible set iptables rules in other containers. example: protect nginx installation, need set iptables rules in nginx container? , although can share necessary log files nginx container fail2ban container, fail2ban unable apply iptables banning rules nginx container without highly custom fail2ban action? have tried https://hub.docker.com/r/superitman/fail2ban/ ? i'm using , it's blocking ssh attempts no problem, i've saw it's not working nginx containers (it seems ip added hosts iptables blacklist nginx container i'm not sure problem)

php - Paypal Item Form Won't Align Center -

hello have setup paypal form on website cannot dropdown menu align in center rest of content. http://www.christmascakesforcancerresearch.com.au/cakemail.php here code form. able please advise? have tried <div align="center"> , <center> nothing working. <form action='https://www.paypal.com/cgi-bin/webscr' method='post' target='_top'>"); echo("<input type='hidden' name='cmd' value='_xclick'>"); echo("<input type='hidden' name='business' value='petjul@iprimus.com.au'>"); echo("<input type='hidden' name='lc' value='aud'>"); echo("<input type='hidden' name='item_name' value='christmas cakes'>"); echo("<input type='hidden' name='button_subtype' value='services'>"); echo("<input type='hidden' name='no_note...

ios - Resolving duplicate symbols in cocoapods, when using, JIRAMobieConnect and Appcelerator Framework? -

Image
i need use jiramobileconnect , appcelerator frameworks in project. guess appcelerator framework internally using same crashreporter jiramobileconnect , lot of duplicate symbols errors. i see crashreporter framework has in plcrashreporternamespace.h file, /* * external library integrators: * * set value valid c symbol prefix. automatically * prepend given prefix external symbols in library. * * may used avoid symbol conflicts between multiple libraries * may both incorporate plcrashreporter. */ // #define plcrashreporter_prefix acmeco #ifdef plcrashreporter_prefix so set preprocessor macros in jiraconnect target under pods plcrashreporter_prefix=em , undefined symbol error. i found so question , answer says you need recompile corresponding framwork (all .c files) same macro definition exports , uses modified symbol names. so there way other downloading plcrashreporter source code , recompiling library? if that, whats way make work cocoapods? found ...

r - RStudio UTF-8 display issue with htmlwidget:datatable[package DT] -

i have dataframe contained chinese chars encoding utf-8. for example, dataframe below testdf <- data.frame(locationname= c("台北","新北市","台南市"), temp=c(30,29,28)) testdf locationname temp 1 台北 30 2 新北市 29 3 台南市 28 library(dt) datatable(testdf) i found datatable can't display in r viewer (in r console okay) when there have chinese char. i check index.html generate datatable default using "utf-8" if manually modify index.html manually to"charset=big5" , using external browser open, okay display. (or choose "show in new windows" , using external browser decode =big5.) my questions if settings can apply make work in r viewer without manually modify html file manually or view in external browser? help best regards james

javascript - My checkbox values are calculating on unchecking instead of checking -

the below code. want calculate value of checked checkbox. want functionality like,when select '#selectall' checkbox, selecting checkboxes , calculating value. in code calculating values on unchecking '#selectall' checkbox . how can fix issue? $(document).ready(function () { // select $('#selecctall').click(function (event) { //on click if (this.checked) { // check select status $('.checkbox1').each(function () { //loop through each checkbox this.checked = true; //select checkboxes class "checkbox1" }); } else { $('.checkbox1').each(function () { //loop through each checkbox this.checked = false; //deselect checkboxes class "checkbox1" }); } }); }); //addition checked value $('input').click(function () { var sum = 0; $(...