Posts

Showing posts from June, 2010

android - Sending email with Mailgun - a message body writer for Java type FormDataMultiPart and MIME media type application/x-www-form-urlencoded was not found -

i attempting send email android app using mailgun , jersey. problem when post request response, app crashes error: a message body writer java type, class com.sun.jersey.multipart.formdatamultipart, , mime media type, application/x-www-form-urlencoded, not found . not sure why case. researching suggested add multipart class when creating client, did not work either. note in email plain text, need send email in app may contain attachments - 0 or more images. java class: import com.sun.jersey.api.client.client; import com.sun.jersey.api.client.clientresponse; import com.sun.jersey.api.client.webresource; import com.sun.jersey.api.client.config.clientconfig; import com.sun.jersey.api.client.config.defaultclientconfig; import com.sun.jersey.api.client.filter.httpbasicauthfilter; import com.sun.jersey.multipart.formdatamultipart; import com.sun.jersey.multipart.impl.multipartwriter; import javax.ws.rs.core.mediatype; import javax.ws.rs.core.response; clientconfig cc = new defaultcli

reactjs - React TestUtils, how can I simulate document mouseMove? -

i want use testutils.simulate.mousemove on document . have component dragger adds mousemove event listener document . here incomplete version: // dragger.js 'use strict'; var react = require('react'); export default react.createclass({ proptypes: { handledrag: react.proptypes.func // callback set parent }, getinitialstate: function() { return {dragging: false} }, componentdidupdate: function(props, state) { // if (this.state.dragging && !state.dragging) { document.addeventlistener('mousemove', this.onmousemove) } else if (!this.state.dragging && state.dragging) { document.removeeventlistener('mousemove', this.onmousemove) } }, onmousedown: function(e) { this.setstate({dragging: true}) }, onmousemove: function(e) { // calls parent drag this.props.handledrag(e); }, render: function() {

c# - Searching a domain for workstation specific user is logged in -

i trying write little application search domain workstation user logged in on , return host name/ip of workstation. so far have username stored in string. i using vs express desktop not have access lot of references web. i pretty new c# should able understand things. thanks! prototype: public string get_comp(string user)

ios - Attaching but not embedding image in email using MFMailComposeViewController -

i need send email image attached , not in body of email. this abbreviated version of doing. tried setting ishtml no. no matter try, image gets embedded in email, , client wants attachment. mfmailcomposeviewcontroller *mailcomposecontroller = [[mfmailcomposeviewcontroller alloc] init]; [mailcomposecontroller setsubject:subject]; [mailcomposecontroller setmessagebody:@"" ishtml:no]; [mailcomposecontroller addattachmentdata:image mimetype:@"image/png" filename:filename]; [self presentviewcontroller:mailcomposecontroller animated:yes completion:nil]; is there different way this, or depend on mail client received in?

playframework - Play 2.3, Git and IDEA: universal path to embedded database -

my problem create embedded database in project folder share git. if set explicit path like: c:/users/<user>/projects/<project> it works fine. if pulls project git, gets wrong path. idea set universal path. if try: jdbc:h2:file:./db the database created in folder /program files/idea/... if try: jdbc:h2:file:~/db the database created in folder /users/user/..., not in folder of project. is there way set universal path of project? thanks help! according h2's faq should without anything, no . or ~. store database project's folder path_to_my_project/database/mydbfile can use: jdbc:h2:database/mydbfile

ruby on rails - Passing attributes while using a partial inside another view -

i have 3 models - company, user(using devise) & donation.donation rich join between company , user using :through. have partial form creating new donation inside show view of company takes 3 attributes - company_id, user_id , amount. code form inside view follows: <%= simple_form_for @donation |f| %> <div class="row"> <div class="container"> <div class="col-sm-6"> <div class="well"> <h1 align="center" class="amounthead">donate</h1> <form class="form-inline donate-form"> <div class="form-group"> <div class="input-group"> <div class="input-group-addon">&#8377;</div> <%= f.input :amount, label: false, placeholder: 'amount in rupees' %> <div class="input-group-addon">.00</div>

vba - Object Required Error after upgrading to Office 2013 -

