Posts

Showing posts from September, 2013

android - problem with customlist view? -

below code customlist. package com.demo.list; import java.util.arraylist; import android.app.listactivity; import android.app.progressdialog; import android.content.context; import android.os.bundle; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.arrayadapter; import android.widget.baseadapter; import android.widget.imageview; import android.widget.textview; public class mycustomlistview extends listactivity { private arraylist<string> m_orders=null; private orderadapter m_adapter; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); m_orders = new arraylist<string>(); for(int i=0;i<10;i++) { m_orders.add("android list"); } this.m_adapter = new orderadapter(this, r.layout.row, m_orders); setlistadapter(this.m_ada...

html - How can I refresh a list of images in a partialview when one of the images is clicked? -

i have partial view contained on webpage loads number of thumbnail images in set order. when thumbnail clicked want reload list clicked thumbnail becoming first image followed rest of list in order, without reloading rest of webpage. my partialview contains following code loads thumbnails , assigns each url.action . <% foreach (var image in (imagemodel)viewdata.model) { %> <a href='<%= url.action("imagelist", "imageview", new { imagefoldername = image.folder, imagefile = imagehelper.getimagename(image.path) }, null) %>'> <img src="/images/<%= image.path %>" height="<%=(image.height/4).tostring() %>" width="<%=(image.width/4).tostring() %>" alt="" /></a> <% }%> my controller has actionresult loading partial view when containing page loaded. included method returning partialviewresult . public class imageviewcontroller : controller public a...

html - Dynamically displaying input values using Javascript -

i have form, , want dynamically display elements of form filled out. imagine if had text input name. type, want name appear in different part of webpage. how accomplish in simplest manner? (see below update, realized later i'd forgotten handle pasting text field using mouse action.) you can hook keypress event (you'll want keydown , keyup well) on text input field , use trigger update of dom element elsewhere. instance: var namefield = document.getelementbyid('namefield'); namefield.onkeydown = updatenamedisplay; namefield.onkeyup = updatenamedisplay; namefield.onkeypress = updatenamedisplay; function updatenamedisplay() { document.getelementbyid('namedisplay').innerhtml = this.value || "??"; } live example that's basic example using dom0-style event handler (the "onxyz" property, don't like). simplest way these things use library jquery , prototype , yui , closure , or any of several others . they...

how can i get term id of a page in drupal? -

if browsing page of taxonomy in drupal, there way term-id of page?? ex: select * term_data limit 2; +-----+-----+--------------------------+-------------+--------+----------+------+ | tid | vid | name | description | weight | language | trid | +-----+-----+--------------------------+-------------+--------+----------+------+ | 24 | 1 | central african republic | | 0 | en | 0 | | 26 | 1 | cyprus | | 0 | en | 0 | +-----+-----+--------------------------+-------------+--------+----------+------+ if browse page of cyprus, how can tid?? thanks... got answer, arg(2) arg(0) ==> returns "taxonomy" arg(1) ==> returns "term" arg(2) ==> returns tid in other words if (arg(0) == 'taxonomy' && is_numeric(arg(2))) { return arg(2); } else return false; }

jsf - Problem in Value Change Listener -

hi, i having problem in value change listener. times listener not activated when changing value. because, retaining old value. want know, how on write current selected value in jsf life-cycle. lost in previous action doing application. want know how on write selected value. balusc explains lot here: when use valuechangelistener or f:ajax listener? i suggest add <f:ajax> component, or remove valuechangelistener , replace <f:ajax listener="..."> .

like condition in generic lists -

im wondering there condition instead of t-sql in generic list in c# 4.0, ive got gridview on page got datas , need search name , lastname, think there must couldnt find yet... use string.contains , string.startswith or string.endswith part of predicate, either using list<t>.findall or where in linq. for example: var jons = people.where(p => p.firstname.startswith("jon", stringcomparison.currentcultureignorecase)) .tolist();

android - How to keep some of the components fixed when the soft keyboard comes in? -

my application chat application, , ui is: header of app list view chat message, input box, , send button but problem when click edit text, soft keyboard comes , pushes up, need header stay on screen. i've attached simplified problem images , ui code here . (i can't post multiple links or images in post because i'm new stack overflow.) <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <textview android:text="header contents" android:layout_width="fill_parent" android:textsize="20sp" android:gravity="center_horizontal" android:layout_height="wrap_content" /> <listview android:id="@android:id/list" android:layout_width="fill_par...

