Posts

Showing posts from June, 2010

'Member not found' javascript error while open document link with IE browser -

in html page there 2 link of documents. like below: link 1 link 2 when click on link "link 1" , open document in new windows , minimize , , again click on "link 2" out closing previous window. give me 'member not found' javascript error in ie 6/7/8 browsers after had goggling issue , got solution , check below //below code before solution: var viewerurl = "url"; win = window.open(viewerurl, 'subwindow', 'directories=no, status=no'); win.focus(); //after applying solution code below var progressmsgurl = "url"; win = window.open(viewerurl, 'subwindow', 'directories=no, status=no'); if(win==null || win.closed) { win.focus(); } right above code not giving me java script error in ie 6/7/8. but stop focus of windows in browsers.it means when open 1 link 1 documents in 1 windows , minimize , again open link 2 document ,it open newly opened windows refreshing remain in minimize mode, u...

c - Missing XCB header in Debian Squeeze/Wheezy -

the docs talk file called input.h doesn't seem appear in of packages, @ least according to: apt-file search /usr/include/xcb/xinput.h i need because trying use function xcb_input_open_device . what doing wrong? it seems xinput extension disabled default because it's not yet stable enough; hence not packaged in debian. in configure script: --enable-xinput build xcb xinput extension (default: "no")

python - Parse multi-line string up until first line with certain character -

i want parse out lines multi-line string until first line contains character- in case opening bracket. s = """here lines of text want. first line <tags> , after should stripped.""" s1 = s[:s.find('<')] s2 = s1[:s.rfind('\n')] print s2 result: here lines of text want. first line with what i'm looking for: here lines of text want. change s2 = s1[:s.rfind('\n')] #this picks newline after "everything" to s2 = s1[:s1.rfind('\n')] and work. there might better way though...

actionscript 3 - file inside a package -

