Posts

Showing posts from January, 2010

php - mongoDB index strategy -

i have collection called post. have mapping system ensures each document has these fields: id (int) target (string) type (string) user_id client_id updated (string, 11 int timestamp) created (string, 11 int timestamp) enabled (bool) this collection accessed output in api schema. so typical requests might be: /post?type=image&user_id=2 /post?updated=35234423&order_by=client_id /post?enabled=true&order_by=id there no 100% guarantee fields make find or sort field. recently when table reached 8gb of data, started getting error: "localhost:27017: data sort() no index. add index or specify smaller limit" i have looked @ documentation mongo index , found difficult understand whether works in same way mysql index. some threads found on indexing: mongodb - data sort() no index error seem suggest using specific sort fields ensure index hit. cannot when alot of filtering , sorting optional. could suggest firm solution in terms of whether sho

java - How to return from an AlertDialog to the AlertDialog before -

how can return alertdialog called , offers more buttons , user clicks on 1 of buttons, new alertdialog pops input field. if check if user input e.g. numeric, how can return alertdialog offered before? i'd suggest using dialogfragment support library each of these dialogs. add onclicklisteners each of buttons of first dialogfragment , show second dialogfragment in onclick . there should not necessity checking if input number if set appropriate input type first. when user taps button on second dialogfragment , call dismiss() .

Does Qt Webkit with pyside and QML work with angularjs -

i trying use angularjs in qt-webkit application pyside bindings. doesn't seem work. basic templates {{2+3}} also not work. saw this. saw post on github https://github.com/angular/angular.js/issues/2985 but didn't understand further implications of limitations mentioned. mean separately loaded js not work because pre-compiled.

php - How to add many files with silverstripe uploadfield -

hello everyone , i'm trying add more 1 file uploadfield code -> class filedo extends file { static $has_one = array( 'documentsfile' => 'documentsfile', ); } class documentsfile extends dataobject { static $has_one = array( 'documentpageacces1' => 'documentpageacces1' ); static $has_many = array( 'files' => 'filedo' ); public function getcmsfields() { $fields = parent::getcmsfields(); $fields->removebyname('documentpageacces1id'); return $fields; } public function onbeforewrite() { parent::onbeforewrite(); $page = dataobject::get_one('documentpageacces1'); if($page) { $this->documentpageacces1id = $page->id; } } } class documentpageacces1 extends page { static $has_many = array( 'documentsfiles' => 'documentsfile

variables - PHP For loop required for storing data in MySQL -

mysqli_stmt_bind_param($proc, "iss$is", $respondent_id, $ip, $browser, $qstr1); it's causing problem, though $qstr1 contains text $q1, $q2 etc. things stand think $qstr1 being treated single variable within code, guess need extract text , use no sure how? using answer provided below, have modified , added to: $qstr = ''; $markstr = ''; for($i=1; $i<11; $i++) { $qstr .= 'q'.$i.''; $qstr1 .= '$q'.$i.''; $markstr .= '?'; $is .= 'i'; if($i < 10) { $qstr .= ', '; $qstr1 .= ', '; $markstr .= ', '; } } $proc = mysqli_prepare($link, "insert tresults (respondent_id, ip, browser, $qstr) values (?, ?, ?, $markstr);"); mysqli_stmt_bind_param($proc, "iss$is", $respondent_id, $ip, $browser, $qstr1); now, i'm having problem $qstr1 - though looping t

vba conditional find & replace -

today stuck code while trying replace dot (.) if in list sheet1 not match 1 of values list of sheet (same workbook). " argument not optional " error not give me other hint. sub filter(wss worksheet, wsn worksheet, integer, j integer, k integer, l integer, integer) ' ' substitute macro ' application.screenupdating = false range("a1").formular1c1 = "sorted" set wss = sheets("sheet1") set wsn = sheets("non_confid") col1 = "a" col2 = "e" col3 = "c" for = 1 200 if wss.range(col1 & a) = wsn.range("ab2:ab600") = + 1 else: range(col1 & a).replace what:=".", replacement:="", lookat:=xlpart, searchorder:=xlbyrows, matchcase:=false, searchformat:=false, replaceformat:=false = + 1 end if next range("a1").autofilter activeworkbook.worksheets("sheet1").autofilter.sort.sortfields.cle