javascript - Is jQuery an implementation of the Decorator Design Pattern? -

it decorates objects, think is, i'm not sure. example jquery(document).hide() changes document object adding style. edit: if not decorator design pattern? it? there must pattern name it! jquery best fits facade pattern , "define higher-level interface makes subsystem easier use." example, .css() , .hide() features designed ease of use, , jquery's ability perform action multiple elements @ once: $('.foo').css({left: '100px', top: '100px'}).hide(); // jquery // pure javascript for(var = document.getelementsbyclassname('foo'), = 0; < a.length; ++i) { a[i].style.left = '100px'; a[i].style.top = '100px'; a[i].style.display = 'none'; } jquery seems fit decorator pattern in such ways animation functionality. normal html dom elements not offer timed animations , attached queues, jquery adds that. in other areas, jquery provides same functionality available accessing underlying...

iphone - Put another view above self.imagePickerController.cameraOverlayView? -

i want customize new camera overlay view, need figure out 1 way put new view above self.imagepickercontroller.cameraoverlayview. i have tried ways [self.view bringsubviewtofront:self.imagepickercontroller.cameraoverlayview]; [self.imagepickercontroller.cameraoverlayview bringsubviewtofront:self.view]; [self.view insertsubview:self.view abovesubview:self.imagepickercontroller.cameraoverlayview]; but none can work. seem way self.imagepickercontroller.showscameracontrols = no; therefore build own components iphone.camera i think idea cameraoverlayview use base uiview you'd overlay on camera view. main overlay view can transparent, , need place whatever views want overlay on camera subviews of it. you can order these subviews want within overlay achieve desired visual effects. additionally, recommend watching wwdc 2010 video session 421 - "incorporating camera , photo library in app", go detail on how manage camera overlay views. believe ap...

python - end daemon processes with multiprocessing module -

i include example usage of multiprocessing below. process pool model. not simple might be, relatively close in structure code i'm using. uses sqlalchemy, sorry. my question - have situation have relatively long running python script executing number of functions each code below, parent process same in cases. in other words, multiple pools created 1 python script. (i don't have way, suppose, alternative use os.system , subprocess.) problem these processes hang around , hold on memory. docs these daemon processes supposed stick around till parent process exits, if parent process goes on generate pool or processes , doesn't exit immediately. calling terminate() works, doesn't seem terribly polite. there way ask processes terminate nicely? i.e. clean after , go away now, need start next pool? i tried calling join() on processes. according documentation means wait processes terminate. if don't plan terminate? happens process hangs. thanks in advance. regard...

mootools variable scope -

how access outer function's argument 'parent' ??? please see comments in code !! last edit : question misleading, problem caused wrong input argument renderdata : function(parent, children){ children.each(function(e, index){ var li = new element('li'); var haschildren = false; if(e.children && e.children.length >0){ var img = new element('img'); img.src = 'a1.png'; img.inject(li); haschildren = true; } if(e.icon){ var img = new element('img'); img.src = e.icon; img.inject(li); }else{ var img = new element('img'); img.src = 'b1.png'; img.inject(li); } li.set('html',e.te...

c++ - Include another CMake Project as Library -

i have decided make c++-qt-gui c program (both languages don’t know), using kdevelop, in turn uses cmake. the c source has no header, made one, , migrated structs it, declaration of function in c source need call. the problem can’t call it, because either cmake doesn’t find c file (and hence definition), or, when add c source source set in cmakelists.txt, complains both main.cpp , c source file have main functions. how tell cmake should make function c file available declared in header? here it: project(oregengui) cmake_minimum_required(version 2.6) find_package(qt4 required) include_directories(${qt_includes} ${cmake_current_binary_dir}) set(oregengui_srcs oregengui.cpp main.cpp qrangeslider/qrangeslider.cpp) #as add oregengui/oregengui.c, won’t work because of main function qt4_automoc(${oregengui_srcs}) add_executable(oregengui ${oregengui_srcs}) target_link_libraries(oregengui ${qt_qtcore_library} ${qt_qtgui_library}) ps: don’t want change c source much, since ind...

Google visualisation table, how to remove default twin-tone th image using css? -

