Posts

Showing posts from January, 2013

SuccessWithWarning in Paypal Mass Pay -

i building payout system using paypal's mass pay api. according documentation, message come 1 of following status responses: "success" "successwithwarning" "failure" "failurewithwarning" does know example of "successwithwarning" situation mass pay api? have been able simulate "success" , "failure" in sandbox. after turning on negative testing sandbox account, not able reproduce "successwithwarning" status mass pay api. appreciated! thank you. for reference: https://developer.paypal.com/docs/classic/api/nvpapioverview/ the above 4 values possible values variable ack . not api return "successwithwarning" ack value . value applicable api's setexpresscheckout api , doexpresscheckout api etc . can refer below link check possible errors related particular api: https://developer.paypal.com/webapps/developer/docs/classic/api/errorcodes/#id09c3f0o0ntu

java - linked list NullPointerException -

i getting nullpointerexception , don't know why. linkedlist<character>[][] list = new linkedlist[n][n]; (int j = 0; j < n; ++j) { (int m = 0; m < 1; m++) { // here problem list[j][m].add("" + (characterarray[j])); } } i want add characters array list. when run it says nullpointerexception . don't know how initialize list. the problem here created 2 dimensional array of linkedlist objects. remember default value objects in java null, when array first created have 2 dimensional array of nulls. in nested loops trying populate linkedlist objects think have don't (their value null). say null.add("" + (characterarray[j])); obviously creates null pointer exception. so solution make object (in case make new linkedlist object) before trying add it. either having separate 2 nested loops follows: for(int j = 0; j < n; j++) { for(int m = 0; m < n; m++) { list[j][m] = new

php - script stop working when sending often post -

does here have experienced this scenario: have form , text area.in text area putted data every line. data send post read every line of textarea , send post other url other url send response. this working if submit below 10 lines on textarea , if submit more 10 lines script stop working , send me 500.shtml page. i wonder server have limit. because when tried locahost working. have idea?

c# - Dropdown control searching method -

in below form grid contains dropdown control contains products should enter on grid , dropdown fills on form load event , a-z products present in dropdown . see image below: click here see form , dropdown http://imageshack.com/a/img838/5697/1knn.jpg as can see, when press "g" show product names start g , others also. want is: if press 'g' should show product names start g only. dim adapter new npgsqldataadapter(strsql, genconnection) adapter.fill(sourcedatasetproducts) bindsourcesale.datasource = sourcedatasetproducts sourcedatasetproducts.primarykey = new datacolumn() {sourcedatasetproducts.columns("productid")} drpdwnproducts.datasource = nothing drpdwnproducts.datasource = bindsourcesale drpdwnproducts.displaymember = "productname" drpdwnproducts.columnheaders = true drpdwnproducts.width = 800 in way, used fill dropdown in form load. ' dataview of table contained in dataset. dim tables datatablecollection =

java - EAR and EJB classloader error -

