Posts

Showing posts from April, 2015

java - How do I use a custom authorities populator with Spring Security and the ActiveDirectoryLdapAuthenticationProvider? -

i've connected active directory through ldap authenticate, , following in ldap.xml i've called custom authorities populator: <bean id="ldapauthenticationprovider" class="org.springframework.security.ldap.authentication.ldapauthenticationprovider"> <constructor-arg ref="ldapbindauthenticator"/> <constructor-arg ref="ldapauthoritiespopulator"/> </bean> <bean id="ldapbindauthenticator" class="org.springframework.security.ldap.authentication.bindauthenticator"> <constructor-arg ref="ldapserver"/> <property name="usersearch" ref="ldapsearch"/> </bean> <bean id="ldapsearch" class="org.springframework.security.ldap.search.filterbasedldapusersearch"> <constructor-arg value="cn=users"/> <constructor-arg value="(samaccountname={0})"/>

android - gles2 Moving a sprite with an AnalogController -

hello new andengine , have been using andengine cookbook , have reached part creating analogcontroller. have written code move , rotate sprite whenever run runtime error. mcontroller = new analogonscreencontrol(controllerx, controllery, mcamera, controllerbaseregion, controllerknobregion, 0.1f, mengine.getvertexbufferobjectmanager(), new ianalogonscreencontrollistener() { @override public void oncontrolchange( // todo auto-generated method stub // pvalues direction of dragging baseonscreencontrol pbaseonscreencontrol, float pvaluex, float pvaluey) { mainsprite.setposition(mainsprite.getx() + (pvaluex + 2), mainsprite.gety() + (pvaluey + 2 )); mainsprite.setrotation(pvaluex); log.d("mainsprite", string.valueof(mainsprite.getrotation())); }

ruby on rails - How can I use curl to upload a file using paperclip? -

i want upload file information(e.g. package_type) curl in submission model: has_attached_file :package what tried: curl -d "submission[package_type]=type1&submission[package]=@/home/ubuntu/downloads/test.zip" http://localhost:3000/restapi.json if leave out file object, works(a entry inserted database) but specify file above, gives me error: no handler found "@/home/ubuntu/downloads/test.zip" update : i found that should use -f option in curl, in case file information cannot recorded, there anyway include both file object , file info? maybe curl -d -f ? i had similar issue , ended setting content-type multipart/form-data instead of dealing base64 encoding issues when posting rest api. here example includes headers auth: curl -v -h 'content-type: multipart/form-data' -h "x-user-email: <email>" -h "x-user-token: <token>" -x post -i -f submission[package_type]=type1 -f submission[image_attri

c# - How to programmatically select a folder to view in Outlook 2010? -

i programmatically creating search folder via search.save method. after save search (it creates new folder in search folders directory), set focus on newly created folder such view changes folder. this code have far.... searchfolders = inboxfolder.store.getsearchfolders(); foreach (outlook.folder folder in searchfolders) { if (folder.name == "expiring retention policy mail") { folder.showitemcount = microsoft.office.interop.outlook.olshowitemcount.olshowtotalitemcount; //folder.setcustomicon(new bitmap(32, 32)); folder.display(); } } when folder.display() opens entirely new inspector window... don't want happen, want select (like via set focus?) , have viewed in same inspector window exists in. know how this? thank you. this should work you... get access application object (or main add-in class). , this.application.activeexplorer().currentfolder = folder; i.e. can use currentfolder of activeexplorer

javascript - dynamically create input type='text' boxes then add values from each into Backbone.js array -

i wondering how create number of text boxes based on type='number' box...so adds 1 number box, text box field appended backbone.js view...and once enters values textboxes, add each value spot in backbone model array. here of code: <label for='choices'># choices students</label> <input type='number' name='choices' step=1 /> initialize: function(opts) { this.model = new questioncreatemodel({ mode: null, choices: ['a', 'b', 'c'], question: "question goes here", maxchoices: 0, minchoices: 0, wordlimit: 0, charlimit: 0, }), as can kind of see, want take input type='number' , load text boxes can assign values choices array in backbone model. thanks help! -stu your code insufficient think. first, need collection , model. then create view, listens add, remove, change or reset events of collection. if th

iphone - Parsing XML to get multiple values -

i'm retrieving data xml: <appmetrics versionname="1.1.0" startdate="2013-04-16" metric="activeusersbyday" groupby="dayofyear" enddate="2013-04-18" country="us" version="1.0" generateddate="4/19/13 10:10 am"> <day value="6" date="2013-04-16"/> <day value="4" date="2013-04-17"/> <day value="2" date="2013-04-18"/> </appmetrics> i have been successful simpler xmls if instead: <appmetrics versionname="1.1.0" startdate="2013-04-16" metric="activeusersbyday" groupby="dayofyear" enddate="2013-04-18" country="us" version="1.0" generateddate="4/19/13 10:10 am"> <day value="6"/> <day value="4"/> <day value="2"/> </appmetrics> how extract both day value , date under same single

ios - Passing a xml url link to view with UIWebView from lazytablevimage? -

example xml <feed xmlns:im="http://itunes.apple.com/rss" xmlns="http://www.w3.org/2005/atom" xml:lang="en"> <entry> <im:title>como una virgen para cristo</im:title> <im:url>listindiario.com</im:url> </entry> everything work perfect... but question how can when press load cell link url open view uiwebview? i'm working storyboard this code: apptableviewcontroller.m #import "apptableviewcontroller.h" #import "apprecord.h" #import <sdwebimage/uiimageview+webcache.h> #import "customcell.h" #import "webview.h" #import "parseoperation.h" @class webview; @implementation apptableviewcontroller #pragma mark - table view creation (uitableviewdatasource) - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return [self.entries count]; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowat

javascript - Angularjs reset form field with type of email -

in angularjs seems when try 'reset' form, setting of models empty object, if input type="email" doesn't cleared. changing type="text" works however, lose red border on validation. is there anyway reset or clear email type input? thanks! just record, refer op comments explainations , see plunker demo.

Google Drive Document Time Stamp -

i assume modifieddate search field date of modification (obviously) or upload drive. there way preserve original creation date of file on native system? or there possibility modify field? thank you, sean you can use file.update set modification date after upload. https://developers.google.com/drive/v2/reference/files/update also, file.patch works too: https://developers.google.com/drive/v2/reference/files/patch i know read old thread sometime discussed nice able preserve original creation date on insert, or @ least have option, functionality not exist yet. (can't find post now...) update: i decided nice have method update document time stamp, here is: public static file setlastmodified(string fileid, datetime lastmodified) { file file = driveservice.files.get(fileid).fetch(); file.modifieddate = lastmodified.tostring("yyyy'-'mm'-'dd't'hh':'mm':'ss.fff'z'"); try

testing - Running dynamically created JUnit Tests -

i developing eclipse plugin generates junit test suite dynamically. issue run tests. create package .java, each of them created simple string. want run .java code (junit tests). know junitcore give me possibility, first need instantiate .java classes have been created. step step: 1.create string .java content. string tests = "public class mytests extends testcase {"; ... 2.create .java in external workspace same content string 3. instantiate .java classes . mytest mytestclass = new mytest(); ?????????? 4. run test suite . junitcore junit = new junitcore(); result result = junit.run(mytestclass); now @ step 3. question. example : example contains testcase class implements 1 dummy test string stests = "package test.dqspm;\n\n"; stests += "import junit.framework.testcase;\n"; stests += "\npublic class mttests extends testcase {\n\n"; stests += "\tpublic void test1 (){\n" + "\t\t&q

windows - Want an AWK that implements '@include' -

in gawk manual have describes @include operator. lets make .awk modules , share scripts, etc. include files. so far latest cgywin, mingw , gnu awk-s (awk, gawk, mawk, nawk, ...) i've found windows fail on first: @include statement. can point me version implements whole nawk or awk implementation windows? pretty sure there @ least 1 nawk, in day, had downloaded run windows nt. alternately work around helpful in meantime. (say pre-tested awk includer program??) tia , will as far can tell, @include files not supported natively gawk until 4.x. however, @ least on linux, ships shell script called igawk can use instead; preprocesses awk scripts , replaces @include s contents of included file (found via $awkpath ). perhaps cygwin has script? $ cat foo.awk @include bar.awk $ cat bar.awk begin {print "hello, world!" } $ awk -f foo.awk awk: foo.awk:1: @include bar.awk awk: foo.awk:1: ^ invalid char '@' in expression $ gawk -f foo.awk

c - wait() system call - does the child ignore this? -

so i've seen following code during revision. know wait() causes parent wait child stop have few questions regarding this. firstly, when child created, assumption corrected parent continues, changes x value , waits after if-statement? secondly, when child carries on execution , gets wait(), happens? ignored has nothing wait for? #include <sys/types.h> #include <stdio.h> #include <unistd.h> int main() { int x = 1; pid_t pid = fork(); if (pid == 0) { x = x * 2; } else if (pid > 0) { x = 3; } wait(); // print value of x console printf("%d\n",x); } you can experiment calling wait() @ begin of child execution. once there no children in process, callling simple ignored.

django - "'django_mongodb_engine' isn't an available database backend" when pushing to Heroku -

i have django app ran on heroku , uses mongodb engine. of sudden, can not push anymore. not seem recognize django_mongodb_engine module anymore. reverted changes version last ran, it's still same. suspect version conflict or so, can not figure out how fix it. this error i'm getting: traceback (most recent call last): file "manage.py", line 10, in <module> execute_from_command_line(sys.argv) file "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 429, in execute_from_command_line utility.execute() file "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(*args, **options.__dict__) file "/app/.heroku/python/lib/python2.7/sit

javascript - How can select specific text value from <select> <option...? -

i want value select option selected text (not option value) in html , javascript? once able value, wanted specific string 1 below. value 2.500 , text option value 250 bonus. wanted 250 , assign own input hidden value. thanks okay, have given, can guess need option's text. function getselectedtext(elementid) { var elt = document.getelementbyid(elementid); if (elt.selectedindex == -1) return null; return elt.options[elt.selectedindex].text; } use way: var text = getselectedtext('selectid'); or derek suggested, can have in 1 line too: var text = elementid.queryselector("option:checked").innertext note: works in modern browsers.

php - Deleting specific data from a text document using fwrite? -

i writing "unfriend" script mini social network, unfriend action needs remove id called: $user friend list , id called: $my_id . have made scripts add user id's each users files not sure how delete this? my friend_list file: 1,2,3 // user 1 their friend_list file: 1,2,3 // user 3 i use add each id text file: if($action === 'accept'){ mysql_query("delete `friend_req` `from`='$user' , `to`='$my_id'"); $fp = fopen($user_data['friend_list'], 'a'); fwrite($fp, ",".$user.""); fclose($fp); $their_id = friend_list_from_user_id($user); $fp = fopen($their_id, 'a'); fwrite($fp, ",".$my_id.""); fclose($fp); } but remove $my_id friend_list , $user id friend_list i'm thinking need use isn't working: if($action === 'unfriend'){ $fp = fopen($user_data['friend_list'], 'a'); unset($user); fclose

css - how do to height set with pixel then auto after -

i have box set width: 153px; , height: auto; when page loads because there nothing within box has no body. how make load height: 51px , change auto once images added? what have tried? i tried using height: 53px auto; setting height on div in html. i'm sure simple can't seem work out. given appreciated , thank time. this invalid! height: 53px auto; use way: height: 53px; height: auto; instead can have min-height , set 53px . min-height: 53px; height: auto;

OCR integration in Android using Google Drive -

i searched lot , not successful yet . don't wish use tesseract medhod . i have created project according to https://developers.google.com/drive/quickstart-android and while running image got uploaded goggle docs . received message file uploaded file name . for downloading data followed public void downloadfile(file file) { string imageastexturl = file.getexportlinks().get("text/plain"); httpclient client = new defaulthttpclient(); httpget = new httpget(imageastexturl); httpresponse response; stringbuffer sb = new stringbuffer(); bufferedreader in = null; try { response = client.execute(get); in = new bufferedreader(new inputstreamreader(response.getentity().getcontent())); string str; while ((str = in.readline()) != null) { sb.append(str); } log.e(" sb data ", sb.tostring()); in.close(); }

haskell - Could not find module, it is a member of the hidden package haskell98 -

when try compile simple source file import io or import random , build fails error message this: could not find module 'io' member of hidden package 'haskell98-2.0.0.1' use -v see list of files searched the module names changed @ point. want import system.io , import system.random instead. here module hierarchy standard libraries in ghc 7.6.1.

Passing a list of functions as an argument in common Lisp -

say there function f. want pass list of functions argument function f. function f go through each function in list 1 one , apply each 1 2 integers: x , y respectively. for example, if list = (plus, minus, plus, divide, times, plus) , x = 6 , y = 2 , output this: 8 4 8 3 12 8 how implement in common lisp? there many possibilities. cl-user> (defun f (x y functions) (mapcar (lambda (function) (funcall function x y)) functions)) f cl-user> (f 6 2 (list #'+ #'- #'+ #'/ #'* #'+)) (8 4 8 3 12 8) cl-user> (defun f (x y functions) (loop function in functions collect (funcall function x y))) f cl-user> (f 6 2 (list #'+ #'- #'+ #'/ #'* #'+)) (8 4 8 3 12 8) cl-user> (defun f (x y functions) (cond ((null functions) '()) (t (cons (funcall (car functions) x y) (f x y (cdr functions)))))) f cl-user> (f 6 2 (list #'

Perl File Reading Line By Line (RegEx) -

what trying open file , read line line. once found regex looking for, want place each 1 @accounts array print them onto screen. though i'm not getting result. must making simple mistake here? #!/usr/bin/perl use strict; use warnings; $line; $file; $start; $end; @match; @accounts; print "enter file name (example: file.txt): "; chomp ($file = <stdin>); open file, $file or die "cannot open $file read :$!"; while ($line=<file>) { $start = '">'; $end = '</option>'; @match = ($line =~ /$start(.*?)$end/g); foreach (@match) { push @accounts, $_; print " $_\n "; } } 1) don't use bareword filehandles: open $infile, '<', $fname or die "couldn't open $fname: $!"; 2) @match?? used g flag, @matches better name. generally, array names going plurals. 3) avoid using $_ in code: for $match (@matches) { print $matc

ipad - Vertical Scroll Bar that moves content sideways -

first time post on stackoverflow.com, shame considered computer science student. first , foremost, thank have provided me via other's inquiry answering own questions. today have own real question post's title may hard understand. challenge. </introduction> abstract: using content of website somethingmedia.co on artist / philosophy pages; create more user friendly display special consideration of mobile devices. method: alter blocked 'div' content virtually inline , allow side scrolling. please visit here clear representation [demo] , see below explanation[a] alteration: while allowing touch , hold sensitivity options seen in [method] allow scrolling occur mouse wheel. please see [demo2] , visit explanation[b] below. functionality: in addition [method] , [alteration], allow scrolling occur upon users' movement of pages scroll bar itself. except (and here tricky part), make scroll bar vertical , yet move content left , right. scroll bar visible

android - Mail applications not in intent chooser -

on click of email id mailto: protocol, want redirect app mail application. have used intent emailintent = new intent(android.content.intent.action_send); emailintent.putextra(android.content.intent.extra_email, aemaillist); emailintent.settype("message/rfc822"); startactivity(intent.createchooser(emailintent, "choose action")); it works on several devices. fail work on nexus 7 , medion life tab. both have jelly bean installed. however, works on nexus 7. in intent chooser shows nfc , quick send apps not mail application or skype. i have looked following links : android - mail app not support in nexus 7 , android 4.2.2 - gmail app not in intent chooser . doesn't help. what can reason such strange behaviour of devices?

c# - Can I get a MouseOver event to show small dialog box for an item in the ListViewControl? -

[edit] - see edit below, think i've figure out! i similar thing => how make floating (tooltip) control in windows.forms? wondering if there better way now? have tried approach window seems hang around , i'm having issues generally. i know how make tooltips form controls ( here ) items in listview don't seem obvious. for particular usage, have list of items in listview control. love if on itemmousehover little yellow tooltip box used show info or bit of text related item in question. i've created tooltip (i think) , doesn't fire. i'm getting event not tool tip. i'm not doing correctly. tried variations on below seem fail miserably. private void showlittlebox(object sender, listviewitemmousehovereventargs e) { tooltip1 = new tooltip {tooltiptitle = "file summary",automaticdelay = 10,backcolor = color.yellow}; richtextbox rtb = new richtextbox //i needed window - used lot of them {autosize = true,visible = true,

javascript - Display loading while retrieving data using Ajax method -

i using ajax, takes time load data database therefore need find way display (loading...) while data not yet complete. below sample code, , looking event while data still in process. $.ajax({ type: "post", url: "some.php", data: "name=john&location=boston", success: function(data){ $('#para').html(data); } }); it simple.. before call ajax start loading image..& after success hide image eg : $.fancybox.showloading(); $.ajax({ type: "post", url: "some.php", data: "name=john&location=boston", success: function(data){ $.fancybox.hideloading(); $('#para').html(data); } }); here $.fancybox.showloading() is function in have property of displaying loader,

translation - Qt: display dynamically composed non-English text on Labels or buttons -

i trying display dynamically generated hindi text on qpushbutton. please have @ following code: char nam[] = { 40, 9, 62, 9, 46, 9 }; qstring namestringinhindi(qstring::fromrawdata((qchar *)nam, 3)); qdebug() << namestringinhindi; output: "नाम" but if ui->pushbutton->settext(namestringinhindi) //some junk characters getting printed. i have tried setting application font well. qfontdatabase::addapplicationfont("/usr/share/fonts/lohit-devanagari/lohit-devanagari.ttf") and qapplication::setfont(qfont("lohit devanagari",12)); but did not help. could please me issue? thank time. i don't know why code doesn't work, adding empty string string created raw data somehow fixes string. works in linux qt 5.0.1: qstring namestringinhindi(qstring::fromrawdata((qchar*)nam, 3) + "");

css - Media query. Is there any sense behind the division: @media all or @media screen? -

simplicity key brilliance. i see sense behind @media print , @media screen tags. comparison @media screen ( @media all , not print) confuses me. is there sence behind division: @media all , @media screen ? intuitively default prefer @media screen might fail in case ? example? you miss other media types (that seldom used, exist): from w3c page: braille intended braille tactile feedback devices. embossed intended paged braille printers. handheld intended handheld devices (typically small screen, limited bandwidth). projection intended projected presentations, example projectors. speech intended speech synthesizers. tty intended media using fixed-pitch character grid (such teletypes, terminals, ) tv intended television-type devices (low resolution, color, limited-scrollability screens, sound available).

java - SmsManager sending message more than one -

i developing auto reply android application send messages incoming number, if matches selected number i.e. saved in database. running send message twice time, sends 3 messages incoming number. i using following code: void processcall(string innumber, string msg) { try { string sent = "android.telephony.smsmanager.status_on_icc_sent"; pendingintent pisent = pendingintent.getbroadcast(getbasecontext(),0, new intent(sent), 0); pendingintent pidel = pendingintent.getbroadcast(getbasecontext(),0, new intent("dilivered"), 0); smsmanager man = smsmanager.getdefault(); //arraylist<string> smstext = man.dividemessage(msg); man.sendtextmessage(innumber, null, msg, pisent, null); //man.sendmultiparttextmessage(innumber, null, smstext, null, null); toast.maketext(getbasecontext()," msg send " + innumber, toast.length_short).show(); contentvalues sentsms = new contentvalues();

Load local json file with image url in Android -

i using source image loading url. image links stored in json file , json file hosted in server. want json file store locally may in assets or drawable. problem if use asset manager, has use stream manager , stream manager not sit url, realated context load image url. if change url of config_wallpaper_manifest_url loacal asset url, ie. example.json, same never loads. possible solution this? thanks. public void loaddata (bundle savedinstancestate) { // check network state if (!networkutil.getnetworkstate(this)) { final retryfragment fragment = retryfragment.getfragmentwithmessage("no connection"); this.addfragment(fragment, retryfragment.tag, true); return; } if (savedinstancestate == null || savedinstancestate.get(key_list_data) == null) { final string url = super.getresources().getstring(r.string.config_wallpaper_manifest_url); if (url != null && urlutil.isvalidurl(url)) { // add loading fr

sql - Find subsequent records that aren't active -

i've got table of dd information , need select records cancelled don't have subsequent active record i have tried select d1.ddireference ddi d1 left outer join ddi d2 on (d1.ddireference = d2.ddireference , d1.transactionid < d2.transactionid) inner join [tm113 file jo check] tm on tm.[ddi reference] = d1.ddireference d1.ddstatus = 'can' , d2.ddstatus <> 'act' but return me ddireference of record cancelled, cancelled, cancelled, active. i want return records cancelled no active. thanks darren i'm not entirely sure understanding question correctly, query gets cancelled records no active record higher transactionid exists. note original query, if multiple records status can exist, 1 row in results each of records. use select distinct avoid in case. select d1.ddireference ddi d1 inner join [tm113 file jo check] tm on tm.[ddi reference] = d1.ddireference d1.ddstatus = 'can' , not exists( select *

c# - LINQ to custom objects with List<Object> member -

chv1 cdd1 chv2 cdd2 chv3 cdd3 chv4 cdd4 sortcol searchcolcount ---- -------------------------------------------------- ---- -------------------------------------------------- ---- -------------------------------------------------- ----------- ------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------ -------------- adventure cafe columbus of house

ruby on rails - Unable to over-write devise routes -

i using devise , want customize urls: users/sign_in --> account/login users/sign_up --> account/register users/edit --> account/profile ... now routes.rb looks this: devise_scope :user '/account/login' => 'devise/sessions#new' post 'account/login' => 'devise/sessions#create', as: :user_session delete 'account/logout' => 'devise/sessions#destroy', as: :destroy_user_session post 'account/password' => 'devise/passwords#update', as: :user_password 'account/password/forgot' => 'devise/passwords#new', as: :new_user_password 'account/password/edit' => 'devise/passwords#edit', as: :edit_user_password put 'account/password' => 'devise/passwords#update' 'account/cancel' => 'devise/registrations#cancel', as: :cancel_user_registration post 'account' => 'devise/registratio

How can I change vim mappings for accented characters -

i trying change vim mappings (french) accentuated characters. à (ascii 133) alt + a À (ascii 183) alt + shift + a é (ascii 130) alt + e É (ascii 144) alt + shift + e i happy remap existing maps alt + i ==> é (why that?) how can mappings work ? mapping works theses chars, , question alt key, may not work when terminal prefixes character esc character. type :help map-alt-keys more informations on that. i tried in xterm , theses mapping worked: :imap <a-a> à :imap <a-a> À :imap <a-e> é :imap <a-e> É and also, changing default mapping another, use "remap" instead of map : :iremap <a-i> whatever edit : see alt key shortcuts not working on gnome terminal vim

c# - Send Image in Json : 400 Bad request -

from android trying send image class of data, iis webservice. (c#) the problem 400 bad request . the image being encoded base64 . , placed json rest of class elements. my guess base64 not valid inside json. server not understand it. if set string "" , post accepted fine. so question is, how make base64 valid within json array? ( tried url.encode no success). or how should send image android webservice? gson gson = new gson(); string json = gson.tojson(record); // record has param { string base64photo } how big image? i'm pretty sure surpassing iis json size limit (default 4 mb). check http://geekswithblogs.net/frankw/archive/2008/08/05/how-to-configure-maxjsonlength-in-asp.net-ajax-applications.aspx or http://www.webtrenches.com/post.cfm/iis7-file-upload-size-limits good luck!

c++ - MFC and threads. Skip Document/View and make my own solution? -

i rewriting mfc application make threadsafe. application not use document/view pattern , data not handled consistently. in gui, in structs, in xml. so want handle data in consistent, threadsafe way. if have data in 1 struct easy lock when needed. so ok skip whole document/view model , separate data , presentation in own way? the application work this: a communication stack run in 1 thread, when message received lock data , necessary changes it. send message main thread tell gui needs updated. gui lock data , read it, change gui. simple answer yes, it's ok that. can custom-write own presentation completely, literally down pixel if want. doing lock->data access->unlock->paint seems wise; depending on access time, might able paint inside lock well, or update dib in lock painting outside of lock... have lots of options...

r - open many file in one time and each store as one dataframe -

i have many data in 1 folder data=list.files(path="d:/result") data > > [1] "cnvworkshop (1).txt" "e17 result.txt" [3] "e17new result.txt" "e18 new result.txt" > > [5] "e18result.txt" "l15 new result.txt" [7] "l15 > result.txt" "l22new result.txt" [9] "l51 new result.txt" > "l51result.txt" [11] "l54 new result.txt" "l54result.txt" > [13] "penncnv.txt" "s40 new result.txt" i want read many file in 1 time , store each file each dataframe a=paste("watto",1:14,sep="") this things below it's not work for(i in 1 :length(data)){ a[i]=read.table(file=paste("d:/result/",data[i],sep=""),header=t,sep="\t") } and it's show warning message , not give me result > warning message: in a[1] = read.ta

android - Calling a fragment from another fragment on click -

what want call 1 fragment on click on item of listview. program builds without errors crash on click on item. btw i’m making here local fragment_3 object, have got done in mainactivity, how pass function? fragment_1.java content: public class fragment_1 extends sherlockfragment implements onitemclicklistener{ @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { super.oncreate(savedinstancestate); // requestwindowfeature(window.feature_no_title); view view = inflater.inflate(r.layout.fragment_1, container, false); listview listview = (listview) view.findviewbyid(r.id.listview1); listview.setonitemclicklistener(this); return view; } @override public void onitemclick(adapterview<?> parent, view v, int position, long id) { // todo auto-generated method stub fragment fragment3 = new fragment_3(); integer fragmentid = (integer) v.gettag(); fragmentmanager fragmentma

iis - PHP soap extension not loading -

i trying set php website uses soap on iis , cannot soap extension load. have use phpinfo() , can see loading correct php.ini file, soap not loaded. have uncommented extension=php_soap.dll, have extension_dir set correctly, have tried load extension directly path extension=c:\php\php_soap.dll. none of these attempts have been fruitful. i have tried enable other extensions don't need see if enable , none of them will. pulling hair out now, hoping here can give me hand.

java - How to change coordinate regularly using gl.glTranslatef() ? -

having following display() - float tranx , trany , tranz ; public void display(glautodrawable gldrawable) { final gl gl = gldrawable.getgl(); gl.glloadidentity(); gl.glpushmatrix(); gl.gltranslatef(tranx ,trany ,tranz); gl.glcalllist(i); gl.glpopmatrix(); tranx += 0.05; trany += 0.05; tranz += 0.05; } as can see each display() calling matrix of object in gl.glcalllist(i) saved , coordinates change gl.gltranslatef(tranx ,trany ,tranz) . suppose @ stage want save object @ current position (after gl.gltranslatef calling ) , start translate tranx , trany , tranz values . how save object position considering above gl.glpushmatrix() , gl.glpopmatrix() ? push/pop matrices there accumulate complex matrix transformations otherwise painful hand. storing , moving object positions, keeping variables have done correct. expand on and, start moving in another, add directionx/y/z. eg, tranx += directionx etc. when want change directi

How do I add the library android-support-v7 in IntelliJ IDEA (Not Android Studio/Gradle)? -

i copy appcompat folder android sdk extras v7 folder , create android library module in project. compiling project errors, first 1 being appcompat/res/layout/abc_action_mode_close_item.xml:17: error: error: no resource found matches given name (at 'contentdescription' value '@string/abc_action_mode_done') . looks appcompat needs mediarouter resources well. create android library module mediarouter. set mediarouter dependency appcompat library. compile. error mediarouter/res/values/styles.xml:18: error: error retrieving parent item: no resource found matches given name 'widget.appcompat.actionbutton' . add depenency appcompat mediarouter. compile. errors appcompat/res/values/attrs.xml:32: error: attribute "windowactionbar" has been defined help! you need add "@string/abc_action_mode_done" in appcompat/res/values/strings.do not "set mediarouter dependency appcompat library".(in case,"@string/abc_action_mode_done

yii if condition within query builder -

class retailjob extends cformmodel { public function getreatilproducts() { $condition=false; $user = yii::app()->db->createcommand() ->select('tbl_retailjob.retailjobmaster_id, tbl_retailjob.joborderflag, tbl_retailjoborder.retailjob_id, tbl_retailjoborder.retailjobsub_id, tbl_retailjoborder.filename,tbl_retailpostpressjoborder.retailpostpressjo_id,tbl_retailpostpressjoborder.retailjobsub_id,tbl_retailpostpressjoborder.retailpostpresssub_id') ->from('tbl_retailjob') ->join('tbl_retailjoborder', 'tbl_retailjob.retailjobmaster_id=tbl_retailjoborder.retailjobmaster_id') ->join('tbl_retailpostpressjoborder', 'tbl_retailjob.retailjobmaster_id=tbl_retailpostpressjoborder.retailjobmaster_id') ->where('tbl_retailjob.retailjobmaster_id=:id', array(':id' => 7)) ->queryall(); return $user;

MATLAB: Global Optimization where one parameters has to be an odd integer -

i want find global minimum of function f takes 2 parameters a , b . while a continuous, b has odd integer. how can approach problem, given matlab's built in functions , come optimization , global optimization toolboxes?

objective c - Getting Null from NSDateFormatter -

i trying convert string nsdate, getting null. sample string input = 8/8/2013 12:32:22 pm code: [self.dateformat setdateformat:@"mm/dd/yyyy hh:mm:ss a"]; nslog(@"date %@", [[communications objectatindex:x] objectforkey:@"dateupdated"]); nsdate *date = [[nsdate alloc] init]; date = [self.dateformat datefromstring:[[communications objectatindex:x] objectforkey:@"dateupdated"]]; nslog(@"date nsdate %@", [self.dateformat stringfromdate:date]); what doing wrong? sample nslog output 2013-08-15 13:01:59.409 hd[478:907] date 8/8/2013 12:32:22 pm 2013-08-15 13:01:59.412 hd[478:907] date nsdate (null) 2013-08-15 13:01:59.418 hd[478:907] date 8/12/2013 9:45:18 2013-08-15 13:01:59.419 hd[478:907] date nsdate (null) 2013-08-15 13:01:59.421 hd[478:907] date 8/12/2013 9:45:20 2013-08-15 13:01:59.423 hd[478:907] date nsdate (null) 2013-08-15 13:01:59.430 hd[478:907] date 8/12/2013 4:10:49 pm 2013-08-15 13:01:59.431 hd[478:907] date nsd

casting - Setting uniform Numpy dtype of all scalars and arrays (how to avoid downcasting in precision) -

question: simplest way set dtype of all scalar , array variables using numpy? problem: size , complexity of algorithms grow, finding difficult tracing convergence problems due round-off , truncation errors. need way confidently set precision of operations eliminate errors trivial cause. specifics: indicated in research section, having difficult time figuring out how set precision type of scalars variable (see below). though arrays have variable dtype, because scalar may not have been explicitly set same or higher precision dtype, down-casting occurs , lose precision unknowingly in algorithms. research: can set float128 standard float-array in numpy question gave me great advice; set array dtype variable , in code define variable "numpy.float64" or whatever want. but, how scalars? how perform precise calculations in python, regardless of input types? 1 suggests mapping scalars desired input. but, there cleaner way? what have been doing (thanks ophion in c

c# - WPF modal progress window -

i apologize if question has been answered tons of times, can't seem find answer works me. create modal window shows various progress messages while application performs long running tasks. these tasks run on separate thread , able update text on progress window @ different stages of process. cross-thread communication working nicely. problem can't window on top of other application windows (not every application on computer), stay on top, prevent interaction parent window, , still allow work continue. here's i've tried far: first, splash window custom class extends window class , has methods update message box. create new instance of splash class on , show/hide needed. in simplest of cases, instantiate window , call .show() on it: //from inside secondary thread this._splash.dispatcher.invoke(new action(() => this._splash.show()); //do things //update splash text //do more things //close splash when done this._splash.dispatcher.invoke(new action(()

asp.net - class icon in gridView column using VB.net -

i have 1 gridview , have css class called class="icon-p" . want use class in gridview column "modify", except using buttontype="image" , imageurl ..` here gridview code: <asp:gridview id="gridview2" runat="server" autogeneratecolumns="false" cssclass="table" datakeynames="id_s" datasourceid="sqldatasource1"> <columns> .. <asp:commandfield canceltext="cancel" deletetext="delete" edittext="update" headertext="modify" showeditbutton="true" showheader="true" buttontype="image"/> </columns> </asp:gridview> right click on gridview in design view go edit columns. find commandfield , click blue hyperlink @ bottom says "convert template". exit out , go markup , find individual controls there , can @ them set cssclass etc. thing makes update but

c++ - L-Value, Pointer arithmetic -

this question has answer here: why ++i++ gives “l-value required error” in c? [duplicate] 5 answers i looking explanation of how lines l1 , l2 in code snippet below differ w.r.t l-values , i.e, why getting the: c2105 error in l1, not in l2? *s = 'a'; printf("%c\n", *s ); //printf("%c\n", ++(*s)++ ); //l1 //error c2105: '++' needs l-value printf("%c\n", (++(*s))++); //l2 printf("%c\n", (*s) ); note: got above result when code compiled .cpp file. now, on compilation .c file, same error c2105 on both lines l1 , l2. why l2 compile in c++, , not in c mystery :(. if of help, i'm using visual c++ express edition. compiler see ++(*s)++ ++((*s)++) , post-increment has higher precedence pre-increment. after post-incrementation, (*s)++ becomes r-value , can't further pre-incremented (here). ,

how can I exctract attribute value using JAVA regex -

i have such string: <a href="https://host-test.com/create?username=test3&amp;user-mail=myemail@gmail.com&amp;id=14b72820-3855-4f2b-9a39-543ced6784a0&amp;downloadurl=https://host-test.com:443/123/rest/tmp-z7vvymo3wmfzke/vfs/v2/downloadzip/&amp;projectid=d29ya3nwywnlexfpyxlwzjgwb2sxnda2mjovy3jlyxrlqwnj:createacc;" style="font-family:myriad pro,arial,tahoma,serif;color:#fff;font-size:14px;text-decoration:none;font-weight:bold" title="confirm tenant creation" target="_blank"> <div style="font-family:'lucida grande',sans-serif;border-radius:5px;width:120px;min-height:40px;line-height:40px;border:1px solid #577e15;color:#fff;text-align:center;background:#e77431;margin:15px 0 15px"> confirm </div> </a> and need extract using regexp href value: https://host-test.com/create?user

python - y from sklearn.datasets.make_classification -

in sklearn.datasets.make_classification, how class y calculated? let's run his: from sklearn.datasets import make_classification x, y = make_classification(n_samples=1000, n_features=2, n_informative=2, n_classes=2, n_clusters_per_class=1, random_state=0) what formula used come y's x's? documentation touches on when talks informative features: the number of informative features. each class composed of number of gaussian clusters each located around vertices of hypercube in subspace of dimension n_informative. each cluster, informative features drawn independently n(0, 1) , randomly linearly combined in order add covariance. clusters placed on vertices of hypercube. thanks, g the y not calculated, every row in x gets associated label in y according class row in (notice n_classes variable). of these labels possibly flipped if flip_y greater zero, create noise in labeling. edit: giving example for example, assume want 2 cla

objective c - Setting the cell on NSTextField -

Image
i have custom nstextfieldcell want set on nstextfield . if set on ib works fine. and gets working this: but want set programmatically , try this: -(void)awakefromnib{ nsrect therect = nsrectfromcgrect( nsmakerect(50, 100, 100, 100)); nstextfield *inputfield = [[nstextfield alloc] initwithframe:therect]; drkhudtextfieldcell *thec = [[drkhudtextfieldcell alloc] inittextcell:@"textfield"]; [inputfield setcell:thec]; [[_window contentview] addsubview:inputfield]; } this result get: what going wrong? code bad or what? try way, working fine: nsrect therect = nsrectfromcgrect( nsmakerect(50, 100, 100, 100)); nstextfield *inputfield = [[nstextfield alloc] initwithframe:therect]; nstextfieldcell *thec = [[nstextfieldcell alloc] inittextcell:@"textfield"]; [inputfield setcell:thec]; [inputfield setbordered:yes]; [inputfield setbackgroundcolor:[nscolor whitecolor]]; [inputfield setb