please refer following link: http://code.google.com/p/browserscope/source/browse/trunk/static/goog_table.css?r=765 .google-visualization-table-tr-head, .google-visualization-table-tr-head td, .google-visualization-table-tr-head-nonstrict { font-weight: bold; background: #fff url(//ajax.googleapis.com/ajax/static/modules/gviz/1.0/table/title-bg.gif) repeat-x left bottom; text-align: center; } i trying remove default table header image, appear above gif. replace line with, testing, background-color:xxx; , nothing seems rid of default image? can help? have tried setting background-image:none !important; ?

java - pagination using velocity -

is macros / tools available pagination in velocity (spring used framework) take @ org.apache.velocity.tools.view.pagertool allows page through list of items.

c# - How to access a cell in a DataRowView based on the columns DataPropertyName? -

i have windows forms application dataset . i've used data | add new datasource add products table of northwind database datasources , created datagridview showing contents of products table. dragged products table data sources window form, columns created automatically. now, want rows containing product discontinued column true painted in different color. i've created cellpainting event handler it, i'm having trouble locating value discontinued column. because datagridview created automatically, columns in have names datagridviewtextboxcolumn1 , has datapropertyname of "productid". my question is: how can find value discontinued based on datapropertyname ? or required use name of column itself? (in case better give meaningful name) my code is: private void productsdatagridview_cellpainting(object sender, datagridviewcellpaintingeventargs e) { if (e.rowindex >= 0) { var row = productsdatagridview.rows[e.rowindex]; i...

php - Code Igniter - carts library random works -

i’m using cart library orders in web bookstore. when call addcart function on 1 of book it’s works, not time. please, help there model function: function get_books_by_id($id) { $this->db->where('book_id', $id); $query = $this->db->get('books'); return $query; echo vardump($query); } controller: function addcards($id=1) { $query = $this->kategorie_model->get_books_by_id($id); if($query->num_rows() > 0) { $item = $query->row(); $data = array( 'id' => $item->book_id, 'qty' => 1, 'price' => $item->book_price, 'name' => $item->book_title ); $this->cart->insert($data); } } view: <tr> <td class="color"><b>cena: </b><?php echo $data->book_price;?>zÅ‚</td> <td class="border" id="koszyk...

Android custom control to display map tiles -

i have on server map tiles sorted on folder structure openstreetmap (osm) uses. need able display these tiles, zoom in/out, pan , rotate map. wouldn't start scratch create new control. i've seen osmdroid didn't find way set own non vectorized tile source. i open suggestions. i first try check out source code understanding of how did it. here link source codes. more precise think this file looking for.

jquery - loop through json string via java script -