i have following sub copies chart passed powerpoint slide. it's used build powerpoint deck charts , data in excel spreadsheet. code worked fine in excel 2010. i've been upgraded office 2013 , i'm getting "object required" error on sr.lockaspectratio = msofalse line. sub copy_chart(ppres powerpoint.presentation, slidenumber integer, chart chartobject, top single, left single, height single, width single) dim sr powerpoint.shaperange chart.activate activechart.copypicture appearance:=xlscreen, size:=xlscreen, format:=xlpicture set sr = ppres.slides(slidenumber).shapes.paste sr.lockaspectratio = msofalse sr.top = top sr.left = left sr.height = height sr.width = width end sub apparently past method must returning array of shaperanges. i'm not sure if how it's been , office 2010 little more forgiving or not. so, correct issue, when referencing sr i've had sr(sr.count) . working code below...

python - Plot empty DataFrame -

can force empty dataframe plot? i'm filling xlim , yticks , don't see why should not possible. >>> df empty dataframe columns: [time, ch, 0] index: [] >>> df.plot(x="time", y="ch", ax=ax, ... xlim=(start, end), yticks=range(ymin, ymax+1)) ... typeerror: empty 'dataframe': no numeric data plot also tried plot using matplotlib.pyplot , ends keyerror if pass ax . >>> plt.plot() >>> plt.axes(ax) ... keyerror: <matplotlib.axes._subplots.axessubplot object @ 0x00000000060e6be0>

How to track opened file(s) in Android Studio? -

i new android studio. in visual studio, there functionality track opened files. i.e if have file named usercontrol.ascx opened in right pane, in left pane, source tree is, high-light file in solution explorer. does such functionality exist in android studio? poked around ide, , doesn't seem find it? please advise. project , file structure android project view by default, android studio displays project files in android project view. view shows flattened version of project's structure provides quick access key source files of android projects , helps work gradle-based build system. android project view: shows important source directories @ top level of module hierarchy. groups build files modules in common folder. groups manifest files each module in common folder. http://developer.android.com/tools/studio/index.html

ios - Resume download after app has been quit -

i wondering whether possible resume download after app has been terminated user or os. i can see sktdownloadmanager has methods pause , resume download. however, these methods work current sktdownloadobjecthelper s. if pull them out of sktdownloadmanager.storeddownloadobjects() after app has been quit , started again , throw them @ sktdownloadmanager.sharedinstance().resumedownloadfordownloadhelper() manager won't resume downloads. i dug little deeper code , these downloads not getting restarted because of lack of proper status. sktgroupeddownloadoperation.m:87 : if (self.currentrunninggroupedoperation.statedownloaditem >= sktmapdownloaditemstatusdownloading) { return no; //cannot start download,isntall, finsihed } so, questions whether possible resume downloads after app has been terminated , if how do it. appreciated :) for resuming download, should trigger event in application: didfinishlaunching or after application restarted: [[skdownloadman

Duplicate Columns in TSQL Pivot -

i have set of raw data stored in database looks following: reportdate server avgavail outageid 6/4/2015 cpu1 0.9797 11111111 6/4/2015 cpu2 0.9999 null 6/4/2015 cpu3 0.9999 null 6/4/2015 cpu4 0.9999 null 6/5/2015 cpu1 0.9999 null 6/5/2015 cpu2 0.9999 null 6/5/2015 cpu3 0.9887 22222222 6/5/2015 cpu4 0.9999 null 6/6/2015 cpu1 0.9999 null 6/6/2015 cpu2 0.9999 null 6/6/2015 cpu3 0.9999 null 6/6/2015 cpu4 0.9999 null 6/6/2015 cpu5 0.9999 null i use tsql dynamic sql generate table because report dates can chosen via date picker. output following: server outageid 6/4/2015 outageid 6/5/2015 outageid 6/6/2015 cpu1 11111111 0.9797 null 0.9999 null 0.9999 cpu2 null 0.9999 22222222 0.9887 null 0.9999 cpu3 null 0.9999 null 0.9999 null 0.9999 cpu4 null 0.9999 null 0.

regex - How can I read this string in Java? -