i`m developing client uses library overthere 2.3.1. local machine client works perfectly. when try call same code included ejb 3.0, i've got exception not required classes have been loaded. i`ve looked on source , found class contains protocol annotation scanner ( https://github.com/hierynomus/scannit ) hardcoded class name: scannit scannit = new scannit(configuration.config() .scan("com.xebialabs") .with(new abstractscanner[] { new typeannotationscanner() })); the command thread.currentthread().getcontextclassloader().getresources("com/xebialabs") returns null. looks ejb runs in separate classloader not have access jars. the ejb packed ear following structure: ear --meta-inf ----sda-dd.xml ----sap_manifest.mf ----manifest.mf ----application-j2ee-engine.xml --ejb.jar --extlibs.jars the manifest.mf file don`t contain referenses external libs in class-path. ear project deployed application server successfully. t

java - Authentication with Twitter4j Android -

i trying post tweet after being authenticated twitter4j , walking on this tutorial . problem login button doesn't while has open authentication page. couldn't find reason. help. mainactivity: public class mainactivity extends activity { // constants static string twitter_consumer_key = "my_api_key"; static string twitter_consumer_secret = "my_api_secret"; // preference constants static string preference_name = "twitter_oauth"; static final string pref_key_oauth_token = "oauth_token"; static final string pref_key_oauth_secret = "oauth_token_secret"; static final string pref_key_twitter_login = "istwitterlogedin"; static final string twitter_callback_url = "oauth://t4jsample"; // twitter oauth urls static final string url_twitter_auth = "auth_url"; static final string url_twitter_oauth_verifier = "oauth_verifier"; static fin

I want a drop down form with a submit button in php -

i've edited code. right now? <form action="" method="post"> <select name="event"> <option value="" disabled="disabled" selected="selected">please select make</option> <option value="1">honda</option> <option value="2">volkswagen</option> </select> <select name="event2"> <option value="" disabled="disabled" selected="selected">please select model</option> <option value="1">civic</option> <option value="2">passat</option> </select> <input type="submit" value="submit"> </form> try this: <form action="" method="post" name ="testfrm" id="testfrm"> <select name="event"> <option value="&q

mysql - Error undefined local variable or method `created_at' -

i write query find out how user has reduced calories in week, have error. how avoid mistakes? def self.calories_burned(current_user) week = ((created_at - current_user.first_program_started_at.utc.beginning_of_day) / 86400 / 7).ceil.to_i || 1 find_by_sql(" select count(*) cnt, week(#{week}) week_number user_daily_updates user_id=#{current_user.id} group week_number ") end when write this: def self.calories_burned(current_user) etc... end it's method can called this: myusermodel.calories_burned(some_user) in case running code on class before instantiated, means model hasn't attached connection database , because of not able access attributes pertain model. on other hand, if write this: def calories_burned etc... end you don't need pass user method, call on controller after instantiating model, this: id = 123 current_user = myusermodel.find(id) current_user.calories_b

jsf - Richfaces DataTable - total number of pages -

i've situation i've multiple columngroups inside datatable , each record render 1 or more columngroup depending on business logic. now, since number of rows in datatable different size of records list, how total number of pages in datatable, provided number of rows per page fixed number let's 60. i need number custom datascroller.

vb.net - JSON deserilaization of single string in JSON -

this json string i'm receive http response. [{"ts":"1395318389","date":"2014-03-20","time":"12:26:21","nodeid":"1229001363","lat":"53.292425","lon":"-6.43203333333333","speed":"76","dir":"242","sv":"9","volt":"4187","rssi":"-69","us":"3","type":0,"net":"27202","height":"108","hdop":"9","cellid":"eb84","dd":6105,"ttf":"0","lac":"4e24","odo":"0","gle":"0"}] my class set this friend class smarttrack_postionlist public positionlist smarttrack_postion() end class friend class smarttrack_postion public ts string public [date] string public time stri

spring - How to provide a property Bean to a Java Component in Mule Studio? -

in mule studio 3.5, directly in xml , in flow, have following declaration : <component class="fr.esb.bo.generatereportfilecomponent" doc:name="boreport"> <spring:property name="boservices" ref="boservices"/> </component> when launch mule this, following error org.xml.sax.saxparseexception: cvc-complex-type.2.4.a: invalid content found starting element 'spring:property'. 1 of '{"http://www.mulesoft.org/schema/mule/core":annotations, "http://www.mulesoft.org/schema/mule/core":abstract-interceptor, "http://www.mulesoft.org/schema/mule/core":interceptor-stack, "http://www.mulesoft.org/schema/mule/core":abstract-entry-point-resolver-set, "http://www.mulesoft.org/schema/mule/core":abstract-entry-point-resolver, "http://www.mulesoft.org/schema/mule/core":abstract-object-factory, "http://www.mulesoft.org/schema/mule/core":a

excel - Importing multiple .xlsx files into SQL Server using SSMS (Basic, not Enterprise) -

as question states, i'm trying upload 2000 single-worksheet excel files single sql-server database. database has been set using 1 of excel files template , files have same layout. i'm hoping it's simple copying rest of data across files. there way of moving 2000 across @ once instead of having upload them individually using ssms import wizard. info: location of excel files - c:\myserver\myuser\desktop\nominations database add each excel table - dbo.mydatabase$ using ms sql server management studio. can't add diagram of layout (too new stackoverflow), imagine 12 column db , you're there. it's simple db. i don't believe have multiple file option within wizard unless upgrade enterprise, work won't allow until complete proof-of-concept test these files. any appreciated. thanks, folks! you don't need wizard insert destinationtable select * openrowset( 'microsoft.ace.oledb.12.0', 'excel 12.0;database=c:\path\to\f

javascript - Jquery put element inside another not after -

i have few images , element can drag , drop on images <span name="imie" id="drag1" class="drag"> <img name='aa' id='test' src="http://placehold.it/80x80/c9112d/fff&text=1" width="70px" height="20px" /> </span> <span>imiÄ™</span> <div class="col droppable"> <div class="canvas"> <img class="img-bg" src="test.jpg"> </div> <div class="canvas"> <img class="img-bg" src="test.jpg"> </div> </div> i want add dropped box inside <div class="canvas"> after or before img . want see box on img in code should inside canvas not after script var counter = 0; var x = null; //make element draggable $(".drag").draggable({ helper: 'clone&#

python - Construct a object which can be mapped or un packed -

so have (of course true thing more complicated) : class test(object): = -1 def keys(self): return ["a", "b"] def __getitem__(self, item): return {"a": 0, "b": 1}[item] def __len__(self): return 2 def __contains__(self, item): if item in ["a", "b"]: return true return false def __iter__(self): return self def next(self): self.i += 1 if self.i > 1: raise stopiteration() return ["a", "b"][self.i] what want (again true thing more complex): > t = test() > dict(t) {'a': 0, 'b': 1} > dict(**t) {'a': 0, 'b': 1} this work perfectly, fail work if define class subclass of dict, , want, want object behave dict hidden tricks under knees (and again sure makes more sense in real code): class test(dict): .... same code here ....

Can an Ember.js Route redirect to an external URL? -

if want have url on ember.js website called example1.com forwards url on example2.com, how that. can create route of example1.com perform forward example2.com - maybe in beforemodel hook? just use regular <a> : <a href="example2.com">route example 2</a> if want have forward if user types in url directly address bar, need redirect in server. doesn't have ember though. alternatively use app.yourroute = ember.route.extend({ redirect: function() { window.location.replace("http://stackoverflow.com"); } }); the beforemodel (or other) hook should work.

Django Error: __init__() got multiple values for keyword argument 'max_length' -

i getting error. not understand head , tail of it. __init__() got multiple values keyword argument 'max_length' . i adding 3 fields usercreationform django.contrib.auth.forms , email , first name , last name , want save them user object. (does first name , last name gets saved automatically). here form trying load. class myregistrationform(usercreationform): #define fields email=forms.emailfield(required=true) first_name = forms.charfield(_('first name'), max_length=30, required=true) last_name = forms.charfield(_('last name'), max_length=30, required=true) helptext={'username':"* must contain alphabets , numbers", 'email':"*", 'password1':"*must contain alphabets in upper , lower case, numbers special char", 'password2': "*enter same password above, verification"} err_messages={'invalid_username': _(&

ssl - How to make Socks request over http proxy? -

i have built application called tun2socks gui . it's program make socks proxy o transparent. usually use ssh port forward or tor socks service, want can use http proxy too. build socks5 proxy self connect http proxy. it's working capturing http request client sent http proxy. the problem when client send ssl request, cannot capture request forwarded. how best method make ssl request socks proxy through http proxy? schema of request transportation here : client ssl request > socks proxy > http proxy > internet thanks when client intentionally wants establish ssl session target server through proxy, not establish ssl session proxy itself. client first tells proxy establish connection target server, , client initiates ssl session target server. in situation, not possible proxy sniff traffic encrypted, nor should trying to. proxy pass-through, exchanges raw data , forth between client , server needed. proxy should not care kind of r

database - Load the R output eachtime in MySQL DB -

i have loop iterates each row in data frame , generates 5 output files , keep appending on same file records - code working fine. for (n in 1:nrow(data)) { #initialize required variables (some function ---) #write file output file df1= data.frame (key,value) df2= data.frame (key,value) df3= data.frame (key,value) df4= data.frame (key,value) df5= data.frame (key,value) write.table(df1, file = paste(pradd,"table1.tsv",sep="/"), append = true, quote = false, sep = "\t") write.table(df2, file = paste(pradd,"table2.tsv",sep="/"), append = true, quote = false, sep = "\t") write.table(df3, file = paste(pradd,"table3.tsv",sep="/"), append = true, quote = false, sep = "\t") write.table(df4, file = paste(pradd,"table4.tsv",sep="/"), append = true, quote = false, sep = "\t") write.table(df5, file = paste(pradd,"

java - Mongoexport - Issue with "\n" -

i trying export data mongo oracle. used below approach. step 1 : export data cs file usign mongoexport command. step 2 : read data through java code, necessary data transformation. step 3 : insert data oracle issue that, when of comment section has new line character ('\n'), data moving next line , java read fails process document. there open bug 10gen this, jira . has 1 faced issue. there workaround ? as many formatting nuances in csv, there no agreed "standard" how handle embedded newline characters in csv field. a common implementation rfc-4180: common format , mime type comma-separated values (csv) files , suggests: 6) fields containing line breaks (crlf), double quotes, , commas should enclosed in double-quotes. example: "aaa","b crlf bb","ccc" crlf zzz,yyy,xxx this format mongoexport using. if use csv parser compliant rfc-4180 (eg. supercsv suggested @evanchooly) should handle quoted newlines expecte

ios - How do I save/load data in my application using NSCoding? -

yes, i've looked through numerous questions similar asked already; however, still did not quite understand going on or @ least couldn't figure out how in application. so "practice" app has main view controller displays 2 text labels. these text labels populated nsobject class holds large array. user inputs number in array want go to, , string @ index in array becomes text in 1 label, while user-input number becomes text in other label. user can "favorite" string array pressing button. when happens string , it's index number added 2 separate mutable arrays reside in main view controller. then, when user wants see of "favorites", can swipe (modally) bring uitableview has of user's "favorite strings". achieved passing data (2 mutable arrays) main view controller uitableviewcontroller using navigation controller/segue. @ point, there 2 mutable arrays in uitableviewcontroller contain strings , index numbers main view controller.

javascript - angularjs Strange issue-Google voice search issue with website -

i have implemented website of angularjs,jquery , ruby on rails end. i have used #! in url of website.. make website crawlable have used escaped_fragment allow google crawl. the website live 15 days , quite stable..now problem having when using google voice search , open abc.com website redirecting me escaped fragment url eg:- www.abc.com?_escaped_fragment_=/home whereas should go www.abc.com/#!/home if try open abc or abc.com giving me proper results , redirected proper home page ie www.abc.com/#!/home .all other mobile search giving me proper results(google search). why happening , should stop this. bug google

c++ - Object Instantiation in c ++ with a protected constructor -

i have c++ class , want initialize object of type: class myclass { public: /** * creates instance of class. * @return pointer created object. */ static myclass * create (); protected: // explicit protected constructor //and copy-constructor, use create() create instance of object. myclass(); } to create instance, did this: static myclass * m_object = myclass.create(); but got warnings , errors: warning c4832: token '.' illegal after udt 'myclass' error c2275: 'myclass' : illegal use of type expression error c2228: left of '.create' must have class/struct/union how instantiate object? in c++, static variables/methods access using scope resolution (::) operator. change code to static myclass * m_object = myclass::create();

html - Aligning images in bootstrap colums -

im using bootstrap , i'm having problem css. im trying align columns images inside each column have same bottom line, not top. have tried can think of nothing seems work. can me align images correctly? bottom of images match? <div class="container marketing"> <!-- sponsors logos--> <div class="row featurette lastnew"> <div class="col-lg-4"> <img class="img-responsive midjasponsora" alt="1496x613" src="images/logos/platinum/image1.png"> </div> <div class="col-lg-4"> <img class="img-responsive" alt="180x52" src="images/logos/platinum/image2.png"> </div> <div class="col-lg-4"> <img class="img-responsive" alt="283x66" src="images/logos/platinum/image3.png"> </div> </div> </div> i found answer. put class

sql - mysql current_timestamp issue in phpMyAdmin openshift db client -

when try execute query in openshift phpmyadmin client getting below error: #1293 - incorrect table definition; there can 1 timestamp column current_timestamp in default or on update clause when trying execute below query, getting above issue in openshift: `created_dttm` timestamp not null default '0000-00-00 00:00:00', `modified_dttm` timestamp not null default current_timestamp on update current_timestamp, but in local have heidisql client working properly, both in openshift , local uses same mysql 5.1 version, don't know how fix this.

List Reservations at all locations in the state of 'CA' - NEED SQL guidance -

select * reservation,hotel reservation.guestid = hotel.hstate , hstate = 'ca'; i keep on trying sql command , don't anything. think there might wrong foreign keys , that. little please. these tables brand guest hotel htmldb_plan_table reservation room roomtype i'm guessing here (from experience, , fact seems homework assignment db 101 course), think guest , hotel tables related via reservation table, , if correct, query you're looking this: select * reservation inner join guest on reservation.guestid = guest.id inner join hotel on reservation.hotelid = hotel.id hotel.hstate = 'ca' adjust column names match actual design (which didn't inform about).

android - RuntimeException in MediaRecorder.start() -

i have runtimeexception when call method "start()" on mediarecorder object. can not paste stack trace because have discovered bug on google analytics. code: mediaplayer p = new mediaplayer(); final mediarecorder recorder = new mediarecorder(); recorder.setaudiosource(mediarecorder.audiosource.mic); final string path = getoutputaudiofilepath(activity); if (path == null) return; recorder.setoutputformat(mediarecorder.outputformat.three_gpp); recorder.setaudioencoder(mediarecorder.audioencoder.amr_nb); recorder.setoutputfile(path); recorder.setmaxduration(300000); try { recorder.prepare(); } catch (ioexception e) { toast.maketext(activity,e.getmessage(),toast.length_long).show(); } recorder.start(); i run code , it's right. works. used final string path = getfilesdir().getabsolutepath()+"/myfile" instead. so make sure getoutputaudiofilepath(activity) method returning va

How to tell if a datetime string has a date component in PHP -

i need again, here want do: create datetime object date (only) following given format (so far it's okay) alter datetime string following specified format well, can either single time of date , time string. an example: we have single date in filename base date of datetime object. inside file date , time strings, of time time. if string holds date, have update base date accordingly. a bit difficult explain, hope understand. feel solution quite obvious still, can't find it... cheers! just use strtotime('yourtimestring') http://uk3.php.net/strtotime it parse string if able , return false if not.

regex - Can't Process Any String from a Txt file -

this weird. can't process string text file. thing can print out. here code: val pattern = new regex("</document>") val file = source.fromfile(filelocale)(io.codec("iso8859-1")) (line <- file.getlines()) { // line match { // case "</document>" => {println("found it!!!!!"); return} //break out // case _ => println(line) //save lines file // } println(line.indexof("public")) } first using regex , pattern match pattern.findfirstin() , match result. found couldn't produce anything. thought regex off because don't know regex (i'm trying match closing tag </document> in txt file, find first closing tag, exit out of loop/function , save read different file) please don't tell me use jsoup. i'm dealing text file 23mb big , crushed browser (written in c++) , plain text editor. i'm preprocessing text file , reduce more desirable si

java - Receiving emails and storing it in jTable -

i trying receive mails email account. not able store in jtable . want because when 1 row selected contents displayed in jtextarea . code snippet. public void connect() { final string pass = set.pass; final string user = set.uname; try { properties props = new properties(); props.put("mail.imap.host", "imap.gmail.com"); props.put("mail.imap.socketfactory", 995); props.put("mail.imap.socketfactory.class", "javax.net.ssl.sslsocketfactory"); props.put("mail.imap.port", 995); session session = session.getdefaultinstance(props, new authenticator() { @override protected passwordauthentication getpasswordauthentication() { return new passwordauthentication(user, pass); } }); store store = session.getstore("imap"); store.connect("imap.gmail.com",

c++ - 'DETECT' keyword errors in BoundaryFill Algorithm -

i want use boundary fill algorithm cpp in visual studio environment. tried run code parts it, faced face error @ every turn. error 'detect' keyword in codes. of codes include lines: int gd=detect,gm,n,ch,xc,yc,r,bcolor,fcolor; initgraph(&gd,&gm,""); i have error "the definition 'detect' undefined" because of usage. how can overcome problem? ps: can reach example code used link -> http://www.hhhprogram.com/2013/05/draw-circle-and-fill-color-using-boundary-fill-algorithm.html thank you. add header detect, may solve issue.

HTML Image Link not working properly in android phonegap app -

Image
i developing fm radio streaming app. when user presses in toggle button streaming should stop when clicked again should start. streaming works fine portion user needs touch not coming on top of toggle icon. coming on top portion of icon. portion have circled , shown in picture. how create image button simple css , html case <a href="#" style="position:fixed;top: 1%;left: 5%;" onclick="toggleaudio('http://kantipur-stream.softnep.com:7248');"> <img src="images/toggle.png"> </a> i'd recommend using touchststart, or touchend, event instead of click events, (except in recent mobile chrome browsers) have delay. also, i'd rid of link. add event handler image itself.

php - RewriteRule correction -

i've been working on whole day can't figure out. want. both should have urls left /p/test/ or /p/test , not redirect /p.php?slug=test (same tag). example.com/p/test/ -> query example.com/p.php?slug=test example.com/p/test -> query example.com/p.php?slug=test example.com/tag/sometag/ -> query example.com/tag/index.php?tagid=sometag example.com/tag/sometag -> query example.com/tag/index.php?tagid=sometag what i've tried far: rewriteengine on rewritecond %{request_filename} !-f rewriterule ^p/([a-z]+)$ p/$1/ [l] rewriterule ^p/([a-z]+)/$ p.php?slug=$1 [l] rewriterule ^tag/([a-z]+)/?$ tag/index.php?tagid=$2 [l] 2nd example: rewriteengine on rewritecond %{request_filename} !-f rewriterule ^p/([a-z]+)$ p/$1/ [l] rewriterule ^p/([a-z]+)/$ p.php?slug=$1 [l] rewriterule ^tag/([a-z]+)$ tag/$2/ [l] rewriterule ^tag/([a-z]+)/$ /tag/index.php?tagid=$2/ [l] last example: rewriteengine on rewritecond %{request_filename} !-f rewriterule ^p/(

visual c++ - Where to put assignment statement -

when open new file, opens new view. need put assignment statment references new view upon opening file. might be? it can't onopendocument because view not loaded @ point. edit: sorry mfc. it looks best place in derived cview::oninitialupdate() [this article gives sequence of actions when new document opened]

Understanding Make in C -

i seasoned developer in java , had learned c in college days, brushing c skill , following tutorial here i trying follow tutorial on makefile here author says: does file ex1 exist already? no. ok, there file starts ex1? yes, it's called ex1.c. know how build .c files? yes, run command cc ex1.c -o ex1 build them. shall make 1 ex1 using cc build ex1.c. but unable grasp, makefile , why used? parameters same? cflags? cc? new ubuntu although. good explanation long. short explanation: makefile set of instructions on how compile / build executable. includes relationships. example, "executable needs object files b , c. b compiled files x.c x.h y.c , y.h; c depends on k.c". if modifies k.c, know need recompile c don't need recompile b (just link b , c @ end). as projects more complicated becomes more important. as flags - there kinds of ways control compiler. want change these - say, want include more debug, or increase level of optimization; or ch

ruby on rails - Running test suites multiple times, automatically -

i'm using minitest , running tests against rails backend gaming application. because "game world" has synthesized elements generated according various random distributions, want run test suite repeatedly reveal defects might arise consequence of unlikely, possible combinations of synthesized random attributes. (like have run repeatedly several hours.) ideally, id test suite keep running until stop it, or until halts due discovered error scenario, @ point know unlikely set of events caused fail. i'm not sure how go this. there doesn't seem rake test option "run multiple times" or "run till fail". create file called "run_tests_forever.rb with: while true puts "running tests again..." `rake test` end (note: backticks make system call) then run with: ruby run_tests_forever.rb :) (or equivalent requirements...)

ios - Types of volume on an iPhone, iPod and iPad -

when set volume of iphone programatically using [mpmusicplayercontroller ipodmusicplayer] can still listen audio. are there multiple volume's on iphone? indeed there is, there levels phone, mp3/ipod playback , ringer. each changable user @ time of usage buttons.

Setting the position of GridBagLayout at the top of JPanel in Java Swing -

Image
i have written following code add jlabel jpanel displays in center, while expected placed @ top of jpanel . here piece of code i'm referring to: jpanel pnlprojects = new jpanel(); pnlprojects.setminimumsize(new dimension(10, 300)); gridbaglayout gridbaglayout = new gridbaglayout(); pnlprojects.setlayout(gridbaglayout); gridbagconstraints gridbagconstraints = new gridbagconstraints(); // add multiple label dynamically; (int count = 0; count < project.length; count++) { lblprojects[count] = new jlabel("project"+count ); lblprojects[count].sethorizontalalignment(swingconstants.left); lblprojects[count].sethorizontaltextposition(swingconstants.left); lblprojects[count].setborder(borderfactory.createbevelborder(0)); lblprojects[count].setpreferredsize(new dimension(100, 20)); gridbagconstraints.fill = gridbagconstraints.vertical; gridbagconstraints.gridx = 0; gridbagconstraints.gridy = count; pnlprojects.add(lblprojects[count],

magento - Mage registry key "_singleton/" already exists error -

i know there lot of posts have seen , didn't find error in code bellow : config.xml : <events> <core_block_abstract_to_html_after> <observers> <type>singleton</type> <class>webdirect_customprice_model_observer</class> <method>convertpricespantoinput</method> </observers> </core_block_abstract_to_html_after> </events> observer class : class webdirect_customprice_model_observer { const module_name = 'webdirect_customprice'; public function convertpricespantoinput($observer = null) { if (!$observer) { return; } if ('product.info.simple' == $observer->getevent()->getblock()->getnameinlayout()) { if (!mage::getstoreconfig('advanced/modules_disable_output/'.self::module_name)) {

jquery - validate model on change of texbox event -

i have model class public class actorphonemodel { public int phonetypetd { get; set; } public string phonetype { get; set; } [stringlength(30, errormessageresourcetype = typeof(errormessage), errormessageresourcename = "phone_number_you_entered_must_be_at_least_five_characters", errormessage = "", minimumlength = 5)] [regularexpression(@"/^[ 0-9()+-]*$/", errormessageresourcetype = typeof(errormessage), errormessageresourcename = "phone_number_is_invalid", errormessage = "")] public string phonenumber { get; set; } } and on view @foreach (var phone in model.phones) { <tr> <td>@phone .phonetype</td> <td> @html.textboxfor(m => phone .phonenumber, new { @class = "ph

R: multiple linear regression model and prediction model -

starting linear model1 = lm(temp~alt+sdist) need develop prediction model, new data come in hand , predictions temp made. i have tried doing this: model2 = predict.lm(model1, newdata=newdataset) however, not sure right way. know here is, if right way go in order make prediction temp . bit confused when comes newdataset . values should filled in etc.? i putting comments answer. 1) can use predict rather predict.lm predict know input of class lm , right thing automatically. 2 newdataset should data.frame same variables original predictors - in case alt , sdist . 3) if bringing in data using read.table default create data.frame . assumes new data has columns named alt , sdist can do: newdataset<-read.table(whatever) newpredictions<- predict(model1, newdata=newdatset) 4) after have done if want check predictions - can following summary(model1) this give intercept , coefficients alt , sdist newdataset[1,] should give alt , sdist va

php - Connection to Access database on linux failed unixODBC -

currently have website running on windows machine @ hostingprovider. on windows machine have connection mdb database using following code: new pdo("odbc:driver=microsoft access driver (*.mdb); dbq=$this->dbname; uid=; pwd=;"); this working fine. now same, on linux machine @ hostingprovider (which cheaper). have ftp access webserver. can't install on webserver. offcourse linux machine not have microsof acces driver, has unixodbc installed. i can't create dsn think need dsn-less connection. can unixodbc used connect access database? how should create connection mdb database on linux webserver? you might have unixodbc installed still need microsoft access odbc driver , 1 not come unixodbc. there 2 know of linux , both need installing (however, still possible ftp). 2 know mdb tools free , the easysoft ms access odbc driver need purchase. i've never had luck mdb tools (various odbc functions did not work , don't think maintained). kn

jquery - Going back a page manually messes things up -

i'm having problem website i'm making friend of mine. basically home page div image in it, , menu bar links in middle of it. using jquery prevent default action of clicking on link, after menu bar slides up, pressed link becomes active , @ same time image fades out. after redirected selected page. works, it's smooth transition , don't notice page transition. problem is, if redirected page, , press browsers button, return homepage image still disappeared, menu bar in top , previous link still have class "active". so it's go homepage, in state wherein page has executed jquery. don't want this, has same if refresh page. there way achieve this? thanks in advance edit: code: $( document ).ready(function() { $('.nav_item a').click(function( event ) { event.preventdefault(); }); $("#menu").on('click', '.nav_item', function(){ $(this).toggleclass('nav_item_active'); $(

c# - Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource -

i have function dropdownlist , should run store procedure , supplires names taht should displayes @ dropdownlsit . this function : public void loadsuppliers(dropdownlist ddl , int num) { con = connect("igroup9_test1connectionstring"); using (sqlcommand sqlcomm = new sqlcommand("[spgetsuppliers]", con)) { if (con.state != connectionstate.open) { con.open(); } try { sqlcomm.commandtype = commandtype.storedprocedure; sqlcomm.parameters.addwithvalue("@rowmeterialid ", num); sqlcomm.commandtimeout = 600; ddl.datasource = sqlcomm; sqlcomm.executenonquery(); ddl.databind(); ddl.datatextfield = "sname"; ddl.datavaluefield = "sname"; } catch (exception ex) { throw (ex); } } } and procedure: use [igroup9_test1] go /****** obje