Posts

Showing posts from July, 2013

javascript - Form validation plugin fails with classes -

i working validator plugin have built, , each problem solved seems new 1 appearing. problem when use class validation selector, class validated , long 1 of them filled in accepted. now, while okay instances, not all. fiddle http://jsfiddle.net/9gwuyras/2/ the full code validation plugin can found in fiddle well. parts of code think issue being caused using fiddle reference lines of code lines 497 - 514 reasoning doesn't matter class selector in setting.selectors[] array multiple times, possible option. for(var control in controls){ if(typeof controls[control] != 'object'){ console.log("controls."+control+" must object. skipping element"); continue; }else if(typeof controls[control].validate == 'undefined'){ console.log("controls."+control+".validate must defined"); continue; } $this.find('input, textarea, select').each(function(){ if($(this).is(...

osx - MKMapView Broken on OS X 10.11? -

i have production app uses mkmapview , shows users map. can zoom using +/- key or via mouse scroll wheel , drag map location. on os x 10.11.x drag location seems no longer work. zooming functions work, not map dragging. true of both production version (currently in mac app store) development versions built using xcode 7.0.1. the os x deployment target 10.9. the mkmapview added views manually using code: _mapview = [[mkmapview alloc] initwithframe:cgrectzero]; _mapview.translatesautoresizingmaskintoconstraints = no; _mapview.autoresizessubviews = yes; _mapview.showsuserlocation = no; _mapview.maptype = mkmaptypestandard; _mapview.pitchenabled = no; _mapview.rotateenabled = no; _mapview.showszoomcontrols = yes; _mapview.scrollenabled = yes; _mapview.zoomenabled = yes; _mapview.showsbuildings = yes; _mapview.delegate = self; [self addsubview:_mapview]; has else seen or have ideas might going on, or if missing something? i'm hoping not os x mkmapview bug. **** up...

html - Http Request. How to get png name? Spring Boot -

i've web app. have png file in /src/main/resources/static/images/head.png . i want http request obtain png file ( localhost:8080/images/head.png ). responseentity<byte[]> entity = new testresttemplate().getforentity("http://localhost/images/head.png", byte[].class); and want know name of png file. im trying code, doesn't work. for example, using entity.getheaders().tostring() obtain: server=[apache-coyote/1.1], last-modified=[mon, 28 sep 2015 22:03:31 gmt], content-type=[image/png;charset=utf-8], content-length=[442526], date=[tue, 29 sep 2015 21:02:11 gmt] but there no information of name file. how can name file? can check code here . thanks you cannot filename unless pass through additional parameter or header in original upload. http not know or care filesystems , associated them.

c++ - How can I properly release a ID3D11ShaderResourceView** to avoid memory leaks? -

i have private member of class. id3d11shaderresourceview** texture_pool; i set null in class constructor this: texture_pool = null; then initialize in class initialization: texture_pool = new id3d11shaderresourceview*[texture_count]; (int n = 0; n < texture_count; n++) texture_pool[n] = null; and in class destructor release this: for (int n = 0; n < texture_count; n++) safe_release(texture_pool[n]); safe_delete_array(texture_pool); but program crashes when exit , debbuger point @ line cause of crash: for (int n = 0; n < texture_count; n++) safe_release(texture_pool[n]); if remove line works smooth, i'm worried possible memory leaks if dont release array. so, can remove line , cleaned porperly? these defined lines release , delete instructions: #define safe_release(p) { if ( (p) ) { (p)->release(); (p) = 0; } } #define safe_delete(a) if( (a) != null ) delete (a); (a) = null; #define safe_delete_array(a) if( (a) != null ) delete[] (a); (a) = ...

javascript - Parse multipart file with Node/Express and upload to Azure Blob Storage -