i have string such this: "xxxxxxx , yyyyyyy - zzzzzz" , happens "xxxxxxx - zzzzzz" length of x may vary. want get, x word. there easy way this? what thought was: iterate through string, append stringbuilder every char read until read ",", break iteration , word, looks pretty messy. so maybe there easier way this. here several ways first character: string str = "x , y - zzzzzz"; system.out.println(str.charat(0)); system.out.println(str.substring(0, 1)); system.out.println(str.replaceall("^(.).*", "$1")); see ideone demo choose 1 more :) update : to find first word, may use following regex pattern: string pattern = "[\\s\\p{p}]+"; \s stands whitespace, , \p{p} stands punctuation. you can use split in string str = "xxxxxxx , yyyyyyy - zzzzzz"; system.out.println(str.split(pattern)[0]); str = "xxxxxxx - zzzzzz"; system.out.println(str.split(pattern)[0]); str = &qu

angular - How do i get ng-if to reiterate the array? -

i have element *ng-for on. renders data (an array of objects) perfectly. if add element, see new data in view. <div *ng-for="#item of items" [attr.bob]="item.bob" /> if modify item in list of items, need reflected in view it's not. how can make happen? ok triggering full rendering of whole array - , can adding/removing element - best practice here? perhaps there method 'dirty' #item ? edit: changed code original version couldn't work, because version posted worked, nullifying question. i'm still curious if can force re-iteration manually though i'm leaving question up. in case here looking solution, did make dependent on property directly (index) instead of nested inside object in array. no need of re-iterations actually. attribute binded element of array , change respectively. change of array displayed automatically. function randomcolorhex(){ return '#'+math.floor(math.random()*16777215).tostring(16);

java - How to refer to a variable with method scope from a different method called from method in which variable is declared? -

suppose if have code - public class rectangle { int length, breadth; // used else different purpose/calculations public int area(int length, int breadth) { int result = length*breadth; resetvalues(); return result; } public void resetvalues() { length = ""; breadth = ""; } so, in above code, since calling resetvalues method area, length , breadth variables defined in area method referred/changed in resetvalues method rather ones declared in class level. how achieve this? how can make resetvalues method refer variables declared in area method when called method? the variables in area() local or method scoped. cannot accessed outside method. understanding of variable scopes you can reset variable inside area method directly , not affect class variables: public int area(int length, int breadth) { int result = length*breadth; length = 0; breadth = 0; return result; } here reference gives clear descriptions: http://www.java-made-easy.com

c# - Trying JQuery-UI to create modal in MVC project -

i'm using mvc 5/c#. i'm trying follow example found here: jquery-ui in mvc5 has me add jquery-ui nuget, did. here have in index.cshtml: <div> <input type="button" value="get form" onclick="getform()" /> </div> <script type="text/javascript"> function getform() { $('#dialog').dialog({ autoopen: true, width: 400, resizable: false, title: 'register', modal: true, open: function (event, ui) { $(this).load('@url.action("register", "registration")'); }, buttons: { "close": function () { $(this).dialog("close"); } } }); }</script> <div id="dialog"></div> here in _layout.cshmtl file: @styles.render("~/bundle

Wordpress/PHP Warning, Creating default object, Can't access Admin Panel Fatal Error -

this new me. wordpress website throwing error... [25-jun-2015 11:28:24 utc] php warning: creating default object empty value in /.../public_html/chrismarsh.us/wp-content/themes/standardtheme_272/admin/functions.php on line 229 and unwanted ads started showing everywhere. tried log admin panel see if plugin problem , throws error... [25-jun-2015 13:53:42 utc] php warning: creating default object empty value in /.../public_html/chrismarsh.us/wp-content/themes/standardtheme_272/admin/functions.php on line 229 [25-jun-2015 13:53:42 utc] php warning: cannot modify header information - headers sent (output started @ /.../public_html/chrismarsh.us/wp-content/themes/standardtheme_272/admin/functions.php:229) in /.../public_html/chrismarsh.us/wp-includes/pluggable.php on line 1178 can me out? website chrismarsh.us double-check wp-config.php , /wp-content/themes/standardtheme_272/functions.php make sure there no whitespace before <?php part of file. don&

How to correctly queue image manipulation in laravel with beanstalkd while uploading to Amazon S3? -

i'm doing tests laravel loading images amazon s3 , queuing image manipulation beanstalkd. please note testing. here implementation: // routes.php route::post('/', function() { $validator = validator::make(input::all(), array( 'title' => 'required', 'file' => 'required|mimes:jpeg,jpg,png', )); if( $validator->fails() ) { return redirect::to('/'); } // upload file $file = input::file('file'); $now = new datetime; $hash = md5( $file->getclientoriginalname().$now->format('y-m-d h:i:s') ); $key = $hash.'.'.$file->getclientoriginalextension(); $s3 = aws::createclient('s3'); $s3->putobject(array( 'bucket' => 'bellated', 'key' => $key, 'sourcefile' => $file->getrealpath(), 'contenttype' => $file->getcl

javascript - Cannot show a variable value on HTML -

i'm trying build dynamic html using jquery. i have checkbox desired language labels of form when apply parsehtml() variables not display info. here's code. $desiredlanguagecompany = ""; $labelcompanyuk = "company name "; $labelcompanygerman = "unternehmen "; $labelcompanyfrench = "nom de la soci&eacute;t&eacute; "; $labelcompanyitalian = "societ&agrave; "; $labelcompanydanish = "virksomhedsnavn "; $labelcompanyswedish = "not provided "; $labelcompanyfinish = "yritys "; $labelcompanynorwegian = "selskap "; $formgroupcompany = '<div class="form-group">' + '<label for="inputlastname" class="control-label">' + $desiredlanguagecompany + '<span class="required">*</span></label><input type="text" aria-required="true" required="" placeholder=&qu

rstudio - R rounds time to date -

by loading table of postgresql ( rpostgresql ) time rounds date. instead, "2015-01-28 03:04:01 cet" have "2015-01-28 cet" , class "posixct" "posixt" , not shows, "2015-01-28 00:00:00 cet" . , on local mac, r in server receives same table without problems. rather, options. can help? > command3 <- "select requested_at rides city_id != 1;" > riders3 <- dbsendquery(con, command3) > riders_total <- fetch(riders3, n = -1) > riders_total$requested_at[1] [1] "2015-04-19 cest" ##### "2015-04-19 03:04:31 cest" ! > riders_total$requested_at[1] + 1 [1] "2015-04-19 00:00:01 cest" > dput(head(riders_total, 10)) structure(list(requested_at = structure(c(1429394400, 1429653600, 1429653600, 1431468000, 1431468000, 1429394400, 1431468000, 1417993200, 1430085600, 1431468000), class = c("posixct", "posixt"), tzone = "")), .names = "reques

unending loop in java -

i have here code search of deepest pit in array i search deepest pit using formula min(a[trip] - a[triq], a[trir] - a[triq]); where trip first point, triq second , trir third. what dont not able see printing. or rather code has infinite loop. int[] = {0, 1, 3, -2, 0, 1, 0, -3, 2, 3}; int length = a.length, depth = 0, x = 0, mind; int trip = 0, triq = 0, trir = 0; while(x < length){ while(x < length){ if(x + 1 == length) break; x++; if(a[trip] > a[x]){ while(a[trip] > a[x]){ if(x + 1 == length) break; x++; } triq = x; break; } else{ trip++; if(x + 1 == length) break; x++; continue; } } while(x < length){ if(x + 1 == length) break; x++; if(a[triq] < a[x]){ while(a[triq] <

csv - Loop over files in a directory and merge them python -

i have 2 files in folder called looper: testfile.csv file2.csv i want python code loop on each file in folder , merge them single output file. far, code follows: def combine_csv_files(input_folder_path, output_path): fout = open(output_path, "a") file in sorted(os.listdir(input_folder_path)): line in open(file): fout.write(line) with getting error: ioerror: [errno 2] no such file or directory: 'file2.csv' i don't understand why. also, when merge these files, want column headers first file. want merge remaining files form second row. please help! os.listdir() returns file names, full path, use os.path.join() : full_path = os.path.join(input_folder_path, file) line in open(full_path): fout.write(line) as follow-up question skipping first line, simplest way use itertools.islice : from itertools import islice line in islice(open(full_path), 1, none): fout.write(line)

c# - Entity Framework performance problems -

i'm having problem below query taking around 700ms execute. it's in loop , gets called 100+ times it's taking forever. model: public class releasedates { public int id { get; set; } public string moviename { get; set; } public string country { get; set; } public datetime releasedate { get; set; } public string alternatesource { get; set; } } query: public async task<list<releasedates>> getreleasedatesasync(string moviename) { return await db.releasedates.where(x => x.moviename == moviename && string.isnullorempty(x.alternatesource)).tolistasync(); } any suggestions how speed up? get rid of loop. that's problem. you're sending lot of queries database. store movie names you're searching in list , contains there. public async task<list<releasedates>> getreleasedatesasync(list<string> movienames) { //movie names you're searching - movienames return await db.relea

c++ - Printing diamond of stars -

i printing diamond of stars code compiling , running printing half of diamond......anyone please help. below have mentioned code. cannot understand problem why system executing first half , not other half of diamond. #include<iostream> using namespace std; int main() { int n,i=0,j; cin>>n; while(i<=(n/2)) { j=0; while(j<(n/2)-i){ cout<<" "; j=j+1; } j=0; while(j<i+1){ cout<<"*"; j=j+1; } j=0; while(j<=i-1){ cout<<"*"; j=j+1; } cout<<"\n"; i=i+1; } while(i<=(n/2)) { j=0; while(j<(n/2)-i) { cout<<" "; j=j+1; } j=0; while(j<i) { cout<<"*"; j=j+1; } j=0; while(j<i-1){ cout<<"

html - Fullscreen bootstrap grid with different sizes -

Image
i'm trying create fullscreen bootstrap grid different heights (33.33%, 66.66% or 100%) , different widths (20%, 40%, 60%, 80%, 100%). the problem because of height difference gaps occur. http://www.bootply.com/bxenv65tq8# i found couple of solutions none of them realy working should: wrong margins, cannot fullscreen,... masonry-style layout css my result (from highest rated anwer): in way you're using can not result shown in first box. achieve need organize div columns , not rows. here's example perhaps can help

Build error using C++ Eclipse -

i configured eclipse helios c++ using mingw , msys. added same path variable. not able build using eclipse. error message below has little information : build of configuration debug project test internal builder used build g++ -ic:\mingw\lib\gcc\mingw32\4.8.1\include\c++ -o0 -g3 -wall -c -fmessage-length=0 -osrc\test.o ..\src\test.cpp build error occurred, build stopped time consumed: 220 ms. i able use make/g++ command line. thanks more logs once enabled "don't fail on error" setting : **** rebuild of configuration debug project test **** **** internal builder used build **** g++ -ic:\mingw\lib\gcc\mingw32\4.8.1\include\c++ -o0 -g3 -wall -c -fmessage-length=0 -osrc\test.o ..\src\test.cpp g++ -otest.exe src\test.o g++: error: src\test.o: no such file or directory g++: fatal error: no input files compilation terminated. build completed errors time consumed: 337 ms. try separating '-o' , filenames in 2 g++ com

How to remove White Transparent Color from top and bottom of UiPickerView row in IOS -

Image
i have 3 uipickerviews. want remove white transparent color top , bottom of each pickers row should clear , numbers should show full color. i changed height delegate method - (cgfloat)pickerview:(uipickerview *)pickerview rowheightforcomponent:(nsinteger)component and changed labels height , font size in -(uiview *)pickerview:(uipickerview *)pickerview viewforrow:(nsinteger)row forcomponent:(nsinteger)component reusingview:(uiview *)view but didnt resolve problem. please me in regard. you can image of screen below link unfortunately, can't remove shadow uipickerview . have either create own view or use custom 1 afpickerview (it's on mit license)

python - Django: Using Twitter credentials of users to fill in form data -

my application has simple form, , twitter login feature implemented using django-social-auth forms.py django import forms rango.models import evangelized class evangelizedform(forms.modelform): full_name = forms.charfield(help_text="full name") email = forms.charfield(help_text="email id") mobile_no = forms.charfield(help_text="mobile number") twitter_url = forms.charfield(help_text="twitter url") gender = forms.charfield(widget=forms.radioselect( choices=evangelized.gender_choices), help_text="gender", max_length = 128) area_of_interest = forms.charfield(max_length = 1230, widget=forms.checkboxselectmultiple( choices=evangelized.area_choices), help_text="areas of interest(upto 3)") """def clean_area_of_interest(self): if len(self.cleaned_data['area_of_interest']) > 3: rais

angularjs - I used $location.search to set paramValue, but if i select other link also it get appended to new url, how to solve it -

in angularjs used $location.search() set paramvalue in url i.e if change dropdown executesearch() called. executesearch() { $location.search('type', task); } result : index.html#/search?type=task. but if click on other link coming index.html#/help?type=task how make specific function only..if click on other link ?type=task appended. how remove paramvalues(" ? folled paramvalues ") if click on other links. <select class="search-dropdown-select" ng-change="searchbar.executesearch()" ng-model="searchbar[item.model]" ng-options="item.name item in searchbar.{{item.options}}"></select> when clicking on other link use $location.url() . clear of query parameters. function navigate(path) { $location.url(path); } <a href ng-click="navigate('/help')">help</a>

How to pack a Firefox extension from scratch -

i new firefox extensions , me pack 1 extension build , send friends test it. my extension "block" urls. means if tries join "facebook.com" extension should redirect him "www.google.com" the code below. const {classes: cc, interfaces: ci, utils: cu, results: cr} = components; cu.import('resource://gre/modules/services.jsm'); var urls_block = [ //if urls contain of these elements blocked or redirected, // choice based on code in observer line 17 'www.facebook.com', 'www.apple.com' ]; var redir_obj = { 'www.facebook.com': 'http://www.google.com/', 'www.apple.com': 'http://www.samsung.com' } var observers = { 'http-on-modify-request': { observe: function (asubject, atopic, adata) { console.info('http-on-modify-request: asubject = ' + asubject + ' | atopic = ' + atopic + ' | adata = ' + a

mysql - C++ thread attach/dettach segfaults -

i use plugin written in c++ running queries on mysql. it's used inside xojo (www.xojo.com) made application. the problem if many queries executed crashes on linux segmentation fault. the plugin works detaching calling thread before executing query in order not block main application etc , re-attaching once it's done. think re-attaching problem (gdb debugging in linux seems this) due not having symbols on xojo's framework i'm not sure. this 2 methods/functions used detaching , re-attaching void reattachcurrentthread(void *token) { static void (*pattachthread)(void*) = nullptr; if (!pattachthread) pattachthread = (void (*)(void *)) gresolver("_unsafeattachcurrentthread"); if (pattachthread) pattachthread( token ); } void * detachcurrentthread(void) { static void * (*pdetachthread)(void) = nullptr; if (!pdetachthread) pdetachthread = (void * (*)(void)) gresolver("_unsafedetachcurrentthread"); if (pdet

c++ - Displays unwanted character while converting from QDataStream to QChar -

i have code below qbytearray bla("abcde"); qdatastream ds(bla.right(bla.size()-1)); qchar c; ds>>c; qdebug()<<c; // prints '?' instead of 'b' it prints out b if change code as qint8 c; ds>>c; qdebug()<<qchar(c); // prints 'b'. it's ok single character suppose, have lot of characters need make loop , cast every single of them . please suggest approach. ds>>c; equals ds>>c.unicode(); , has type ushort & . while qbytearray contains char s. the correct way converting qbytaarray sequence of qchar be: qbytearray bla("abcde"); qtextcodec *codec = qtextcodec::codecforlocale(); const qstring string = codec->tounicode(bla); foreach (const qchar &c, string) { qdebug() << c; }

regex - Python regular expression replace string -

i have following code: a="32<2>fdssa</2>ffdsa32" re.sub(r'<(\d+)>|</(\d+)>',"item",a) the result get: 32itemfdssaitemffdsa32 i want result: 32<item>fdssa</item>ffdsa32 you need capture </ part. re.sub(r'(</?)\d+>',r"\1item>",a) since made / optional, (</?) capture < or </ example: >>> a="32<2>fdssa</2>ffdsa32" >>> re.sub(r'(</?)\d+>',r"\1item>",a) '32<item>fdssa</item>ffdsa32'

powershell - openprinter with winspool.drv not working -

as part of project learning how handle printers using "winspool.drv" , "printui.dll,printuientry" new. using powershell project. problem code throwing error when trying printer handle openprinter method error: method invocation failed because [openprinter1.program1] not contain method named 'openprinterhandle'. code: $code = @' using system; using system.collections.generic; using system.componentmodel; using system.drawing; using system.linq; using system.text; using system.runtime.interopservices; using system.io; namespace openprinter1 { public class program1 { [dllimport("winspool.drv", entrypoint = "openprinter", setlasterror =true)] internal static extern bool openprinter(string pprintername, ref intptr phprinter, printer_defaults pdefault); [dllimport("winspool.drv", entrypoint = "closeprinter", setlasterror = true)] internal static extern int closep

javascript - jQuery scrollTop after ajax load not working -

after ajax load of html content need scroll specific element. element has attr data-event-id="" variable $('.timelinetoolpanel[data-event-id="'+id+'"]').offset().top; returns 0. whole ajax code is: function refreshcontent(id) { var scrollnumber = 0; $.ajax({ type: 'post', url: '<?php echo yii::app()->createabsoluteurl("user/ajaxeventload"); ?>', datatype:'html', success:function(data){ $("#eventlistblock").empty().append(data); if(id!=null) { console.log(id); scrollnumber = $('.timelinetoolpanel[data-event-id="'+id+'"]').offset().top; console.log(scrollnumber); $("html, body").animate({ scrollto: scrollnumber }, 1000, function() { // alert("finished animating");

php - Show my own errors while any system error occurs in YII -

Image
i need show own error messages while system error come. i using yii framework modular directory. i don't want show error below image end users. instead of below error want show own errors text. possible? below code index.php <?php // change following paths if necessary $yii=dirname(__file__).'/../framework/yii.php'; $config=dirname(__file__).'/protected/config/main.php'; // remove following lines when in production mode defined('yii_debug') or define('yii_debug',false); # true in while dibuging @$shok // specify how many levels of call stack should shown in each log message defined('yii_trace_level') or define('yii_trace_level',3); require_once($yii); yii::createwebapplication($config)->run(); ?>

#DocusignAPI - Fetching Data from Docusign to create Web Page to view status for non admin -

i not technical person, wondering if possible fetching information docusign pertaining status, reminder, envelope id, name etc , display on custom webpage ? i wish create internal company portal requesters can view status of signature requests , stuff. thanks in advance ! rakesh yes possible docusign if you're not technical i'd recommend outsourcing work. can done using docusign's rest and/or soap apis need programmer so. yes there api calls can make query real-time information , metadata reminders on envelope. the docusign developer center developers should start:

mysql - Select Multiple rows then join for each row -

Image
i have table stores each location user watching. table called usercity , pictured below example row. i need select rows user_id='1' , , retrieve each location_id 's record location table, pictured below: i not sure start here, here's lame attempt: select b.* usercity join location b on a.location_id=b.id user_id='1' edit query works 1 record. not sure if work multiple rows. try below- select a.*, b.* usercity join location b on a.location_id=b.id user_id=:uid

Google Drive Spreadsheet Keys -

have multiple references other google drive spreadsheets using importrange spreadsheet key. reason spreadsheet keys appear have changed, can find no way prevent happening or make importrange statements update automatically. this leaves me having search out , open referenced spreadsheets, copy new key , paste every importarange statement correct it. does 1 know way around or how protect against it. 1 know why spreadsheet keys may have changed? also there not clear context, spreadsheet referring to. 1 know how might find out seeing key has changed. the reason spreadsheet key has been changed sheets updated new sheets. can check checking starting character value of spreadsheet key. if value 0, old sheet , if 1, new sheet. the way can changed sheet old key finding sheet in drive spreadsheet key , give new sheet. may can add old key in sheet url , redirect actual sheet new key. hope helps!

mysql - mysql_query() - PROTOCOL -

Image
if not mistaken, mysql_query() function sends data using tcp protocol. possible reassemble query tcp packets , - send on network - , reconstruct query @ other place? i hope below image explain question more. yes, is. need monitoring sowtware (like wireshark ), computer2 (where have software installed) must know i.p of source or destination mysql server , able intercept packets. (f.instance being in same wireless connection -or location , monitoring- of source or destination). after that, you've got packets in order read them depends of settings of connection between client , server. mysql can establish kind of compression, in case should decompress packets. happen client/server connection follow ssl protocol, in case should decrypt packets... etc. not easy @ all, possible.

javascript - Can't get all form data -

Image
i looked everywhere on internet. still stuck ... here's i'm stuck : did form looks : a multipart form, 2 inputs : data & selectable item. the problem : i'm lost dropzone, because know i've declare programmatically (because it's part of form). file data , not select option. (java servlet good, after researchs, problem in .jsp / .js files). here's .jsp : <form action="upload" id="myform" method="post" enctype="multipart/form-data"> <div id="mydz" class="dropzone dz-clickable hvr-outline-out" style="margin-bottom: 5px;"> <div class="fallback"> <input name="datafile" type="file" /> </div> </div> <div id="procedure"> procédure : <select name="procedure"> <option value="1

objective c - Unabe to get image path & image from UIImagePicker in ios using simulator? -

i trying image path & selected image imagepicker controller.i have used delegate method getting path & image getting null . code showing imagepicker - (ibaction)choosepicture:(id)sender { uiimagepickercontroller *pickercontroller = [[uiimagepickercontroller alloc] init]; pickercontroller.delegate = self; [self presentviewcontroller:pickercontroller animated:yes completion:nil]; } code delegate - (void) imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingimage:(uiimage *)image editinginfo:(nsdictionary *)editinginfo { //you can retrieve actual uiimage uiimage *pick_image = [editinginfo valueforkey:uiimagepickercontrolleroriginalimage]; nsurl *path = [editinginfo valueforkey:uiimagepickercontrollerreferenceurl]; [picker dismissviewcontrolleranimated:yes completion:^{ }]; } protocol code view controller #import <uikit/uikit.h>

java - Using ConfigurationProperties to fill Map in generic way -

i'm wondering, if there generic way fill map properties know prefix. assuming there bunch of properties like namespace.prop1=value1 namespace.prop2=value2 namespace.idontknowthisnameatcompiletime=anothervalue i'd have generic way fill property inside map, like @component @configurationproperties("namespace") public class mygenericprops { private map<string, string> propmap = new hashmap<string, string>(); // setter , getter propmap omitted public set<string> returnallkeys() { return propmap.keyset(); } } or there convenient way collect properties prefix, instead of iterating on propertysources in environment? thanks hansjoerg as long you're happy having every property added map, rather don't know in advance, can @configurationproperties . if want grab that's beneath namespace need use empty prefix , provide getter map named namespace : @configurationproperties("") public clas

orm - Openjpa generate entities from table skips one column -

i have table following schema (for keeping logs): * bigint id * timestamp time varchar(255) nullable comment varchar(255) description integer nullable affected_object_id when generate entity table results in : @embeddedid private historypk id; private string comment; private string description; ... getters/setters ... i use rad 8.5.5.1, built on top of eclipse platform 3.6.3. database db2 9.1. somehow affected_object_id not translated entity. can fix it? (i know can fix manually in code, want trust ide) or may i'm doing wrong? i tried disconnecting , connecting again database, no avail. cleaning project did fixed it.

java - Use annotation other than XstreamAlias to serialize an object with XStream -

i have java class in members annotated xstreamalias annotation. under conditions output same class (and members recursively) different annotations. how can ask xstream use method/class annotations not @xstreamalias annotation? you cannot make xstream use different annotations, can define different aliases in code. @xstreamalias("abc") public class abc { @xstreamalias("bb") public string a; } when serialize above class annotations following xml <abc> <bb>something</bb> </abc> when disable annotations , define new aliases xstream xstream = new xstream(); xstream.autodetectannotations(false); xstream.alias("xxx", abc.class); xstream.aliasfield("ccc", abc.class, "a"); you different xml output <xxx> <ccc>something</ccc> </xxx> list of available alias methods: alias class shorter name used in xml elements. public void alias(string name, class type)

Python won't tell my name. How can I make it to tell my name? -

name = input ("hey, what's name ?") print ("so, name is") + name the result is: hey, what's name ?robert so, name traceback (most recent call last): file "c:/users/angel'94/desktop/sal.py", line 2, in <module> print ("so, name is") + name typeerror: unsupported operand type(s) +: 'nonetype' , 'str' i space when i'm entering name after question mark. you need first build string, then pass result print() : print("so, name " + name) what did first print "so, name is" , , print() function returns none when done. tried add name none return value. instead of using concatenation, pass name in argument print() function: print("so, name is", name) and function insert space between 2 arguments you. to space on prompt, add input() argument: name = input("hey, what's name? ") # space here ^