xampp - How Do I run Localhost? -

hi figure out how can run local host. keep getting error of port 480. page unable load. check browser compatibility already.cheers. perhaps programmes such skype have blocked off port.

python - Add object to existing value in dictionary -

in order make own tile based rpg, have question. have dictionary want, during creation of tile map, store pairs of tile type/ rect values e.g. {1: rect(0, 0, 32, 32), 2: rect(0, 32, 32, 32)} my problem have give every key multiple values, since there limited number of tile types multiple tiles of each type. tried this: def create(self): x, y = 0, 0 row in self.matrix: tile in row: self.surface.blit(tiles[int(tile)].img, (x-camerax, y-cameray)) tiles[int(tile)].rect = pygame.rect(x-camerax, y-cameray, 32, 32) if numbers[tiles[int(tile)]] not in collision_list: collision_list[numbers[tiles[int(tile)]]] = tiles[int(tile)].rect else: dummytuple = collision_list[numbers[tiles[int(tile)]]] collision_list[numbers[tiles[int(tile)]]] = dummytuple, tiles[int(tile)].rect x += 32 if x >= self.surface.get_width(): y += 32

angularjs - Writing Unit Test Case in Angular JS using Jasmine -

i building application using angular js. new don't know writing test cases in it. suppose have service: angular.module('myapp'). factory('mainpage', function($resource,base_url){ return $resource("my api call", {}, {query: {method:'get'}, isarray:true}); }). my controller: var app = angular.module('myapp') app.controller('mainctrl',function($scope,mainpage,$rootscope){ $scope.mainpage = mainpage.query(); }); how write test case controller in angular js using jasmine. you write along these lines: describe('myapp controllers', function() { describe('mainctrl', function(){ it('should populate query', function() { var scope = {}, ctrl = new mainctrl(scope); expect(scope.mainpage).toequal(somemainpagemock); }); }); }); this documented, see angularjs tutorial quick reference, it's suggested read jasmine docs (!). you'd want spy on q

sql - How update order -

this table: id int (primary key) name order i'm trying move up/down rows. want update order field. update technology set order = order + 1 id = 2; i'm guessing have problem column name order . order keyword can't use directly. try way: update technology set [order]=[order]+1 id=2 try this: update menu set [order]=m2.[order]+1 menu join menu m2 on menu.[order]= m2.[order]-1

opencv - Mat::convertto() not working in javacv, android camera -

i developing android opencv app based on opencv4android sdk tutorial 2 - mixed processing. in frame processing function public mat oncameraframe(cvcameraviewframe inputframe) {} the frame rgba , want make rgb doing this: mrgba = inputframe.rgba(); mgray = inputframe.gray(); mat mrgb=new mat(640,480,cvtype.cv_8uc3); mrgba.convertto(mrgb, cvtype.cv_8uc3); //imgproc.cvtcolor(mrgba, mrgb, cvtype.cv_8uc3); pinkimage(mrgb.dataaddr()); but when debug , log things passed jni part, find it's not working @ all. mrgb cv_8uc4 after calling converto() what cause of this? ok, answer here imgproc.cvtcolor(mrgba,mrgb,imgproc.color_rgba2rgb); instead of mrgba.convertto(mrgb, cvtype.cv_8uc3); thanks lot!!

Select datas from multiple tables using one common table in sql server 2005 -