i receiving multipart file via rest service call vendors api. file includes xml data , blob data 2 images. need able split , store these individual files using node/express. have seen lot posts/resources on multipart form data, needs parsing using javascript individual files can uploaded azure blob storage. suspect node/express or node module such request ( https://github.com/request/request ) right way go, haven't found concrete. here example of multipart file. note there not filename multipart file: mime-version:1.0 content-type:multipart/mixed; boundary="----=_part_4_153315749.1440434094461" ------=_part_4_153315749.1440434094461 content-type: application/octet-stream; name=texture_1.png content-id: response-1 content-disposition: attachment; filename=texture_1.png ‰png "blob data here" ------=_part_4_153315749.1440434094461 content-type: application/octet-stream; name=manifest.xml content-id: response-2 content-disposition: attachment; filename=man...

optimization - Why doesn't my C++ compiler optimize these memory writes away? -

i created program. nothing of interest use processing power. looking @ output objdump -d , can see 3 rand calls , corresponding mov instructions near end when compiling o3 . why doesn't compiler realize memory isn't going used , replace bottom half while(1){} ? i'm using gcc , i'm interested in required standard. /* * create program nothing except slow down computer. */ #include <cstdlib> #include <unistd.h> int getrand(int max) { return rand() % max; } int main() { (int thread = 0; thread < 5; thread++) { fork(); } int len = 1000; int *garbage = (int*)malloc(sizeof(int)*len); (int x = 0; x < len; x++) { garbage[x] = x; } while (true) { garbage[getrand(len)] = garbage[getrand(len)] - garbage[getrand(len)]; } } because gcc isn't smart enough perform optimization on dynamically allocated memory. however, if change garbage to local array instead, gcc compiles loop this: .l4: call rand ...

ios - How to make a drop down menu in Swift -

Image
this question has answer here: making drop down list using swift? [closed] 5 answers my idea that, in order provide user different options choose interesting include type of iboutlet drop down menu on it. this how should seen. how best way this? suggestion appreciated. presuming down arrow button trigger drop-down you've illustrated, first suggestion comes mind create ibaction button presents table view child view controller. table view list out "different options".

Quill JS - unsure how to properly set initial toolbar options -

my understanding of quill js pretty limited @ moment, , can't find documentation on over quill site/github page, hope may able set me straight. when creating quill toolbar, it's possible set 'selected' attribute of toolbar's select elements, , setting used default value when entering new line. <select title="size" class="ql-size"> <option value="10px">small</option> <option value="13px">normal</option> <option value="18px">large</option> <option value="32px" selected>huge</option> </select> while default value displayed in toolbar, corresponding value not applied line. please see following js fiddle the 'default' font monospace , size 'huge'. however, if type editor, not applied, unless re-select these values toolbar dropdowns. is expected should apply css rules editor match 'default' v...

ruby on rails - How to get a timeline of posts of only people someone follows -

i'm trying instagram can see images of people follow. user can follow user , create new posts. this have following , unfollowing in users controller. def following @user = user.find(params[:id]) current_user.mark_as_following @user respond_to |format| format.html {redirect_to @user} format.js end end def unfollow @user = user.find(params[:id]) @user.unmark :following, :by => current_user respond_to |format| format.html {redirect_to @user} format.js end end here my posts controller class postscontroller < applicationcontroller load_and_authorize_resource def show @post = post.find(params[:id]) end def new @post = post.new end def create @post.user_id = current_user.id if @post.save redirect_to @post else render :new end end def edit @post = post.find(params[:id]) end def update @post = post.find(params[:id]) if @post...

python - Counter through embedded if statements inside for loop -

so, have script in python (2.7) makes list of 1000000 numbers between 1 , 5000 , runs loop on entire list checking each element against multiple embedded if statments. ex: i = 0 number in random_list: += 1 if random_list[number] <= 3000: += 1 if random_list[number] <= 300: += 1 if random_list[number] <= 30: += 1 if random_list [number] <= 3: += 1 break print the whole point being want see how many "checks" occur on entire list. unfortunately value less total number of elements in list should not case since each element should checked @ least once. i'm getting in range of 1000's 10000's. i'm sure there's more pythonic way of doing this, advice on how achieve i'm trying appreciated. extra = 0 values = (random_list[number] i,number in enumerate(my_numbers)) v in values: += sum(v < x x in [300...

xml - Adding Attribute to Root Element of Output -

so need add 4 attributes root element (<weather>) of xml output creating using xslt. 4 elements details of weather station data obtained from. contained within stations.xml file , has structure follows: <stations> <station> <site>81123</site> <name>bendigo airport</name> <latitude>36.74</latitude> <longitude>144.33</longitude> <state>vic</state> </station> <station> <site>81124</site> <name>yarrawonga</name> <latitude>36.03</latitude> <longitude>146.03</longitude> <state>vic</state> </station> </stations> an xpath tester tells me following correct predicate obtain required station node. ./stations/station[site=81123] i've tried matching think i've lost way here. if can offer assistance great. code have far below: <xsl:sty...

I need to return QHash value from a function, I test this code in Qt where is the error -

class datainputsetting { public: // constructor datainputsetting(); qhash<qstring,qstring> inputdata; inputdata load(const std::string &file); void save(const inputdata &inputdata, const std::string &file); }; i declare class in following way: class datainputsetting { public: // constructor datainputsetting(); qhash<qstring, qstring> inputdata; // function returns hash. qhash<qstring, qstring> load(const std::string &file); void save(const inputdata &inputdata, const std::string &file); }; the problem make load() function return concrete variable (class member). c++ syntax assumes, have declare type function returns, , not variable name.

asp.net - Consuming a WSDL WebService from a DLL in C# using Visual Studio 2012 -

Image
is there way make possible? i have created simple wsdl web service 1 method, have tested , working. now creating dll , i'm adding web reference, when try use on code following error: the "name of webservice" not exist in current context other weird thing looks web service files not loading , don't see else web service folder (announcement service) checking on folder have 3 files: .wsdl file, reference.cs file , .map file i don't see other .xsd , .disco files. am doing wrong, or different add web service dll normal asp.net application ? thank as fyi finding question via google, did, page reference: https://www.sitepoint.com/net-web-services-5-steps/ you can skip part 1, since won’t need create web service. (they built method accepts string , inserts sql query , returns datatable – pretty common web service method) part 2: create proxy class append ?wsdl web services url, i.e. http://localhost/suppliers.asmx ?wsdl ...

c - Trying to use command line ls -l argument as scanf input -

i'm trying parse through ls -l output check file permission , size. seems scanf() function not take in after space. there trick or workaround this? i'd stick using scanf if it's not possible i'm open suggestions. when run program below , print test2 "total" gets stored. <#include stdio.h> int main(int argc, char **argv){ char test[200]; char test2[200]; scanf("%c\n", test); for(int = 0; < 9 ; i++){ if(test[i] != '\n'){ test2[i] = test[i]; } } (int = 0; < 9; i++){ printf("%c\n", test2[i]); } return 0; } thanks. there way check if file or directory using ls -l? however seems scanf() function not take in after space. ... scanf("%c\n", test); it not scanf() , format used. scanf("%c\n", test); scans 1 char test (test not null character terminated) , scans , tosses white-space. continues until non-white-space found. more want scanf(" %199[^\n]"...

php - Selection of a random AND 'published' row from table in mysql -

i've read many answers question none seem answer in scenario when need pick 1 random row in db of articles, wordpress db, in wp_posts, have both revisions, trashed , published articles. previous answers seems return blank result if id random , post not published in code select * wp_posts w join (select (rand() * (select max(id) wp_posts)) id) r2 w.id >= r2.id , w.post_status = 'publish' order w.id asc limit 1 just use select * wp_posts post_status = 'publish' order rand() limit 1 to random record being published.

Programmatic access to Visio shape tooltip -

to avoid xy problem , here's i'm trying accomplish: when shape selected, want detail text shape appear on screen. i first tried using shape data, supports single-line name=value pairs. detail information arbitrary, multiline text blob. my next thought used shape's screentip (aka tooltip) hold text data, write vba code handle _selectionchanged event. when shape selected want copy it's screentip text text of object (my details panel). i got _selectionchange event-handling working, poking around selection object in debugger can't find property of selected object exposes screentip information. is visio's programming api anemic support kind of thing? there way might able this? there tool might better (preferably free)? visio's api capable of doing this, handily. it seems you're not aware of visio's shapesheet, screen tip text stored, along pretty you'd want know shape. to access screen tip text read comment cell selected shap...

How do you split a string in Python with multiple delimiters? -

for example, want split "hello>>>world!!!!2]]splitting" ["hello", "world","2","splitting"] . doesn't need ^that^, want split string multiple (say 5) delimiters. thanks. edit: want keep delimiter, making ["hello", ">>>", "world", "!!!!", "2", "]]", "splitting"] here's i've tried: >>> string = "hello>>>world!!!!2]]splitting" >>> import re >>> re.split("(\w)>>>|!!!!|]]", string) ['hello>>>world', none, '2', none, 'splitting'] (i'm new @ regex) to using re.split can do: re.split(r'(>+|!+|]+)', string) explaining briefly: you split on 1 or more occurrences of different delimiters ( > , ! , ] ). in order include delimiters in result, put pattern in capturing group putting parens around it.

Selenium: How to assign a variable part of a string using xpath and regex? -

i'm trying assign 6-digit sequence lays in <pre> -node variable using "store" command xpath , regex, wrong approach. sample text <pre> : "operacia, kod podtverzdenia 021477" command: store(//table[@id='sms_table']/tbody/tr/td/pre[matches(text(),'[0-9]{6}')], foo) first thing note, should using storetext, not store. store record put in target field, won't locator on page. also, way you've done regex ([0-9]{6}) won't give you'd need. digit 0-9 followed 6 more digits. i've had pretty same thing, way did separated out 2 commands, rather trying process in 1 go. first command, store full thing, second command, regex pull out 6 digits. below <tr> <td>storetext</td> <td>//table[@id='sms_table']/tbody/tr/td/pre</td> <td>text</td> </tr> <tr> <td>storeeval</td> <td>storedvars['text'].match(/\d{6...

java - Eclipse throw NullPointerException when running JUnit test -

the version of jdk 7.0 . version of eclipse eclipse-jee-mars-r-win32-x86_64 . version of junit 4.4. my code follows: package nn; import org.junit.test; public class ofin { @test public void show(){ system.out.println("cx"); } @test public void show2(){ system.out.println("cx2"); } } my question when select name of method (for example select show ) , run junit test, eclipse throws nullpointerexception . however, when select name of method and brackets (for example selecting show() ) ok, can see result on console. why? my code simple can't have syntactic error. use older version of eclipse, versions in years after 2014 have problem. i search , find may version of junit causes problem.then,i try it. abandon add external junit jar(the version 4.4) , write @test in text editing area,then use alt + / let ide add junit4 library,after this,everthing ok. it...

c# - Dapper How to Handle DBNull by DynamicParameter.Get -

var param = new dynamicparameters(); param.add("msgid", dbtype.int32, direction: parameterdirection.output); connection.execute(messageseloutmessageid, param, commandtype: commandtype.storedprocedure); count = param.get<int>("msgid"); by reference dapper, using code above call stored procedure output parameter - msgid. working fine in cases, there no value found stored procedure , returned output parameter value null. in these cases exception error below : attempting cast dbnull non nullable type! note out/return parameters not have updated values until data stream completes (after 'foreach' query(..., buffered: false), or after gridreader has been disposed querymultiple) understood mark return data type nullable avoid error code below count = param.get<int?>("msgid"); but there other way check param.get("msgid") == null instead of using nullable data type - int? thanks paulius, tried dynamic datat...

New to lisp, compiler telling me this is a bad lambda -

i new lisp , have little experience lambda expressions @ point in college career. homework exercise problem states: write lisp function countallnumbers counts number of numeric atoms in list, no matter how nested are. example: (countallnumbers ‘(1 2 (3 b 4 (5 6)))) returns value 6 i using lispworks compile code , have been getting error: badly formed lambda: (numberp (car list) (+ 1 (countallnumbers (cdr list)))) here code: (defun countallnumbers(list) (if (eql list nil) nil (let ((elem (car list)) (restlist (cdr list))) (if (listp elem) (append (countallnumbers elem) (countallnumbers restlist)) (append (cons elem nil) (countallnumbers restlist))) ((numberp (car list) (+ 1 (countallnumbers (cdr list)))))))) (write (countallnumbers '(1 2 3 b (4 c)))) so far have tested , got work line starts calling numberp. figured easiest deal if input converted list of atoms, no nesting. making making sense of ap...

ios - iAd uses IDFA but doesn't support functionality Rejection Issue -

i have completed app uses iad banner ads apple. when submitted it, rejected using advertising identifier not including ad functionality. update app, , don't think code wrong because code use in 1 of apps has ads. please on means , how fix it. don't want submit , rejected again.

decompiling - Android decomplie strange problems -

Image
i have catch strange problem android decomplie. research, decomplie android apk apktool , dex2jar , every thing seems ok, when use jd-gui open decomplied .jar file, cannot found android activity class file in it, interested saw androidmanifest.xml file has wrote activity path in it, , promise cannot found these classes file path, what's wrong it? , how can it? --[updated]-- found not activity class file not exists, custom widget class file too, saw layout xml has used custom widget, cannot found them real file. there in way can hide class file prevent others decompile? disassembling .dex file contains java source code. file commonly classes.dex , multi dex applications can exist anywhere in classes#.dex # number >= 1 . you not find androidmanifest.xml , various layout files in .dex file. these located elsewhere ( resources.arsc , androidmanifest.xml , res/ ) , decoded human-readable form apktool. additionally, can't hide anything. if appli...

java - Arrays are null. Not getting information from while loop -

the following snippet of code supposed read text file, check how many words in file, , how many lines there are, , information it's supports sort nth word it's appropriate array. protected static void loadaccountinformationfromfile() throws exception { // these variables control logic needed put words in right array int accountnumbercount = 1; int firstnamecount = 2; int lastnamecount = 3; int balancecount = 4; int lastvariablecount = 5; int sortcount = 1; scanner account = new scanner(new file(input_account_file)).usedelimiter(","); // using word count nth value later int wordcount = 0; while(account.hasnext()) { account.next(); wordcount++; } // if count 0 means account list empty if (wordcount == 0) { system.err.println("error: account list empty."); system.exit(1);...

java - error: cannot assign a value to final variable (int) -

ok i'm sure simple, i'm having issues , mind blank. =( know 'final' makes variable can't change that's pretty can figure out right now. , code... if take out 'final' error comes "error: missing return statement }" first 2 methods. edit: thank help, surprising how fast got help! took out 'final' , added 'void' first 2 methods. i'm sure it'll take time understand everything, helps. there part 2 , here part have no clue on do... second part have test first program. supposed make separate file same code? if can great, if not thats fine i'll work on later. you declare function public static int removeonefromroom (int number) { totalnumber = totalnumber-number; } the emphasis here public static int, telling compiler function supposed return integer. not return in function body, compiler complains rightfully. either return something, or declare return value void.

Why do I get a different SHA1 hash between Powershell and 32bit-Python on a system DLL? -

i'm trying calculate sha1 hash values in python against binary files later comparison. make sure things working, used several methods check validity of result. and, i'm glad did. powershell , python return different values. 7zip's sha1 function agrees powershell's results , microsoft's fciv agrees python's results. python: import hashlib open("c:\\windows\\system32\\wbem\\wmiutils.dll", "rb") f: print(hashlib.sha1(f.read()).hexdigest()) powershell: ps c:\> get-filehash c:\windows\system32\wbem\wmiutils.dll -algorithm sha1 results: python: d25f5b57d3265843ed3a0e7b6681462e048b29a9 powershell: b8c757ba70f6b145ad191a1b09c225fba2bd55fb edit: 32-bit python , 64-bit powershell against system32 dll. problem. have homework basically, 32-bit , 64-bit applications receive different file , thus, different hash results. launched 64-bit python , ran exact same code against dll , 64-bit powershell process. received consi...

android - How to include a library module multiple times into multiple library modules in the same app project? -

i have project structure as: - app module - multiple library modules.. - ... - common library module (commonlib) consumed library modules above^ (has realm (compile 'io.realm:realm-android:0.82.2') included dependency) now commonlib included dependency in many modules , when tried run project got multiple dex files found error: :app:predexdebug up-to-date :app:dexdebug unexpected top-level exception: com.android.dex.dexexception: multiple dex files define lio/realm/defaultrealmmodule; @ com.android.dx.merge.dexmerger.readsortabletypes(dexmerger.java:596) @ com.android.dx.merge.dexmerger.getsortedtypes(dexmerger.java:554) @ com.android.dx.merge.dexmerger.mergeclassdefs(dexmerger.java:535) @ com.android.dx.merge.dexmerger.mergedexes(dexmerger.java:171) @ com.android.dx.merge.dexmerger.merge(dexmerger.java:189) @ com.android.dx.command.dexer.main.mergelibrarydexbuffers(main.java:454) @ com.android.dx.command.dexer.main.runmonodex(main.java:3...

Javascript for "Paste" in RadComboBox "OnClientKeyPressing" event -

in onclientkeypressing event of radcombobox , checking if entered text inside radcombobox greater 5 characters, enable asp:button , if not disable asp:button . both radcombobox , asp:button inside radgrid . this works perfetcly if type in 5 or 5+ characters manually, not if paste 5 or 5+ characters inside radcombobox , if paste asp:button remains disable. reason is: when paste in radcombobox , onclientkeypressing event raise , since key(ctrl+v) pressed 1 time, length of text 0 , per condition (if length < 3, disable button) remains disable. please note length starts 0 not 1. i know reason dont know how make detect whole text-length after paste in radcombobox below javascript till now: <telerik:radcodeblock id="rcb" runat="server"> <script type="text/javascript"> function handlekeypress(sender, eventargs) { var len = sender.get_text().length; var comboid = sen...

angularjs - can not retrieve property of object from an objectID passed by html form -

i using mean stack (mongo/mongoose, ember, angular, node). the database includes 2 schemas var childschema = new schema({ childname: { type: string, required: true, trim: true } }); var parentschema = new schema({ parentname: { type: string, required: true, trim: true }, child: { type: schema.objectid, ref: 'child' } }); mongoose.model('parent', parentschema); mongoose.model('child', childschema); there html form allows user create new parent , form has select box populated children stored in database , retrieved findchildren() function. the html here: <section data-ng-controller="parentcontroller" data-ng-init="findchildren()" > <form name="parentform" class="form-horizontal col-md-6" role="form" data-ng-submit="create(parentform.$valid)" novalidate> <div class="for...

How Can I Generate Super Dynamic Random Numbers In Lua Corona SDK? -

i need generate random number dynamically changes every seconds. what this: local function numbergenerator() print("random number:", math.random(80000, 180000) ) timer.performwithdelay( 1000, numbergenerator ) end numbergenerator()

php - Browser hangs and crashes when using a while loop -

i executing 2 queries , evaluating following conditions each record: if $production_query->row->0 equal $jobcard_query->row->0 if $production_query->row->1 equal $jobcard_query->row->1 when true, should display results of $production_query . however, when using while statement, browser takes long time respond , crashes. can suggest solution? my code: $query = " select job_card_num , die_qty,id sample_jobcard order id desc” $production_query = mysql_query($query,$connection1); $query1 = "select job_card_num , die_qty,id com_jobcard order id desc "; $jobcard_query = mysql_query($query1,$connection1); while ($row = mysql_fetch_array($production_query)) { while( $row1 = mysql_fetch_array($jobcard_query)) { while (($row1[0] == $row[0]) && ($row1[1] == $row[1])) { echo $row[0] . $row[1]. $row[2]'<br>'; } } } try changing query this: $query = "sel...

security - git-like history derived database -

i designing highly sensitive software based on rdbms 1 thing bothers me data being compromised through unintentional/malicious acts. hence traceback changes identify origin of changes pin-point such activity. believe useful maintain transaction history in such way such activities can discovered, , restore database last uncompromised state, , still having list of later transactions can committed selectively. , having git-like feature identifying tampering useful. i wondering if there particular algorithms/methods/databases (or software) available these features. if not general approach in realizing these goals.

ruby Elegantly wrap an array of items each into an object -

given: class thing def initialize(object) @object = object end end items = [1,2,3] i'd know of more elegant way convert each item thing this: items.map{ |item| thing.new item } # => [<thing @object=1>, <thing @object=2>, <thing @object=3>] you can use unary prefix & operator: items.map(&thing.method(:new)) i have suggested class es should behave factory functions , allow write this: items.map(&thing) however, there doesn't seem interest in proposal. can monkey-patch yourself, though, implementation trivial: class class def to_proc method(:new).to_proc end end

javascript - Array of Inputs are passing as null in Angularjs -

i've form in i'm displaying values db through webapi. 1 of control having array of values. i've scenario user can edit , save it(put function). controller : $scope.put= function () { $scope.item1 = []; $scope.item1 = $scope.cast.split(','); var movie1 = { _movieid: $scope.movid, _title: $scope.movtitle, _releasedate: $scope.movdate, _rating: $scope.movrate, _cast: $scope.item1 }; var result-= myservice.update($scope.movid, movie1); result.then(function (pl) { $scope.message = "updated successfuly"; } html : <input type="text" ng-model="movid" class="spacebox" size="30" /> <br /> <input type="text" ng-model="movtitle" class="spacebox" size="30" /> <input type="text" ng-model="cast" class="space...

How to send email with non-english sender ID in Java? -

i want send email non-english email id डेमो@डेमो.कॉम email id using java. when use : string = "demo@gmail.com"; string = "डेमो@डेमो.कॉम"; string host = "localhost"; properties properties = system.getproperties(); properties.setproperty("mail.smtp.host", host); session session = session.getdefaultinstance(properties); try{ // create default mimemessage object. mimemessage message = new mimemessage(session); message.setfrom(new internetaddress(from)); message.addrecipient(message.recipienttype.to, new internetaddress(to)); message.setsubject("this subject line!"); // set actual message message.settext("this actual message"); transport.send(message); system.out.println("sent message successfully...."); }catch (messagingexception mex) { mex...

java - How to end transactions in progress properly and to close the database in Android? -

i develop simple application in android. execute time stopped unfortunately , throw error these a sqliteconnection object database '/data/data/com.h2o/databases/mydbname.db' leaked! please fix application end transactions in progress , close database when no longer needed. what avoid above error here db code: public class dbhelper extends sqliteopenhelper { public static final string database_name = "mydbname.db"; public static final string address_table_name = "address"; public static final string address_column_id = "id"; public static final string address_column_addresstype = "addrtype"; public static final string address_column_line1 = "line1"; public static final string address_column_line2 = "line2"; public static final string address_column_city = "city"; public static final string address_column_zipcode = "zipcode"; public static final stri...

java - Need some help for deeplearning4j single RBM usage -

i have bunch of sensors , want reconstruct input. so want this: after have trained model pass in feature matrix get reconstructed feature matrix back i want investigate sensor values different reconstructed value therefore thought rbm right choice , since used java, have tried use deeplearning4j. got stuck early. if run following code, facing 2 problems. the result far away correct prediction, of them [1.00,1.00,1.00]. i expect 4 values (which number of inputs expected reconstructed) so have tune a) better result , b) reconstructed inputs back? public static void main(string[] args) { // customizing params nd4j.max_slices_to_print = -1; nd4j.max_elements_per_slice = -1; nd4j.enforce_numerical_stability = true; final int numrows = 4; final int numcolumns = 1; int outputnum = 3; int numsamples = 150; int batchsize = 150; int iterations = 100; int seed = 123; int listenerfreq = iterations/5; datasetiterator iter =...

visual studio 2013 - Less Missing closing } -

i have following code , code in less file. @iterations: 100; .width-loop (@i) when (@i > -1) { (~".w@{i}") { width: ~"@{i}% !important"; } .width-loop(@i - 1); } .width-loop(@iterations); the result this. .w100 {width 100% !important; } .w99 {width 99% !important; } ...... etc however, when build project, error pops in error window. less: missing closing '}' where missing }? error window popping distracting. when view output in browser, style classes list correctly. you calling function wrong. this: @iterations: 100; .width-loop (@i) when (@i > -1) { .w@{i} { width: ~"@{i}% !important"; } .width-loop(@i - 1); } .width-loop(@iterations);

Haskell: Create a list of tuples from a tuple with a static element and a list -

need create list of tuples tuple static element , list. such as: (int, [string]) -> [(int, string)] feel should simple map call having trouble getting output tuple zip need list input, not constant. i think direct , easy understand solution (you seem acquainted map anyway): f :: (int, [string]) -> [(int, string)] f (i, xs) = map (\x -> (i, x)) xs (which happens desugared version of [(i, x) | x < xs] , landei proposed) then prelude> f (3, ["a", "b", "c"]) [(3,"a"),(3,"b"),(3,"c")] this solution uses pattern matching "unpack" tuple argument, first tuple element i , second element xs . simple map on elements of xs convert each element x tuple (i, x) , think you're after. without pattern matching more verbose: f pair = let = fst pair -- first element xs = snd pair -- second element in map (\x -> (i, x)) xs furthermore: the algorit...

json - Calabash-ios: Run test physical device installed ipa without xcodeproj -

i new calabash-ios , have dummy question is: how possibly run calabash test real device have installed ipa file (included calabash framework) , without xcodeproj? problem doing qa , dev gives me ipa file test without source code. update: able run ipa file in console , cucumber adding bundle_id. , make sure cfnetwork.framework including in app framework establish connection. but got problem run scenario: 1. when run command below: device_endpoint=http://192.168.1.9:37265 no_launch=1 bundle_id=com.example.appname device_target=udid cucumber then got error: json text must @ least contain 2 octets! (json::parsererror) features/my_first.feature:8:in `then touch "log-in/ create account"' all other steps skipped then run console code device_endpoint=http://192.168.1.9:37265 no_launch=1 bundle_id=com.example.appname device_target=udid calabash-ios console then run server_version got reply said connection succeed when run start_test_server_in_backgr...

javascript - Is this Cross-Site Scripting: DOM in dhtmlHistory.js -

i'm newbie js. in 1 of project i'm working depend on dhtmlhistory.js . understand js library use track history , bookmarking related functionalities in ie. , library seems dead too. when fortify security scan there exist vulnerabilities. e.g. var initialhash = this.getcurrentlocation(); if (this.isinternetexplorer()) { document.write("<iframe style='border: 0px; width: 1px; " + "height: 1px; position: absolute; bottom: 0px; " + "right: 0px; visibility: visible;' " + "name='dhtmlhistoryframe' id='dhtmlhistoryframe' " + "src='blank.html?" + initialhash + "'>" + "</iframe>"); // wait 400 milliseconds between history // updates on ie, versus 200 on firefox this.wait_time = 400...

php - Laravel 5.1 get variable from pretty URL to Request object -

i have controller method in laravel 5.1 takes both , post requests. there variables have pass in method. so i'd pass variable in this: http://localhost/<methodname>/<var1 value>/<var2 value> i'd laravel's request object populated variables. of course can do: http://localhost/<methodname>?var1=var1_value&var2=var2_value but i'd keep pretty url mentioned before , still able populate request object. public function methodname(request $request) { dd($request); } this return empty array. yes, can like: public function methodname(request $request, $var1= "", $var2 = "") { dd($var1." ".$var2); } this return variables i'd have request object populated if possible. the route i'm using is: route::match(['get', 'post'], '/<method-name>/{<var1_value>?}/{<var2_value>?}/{<var3_value>?}', '<controllername>@<methodname...

java - Hibernate : Resultset mapping in to Map<EntityTypeId,List<EntitiyIds>> -

we have table contains data below id entity_type_id entity_id 1 1 1234 2 1 2356 3 1 7896 4 1 4321 5 2 1234 6 2 9876 7 2 5289 8 2 4568 and wrote query follow data. how can modify query return list of entitiyids value , entitytypeid key. <query name="getallentities"> <![cdata[ select e.entity_type_id, e.entity_id entity e ]]> </query> something below <query name="getallentities"> <![cdata[ select new map(e.entity_type_id et_id, e.entity_id e_id) entity e ]]> </query> refer this more details

highcharts - How to add border in polygon plot? -

i plotting polygon series using highcharts cannot add border it. tried use plotoptions.series.borderwidth no effect. code: $(function () { $('#container').highcharts({ title: { text: 'height vs weight' }, subtitle: { text: 'polygon series in highcharts' }, xaxis: { gridlinewidth: 1, title: { enabled: true, text: 'height (cm)' }, startontick: true, endontick: true, showlastlabel: true }, yaxis: { title: { text: 'weight (kg)' } }, legend: { layout: 'vertical', align: 'right', verticalalign: 'middle' }, series: [{ name: 'target', type: 'polygon', data: [[153, 42], [149, 46]...