i want use as3 file() method import xml file. the file inside project in package resources/xml/basexml.xml now file() method has several properties like: applicationdirectory, applicationstoragedirectory, desktopdirectory, documentsdirectory but none of them points me in right direction. how should this? xml file inside package? i have tried embed file have class , not file . do need use file()? if xml file httpservice? try: <s:httpservice url="resources/xml/basexml.xml" result="yourresulthandlertoparsethexml(event)"/> or do: <fx:xml source="resources/xml/basexml.xml"/> and parse off of that. (both located inside tags. unless need actionscript solution in case below should work: var myxml:xml = new xml(); myxml.ignorewhite = true; myxml.load("resources/xml/basexml.xml");

SFTP connection through Java asking for weird authentication -

so i'm writing little program needs connect remote server through sftp, pull down file, , processes file. came across jsch through answers here , looked perfect task. far, easy use , i've got working, 1 minor thing i'd fix. i'm using following code connect , pull file down: jsch jsch = new jsch(); session session = null; try { session = jsch.getsession("username", "127.0.0.1", 22); session.setconfig("stricthostkeychecking", "no"); session.setpassword("password"); session.connect(); channel channel = session.openchannel("sftp"); channel.connect(); channelsftp sftpchannel = (channelsftp) channel; sftpchannel.cd(remote_ftp_dir); sftpchannel.lcd(incoming_dir); sftpchannel.get(tmp_file, tmp_file); sftpchannel.exit(); session.disconnect(); } catch (jschexception e) { e.printstacktrace(); ...

javascript - Check if a popup window is already open before opening it using Jquery -

i want check if popup window open , before open popup window. how done using jquery? below code open new popup window : window.open("mystopchat.php?stat=1&session="+data['myid1']['session_id'][i],"win1","width=500,height=500"); now before call this, want sure popup window not open. this little trick use, perhaps use it: var winref; //this holds reference page, see later open or not function openwindow() { var url = //your url; if (typeof (winref) == 'undefined' || winref.closed) { //create new, since none open winref = window.open(url, "_blank"); } else { try { winref.document; //if throws exception have no access child window - domain change open new window } catch (e) { winref = window.open(url, "_blank"); } //ie doesn't all...

SQL Query Stuck in Infintite Loop -

i'm running pretty simple sql query on database, , seems returning same record on , over, creating infinite loop. maybe i'm missing obvious, don't see it. here's query: select s.customer 'customer', s.store 'store', s.item 'item', d.dlvry_dt 'delivery', i.item_description 'description', mj.major_class_description 'major description', s.last_physical_inventory_dt 'last physical date', s.qty_physical 'physical qty', s.avg_unit_cost 'unit cost', [qty_physical] * [avg_unit_cost] value database.delivery d, database.store_inventory s, database.item_master i, database.minor_item_class mi, database.major_item_class mj, database.store_inventory_adjustment sa sa.store = s.store , s.last_physical_inventory_dt between '6/29/2011' , '7/2/2011' , s.customer = '20001' , s.last_physical_inventory_dt not null there 1 ...

How to retrieve Jenkins build parameters using the Groovy API? -

i have parameterized job uses perforce plugin , retrieve build parameters/properties p4.change property that's set perforce plugin. how retrieve these properties jenkins groovy api? regarding parameters: see answer first . list of builds project (obtained per answer): project.builds when find particular build, need actions of type parametersaction build.getactions(hudson.model.parametersaction) . query returned object specific parameters. regarding p4.change: suspect stored action. in jenkins groovy console actions build contains p4.change , examine them - give idea in code.

Parsing CSV with headers in Ruby? -

this works: require 'csv' file = csv.open(filename) puts file.shift this not: require 'csv' file = csv.open(filename, :headers=>true) puts file.shift i get: c:/program files (x86)/ironruby 1.1/lib/ruby/1.9.1/csv.rb:2177:in `convert_field s': undefined method `with_index' ironruby.builtins.enumerator:enumerator (n omethoderror) c:/program files (x86)/ironruby 1.1/lib/ruby/1.9.1/csv.rb:2218:in ` parse_headers' c:/program files (x86)/ironruby 1.1/lib/ruby/1.9.1/csv.rb:1918:in ` shift' c:/program files (x86)/ironruby 1.1/lib/ruby/1.9.1/csv.rb:1818:in ` loop' c:/program files (x86)/ironruby 1.1/lib/ruby/1.9.1/csv.rb:1818:in ` shift' c:/myproject/myproject/myproject/program.rb:3 i using ironruby 1.1.3 i looking correct syntax single line headers option. i tested in different engine , seems bug in ironruby

python - django unsupported locale setting on Mac OS X -

i've been developing application using django past year. application written in debian environment, development , testing entirely done in debain machine. recently, decided move application local mac os x based laptop. using port's did virtual environment , pulled project github. when try runserver, getting "unsupported locale setting" exception. my application uses locale heavily, noticed though language setting in machine set en_us.utf-8 while on debian machine en_us.utf8. don't know if dash reason why failing though. my application using django-localeurl creating language code url schema i10n , i18n. below exception getting environment: request method: request url: http://127.0.0.1:8000/en/ django version: 1.3.1 python version: 2.7.1 installed applications: ['localeurl', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messag...

java.util.logging.Logger swallowing logs -

i using java.util.logging.logger , want enable log levels. thought following work: logger.setlevel(level.all); but apparently doesn't. info level logging statements taking effect, , others being swallowed. how enable log levels? it's log handler swallowing log records. need set log level on handlers too. example: for (handler handler : logger.getlogger("").gethandlers()) { handler.setlevel(level.all); } or can read configuration logging.properties file (just put in classpath root), or can read logging.properties -style configuration stream using logmanager.getlogmanager().readconfiguration(someinputstream) .

jquery - Long polling issue with IE8 -

im building app uses long polling technique , im running trouble ie8. so here simplified code use: php: $time = time(); while((time() - $time) < 10) { $data = rand(0,10); // if have new data return if($data == 3 || $data == 6) { echo json_encode($data); break; } sleep(1); } js: var lponcomplete = function(response) { alert(response); // more processing lpstart(); }; var lpstart = function() { $.post('http://example.com/test', {}, lponcomplete, 'json'); }; $(document).ready(lpstart); the problems seems ie8 not waiting til server responds fires next request straight after or dies after first proper response. may cause behavior? this seemed trick. $.ajaxsetup ({ cache: false });

radpanelbar - WPF Expand RadPanelBarItem only in available space -

i have radpanelbar each radpanelitem having list of entities(different list in each item). each item in list shown groupbox. large number of items radpanelbar has scrolled in order other radpanelbaritems visible. want such scrollbar appears within each radpanelbaritem radpanelbaritems visible on screen @ same time , if contents of item long, user has scroll within each radpanelbaritem. i'm using itemssource property of each radpanelbaritem , setting itemtemplate display groupboxes. is there way this, everything(height , such) kept dynamic? thanks! there seems no easy way this. got following response telerik when asked similar question: if got case correctly have several options: 1) set size panelbaritem. way limit how big be. if match items summed size size of panelbar should eliminate clippings. 2) customize panelbar , panelbaritem control templates in order support automatic proportional sizing. in case should remove scrollviewer panelb...

hibernate - @OneToMany save duplicate records -

i have 3 tables: playlist , advertisement , playlistadmap (join table) 1- playlist : @entity @table(name = "playlist", catalog = "advertisedb") public class playlist implements java.io.serializable { @onetomany(fetch = fetchtype.lazy, cascade = cascadetype.all) private set<playlistadmap> playlistadmaps = new hashset<playlistadmap>(0); } 2- advertisement : @entity @table(name = "advertisement", catalog = "advertisedb") public class advertisement implements java.io.serializable { @onetomany(fetch = fetchtype.lazy, mappedby = "advertisement") private set<playlistadmap> playlistadmaps = new hashset<playlistadmap>(0); } 3- playlistadmap : @entity @table(name = "playlist_ad_map", catalog = "advertisedb") public class playlistadmap implements java.io.serializable { @manytoone(fetch = fetchtype.eager) @joincolumn(name = "fk_advertisement", r...

C# Datagridview SelectionChanged Event fires earlier than I want it to -

i'm working windows forms. want event fire when user makes selection of cells (or 1 cell) in datagridview. selectionchanged event firing select 1 cell. there way have wait user done selecting? i have tried cellmouseup event, don't behaviour because if mouseup happens outside grid doesn't fire. as select each cell new selection change should fired. looking @ "remembering" selected cells each time eventhandler gets triggered , doing processing based on that. how of pain going depends on processing doing selection. deal.

database - Update query after the selected records from a Select Query -

i have select rows table, send result queue , same records 'sent' in db. how trying not sure how pass column value where clause of update query each record of select query. <route> <from uri="timer://kickoff?period=10000"/> <setbody> <constant>select top 10 * tablename</constant> </setbody> <to uri="jdbc:test"/> <multicast> <to uri="activemq:queue:testqueue"/> <setbody> <constant>update tablename set status='sent' primarykey= ${primarykey}</constant> </setbody> <to uri="jdbc:test"/> </multicast> </route> will route run 10 records? if not possible jdbc/sql component how achieve hibernate component? when run query using camel jdbc, arraylist of hashmaps. see camel documentation here: http://camel.apache.org/jdbc.html "the result returned in out bod...

jQuery: Enforce order of execution of document.ready() calls -

i'm working on codebase multiple blocks of code setting behavior on document.ready() (jquery). there way enforce 1 specific block called before of others? background: need detect js errors in automated testing environment, need code starts logging js errors execute before other js code executes. document.ready() callbacks called in order registered. if register testing callback first, called first. also if testing code not need manipulate dom, may able run code parsed , not wait until dom ready run before other document.ready() callbacks called. or, perhaps run part of testing code , defer part uses dom until document.ready() . another idea (for testing purposes only) run modified version of jquery added flag document.ready() when passed , set true indicated call function first or add new method document.readyfirst() call function first. involve minor changes document.ready() processing code in jquery.

sql server - Distinct on one column -

i have through duplicated question solution there not work me. i have 2 columns: instanceid productid and want unique productids only. from others questions asked here try solution: select * (select cast(a.col001 int) surveyinstanceid , cast(a.col002 nvarchar(25)) productid , row_number() over(partition a.col002 order a.col001 desc) rn datasetsmaterializeddatasqlvariant datasetsmaterializedinternalrowsetid = 5 ) rn = 1 but result duplicated values. edit: for more information, have in table: instanceid productid 1 10 1 11 1 12 1 13 2 10 2 a1 3 10 3 11 3 b1 3 c1 3 d1 3 e1 ...... i need unique product ids. sorry did not provided example @ beg. that seems way complex. try this: select distinct productid datasetsmaterializeddatasqlvariant datasetsmaterializedinternalrowseti...

c# - When inheriting from a framework control, should I call the base constructor? -

i'm inheriting listbox. need explicitly call base constructor? public class mylistbox : listbox { public mylistbox() : base() { } // or public mylistbox() { } } the 2 options listed compile identical code. the reason include : base() explicitly denote calling base classes default constructor instead of other constructor, design. if left off, happens automatically. such, optional. however, if want use constructor other parameterless constructor of base class, have explicitly state this, ie: public mylistbox() : base("foo") { } this explicitly use constructor accepted string argument.

php - Update Postgres database without reloading page -

i'm building personal reddit fun , experience (i'm pretty new whole thing).  on other web things i've made changes must applied same page, used form, action point current page. in php, have function check post variables form, make database query before page loads. way, when function later on called display data, have new stuff added.  this has worked tremendously , happens instantaneously because sites exclusively deployed local networks. came on own (i realize may not totally efficient). before, have go different page process button.  on current project, when click voting button, same thing happens , works fine. however, page longer i've made previously, , result, jumps top of page. it's jarring experience. i'd keep inline, nothing happened.  what kinds of tricks require little (read: simple) no server modification can use?  to make href stop reloading page add hrefs: <a href="#" onclick="return false">blah</...

apache - Change path chiliproject -

i want use subdirectory chiliproject instance. using apache passenger, thinking of using rewrites + alias, gives me 404. adding railsbaseuri connection reset. is routes.rb should adapt or looking @ wrong place? working right on https://mydomain.com i'd have on https://mydomain.com/tracker you can use passenger directly without having use alias or redirection. however, passenger requires special configuration that. please see one of our guides complete installation example. generally need configure similar (cited linked guide): at first, assume have installed chiliproject /srv/www/chiliproject . not documentroot. you need hint passenger bit here correctly finds chiliproject. create symlink existing documentroot directory out chiliproject installation. ln -s /srv/www/chiliproject/public documentroot/chiliproject now add following directives existing virtual host: # todo: remember replace documentroot actual path <directory documentroot> options +...

Stock information data structure for c? -

i'm new c(less week), , trying figure out more effective way of retrieving data. imagine have few pieces of stock data: ticker, price, change. my approach far has been put data in 3 arrays. if want price of ibm, search ticker array , index location location price array. works fine because lot of lookups , data doesn't change wondering if there maybe more effective way of doing this? i tried dictionary/hashmap maybe store ibm key , array of price/change values, can't seem figure out how in c. if possible there simple way this? working on different program , don't want learn how create own scratch(although if have to, def. work on it). try this: http://uthash.sourceforge.net/ the examples on front page pretty self explanatory. struct stock { float price, change; char name[3]; ut_hash_handle hh; }; struct stock * stockshash = null; struct stock * stockitem; hash_add_str(stockshash, name, stockitem ); hash_find_str(stockshash, "ibm...

extjs4 - ExtJS: Making an image as a column header -

is possible in extjs 4.0 set column header image, or custom rendered html? the api column text says: text : string the header text used innerhtml (html tags accepted) display in grid. which means can pass in <span class="myspan"></span> , define css class has background image. edit: here example: http://jsfiddle.net/hsvj8/102/

java - Error when trying to run class file from Command Prompt -

i have class stored in c:/code/src/ i open cmd , type in c:/code/src>java -cp . hello and gives me error exception in thread "main" java.lang.noclassdeffounderror: hello <wrong name: src/hello> the java version "1.7._02" not know else do? complies , runs in eclipse ide not command console? what should rectify problem? public class hello { public static void main(string[] args) { system.out.println("hello"); } } environment variables java_home = c:\program files\java\jdk1.7.0_02\bin\; path = c:\program files\java\jdk1.7.0_02\bin\; it complies , runs in eclipse ide not command console? you should running command in dir hello.class file running in src has hello.java file find hello.class file under /bin (that's eclipse places them)

mingw32 - How to build cogl and clutter on mingw? -

i'm going build clutter on mingw environment, when try build cogl, there compling errors, unknow type: glchar, glintptr, glsizeiptr. the source code version used is: clutter(1.8.4), cogl(1.10.2), can give me advice ? thank much! the clutter wiki has set of instructions building clutter mingw: http://wiki.clutter-project.org/wiki/buildingclutteronwindows also, if you're using cogl 1.10 should use clutter 1.10 well.

c# - Bind with WindowsFormsHost -

i trying bind list of items tabcontrol. items like: class scieditor { private scintilla editor = null; public system.windows.forms.control editor { { return editor; } } private string path = null; public string shortname { { return null == path ? "new script" : path.getfilenamewithoutextension(path); } } .... in main window, list called "allscripts". here's xaml: <tabcontrol grid.row="0" grid.column="0" name="tabcontrol1"> <tabcontrol.itemtemplate> <datatemplate> <textblock> <textblock text="{binding shortname}"/> </textblock> </datatemplate> </tabcontrol.itemtemplate> <tabcontrol.contenttemplate> <datate...

c# - How do I write a where query to only include 1 entity of child -

i have entities blog{ blogid, name, creatoruserid } blogsettings{ blogid, userid, column1 } now have method accepts blogid , userid , querying on blog (not blogsettings ) blog contains collection of blogsettings . how should it? if write context.blogs.include("blogsettings").where( b => b.blogid == blogid) inefficient since need blogsettings userid == userid. note: not querying on blogsettings. can see querying on blog collection. var blogwithsetting = context.blogs .where(b => b.blogid == blogid) .select(b => new { blog = b, blogsetting = b.blogsettings.firstordefault(bs => bs.userid == userid) }) .singleordefault(); if (blogwithsetting != null) { blog blog = blogwithsetting.blog; // } such projection way result in single roundtrip database because eager loading include doesn't support filtering or sorting on included child collections. blog.blogsettings populated automatically ...

Ninject and Asp.Net Web API problems with dependency injection -

i have asp.net web api project side side mvc3 project. both projects ninject configured dependency resolver. i'm having problems in web api project, since writing own authorization attribute, in order authorize incoming requests api. in attribute, need inject dependencies perform verifications on request. so how code in attribute looks: public class customauthorizeattribute : actionfilterattribute { public string roles { get; set; } [inject] public iauthschemaselector _schemaselector { private get; set; } [inject] public iuserservice _userservice { private get; set; } [inject] public iroleverifier _roleverifier { private get; set; } public override void onactionexecuting(httpactioncontext actioncontext) { try { var principal = _schemaselector.authorize(actioncontext.request, roles, _userservice, _roleverifier); actioncontext.request.properties["ms_userprincipal"] = principal; ...

model - cakePHP not updating a record -

i trying cakephp update record in database appose creating new one. script check "first", , if not return false, should create new record, else should update existing 1 based on id specifying. have below deliberately added $this->asset->id = 62; try force update, not work. help? (also, if can understand it's suppose do, please feel free guide me perhaps better code :) new cake: public function index() { if($this->request->is("post")) { $aid = $this->request->data['asset']['asset_identifier']; $type = $this->request->data['asset']['asset_type_id']; $asset = $this->asset->find("first",array("fields" => array("asset.id", "asset.user_id", "asset.status_id", "asset.financial_id", "asset.insurance_id"),"conditions" => array("asset.asset_identifier" => $aid, ...

android - probleme with AsyncTask: execute -

i tried use asynctask object connect application remote server. here's code: public class connectserver extends asynctask<void, void, void> { string ip = ""; inputstream = null; jsonobject json_data = null; arraylist<namevaluepair> namevaluepairs = new arraylist<namevaluepair>(); arraylist<string> donnees = new arraylist<string>(); @override protected void doinbackground( void... params ) { // todo auto-generated method stub ip = "http://192.168.101.1/fichier.php"; namevaluepairs.add( new basicnamevaluepair( "nom", envois.nom ) ); namevaluepairs.add( new basicnamevaluepair( "prenom", envois.prenom ) ); namevaluepairs.add( new basicnamevaluepair( "nationalite", envois.nationalite ) ); namevaluepairs.add( new basicnamevaluepair( "passeport", envois.passeport ) ); try { //commandes httpclien...

c# - HTML recursive binding -

i have datatble below: id menuname url parentid 1 home ~/home.aspx null 2 product ~/products.aspx null 3 services ~/services.aspx null 4 erp ~/erp.aspx 2 5 hrm ~/hrm.aspx 4 7 payroll ~/payroll.aspx 4 8 programming ~/programming.aspx 3 9 advertising ~/advert.aspx 3 10 television advert ~/tvadvert.aspx 9 11 radio advert ~/radioadvert.aspx 9 ........ ........ so want generate menu item unordered list based on datatable above such items null parentid should first level menu , others submenus based on parentid so: <ul class="menu"> <li><a href="home.aspx">home</a></li> <li><a href="produc.aspx">product</a> <ul> <li> <a href="erp.aspx">erp</a> ...

ms access - Changing the style of an inputbox for memos -

Image
i beginner @ microsoft access trying creating database , 1 of fields memo field. request user input field; however, standard inputbox has single line user enter data, , although can use add large amounts of text, not pleasing. i want inputbox accepts memos user inputs paragraph of text, can see entire paragraph when submits. how using inputbox , not form? possible? i guessing entering data directly table. if can hover on line between 2 rows until double arrows , click , drag. when closing table ask if want save changes. if yes every time after appear same when when opened. give more viewing area per field. however, agree hansup, best controlled via form. here snapshot of table more room per row. the same can done query results.

HTML5 Video Tag Not Playing -

i'm trying utilize html5 video tag autoplay mov or mp4 video when page loaded. however, video isn't playing when page loads. here code: <!doctype html> <html lang="en-us"> <head> <meta charset="utf-8" /> <title>bropocalypse</title> <style> body {background:#000000; margin:100px;} p {font-size:36px; text-align:right; margin:20px 0px;} a:link, a:hover, a:visited {color:#ff0000; text-decoration:none;} .trailer {width:700px; height:100%; margin:0 auto;} </style> </head> <body> <div class="trailer"> <video width="700" height="400" src="trailer.mp4" poster="trailer.mp4" controls="controls" autoplay="autoplay" type="video/mp4; codecs='avc1.42e01e, mp4a.40.2'"> <p>if reading this, because browser not support html5 video element.</p> </video> <p><a href="abo...

java - How to reliably take a photo in Android? -

i trying take photo in android app, convert jpeg, upload web service. far got following: private static final int camera_request = 1888; private void takephoto() { intent cameraintent = new intent(android.provider.mediastore.action_image_capture); startactivityforresult(cameraintent, camera_request); } @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); switch (requestcode) { case camera_request: bitmap photo = (bitmap) data.getextras().get("data"); bytearrayoutputstream bos = new bytearrayoutputstream(); photo.compress(bitmap.compressformat.jpeg, 90, bos); byte [] bitmapdata = bos.tobytearray(); char [] dataaschar = new string(bitmapdata ).tochararray(); url url = new url("http://www.foo.com/bar); urlconnection conn = url.openconnection(); conn.setdo...

Generate urls for video,audio and image files in django -

i developing website user can upload pictures,audios , videos.all users can see files uploaded other users.now don't want user download files uploaded other users.how can securely display files on webpage without allowing user download files? i suggest managing media request through view. @login_required def getmedia(request, media_id): media = get_object_or_404(media, pk=media_id) if media.owner != request.user: #handle user not owning media httpresposeredirect("/404") # handle users owning media

reporting services - SSRS 2008 R2 Last Record in Data Driven Subscription Takes Forever -

i running ssrs 2008 r2 , have data driven subscription on report. there 44 rows returned in data driven query 44 reports posted sharepoint document library. when kick off subscription, 43 of reports delivered in 3 minutes. last 1 takes 20 minutes. there nothing special parameters on last one. ideas? i figured out. found column reportserver.dbo.notifications.processafter. causing "issue" not issue. not sure why report server code set field far future, after tweaking of report parameters, issue went away.

Javascript history does not work -

document.addeventlistener('domcontentloaded', function () { displayrecenturls("recenturls"); }); function displayrecenturls(divname) { var popup = document.getelementbyid(divname); var ul = document.createelement("ul"); popup.appendchild(ul); var microsecondsperweek = 1000 * 60 * 60 * 24 * 7; var oneweekago = (new date).gettime() - microsecondsperweek; history.search({ 'text': '', 'starttime': oneweekago }, function(historyitems) { (var = 0; < historyitems.length; ++i) { var url = historyitems[i].url; var li = document.createelement("li"); ul.appendchild(li); var = document.createelement("a"); a.href = url; a.appendchild(document.createtextnode(url)); li.appendchild(a); } }); } i wrote code above generate browsing history 1 week. not work. i'm new javascript may have m...

asp.net - cannot connect to sql database on shared server -

i have purchased website installed on dedicated server. have moved arvixe , able restore database on 1 of shared servers. able connect server sql studio management studio 2008 using domain name (www.mydomain.com) , username , password of database account setup in arvixe control panel. however, not able connect database application. able see pages of site not use database. application using .net 3.5 have set server .net 2.0 classic iis. have done lots of searching on web , have read through many forums. have tried every possible option connection strings in web.config , still receive same error: server error in '/' application. a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 26 - error locating server/instance specified) description: unhandled exception occurred during...

remove country code after launch skype programetically -android -

i want start skype call app, use code intent skype_intent = new intent("android.intent.action.call_privileged"); skype_intent.setclassname("com.skype.raider", "com.skype.raider.main"); skype_intent.addflags(intent.flag_activity_new_task); skype_intent.setdata(uri.parse("tel:+99mynubber")); context context = getapplicationcontext(); context.startactivity(skype_intent); this code work fine, skype remove + , add countrycode calling +3999mynumber how can avoid effect , call number want?? thanks all

c# - Find the position of a List Item in a List based upon specifice criteria using LINQ -

this question has answer here: find indices of particular items in list using linq 2 answers something similar linq find in position object in list , except accepted answer evaluating @ object level. say have public interface ifoo{ string text {get;set;} int number {get;set;} } and public class foo : ifoo{ public string text {get;set;} public int number {get;set;} } now have list collection of ifoo so: public ilist<ifoo> foos; i want write method brings index(es) of foos based upon property value and/ or values (for example, text or number in case) can like: var fooindexes = foos.getindexes( f => f.text == "foo" && f.number == 8 ); how write that? you use like: public static ienumerable<int> getindices<t>(this ienumerable<t> items, func<t, bool> predicate) { return...

java - Separate numbers from letters in Lucene -

in many documents i'm indexing lucene, people accidentally concatenate words numbers. instance, 1 say: "i born in2000", instead of "i born in 2000". is there lucene tokenizer can separate words numbers (e.g. in2000and) several words (e.g. in 2000 and)? you can use worddelimiterfilterfactory , add splitonnumerics=1 param schema.

javascript - Passing a variable to a function -

i have variable declared: var recent; and wrote function needs variable passed it. however, believe happening variable being passed string. var represented thisvar : function detachvariable(thisdiv, thisvar, filename) { //check if section visible: if($(thisdiv + " li").length > 0) { $(thisdiv).prepend(thisvar); } else { //if variable not have content stored, store it: if(thisvar === undefined) { $("#site-nav li a").parents().removeclass("nav-active"); $(this).addclass("nav-active"); $(thisdiv + " ul.top-level").load('assets/includes/' + thisfile, function () { $(this).show().siblings().hide(); ajaxaudiocontroller(); }); //if variable has content, show it: } else { $("#site-nav li a").parents().removeclass("nav-active"); $(this).addclas...

How to rename Amazon RDS instance endpoint? -

say have instance name of 'webserver' , endpoint webserver.i2jfi23dfds.us-east-1.rds.amazonaws.com the beginning of string instance name. can change beginning of endpoint of instance like.. adifferentname.i2jfi23dfds.us-east-1.rds.amazonaws.com this feature added. modify instance , see can rename it.

jquery - When div is added to dom enable it to be droppable -

is possible allow new div added dynamically dom made droppable ? i'm trying : var mydroppable = '<div id="mydroppablediv" >new droppable</div>'; $("#mydroppables").append(mydroppable ); but receive error : object has no method 'droppable' just invoke droppable method appended: $(mydroppable).appendto('#mydroppables').droppable();

java - Compiling and running with JavaFX 2.1 -

i trying simple use of javafx using simple set of lines of code got stackoverflow page ( here ). but, problem not code more fundamental in build , run process. here code: import javafx.scene.media.media; import javafx.scene.media.mediaplayer; . . . media medmsg = new media("msg.mp3"); mediaplayer medplmsg = new mediaplayer(medmsg); medplmsg.play(); at first couldn't compile @ all. figured out needed put -classpath c:\program files\oracle\javafx 2.1 sdk\lib\rt\jfxrt.jar on javac command line. (one obvious complex of questions here is: why isn't documented in obvious place (1) needed , (2) how figure out path javafx installation is?!) but, when run code get: exception in thread "main" java.lang.noclassdeffounderror: javafx/scene/media/media @ progtest.main(progtest.java:120) caused by: java.lang.classnotfoundexception: javafx.scene.media.media @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown...

c# - Couldn't Upload File ASP.NET MVC -

i'm trying create create model object page. i'm using asp.net mvc c#. in project i'm trying create library application has books , can add book application has picture. create controller this, [httppost] public actionresult create([bind(exclude = "id,bringback,borrower,isborrowed")]book booktocreate, httppostedfilebase picture1) { try { if (picture1.contentlength > 0) { var filename = path.getfilename(picture1.filename); var path = path.combine(server.mappath("~/app_data/pictures"), filename); picture1.saveas(path); } // todo: add insert logic here _entities.addtolibrary(booktocreate); _entities.savechanges(); return redirecttoaction("listbooks"); } catch { return view(); } } and view this, <%@ page language="c#" in...

regex - Getting all matches for a regexp on clojure -

i'm trying parse html file , href's inside it. so far, code i'm using is: (map #(println (str "match: " %)) (re-find #"(?sm)href=\"([a-za-z.:/]+)\"" str_response)) str_response being string html code inside it. according basic understanding of clojure, code should print list of matches, far, no luck. doens't crash, doens't match either. i've tried using re-seq instead of re-find , no luck. help? thanks! this looks html scraping problem in case, advise using enlive . something should work (ns test.foo (:require [net.cgrand.enlive-html :as html])) (let [url (html/html-resource (java.net.url. "http://www.nytimes.com"))] (map #(-> % :attrs :href) (html/select url [:a])))

javascript - FB app requests redirecting to canvas page instead of tab page -

when users send app requests, requests point canvas page instead of page tab. i know solution point canvas app url page redirects page tab. however, it's not working. this js on redirect page: top.location.replace("#{page_tab_url}"); going redirect page directly (myapp.com/redirect) redirect page tab fine. reason, requests don't work. when users click view request, app returns 404. is there problem top.location.replace within facebook? the following question's solution did not work me: fb app request points canvas page instead of page tab the problem in routes file (it's rails app), get ing /redirect, , wasn't handling post , happens in page tab. working solution: on redirect page: `window.top.location.href = "#{page_tab_url}";` routes.rb: `match "redirect" => "home#redirect"`

visual studio - How do I embed and use resource files in a C program using VS11? -

this first attempt @ using resource file. have seen lot of answers apply c# not c. suggestions? assuming mean method used sysinternals , others carry drivers or needed dlls (or x64 version of program itself) in resource section of program (e.g. sysinternals' process explorer), using microsoft visual c can use code: bool extractresto(hinstance instance, lpctstr binresname, lpctstr newpath, lpctstr restype) { bool bresult = false; hrsrc hrsrc; if(hrsrc = findresource(hmodule(instance), binresname, restype)) { hglobal hglob if(hglobal hglob = loadresource(instance, hrsrc)) { dword dwressize = sizeofresource(instance, hrsrc); handle hfilewrite = createfile(newpath, generic_read | generic_write, file_share_read | file_share_write, null, create_always, file_attribute_archive, 0); if(hfilewrite != invalid_handle_value) __try { dword dwsizewritten = 0; ...

WordPress editing php get_template_part() and get_post_format() function -

i want load post content no title, date, comment, etc info. there way grab post only? <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php endif; ?> simply replace: <?php get_template_part( 'content', get_post_format() ); ?> with: <?php the_content(); ?> the former looking content-status.php or content-aside.php or likely, in case of plain old 'post', content.php in theme root.

r - select column in data frame based on NAs in rows -

say have data frame of 7 columns, rows having 7 values , others nas past point. want grab last value (going left right) not na , value directly left. hierarchical data, groups go deeper others. want deepest , second deepest groups in 2 columns in new data frame. this code works maxes out memory data frame of 46k observations. there more efficient way i'm not thinking of? df <- data.frame(level1 = c('animal', 'vegetable', 'mineral'), level2 = c('mammal', 'pepper', 'rock'), level3 = c('dog', 'jalepeno', na), level4 = c('westie', na, na)) deepest <- apply(df, 1, function(x) length(which(!is.na(x)))) one.up <- apply(df, 1, function(x) length(which(!is.na(x)))-1) len <- nrow(df) output <- data.frame(one.up = unlist(sapply(1:len, function(x) df[x, one.up[x]])), ...