i have retrieved data database , parsed javascript var categories = <?php echo json_encode($categories); ?>; in source code categories variable has following values: var categories = [{"id":"27","name":"john"},{"id":"8","name":"jack"}] now i'm trying loop through array this $(document).ready(function(){ //alert(categories); cats = jquery.parsejson(categories); (x in cats) { alert(cats.name); } } but i'm getting nothing. problem? try this. $(document).ready(function(){ (x in categories) { alert(categories[x].name); } }

how to add some extra field in registration form in wordpress? -

i want add field in registration form in wordpress site how add it.and made entry in database. hope 1 me.thanks i have used plugin 'cimy user fields' on several clients' sites , found job well. last installed on site within last couple of months, wordpress 3 support fine.

Rails 3 and devise escaping mailer templates -

i'm using rails 3 , devise authentication. translating mailer templates devise default results in html escaping. particular consequence of confirmation of new account email includes invalid confirmation token. <p><a href=3d"http://localhost:3000/users/confirmation?confirmation_token= =3d88uo7jetcetc">confirma= r mi cuenta</a></p> the preceding 3d html escaping , should not there. using raw , html_safe has no consequence on output. ok if comes across this, here's how solved it. if mailer template included non english characters, whole template escaped. there doesn't seem way work around other escape such characters before rails does. eg: %p = "!bienvenido, #{username}!" %p usted puede confirmar su cuenta través del siguiente enlace: %p = link_to 'confirmar mi cuenta', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token.html_safe) needs be %p = ...

c++ - Export Visual Studios 08 project to PDA -

i have got visual studios 2008 application deisnged pda. how export project run on pda. pda running windows mobile 6. create , deploy cab file using installer project in studio.

bash - Recursively rename files using find and sed -

i want go through bunch of directories , rename files end in _test.rb end in _spec.rb instead. it's i've never quite figured out how bash time thought i'd put effort in nailed. i've far come short though, best effort is: find spec -name "*_test.rb" -exec echo mv {} `echo {} | sed s/test/spec/` \; nb: there's echo after exec command printed instead of run while i'm testing it. when run output each matched filename is: mv original original i.e. substitution sed has been lost. what's trick? this happens because sed receives string {} input, can verified with: find . -exec echo `echo "{}" | sed 's/./foo/g'` \; which prints foofoo each file in directory, recursively. reason behavior pipeline executed once, shell, when expands entire command. there no way of quoting sed pipeline in such way find execute every file, since find doesn't execute commands via shell , has no notion of pipelines or backq...

Need to rename project in xcode (checked out from svn) and commit back into svn -

i using xcode (3.2.3) iphone project have checked out remote svn repository (beanstalk) i need rename appears correctly (the app name on home screen). i did project -> rename xcode menu. now when want commit files (after change) facing following issues. under scm section in "groups , files" bar, getting 3 entries 1. -info.plist -> has a in scm column. 2. .xcodeproj -> not have against in scm column 3. -info.plist -> greyed out , has r in scm column. when try commit these, getting following scm error - "error: 125001 (bogus filename) description: couldn't determine absolute path of '.' " also, 4. under "other sources" have entry .pch ! mark in scm colum , 5. r in scm column against main project entry right @ top. i have tried could. looks missing trivial. using svn first time xcode , complete beginner. appreciate help. thanks dev. i ended renaming project , create fresh repository taking of time

windows - Robocopy (or xcopy) read from file? -

so have few excel sheets contain directories stemming single root directory. there anyway have robocopy (or similar program) read excel sheet input copy on selected files? this format of spreadsheets: nmmc c6 31b5ac6c-1377-4a86-90a0-73c6335907e3.img nmmc 2e 1da3d2ec-526f-479a-9c09-90cb2cfad0b6.img nmmc 8a f77168ad-2f35-490c-a2a8-25e9fa4ac0ea.img nmmc 2f fc2162f8-7548-4921-b722-5899cbe54641.img nmmc fc 1fe09fcd-3861-4de8-8bfd-4510ffa8f29c.img hcri001 1b 243161b4-eef0-4d5c-9e42-dcea6772afdd.img hcri001 a7 7e60ba72-fb8f-4d65-ae34-92b034c10e2e.img hcri001 84 7934584f-7bc8-4450-bf6d-da58ac2ebb1a.img hcri001 1a cda461ab-fe9d-4b4f-87bf-43dab9dd8644.img hcri001 2b 4f2c02b6-31c6-4d8b-975e-591778bcdfef.img icps 8a 2aca38a8-4133-4972-a03f-8c3c15654df3.img icps 89 8338f897-76c0-4f6f-9ae5-3b4c7e8a302c.img icps 30 d9dba300-6c14-4484-a147-bccb9dd15aa3.img i copy these files filesystem same structure (for example, if image originates c:\apps\test\site\nmmc\c6\31b5ac6c-1377-4...

android - Calculate text size according to width of text area -

i have text should set textview specified width. needs calculate text size fit textview. in other words: there way fit text textview area, imageview scale type feature? if size of space text takes after following might help: paint paint = new paint(); rect bounds = new rect(); int text_height = 0; int text_width = 0; paint.settypeface(typeface.default);// preference here paint.settextsize(25);// have same text size string text = "some random text"; paint.gettextbounds(text, 0, text.length(), bounds); text_height = bounds.height(); text_width = bounds.width(); edit (after comment): use above in reverse: int text_height = 50; int text_width = 200; int text_check_w = 0; int text_check_h = 0; int incr_text_size = 1; boolean found_desired_size = true; while (found_desired_size){ paint.settextsize(incr_text_size);// have same text size string text = "some random text"; paint.gettextbounds(text, 0, text.length(), bounds); t...

java - Scrolling Text with Transparent Background -

i used write tect ticker ,but unfortunately im weak on java , should make work on linux : need jlabel handles text , text should move news ticker ,it should scroll text inside jpanel end being jpanel bounds horizontally . if had experience i`ll appreciate sharing me. cheers update : solved problem using example java translucent , next using vincent ramdhanie example animate . here example of jpanel label uses simple thread scroll text. can modify suit needs. public class scroller extends jpanel implements runnable{ jlabel label; string str = "the message scroll "; public scroller(){ super(); label = new jlabel(str); add(label); thread t = new thread(this); t.start(); } public void run(){ while(true){ char c = str.charat(0); string rest = str.substring(1); str = rest + c; label.settext(str); try{ thread.sleep(200); }catch(interruptedexception e){} } } ...

java - How to manually commit a managed transaction -

i given "api" in form of jar external accounting operations java-seam-hibernate appplication. internally, api plain hibernate application, using 2 independent data sources besides 1 used seam itself. the issue 1 of "api" operations raises following exception when doing internal .commit(): java.sql.sqlexception: cannot commit during managed transaction! @ org.jboss.resource.adapter.jdbc.basewrappermanagedconnection.jdbccommit(basewrappermanagedconnection.java:543) @ org.jboss.resource.adapter.jdbc.wrappedconnection.commit(wrappedconnection.java:334) @ org.hibernate.transaction.jdbctransaction.commitandresetautocommit(jdbctransaction.java:139) @ org.hibernate.transaction.jdbctransaction.commit(jdbctransaction.java:115) @ com.other.apiaccountingimpl.moneymovement(apiaccountingimpl.java:261) @ com.myapp.integration.externalapiintegrator.storeacountingdata(externalapiintegrator.java:125) @ com.myapp.session.employeeaccounting.persist...

zend framework - Divs inside another, shows up when .slideDown() is used in the outer div with Jquery and IE8 -

the above code works in browsers except in ie8 works in compatibility-mode. removed markup inside divs, there huge tables. in ie8 when check checkbox('rf'), suposed show 2 divs(#frmrf , #frmantenas), it's showing div(#frmtx), if think markup not ok, generated zend_form, i'd not have hidden each checkbox create. <script> $('input[name="rf"]').change(function(){ if($(this).is(':checked')){ $("#frmrf").show(); $("#frmantenas").slidedown(); }else{ $("#frmrf").slideup('slow'); if(!$('input[name="tx"]').is(':checked')) $("#frmantenas").slideup('slow'); } }); </script> <table> <tr> <td> <input value=0 type=hidden name=rf ><input id=rf value=1 type=checkbox name=rf> <font class=legenda>rf</font> </td> </tr> </table> <d...

php - How to programmatically turn any webpage into an RSS feed? -

there many websites , blog provide rss feeds, on other hand there many not. want turn type of web page rss feeds. i found solutions using through google feed43 , page2rss , dapper etc, want open source project can perform task or tutorial explaining it. please give me suggestions , if can explain, welcome. my preferable language php. there's nothing magic rss. suggest read tutorial understand how build rss feed scratch: http://www.xul.fr/en-xml-rss.html then use php skills build 1 content. generic html-to-rss scraper can found online searching "html rss converter" or whatever, of these hosted solutions , rss feeds produce aren't great. rss feed requires understanding content you're syndicating, not raw html. imho.

How do I setup git on Windows? -

i new terminologies: git, repository , cloning. able search them online , pretty grip on each (pretty simple stuff!). trying figure out how "run" these instructions: clone repository app: git clone git://github.com/samplelink.git update submodules: git submodule update --init i running windows7. tried run init through command prompt, no luck. these supposed run individual commands or 1 following other in sequence automatically? not sure how run these on windows machine , cannot seem of work. the submodule file within initial repository. i'm sorry if lame question, have never needed run type of setup before. i recommend installing msysgit in "git windows" instance : git-1.7.3.1-preview20101002.exe i using option 2 , adding git\bin directory path environment variable, without overriding built-in windows tools. from there, git clone over http should work.

c# - Invariantly convert ET DST/STD to UTC -

i have logs had been written in et dst timezome, parsed them , wrote log utc time ( date.touniversaltime().getdatetimeformats('g', cultureinfo.invariantculture)[0] ). (when standart time enabled) try run unit tests compare logs , face in issue times differ in hour. is there way invariantly compare outputs without recreating logs. instead of using pattern 'g' (general date time pattern) not include time zone information should @ using 'o' (round-trip date time pattern) preserve time zone information , structure string in such way easy sort on. o: 6/15/2009 1:45:30 pm -> 2009-06-15t13:45:30.0900000 g: 6/15/2009 1:45:30 pm -> 6/15/2009 1:45:30 pm (en-us)

wordpress - Single Taxonomy Attached to Multiple Post Types Template Question -

so have site 6 custom post types.three of these post types attached single custom taxonomy. i able list_cats in sidebar , spit out url ../%post_type%/%taxonomy%/ , have take taxonomy-%taxonomy%.php template , return results of %post_type% . i can create conditional read current %post_type% , style correctly once in taxonomy-%taxonomy%.php file. need direction on effective method modify url pass %post_type% query. thanks in advance. have searched couple days no clear answer. so here feeble attempts @ solution yet 1 big fail based off discussion found @ rlmseo.com ant answer here. trying add post type variable use in query: practice-areas taxonomy. trying add variable can use filter taxonomy post type in taxonomy-practice-areas.php function add_query_vars($avars) { $avars[] = "cust_pt_var"; // represents name of custom post type shown in url return $avars; } // hook add_query_vars function query_vars add_filter('query_vars', '...

listener - Passing one object to many classes using Java -

i need pass object 1 class many different classes. the aim of create 1 method broadcasts object other classes listening. more classes can added , need implement listener function class , not edit of framework. i trying accomplish without use of jms (if it's possible!) observer pattern rescue! woooosh! let subject define method relaying object many listening observers. can dynamically add , remove listeners.

Integrating ASP.NET C# website as subsite to a VB website -

i have asp.net 2.0 website created in c# acts independent site , looking integrate existing asp.net 2.0 website created in vb.net. unfortunately don't know server management side of asp.net yet i'm unaware of when comes iis configuration etc. have advice how can go integrating this? want host in subdirectory root when hit example.com/myindependantsite/ pull c# site. one possible solution came across mentioned dropping project folder root directory , setting directory application virtual directory in iis? few other random questions small things application relative links (~/for-example.aspx) stay relative root subdirectory if it's made application virtual directory? trying running on site said it's independent want preserve websites environment. everyone!! first off, language doesn't make difference- both .net, , can live side-by side easily. setting virtual directory may work, depending on assumptions made when developing c# site. relative links re-...

c# - What should be the approach for implementing data storing -

i having variables page no position url text word i having above different words i.e word 1 may have page no =1 position =10 url abc.com text realtext word real and on have save them in list. first thought of declaring list each thought not idea. is there way save them can access data according url? i not have use database. these lists temporary , populated each time program starts. create class variables want properties: class storage { public string url { get; set; } //etc. } edit: can use class store information: storage mystorage = new storage(); mystorage.url = "www.example.com"; //etc then can store each object created in generic dictionary: dictionary<string, storage> dict = new dictionary<string, storage>(); dict.add(mystorage.url, mystorage); edit: , can retrieve each object url: storage fromdict = dict["www.example.com...

php - List Title But End At Last Word -

i have site listing titles, , since each title larger our needed space have use following code break down if larger amount of characters, , show ...: <?php $title = get_the_title(); echo mb_strimwidth($title, 0, 45, '...'); ?> is there way possibly list amount of words, instead of characters, can @ least have full word @ end of title instead of character , ...? any appreciated. on wp system. since you're using multi-byte string functions, can do: if (mb_strlen($title) > 45) { $title = mb_substr($title, 0, 45); // make sure ends in word chomping @ last space $title = mb_substr($title, 0, mb_strrpos($title, " ")).'...'; } echo $title;

mysql - Updating Column based on values from values in its own table -

basically trying execute query update communication_relevance set score = (select ((ces.expert_score * cirm.consumer_rating) + (12.5 * scs.similarity)* (1 - exp(-0.5 * (cal.tips_amount / at.avg_tips)) + .15))as answer_score communication_relevance cr join network_communications nc on cr.communication_id=nc.communications_id join consumer_action_log cal on cr.action_log_id=cal.action_log_id join communication_interest_mapping cim on nc.parent_communications_id=cim.communication_id join consumer_interest_rating_mapping cirm on cr.consumer_id=cirm.consumer_id , cim.consumer_interest_expert_id=cirm.consumer_interest_id join consumer_expert_score ces on nc.sender_consumer_id=ces.consumer_id , cim.consumer_interest_expert_id=consumer_expert_id join survey_customer_similarity scs on cr.consumer_id=scs.consumer_id_2 , cal.sender_consumer_id=scs.consumer_id_1 or cr.consumer_id=scs.consumer_id_1 , cal.sender_consumer_id=scs.consumer_id_2 cross join (select avg(tips_amount)...

php - rmdir() bug with particular filename? Permission denied -

first, let's these out of way: there no open handles on directory. there no files in directory. chmod ing permissions 0777 not prevent error. the directory name correct. now then, here's problem. rmdir() throwing error when trying delete directory: rmdir(098f6bcd4621d373cade4e832627b4f6) [function.rmdir]: permission denied in path\to\administrate.php on line 124 098f6bcd4621d373cade4e832627b4f6 name of directory. here relevant portion of script. if(is_dir($userhash)) : foreach (new directoryiterator($userhash) $fileinfo) { $filename = $fileinfo->getfilename(); if($fileinfo->isdot()) continue; if(!rename($userhash.'/'.$filename , 'trashcan/'.$username.'/'.$filename)) { echo '<p class="error">could not move '.$filename.'</p>'; $err = 1; } } else : echo '<p class="error">unable delete files! error: 67</p>'; $err =...

xaml - Silverlight custom control default xmlns -

in silverlight, possible set default xmlns name of custom control? by default, each time drag , drop 1 of custom contrl on window, assembly , control automatically added xaml: ... xmlns:my="clr-namespace:myassemblyname;assembly=myassemblyname" ... <my:mycustomcontrol name="whatever"/> everthing works fine exect replace "my" namespace else (myassemblyname) without editing xaml manually. you should able control prefix used xmlnsprefixattribute assembly attribute. place in assemblyinfo.cs found in properties folder of project. while you're @ may add xmlnsdefinitionattribute de-couple xaml namespace assembly , .net namespace. [assembly: xmlnsdefinition("http://schemas.yourorganisation.com/controls", "myassemblyname")] [assembly: xmlnsprefix("http://schemas.yourorganisation.com/controls", "myc")] now when drop control tool bar should get:- ... xmlns:myc="http://schemas.youro...

html - CSS Dropdown menu -

is there css dropdown menu solution use in regular html website? or using javascript better? this current favourite css dropdown menu solution. site presents lot of great themes. recommend reading through html , css understand how works can build on solution.

.net - Can I map an EF entity to two tables with a polymorphic foreign key? -

i make new, mapped entity looks this: public class patheditem { public long id { get; set; } // items table public string name { get; set; } // items table public string path { get; set; } // paths table } the problem path in different table other items , 1 of tables has polymorphic foreign key. here tables: create table items ( [id] [bigint] identity(1,1) not null, [name] [nvarchar](255) not null) create table paths ( [id] [bigint] identity(1,1) not null, [path] [nvarchar](255) not null, [itemid] [bigint] not null, [itemtype] [int] not null) microsoft has howtos on mapping entities 2 tables ( here , here ), seem rely on normal foreign key. is there way map paths.itemid items.id , hardcode value paths.itemtype in join? one way create view, columns require , filter on itemtype. then add view entity model.

github - git rebase fatal: Needed a single revision -

i have branch of public repository , trying update branch current commits original repository: $ git fetch <remote> remote: counting objects: 24, done. remote: compressing objects: 100% (20/20), done. remote: total 20 (delta 12), reused 0 (delta 0) unpacking objects: 100% (20/20), done. git://github.com/path_to/repo 9b70165..22127d0 master -> $/master $ git rebase <remote> fatal: needed single revision invalid upstream <remote> the <remote> in place of remote name , not remote name. documentation on error seems bit loose. you need provide name of branch (or other commit identifier), not name of remote git rebase . e.g.: git rebase origin/master not: git rebase origin note, although origin should resolve the ref origin/head when used argument commit reference required, seems not every repository gains such reference may not (and in case doesn't) work. pays explicit.

Debugging osascript execution from within a ruby daemon -

i have need run applescript on web server. server running rails, , need access models before , after running script, thought daemon (via daemons gem ) might appropriate. in theory easy. below simplified example. #!/usr/bin/env ruby env["rails_env"] ||= "development" require file.dirname(__file__) + "/../../config/application" rails.application.require_environment! $running = true signal.trap("term") $running = false end while($running) rails.logger.info "daemon running @ #{time.now}.\n" # sanity check %x{touch /foo.txt} # stops working after while result = %x{/usr/bin/osascript -s o /path/to/the/script.scpt} # under normal operation, applescript spits out string result rails.logger.info "result: #{result}.\n" sleep 30 end for testing purposes i've replaced (somewhat long , time consuming) production applescript one-liner. here is, in glory: "it worked!" because apples...