i have many tables , 1 common table have ids of these tables eg: table1 | id | value | date | --------------------------- | 1 | 200 | 25/04/2013 | | 2 | 250 | 26/05/2013 | table2 | id | value | date | --------------------------- | 1 | 300 | 25/05/2013 | | 2 | 100 | 12/02/2013 | table3 | id | value | date | --------------------------- | 1 | 500 | 5/04/2013 | | 2 | 100 | 1/01/2013 | and 1 common table | id | table | tableid | ------------------------- | 1 | table1 | 1 | | 2 | table3 | 1 | | 3 | table2 | 1 | | 4 | table1 | 2 | | 5 | table2 | 2 | | 6 | table3 | 2 | and using common table need select datas in above 3 tables eg: output id table tableid value date 1 table1 1 200 25/04/2013 2 table3 1 500 5/04/2013 3 table2 1 300 25/05/2013 4 table1 2 250 26/05/2013 5 table2 2 100 12/02/2013

java - ListView opening a new activity -

this more design centric question. thinking of developing app have listview containing arrays of example, coffee names. now when user clicks on coffee name, want have detailed info page on coffee style , how make it. imagine new window lot of info. my main question is, think best way open new activity on click in listview? new android not sure if there simpler way this. thanks can help! you right, creating new activity on click of list item right approach so.

html - Bootstrap popovers not working in table -

i've included following in html file: <h:outputstylesheet name="css/bootstrap.css" /> <h:outputscript name="js/jquery-2.0.2.min.js" /> <h:outputscript name="js/bootstrap-tooltip.js" /> <h:outputscript name="js/bootstrap-popover.js" /> the part supposed make popover: <ui:repeat var="lowfarecalendersearchitem" value="#{lowfarecalendersearchitems}"> <td> <a href="#" id="searchitem" class="btn" rel="popover">#searchresult.gettotal()}</a> <script> $("#searchitem").popover({ title: "title", content: "content" }); </script> </td> </ui:repeat> the popovers i'm trying display don't turn when hover on or click button. i have looked @ other similar questions, , nothing i'

web services - ExtJS 4 consuming server response -

i'm working extjs4 in large legacy web application, , trying figure out how tie view particular sub-object inside store handles web services proxy. webservice provide object so: foodorder = { result: { date : 02/11/2013, orderid: 123456, fruitproducts: { melons: { water, cantelope, ... }, apples: { delicious, granny smith, ... } } } } the store receiving response looks this: ext.define('myapp.model.foodorder', { extend: 'ext.model', fields: [ {name: 'date', type: 'date'}, {name: 'orderid'}, {name: fruitproducts, type: 'array'} ], proxy: { type: 'mycustomproxy', url: 'the/food/store/order', reader: { root: 'result', totalproperty: 'totalcount' } } }); wh

sql - Cursor while loop never stop. what is wrong in this code? -

/*create table m_b (code varchar(10),itemcount int,type varchar(30),amount money) insert m_b values ('b001',1,'dell',10) insert m_b values ('b001',1,'dell',10) insert m_b values ('b001',1,'apple',10) insert m_b values ('b001',2,'apple',20) insert m_b values ('b001',2,'apple',20) insert m_b values ('b114',1,'apple',30.5) insert m_b values ('b114',1,'apple',10) */ --select * #temp m_c 1=2 declare cur_test cursor select jobid,start,end_date,dayrate m_c go declare @jobid int declare @start date,@end_date date declare @dayrate int open cur_test fetch cur_test @jobid,@start,@end_date,@dayrate --begin declare @jan int set @jan=0 while (@@sqlstatus != 2) begin if month(@start)=1 begin select @jan= @jan + datediff(dd,'2013-01-31',@start) -- testing purpose insert #temp values (@jan,@start,@end_date,56) end if month(@end_da

multithreading - WCF (WPF) error: calling thread must be STA -

i receive data service reference. the structure f.e. follows: receive driverdata service reference (namespace: servicereference.driver) namespace of driverdata in project 'myproject.driver'. driverusercontrol should created in constructor of myproject.driver. public driver(int id, string name, string telephone, string plate, dictionary<datetime, transporttype> transporttypes, division division) { this.id = id; this.name = name; this.telephone = telephone; this.plate = plate; this.transporttypes = transporttypes; this.division = division; usercontrol = new driverusercontrol(this); } but when here: public driverusercontrol(driver magnet) { initializecomponent(); this.magnet = magnet; render(); } whenever reaches constructor of usercontrol following error "the calling thread must sta, because many ui components require this" shows up.

android - Table Layout column taxt right align -

in tablelayout have align text in first column right , third column text left (my second column dummy column spacing). aligning right problem . have 1 concern if content in second column doesn't fit in 1 line how make continue on second line because if entering big text in second column trying fit in 1 line , going out of mobile screen width. <?xml version="1.0" encoding="utf-8"?> <tablelayout android:id="@+id/widget35" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:stretchcolumns="0,2" xmlns:android="http://schemas.android.com/apk/res/android"> <tablerow android:id="@+id/widget43" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <linearlayout android:id="@+id/widget33" android:orientatio

c# - DataMember attribute on private members - Whats happening under the hood -

[datacontract] public class myclass { [datamember] private string privatefiled; // other properties elided. ... } how privatefiled getting set datacontractserializer when serialized/deserialized, how able access private variable. happening under hood? concepts behind this. please point sources on this. you can access non-public members via .net reflection api . reason, although public/private/internal modifiers imply sort of security, should thought of organizational in nature, since circumvented reflection.

android - How can I add multiple tags for one view directly in XML? -

as question states want add more 1 tag xml view. example, want set array of strings , separate string resources. know how them individually want know if there's way of attaching more 1 tag view directly within xml code. edit: my plan have linearlayout (l#1) contained dynamic amount of of different linearlayout (l#2) , within view there spinner , edittext. need 1 tag hint of edittext , other array of strings populate spinner. in entire layout there multiple l#1 each using l#2 populate dynamically , each needing different hints , string arrays based on used for. my next idea add integer tag represent l#1 , and use switch/case block in code populate children of l#2 right hints , string arrays. i don't think possible in xml, in code create custom object holds strings require , set tag. class customtagobject { public list<strings> strings; public string mystring; } then later customtagobject tagobj = new customtagobject(); tagobj.strings = new

python - Test a pair of network sockets at the same time -

i have app x can run on either of 2 computers, on no more 1 @ once. have app y, written in python, given 2 possible ip addresses needs find out computer running app x (if any). i've partially solved having udp service listens on port , responds 'hello' whenever receives data. client can try , send data app x port on each address , if gets response, know application running on computer. my code far looks this: def ipaddress(self): """test side responds on status port.""" s = socket.socket(socket.af_inet, socket.sock_dgram) try: s.settimeout(5) s.sendto("status", (addr_a, port)) s.recvfrom(1024) except socket.timeout: try: s.sendto("status", (addr_b, port)) s.recvfrom(1024) except: pass else: return addr_b else: return addr_a finally: s.close() return none the problem functio

php - Regular expression to match numeric columns -

need regular expression matches numeric columns only. each row of numeric columns may or may not contain decimal point plus minus sing , letter "e". number of white spaces between each column may happen more one. , number of columns not fixed. representative sample of text parsing. #b0 alphanumeric line 26_0000 abc #b1 57 115 550.000000 270.000000 #n 18 #labels x y else here -16.3252 -11.205718 0 2.61836e-07 110 -16.1728 -10.90549 0 2.61836e-07 87 -16.0228 -10.605516 0 2.61836e-07 50 -15.8728 -10.305796 0 2.61836e-07 31 -15.7229 -10.005822 0 2.61836e-07 49 -15.5727 -9.705594 0 2.51826e-07 4998 -15.4228 -9.40562 0 2.71836e-07 176 alphanumeric -14.9729 24678 com @ -14.7531 sum = 147364 ave.mon./time = 136117 i'm little unclear you're asking for, let me @ least point in right direction... you know this: \d*(?:\.\d+)* matches decimal number. so, extend match negative numbers so: -?\d*(?:\.\d+)* and extend

c# - Embed object in Excel programmatically -

i've tried several libraries, including epplus, npoi , can insert images, couldn't find how insert objects( pdf's, text files, images ) as files . there way or library in .net? thanks! using code able embed pdf file, txt file , , png file excel using c#. public static class excelreaderfunctions { public static void excelinsertole(string path) { microsoft.office.interop.excel.application excel = new application(); excel.workbooks.add(); microsoft.office.interop.excel.workbook workbook = excel.activeworkbook; microsoft.office.interop.excel.worksheet sheet = workbook.activesheet; oleobjects oleobjects = (microsoft.office.interop.excel.oleobjects) sheet.oleobjects(type.missing); oleobjects.add( type.missing, // classtype path, // filename true, // link

Matlab spectrogram Hann window -

my task have signal in .wav format sampling frequency 44100hz. want power spectrum. stft hann window size 200ms , window period 50hz. frequency range forcing 0 ~ 22000hz. my question can want following code? [y, fs, nbits, opts] = wavread('a.wav'); [s,f,t,p]=spectrogram(y,hanning(8820),7938,[0:100:22000],fs); the matrix p returned above code want, right? further question what relationship between window size , fft size? through independent in past not sure. can provide simple answer or reference reading? i have command specgram(x, 512, 8000, hamming(80)); --- guess original purpose that: signal sampling frequency : 8000 window nfft : 1024 window period : 10ms actually, not sure original purpose of code, can read it? i not think formatting spectrogram code properly. the commands follows [s,f,t,p] = spectrogram(x,window,noverlap,nfft,fs) where x data, window hanning window, noverlap window jump, nfft fft size , fs data's sampling rat

Understading google geocoding service component filters -

i testing components filters when came across not expecting: using filter improve results of queries . address tested "avenida de almirante reis, 61 c/v.d, lisboa". without filter result point locality, while if add country filter point exact address. which leads me doubt knowledge on filters. modification filter should reduce set of answers, not change it, happens in case. i know because i'm using google's geocoding service , need explain (to degree) why results get, means understanding behaviour. thanks in advance. no , yes. component filters meant restrict results, not change them. both examples return country now, these work: http://maps.googleapis.com/maps/api/geocode/json?address=avenida%20de%20almirante%20reis,%2061%20lisboa http://maps.googleapis.com/maps/api/geocode/json?address=avenida%20de%20almirante%20reis,%2061%20lisboa&components=country%3apt however, see note in component filtering documentation : note : each addres

apache - Persistent .htaccess Rewrite Rules? -

This summary is not available. Please click here to view the post.

jquery - Get value of attribute added to the dropdownlist -

<option visible="false" value="5"></option> this asp.net dropdownlist i have added attribute visible in code behind. want value of visible attribute jquery. say name of dropdownlist vehicleslist i have tried: var value = $('#ctl00_maincontent_dropdownlist option:selected').attr('visible') but value undefined . $isvisible = $('select option:selected').attr('visible'); http://jsfiddle.net/gtpak/

php - How do I change this to make an if statement for showing up on Paypal -

i having trouble code have. making donation page website , not sure how go part of showing "item_name" part of it. have several options possible donations , show option chose showing in item_name when being redirected pay. have: $price = '6.50'; if($_get['prod'] == 1) //price package 1 (regular donator) $price = '6.50'; if($_get['prod'] == 2) //price package 2 (extreme donator) $price = '12.50'; if($_get['prod'] == 3) //price package 3 (10 sof spins) $price = '2.50'; if($_get['prod'] == 4) //price package 4 (20 sof spins) $price = '4.00'; if($_get['prod'] == 5) //price package 5 (fight kiln completion) $price = '5.50'; if($_get['prod'] == 6) //price package 6 (1 ragged gold key) $price = '2.00'; if($_get['prod'] == 7) //price package 7 (4 ragged gold keys) $price = '

Crystal Reports book for formulas or charts -

have completed crystal reports 2011 developers , ready move onto next stage learn ways of doing complicated reports ( job ). there advanced or intermediate book out there on formulas , 1 on charts , these 2 areas wish develop appreciated thank i in charge of metrics reporting work. write , maintain of our crystal reports. here 2 books should at. crystal reports xi: complete reference (osborne complete reference series) no stress tech guide crystal reports xi beginners (2nd edition) both of these books have sections on formulas. second book has pretty section on charts. rest of might little basic you, it's reference book. both can found on amazon.com if want deeper on formulas, learn visual basic. search visual basic crystal reports , you'll find wealth of resources. good luck!

c# - Autofac ordered list as parameter -

i have object takes ordered list (iorderedenumerable) of items order of items important. public class orderedlistworker : ilistworker { private orderedlistworker(iorderedenumerable<ilistitem> orderedlistitems) { foreach (var listitem in orderedlistitems) listitem.dosomethingwhereordermatters(); } } i have multiple objects of type ilistitem . how can register orderedlistworker autofac , ensure listitems in specifc order @ run time? i see order isn't guaranteed in this post , i'm not sure how guarantee order. i have solution, combination of iorderedenumerable , , resolveordered<tcomponent> solution post linked above. using autofacextensions class: public static class autofacextensions { private const string orderstring = "withordertag"; private static int _ordercounter; public static iregistrationbuilder<tlimit, tactivatordata, tregistrationstyle> withorder<tlimit, tacti

node.js - Proxy HTTPS without certificate with nginx -

is possible setup nginx proxies https connection without decrypting it? i'm talking this: server { listen 443 ssl; server_name example.com; location / { proxy_pass https://localhost:8000; proxy_set_header x-real-ip $remote_addr; } } i know, nginx need certificate add x-real-ip header, can re-encrypt proxy? my motivation behind is, want pass traffic through node app, has spdy enabled. being able use spdy in node, need decryption reside inside app. no, it's not possible. nginx have use host header match server_name of server block. without decrypting request, nginx doesn't know request header information. server block won't matched. nginx 1.4+ supports spdy. http://nginx.org/en/docs/http/ngx_http_spdy_module.html . however, doesn't support server push yet. if don't need server push, why not terminate ssl @ nginx level?

python - Force nosetests to find doctests in modules starting with underscore -

basically in project use following pattern: package: __init__.py _mod1.py _mod2.py these modules considered implementation detail , don't want users import them. use doctests test internal modules. in default configuration nosetests won't find doctests in these modules. i tried fix using match option (and doctest modules matched), dummy matches python stdlib. details of system: python 3.3 python compiled pythonz i use virtualenv , virtualenvwrapper nosetests installed inside virtualenv i use nose 1.3.0 here nose config file: [nosetests] match=[^.][tt]est with-doctest=1 processes=50 process-timeout=25 verbosity=3 attr=!singleprocess ignore-files=.*pythonz.* examples of bogus matches: ====================================================================== error: skip test. ---------------------------------------------------------------------- traceback (most recent call last): file "/home/jb/.pythonz/pythons/cpython-3.3.2/lib/python3.3/

oracle - tricky plsql procedure to delete data -

friends , pl/sql gurus... i trying create procedure delete data audit table don't know start with.. it great if provide tips or pointer... requirements: procedure run on first saturday of month (not sure possible via pl/sql or have create separate job) delete data older 2 months mon - sat , date shouldn't 1st of month. (i.e. leave sunday & 1st of month data older 2 months) e.g. *procedure delete_log begin delete audit_logs created >= trunc(sysdate - 60) , created < trunc(sysdate) , created != (sunday) , created != (first of month); commit; end delete_log;* i don't have experience pl/sql tips appreciated.. thanks, mike to schedule job can use cron job @ server level or oracle scheduler run tasks http://docs.oracle.com/cd/b28359_01/server.111/b28310/scheduse002.htm#i1006395 something work: create or replace procedure delete_log begin delete audit_logs trunc (created) < add_months (trunc (sysdate), -2)

Gradle test: how to do something even if the tests fail -

my current test task looks this: test { dofirst { println 'starting application...' thread.startdaemon { appprocess = testserverexec.execute() } sleep 20000 // wait thread start } dolast { appprocess.destroy() } } i've noticed if tests pass, appprocess.destroy() called , everyone's happy. however, if tests fail, thread lingers , have kill process myself. know gradle has try/finally, i'm not sure how use correctly in case. basically, want appprocess.destroy() run, if tests fail. how might go it? edit: discovered beforesuite , aftersuite , run multiple suites of tests , want thread started before suites, , killed after suites. you can use aftersuite , check suite null parent. root suite: test{ aftersuite{descr, result -> if(desc.parent == null){ //put logic here } } } hope helps, cheers, rené

antlr - ANTLR4: Error when I try to find which parser subrule matched -

i've got parser rule this, , need know subrule matched: dt returns [dt v] : (d1=date t1=time?|t2=time d2=date?) {if ($d1 == null) // right side matched ... } ; i antlr4 error message: "missing attribute access on rule reference 'd1' in '$d1'". i can rid of error putting e.g. $d1.v , nullpointerexception @ runtime in antlr-generated code at if (((dtrcontext)_localctx).d1.v != null) because _localctx.d1 null, _localtx.d1.v uses null ptr. any ideas on how can resolve impass? the context object d1 (parse tree node of type datecontext ) can referenced $d1.ctx . equivalent assuming $d1 alone do.

mysql - Count rows returned from a GROUP BY -

i have query select count(*) `applications` approved =0 group user_id order `applications`.`user_id` asc which ( in case ) returns 2 rows this count(*) 1 1 but count isn't counting whole query, 1 row @ time. how desired output? count(*) 2 edit the reason group users have more 1 application counts 1. example john has 4 applications tracy has 1 applications fred has 2 applications total count returned 3. this return 2: select count(distinct user_id) applications approved = 0 it's hard tell whether want or dvk's answer right, because both return same answer when each user has 1 matching row.

c# - Creating a separate Excel process -

i have excel spreadsheet monitors market price of securities. i market price bloomberg , these values change time long market open. i have simple vba tool sends me alert every time risk breached. unfortunately run multiple excel spreadsheets during day , when alert comes other macros stop working. so i'm thinking if possible write in c# can run excel tool in background totally different process doesn't interfere of other excel workbooks open. i suggest using microsoft.office.interop.excel implement code in c# . using above namespace gain full access excel object model, , can monitor different cells. code read excel file using c# on internet. the news c# application run in different thread of excel files , not interfere them. instead of trying write tool run excel tool in background, better approach write tool in c# implement it's logic.

javascript - Unexpected Token Illegal with onclick Java Script in Salesforce.com -

i have been working on of morning no end. trying execute button uses onclick java in salesforce.com , keeps throwing errors. think issue may special characters in data works when use text. time numbers or special characters present error "unexpected token illegal". can me see doing wrong , how can away failing when special characters involved? {!requirescript("/soap/ajax/28.0/connection.js")} var opptyobj = new sforce.sobject("opportunity"); var caseobj = new sforce.sobject("case"); var today = new date(); var sopptyid = "{!case.opportunity__c}"; if( sopptyid != "") { alert("this case tied opportunity!"); } else { opptyobj.accountid = "{!case.accountid}"; opptyobj.closedate = sforce.internal.datetimetostring(today); opptyobj.description="{!case.description}"; opptyobj.case__c = "{!case.id}"; opptyobj.name = "{!case.subject}"; opptyobj.stagename = "estimate

eclipse - How can I select and run a block of python code? -

this question has answer here: eclipse pydev: run selected lines of code 2 answers are there ides let me select block of code in python script , run selected code? i'm using eclipse + pydev , can't figure out. know how (run selection in script instead of running whole script)in eclipse? thanks i guess can done, why? if want experiment portion of code, possible approach is: def a(): # wrap experimental code def b(): # wrap other experimental code if __name__ = '__main__': a() b() # next time this approach delivers multiple advantages: clear logical blocks, easier maintain module importable , doesn't run portion of code unless call functions once development's mature, don't have tear down "experimental" module , rewrite - it's production ready so instead of "select-and-run"

Fortran multidimensional array syntax -

two quick syntax question would real(4), allocatable:: thing1(:,:) create 2d array 2 columns, of yet undefined number of rows, each element array of 4 reals? secondly, would real(4) box(3,3),versions,revert create 2 arrays of length 4, , 2d array of size 3x3 each element array of length 4. the short answer no both. real(4) not create array of reals, determines kind of real. refer question: fortran 90 kind parameter explain this. secondly, thing1(:,:) not declare 2 columns , declares 2 dimensions . first being rows, second being columns. your second create 3x3 array "box" of reals of kind == 4, typically precision "float" in c language. i'm not sure versions,revert supposed be. also, when creating array, typical, , little more explicit, use dimension parameter such: real(4),allocatable,dimension(:,:,:) :: thing1 which can allocated later on as: allocate(thing1(x,2,4)) assuming still wanted 2 columns, x rows, , array o

entity framework - How to implement DbContext hiearchy -

what i'd manipulate ef support plugins access shared database. database contain of tables main application plus of tables required each plugin. application doesn't know plugin data structures, cannot responsible management. plugins solely responsible, , create tables themselves. however, plugins know host application , data structures, ideally should able reference them , inherit them, resulting in database extensible yet able implement optimized patterns. in ef, translates hostcontext contains dbsets appropriate host. each plugin, thought, should have plugincontext inherits hostcontext contains dbsets needed plugin. entity classes included in plugincontext able reference hostcontext entities, and/or inherit entities, , ef able resolve table mapping , relationships. i'm using ef6. when attempt above , try list single entity i've included in plugincontext, exception thrown complaining entity doesn't exist. sure enough, no matching table has been create

password protection - unlocking a screen via code in android -

how unlock phone screen when event happens?i tried following code not unlock screeen . unlock mean bypass pin or pattern am using following code , triggered when sms received. private void unlockscreen(context context){ log.d("dialog", "unlocking screen now"); powermanager powermanager = ((powermanager)context.getsystemservice(context.power_service)); wakelock wakelock = powermanager.newwakelock(powermanager.screen_bright_wake_lock | powermanager.acquire_causes_wakeup, "tag"); wakelock.acquire(); window wind = dialogactivity.this.getwindow(); wind.addflags(layoutparams.flag_dismiss_keyguard); wind.addflags(layoutparams.flag_show_when_locked); wind.addflags(layoutparams.flag_turn_screen_on); } screen powered on user has enter pin/pattern.how on it? straight android api site disablekeyguard() : disable keyguard showing. if keyguard showing, hide it. keyguard preve

c# - Unable to apply Shadow on Window -

i have following: <style targettype="local:mainwindow"> <setter property="foreground" value="{dynamicresource foregroundcolorbrush}" /> <setter property="background" value="{dynamicresource windowbackgroundbrush}"/> <setter property="uselayoutrounding" value="true" /> <setter property="textoptions.textformattingmode" value="display" /> <setter property="template"> <setter.value> <controltemplate targettype="local:mywindow"> <border x:name="windowborder" background="{staticresource windowbackgroundcolorbrush}"> <border.effect> <dropshadoweffect blurradius="20" color="black"/> </border.effect>

.net - Populate Class from List of Objects C# -

first off hope can describe looking if not clear please let me know , try best clarify. i have 2 classes 1 being small class gets wrapped list. second class uses values list. here examples of classes. class firstclass { public string value1 {get; set; } public string value2 {get; set; } public string value3 {get; set; } public string value4 {get; set; } public string value5 {get; set; } public string value6 {get; set; } } class secondclass { public string fieldname { get; set; } public string fieldvalue { get; set; } } list<secondclass> sc = new list<secondclass>(); sc[0].fieldname = "value1"; sc[0].fieldvalue = "hello world"; sc[1].fieldname = "value2"; sc[1].fieldvalue = "hello world"; sc[2].fieldname = "value3"; sc[2].fieldvalue = "hello world"; sc[3].fieldname = "value4"; sc[3].fieldvalue = "hello world"; sc[4].fieldname = "value5"; sc[4