Posts

Showing posts from February, 2012

android - Get message from broadcast receiver to activity -

i know question has been asked many times still unable solve problem.i want otp sms in edittext of activity.for using broadcast receiver. code broadcast receiver: private static final string tag = receivesms.class.getsimplename(); private smsreceivedlistner smsreceived = null; @override public void onreceive(context context, intent intent) { //code sms.... log.e(tag, "otp received: " + verificationcode); if (smsreceived != null) { smsreceived.onsmsreceived(verificationcode); } else { if (constants.isloggingenable) { logger.logerror(tag, "sms listner null"); } } } } } catch (exception e) { log.e(tag, "exception: " + e.getmessage()); } } public void setonsmsreceivedlistener

mysql - Getting all items without open end date -

i need solve following problem using (my)sql, given example table: id | item | start | end 1 | 100 | 2015-01-01 | 2015-01-14 2 | 100 | 2015-01-01 | null 3 | 101 | 2015-03-01 | 2015-04-15 4 | 101 | 2015-04-17 | 2015-04-22 5 | 101 | 2015-04-27 | 2015-05-11 i need query gives me items there no open end date. above i'd expect 101. i tried group , sub-selects didn't show expected. on this? you can using group by , having : select item example group item having count(end) = count(*); count() column names counts number of non- null values. if equal number of rows, no values null . you use: having sum(end null) = 0 edit: i should add following might faster, assuming have right indexes , table items: select i.item items not exists (select 1 example e i.item = e.item , e.end null ); for performance, want index on example(item, end) .

html - Why the font is big for non responsive site? -

Image
it's interesting me why font size big non-responsive site (with no <meta name="viewport" content="width=device-width, initial-scale=1.0"> tag) on small screens? want smaller , able zoom in. html (just 2 columns text): <div class="s"> <div> <h2>...</h2> <p>..</p> </div> <div> <h2>...</h2> <p>...</p> </div> </div> css: body { font: 100%/1.5 tahoma, geneva, sans-serif; } .s { display: flex; margin: 50px auto; width: 1000px; } .s div { background: #eee; flex: 1 1 100%; } demo here https://jsfiddle.net/infous/3hjmc9o0/embedded/result/ . can test f12,ctrl+shift+m (device mode) in chrome. demo #2 https://jsfiddle.net/infous/3hjmc9o0/3/embedded/result/ text in <body> scalable want. i'd text in red border above in image. well, reason of effect because of "

Debugging TypeScript Cordova application in VS 2015 -

a cordova projects' typescript source kept outside of www folder. generated map file points source cannot access. how set post-build event copy typescript source in www folder , update generated mapping file enable debugger load correct typescript source file when breakpoint hit? figured out first requirement, copying typescript source files www folder. edit .jsproj project file , add following: <itemgroup> <typescriptsourcefiles include="$(projectdir)scripts\**\*.ts"></typescriptsourcefiles> </itemgroup> <target name="afterbuild"> <copy sourcefiles="@(typescriptsourcefiles)" destinationfiles="@(typescriptsourcefiles->'$(projectdir)www\scripts\ts\%(recursivedir)%(filename)%(extension)')"></copy> </target> now need modify .js.map file , update sourceroot attribute? any ideas? sorry trouble. know have issues source maps , typescript, depending on scenario

javascript - Handling constructor related functions while testing with mocha and sinon -

i testing application in declare specific variable within constructor , assign return of function imported class. how code looks like: var someclass; function constructor() { this.someclasshandler = null; } constructor.prototype.newsomeclass = function() { someclass = require('./someclass.js'); return new someclass(); } constructor.prototype.getfunction = function() { this.someclasshandler = this.newsomeclass(); } constructor.prototype.callsomefunction = function() { this.someclasshandler.somefunction(); } when try test code whether function 'somefunction' imported class 'someclass' called within method'callsomefunction' receive failed test responses variable 'someclasshandler' still equals null (which makes sense not call method 'getfunction' assigns class variable). i use mocha , sinon tests, bit helpless whether mock or stub class in order assign variable 'this.someclasshandler' correctly. the m

How can compiler place data on ROM in embedded system? -

as know, constant value, initialized data of variable placed in rom (read momory) compiler in embedded system. but, rom read-only, means can't write how can compiler can write these data when programming? i think rom in embedded system case means eeprom or flash memory meaning writing permission. is understanding correct in both embedded system os , without os? but, rom read-only, means can't write how can compiler can write these data when programming? to answer question, compiler merely creates object files. these passed linker, decides @ physical address variables end up, typically reading linker script of kind. linker script might like: "program code goes flash section 1, string literals go flash section 2, const variables go flash section 3". linker creates binary file format. the binary in turn passed chip programmer tool or in-circuit debugger, contains actual routines programming flash.

c# - How to create an add-in/plugin for Outlook 2013 software -

i want create add-in/plugin outlook 2013. here's trying achieve. 1) every day when outlook user opens outlook application, gets small pop-up asking "are taking cab service today?". has 3 buttons can click yes, no , maybe. 2) add-on should collect input , email id of user , send webpage can display information. how go it? start? application use write code add-in/plugin? i have visual studio 2015 community installed on computer. i think first stop should msdn office developer site. allow review options available in sdk. https://msdn.microsoft.com/en-us/office/aa905340.aspx

android - Link sharing is not working when native facebook application is installed -

in application have share button shares application link facebook wall.this how doing it. facebooksdk.sdkinitialize(getactivity()); sharelinkcontent content = new sharelinkcontent.builder() .setcontenturl( uri.parse(preferencemanager .getdefaultsharedpreferences( getactivity() .getapplicationcontext()) .getstring("referral_only_url", ""))) .build(); sharedialog.show(getactivity(), content); now problem works fine web dialog if facebook native application not installed in device if native facebook app installed fails error saying: we sorry post no longer available. may have been removed any appreciated. probably not using same app name facebook app name . <meta-data android:name="com.facebook.sdk

office365 - OneDrive for business - How can I manage, by the PHP Rest API, the permissions on folders? -

i try manage folders, files, users, groups , permissions between them php rest api. can manage : folders , files onedrive rest api. can manage : users , groups azure ad rest api. but can't manage permissions between them... saw onedrive api can generate sharing link, it's not want. want manage permissions without external interventions. tried find on sharepoint api, apparently not discuss onedrive folders. does know how manage them ?

r - Adding the values of second column based on date and time of first column -

i have data frame 2 variables. first column "x" represents date , time format dd/mm/yyyy hh:mm, values in second column "y" electricity meter reading taken each after 5 minutes. want add values of each half hour. instance x y 13/12/2014 12:00 1 13/12/2014 12:05 2 13/12/2014 12:10 1 13/12/2014 12:15 2 13/12/2014 12:20 2 13/12/2014 12:25 1 at end want present result as: 13/12/2014 12:00 9 13/12/2014 12:30 12 and on... here's alternative approach takes x in count (as per op comment ). first, make sure x of proper posixct format manipulate correctly (i'm using data.table package here convenience) library(data.table) setdt(df)[, x := as.posixct(x, format = "%d/%m/%y %r")] then, aggregate per cumulative minutes instances of 00 or 30 within x while summing y , extracting first value of x per each group. i've made more complicated data set in order illustrate more complicated scenar

How to install python-gammu on Raspberry pi -

i have problem when installing python module gammu on raspberry pi model b+. how can solve problem ? thanks! pi@raspberrypi ~ $ sudo pip install python-gammu downloading/unpacking python-gammu running setup.py egg_info package python-gammu package gammu not found in pkg-config search path. perhaps should add directory containing `gammu.pc' pkg_config_path environment variable no package 'gammu' found traceback (most recent call last): file "<string>", line 14, in <module> file "/home/pi/build/python-gammu/setup.py", line 108, in <module> check_minimum_gammu_version() file "/home/pi/build/python-gammu/setup.py", line 43, in check_minimum_gammu_version "gammu" file "/usr/lib/python2.7/distutils/spawn.py", line 34, in spawn _spawn_posix(cmd, search_path, dry_run=dry_run) file "/usr/lib/python2.7/distutils/spawn.py", lin

javascript - Can I blindly replace all occurrences of document.all in my entire project with document.getElementsByTagName('*')? -

i'm working on lot of legacy code , have huge number of instances of document.all usage. need replace these instances (in bulk) microsoft supports (as understand document.all is not supported anymore ). is safe option replace instances of document.all document.getelementsbytagname( ) ? please bear in mind document.all come in many flavours document.all.item("") etc.. need know if document.getelementsbytag(' ') work solution blind replacement of document.all wherever used (in whatever form) from mdn page #document document.all provides access elements id . legacy, non-standard, interface , should use document.getelementbyid() method instead. therefore, no document.getelementsbytagname("*") return more elements elements id this definition means do document.queryselectorall('[id]'); // nodelist however msdn has different definition the all collection includes 1 element object each valid html tag . if valid

excel - exporting a certain worksheet from a workbook to pdf -

i amateur programmer learning how program using vba without further due, question : i have created listbox (listbox1) i've listed sheets(ws) name in specific workbook. i've created listbox(listbox2) when select sheets name on listbox1, transfer listbox2. my main objective choosing 1 or more sheets listed in listbox2, , clicking button, i'll manage save selected sheets in 1 pdf file. here code button used export file in pdf i've written i've managed export them not in 1 pdf file in numerous amount of pdf file. dim nomtableau() string each wkbkname in application.workbooks() if wkbkname.name = choix_poteau.value & "_" & section & "_" & projet & ".xlsx" wkbkname.activate goto lois end if next set wbk = workbooks.open(add1 & "\" & me.projet.value & "\" & me.section.value & "\poteaux\" & me.choix_poteau.value & "_" & me.secti

multithreading - Linux multi-thread, pausing one thread while continue running the other threads within the same process -

i cannot find proper solution problem. if have more 1 thread in 1 process. , want make 1 thread sleep while running other threads within same process, there predefined syntax or have own implementation (sleep) ? ideally want send indication thread thread when time sleep. edited (2015-08-24) have 2 main threads, 1 sending data on network, other receives data network. beside jitter, receiving thread validation , verification , file management in time lead drag behind. add micro sleep sender receiver catch up. sched_yield() not in case because hw has multi core cpu more 40 cores. from description in comments, looks you're trying synchronize 2 threads 1 of them doesn't fall behind far other. if that's case, you're going wrong way. seldom idea synchronization sleeping, because scheduler may incur unpredictable , long delays cause other (slow) thread remain stopped in run queue without being scheduled. if works of time, it's still race condition, , it

http - angularJS access properties of promised object in succes function -

i have problem can't head around. i'm using basic angular http.get returns promise: gettask: function(id) { var promise = $http.get('http://localhost:9000/get/tasks/'+id).success(function(data) { return data; }); return promise; } tasksservice.gettask($stateparams.id).then(function(success){ $scope.task = success.data; }); the task has propperties want access, somehow returns undefined. if example do: tasksservice.gettask($stateparams.id).then(function(success){ $scope.task = success.data; console.log($scope.task.deadline); }); it's undefined. have idea how can access properties , how can share rest of controller? ah, confusion of .success vs. .then strikes again. subtle (and, in opinion, unnecessary) difference angular introduced have spawn lot of issues. the issue here .success returns original promise and, in respect, disregards data return. in other words, "branches off" , allow

Move android components in a LinearLayout -

i have activity has edittext programmatically added linearlayout inside scrollview . scrollview <- linearlayout <- edittext(s) is possible rearrange position seting x , y axis or swing components? this code: for (field classfield : todofields) { customedittext field = new customedittext(this); field.setname(classfield.getname()); layoutfieldwrapper.addview(field); } edit: can freely move components around interface, instance: put component next setting same y , different x or overlap of them other, ecc.. it's possible? you can use relativelayout . replace linearlayout inside scrollview . layout gives accessibility. can move views in user interface freely using type of layout. have play around attributes , try like: gravity, layout_centervertical, padding, layout_margin, layout_width, layout_height, layout_below, layout_torightof, , lot more... reference link: http://developer.android.com/guide/topics/ui/layout/relative.html

android - How to make RecycleView Clickable In a Fragment? -

Image
i parsing json data in fragment. view of json data used recycleview. in fragment showed short detail of post. want when user click recycleview go activity , show details of post. how make recycleview clickable? @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // inflate layout fragment view view = inflater.inflate(r.layout.fragment_recent_post, container, false); recentpostrecycleview = (recyclerview) view.findviewbyid(r.id.recent_posts); recentpostrecycleview.setlayoutmanager(new linearlayoutmanager(getactivity())); recentpostadapter = new recentpostadapter(getactivity()); recentpostrecycleview.setadapter(recentpostadapter); sendjsonrequest(); return view; } my recycleview screenshoot: you should not make recyclerview clickable, cards. add android:clickable="true" card layout , add clickl

php/javascript change inline label after DB update -

this first post.. question simple cannot find right way..! i have php page query selection database show many records, each record i've put form fields need updated , "save" button so each record have column in result table containing form like: $code = "<td><form method='post' action='mypage.php' target='_blank' />"; $code .= " <input type='hidden' name='function' value='formtaglieok' />"; $code .= " <input type='hidden' name='email' value='".$email."' />"; $code .= " <input type='hidden' name='main' value='".$main."' />"; ..... other editing fields $code .= "<input type='text' name='field1' value='' size='2' />" ..... other editing fields $code .= "<td><input type='submit' value='save' /></td&g

c# - Is it OK to have an empty while block when using WaitOne with named mutexes for IPC? -

basically, multiple instances of same process this: using (var mutex = new system.threading.mutex(false, mutex_name)) { while (!mutex.waitone(100)) { /* wait acquire mutex other process */ } try { dosynchronizedwork(); } { mutex.releasemutex(); } } will there pitfalls? can process exit without releasing mutex? abandonedmutexexception thrown if happens? or process acquire mutex? else? edit: looks correct way should (at least scenario) this: using (var mutex = new system.threading.mutex(false, mutex_name)) { bool lockobtained = false; while (!lockobtained) { try { while (!mutex.waitone()) { /* wait acquire mutex */ } lockobtained = true; } catch (abandonedmutexexception ignored) { // mutex abandoned // process before process completed. // can try obtain again. } } try { dosynchronizedw

java - Efficient algorithm for finding the in-order rank of a binary tree node -

given binary tree (not binary search tree) , node in tree, efficient algorithm (in java preferably) find in-order rank of node? an o(n) algorithm possible traversal (either recursive or iterative). there better one? suggestion. imagine worst case: each node has 1 left child, whole tree becomes linked list. if given root, calculate rank need access leaf, in case costs o(n) . o(n) in worst case best can achieve without storing additional information in nodes.

Real time keyboard inputs in batch -

this link https://www.youtube.com/watch?v=eule3dns8dm shows game made in batch. game, called viewpoint, allows move around , shoot @ enemies. game seems accept keyboard input in real time perform actions. there way can batch file accept keyboard input in real time well? (guessing "core" folder saw in game folder, there might other program or command involved.) you use choice command (which snake.bat uses) can take alpha-numeric input 1 @ time. here quick program whipped uses choice take wasd input. @setlocal enableextensions enabledelayedexpansion @echo off prompt $$$g title movement color 0a set length= %%a in (1 2 3) ( set "length=!length! " ) :controls cls echo use wasd move character ([]). echo. echo %length%[] choice /c wasd /n if %errorlevel% equ 1 call:up if %errorlevel% equ 2 call:left if %errorlevel% equ 3 call:down if %errorlevel% equ 4 c

python - get_absolute_url throws a no reverse match -

why not work? in models class have def get_absolute_url(self): django.core.urlresolvers import reverse return reverse ('core.views.landingview', args =[str(self.id)]) and in urls have: urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^$', core.views.landingview.as_view(), name='index'), why throw noreversematch @ / reverse 'visitors.views.landingview' arguments '('da697aca-4269-4700-b174-fe6d022ee3a1',)' , keyword arguments '{}' not found. 0 pattern(s) tried: [] i tried 'index' instead of 'core.views.landingview' . i checked docs , other posts, it's name why? thanks!

How to export JMeter LatenciesOverTime report? -

i'm using jmeter plugins , i'd know if teach me how can export latenciesovertime report using gui? i'm able create report; however, file should output latency report has information "simple data writer". thanks help! i had make right click on graph -> export csv. ui isn't intuitive.

ruby - Why can't I extend the Fixnum class in a module and use it? -

i've created module in extend fixnum class new method. when require module , try use extended method, returns: nomethoderror: undefined method `roundup' 13:fixnum here's module looks like: module eancontrol # extend fixnum #roundup class fixnum def self.roundup return self if self % 10 == 0 # factor of 10 return self + 10 - (self % 10) # go nearest factor 10 end end # more code... end this i'm doing: require 'path_to_module' 12.roundup # => nomethoderror: undefined method `roundup' 13:fixnum how solve this? there 3 problems code: you creating new class eancontrol::fixnum , want change existing builtin ::fixnum . solution: explicitly start constant lookup top-level, or, more idiomatically, drop module. module eancontrol class ::fixnum # … end end # although simpler this: class fixnum # … end you define roundup singleton method of object fixnum , call instance method of instance

Python ctypes program works on 3.2 but incompatiable on 3.4 -

i have program tokenizes thai text calling libtahi c library. programs works ok python 3.2 fails python3.4. idea why fails on 3.4? please find below program code , outputs both version of python: #!/usr/bin/python3 # apt-get install libthai0 libthai-doc libthai-dev libthai-data ctypes import * ctypes.util import find_library thai_library = find_library('thai') if not thai_library: raise oserror('cannot find libthai in system') thai = cdll.loadlibrary(thai_library) thai.th_wbrk_line.restype = c_int thai.th_wbrk_line.argtypes = [c_wchar_p,c_wchar_p,c_size_t,c_wchar_p] def whitespace(ain): # expects bytes ain=ain.decode('utf8') aout=whitespace_string(ain) return aout.encode('utf8') def whitespace_string(ain): # expects string # ain='แล้วพบกันใหม่' aout=' '*(2*len(ain)+1) # assume maximum length set of 1 character + white space adelim=' ' asize=len(aout) res=thai.th_wbrk_li

How do I update a matrix in a for loop MATLAB -

this question has answer here: power method in matlab 1 answer i have matrix , vector u. want run loop update vector u. operation easy, multiple u (result vector denoted z). pick largest element in z (result scalar denoted m). update u dividing vector z m. don't know how index matrix used cell notation might not correct. a=[1 2 3 4; 5 6 7 8 ; 9 10 11 12; 13 14 15 16]; u= ones (4,1); s=1:10 z{s}= a*u{s}; m(s)= max(z{s}); u{s} = z{s}/m(s); end any suggestions helpful. you don't have index anything. remove indices. should read docs learn when index , when not to. have matrix operations. a=[1 2 3 4; 5 6 7 8 ; 9 10 11 12; 13 14 15 16]; u= ones (4,1); s=1:10 z = a*u; m = max(z); u = z/m; end the final value u 0.2028 0.4685 0.7343 1.0000

Issues with scala-parser-combinators: parsing text of the form `(typ1: value1) (type2: value2) ... ` -

i want parse text of following form: "(typ1: value1) (type2: value2) (type3: value3)" here code: case class word(word: string) extends expression case class cluster(wrapped: expression) extends expression def parse(input: string): parseresult[expression] = { val expressions = "(" ~> expr <~ ")" ^^ {expr => cluster(expr) } val capture3 = expressions ~> ":" ^^ word def expr: parser[expression] = rep1(expressions) ^^ { exprs => if (exprs.size > 1) concatenate(exprs) else exprs.head } parseall(expr, input) } this code far supposed capture type s (values added). in form following error: [1.5] failure: `)' expected `1' found (typ1: value1) (type2: value2) (type3: value3) ^ any idea how resolve issue?

c++ - Execution order of code with continue;? -

i work c#, please bear me. also, code written else. the code outputs information text file, , reason, @ midnight, file exported carriage returns , line separators (ie. no actual data). after debugging it, noticed debugger breaks on continue; , after line in for loop (in init2) not being executed. due complexity of code, had remove of it. i've included for loops are. need know continue doing skips "important stuff" being output. any appreciated. thanks. for ( init1; condition; increment ) { ( init2; condition; increment ) { code; ( init3; condition; increment ) { code; if (condition) { code; } code; } if (condition) continue; //always breaks here code; //never breaks here if (condition) { //never breaks here, important stuff not output file. ( init4; condition; increment ) { fprintf_s(fp, "output importan

C++/CURL - Passing data through PHP request the safe way? -

i'm trying send data curl php file , can other actions hashing password/data salt, running database queries eco. seems work fine, there's 1 problem. i'm not sure how secure it, authorization token example. want able query data php file using written application only. can see how become problem, if people had access link through web browser example. i've included code below, if needs similar. main.cpp #include <iostream> #include <stdlib.h> #include <stdio.h> #include <curl/curl.h> #include <sha.h> #include <hex.h> using namespace std; using namespace cryptopp; size_t size = 0; size_t write_to_string(void *ptr, size_t size, size_t count, void *stream) { ((string*)stream)->append((char*)ptr, 0, size*count); return size*count; } template <class t> string querydb(initializer_list<t> list) // use initialize_list query undefined number of params { curl *curl; curlcode res; string submitdata =

azure - IIS Permission Denied 70 error when CGI attempts to Instantiate InternetExplorer.Application -

context: windows server 2012 r2 (azure vm) iis: 8.5 the cgi application 32bit exe. calls msscript object evaluate jscript script. jscript attempts instantiate internetexplorer.application. attempt fails consistently permissions error 70. what reason , must working? if permissions error, permissions need adjusted? more detail this event viewer (local), system tab in windows logs: the machine-default permission settings not grant local activation permission com server application clsid {0002df01-0000-0000-c000-000000000046} , appid {e4803a36-7232-4ac0-a6af-29d59ebcc303} user nt authority\iusr sid (s-1-5-17) address localhost (using lrpc) running in application container unavailable sid (unavailable). security permission can modified using component services administrative tool. yet more posting on answers suggests changing owner of ie trusted installer administrator. answer me? in past when have seen issue application pool using not correctly set enable 32-

ios - Generics for repeated task with associated data - Swift -

i've been trying wrap mind around seemingly simple task, keep getting nowhere. my goal create user-choice flow. let's have list of food-related questions : what favourite breakfast? have dinner? how meat cooked? whats favourite spaghetti sauce? e.t.c. and set of reply options each question q1: <<pancakes|waffles>>, q2: <<steak|spaghetti>>, q3: <<raw|welldone>>, q4: <<bolognese|simple cheese>> how load next question set of reply options depending on users choice in previous question? main trouble how make generic , data-driven - without need bunch of conditionals. i've been trying work arrays , nsdictionaries , nsregularexpressions can't come proper logical solution. any insights appreciated! thank in advance. an alternative dictionaries custom class. think improves readability may have own opinion. class question { var ask: string var answers: [string] var nextquestions =

Ansible Playbooks vs Roles -

according ansible docs, playbook is: ...the basis simple configuration management , multi-machine deployment system, unlike exist, , 1 suited deploying complex applications. and, again, according same docs, roles are: ...ways of automatically loading vars_files, tasks, , handlers based on known file structure. grouping content roles allows easy sharing of roles other users. however distinction between these , different use cases not obvious me. instance, if configure /etc/ansible/hosts file like: [databases] mydb01.example.org mydb02.example.org [mail_servers] mymail01.example.org mymail_dr.example.org ...then " [databases] " entry...a role ? or name of playbook yaml file somewhere? or else?!? if explain me differences on these, understanding of ansible enhance! playbook vs role vs [databases] , similar entries in /etc/ansible/hosts if playbooks defined inside of yaml files, roles defined? aside ansible.cfg living on ansible server, how

c# - Umbraco Custom Controllers, the basics -

i getting error "the type or namespace name 'umbraco' not found" i using in custom controller homecontroller.cs lives in root/controllers/homecontroller.cs. but can not seem find umbraco namespaces. using umbraco.web; using umbraco.web.models; namespace umbraco.umbraco.controllers { public partial class homecontroller : umbraco.web.mvc.rendermvccontroller { } } any basic appreciated regards can try renaming namespace? umbraco.umbraco.controllers to yourproject.controllers

java - Failed to connect hypersonic(HSQLDB) DB on Apache 7.0 -

i have project in eclipse defined 'dynamic web project' on apache-tomcat 7.0 server. need connect hypersonic db (hsqldb) in of java classses. the code i'm trying make simple: private connection getconnection(){ connection conn; try { class.forname("org.hsqldb.jdbcdriver"); conn = drivermanager.getconnection("jdbc:hsqldb:hsql://localhost","sa",""); return conn; } catch (exception e) { e.printstacktrace(); } return null; } i added hsqldb.jar lib library located in project , defined in java build path on eclipse. the problem i'm getting error: java.lang.classnotfoundexception: org.hsqldb.jdbcdriver @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1722) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1573) @ java.lang.class.forname0(native method) @ java.lang.class.forname(

c# - .NET retrieving values from dynamically created controls in a placeholder -

i have .net web form, c# backend. i need looping through nested controls in placeholder. have single placeholder, creating dynamic form controls on fly based on data coming stored procedure. placeholder has single table created on fly. table populated checkboxes, , textboxes (they "attached" each other, id... not attached, have same numeric id component). i need looping through placeholder, , table detect: checkboxes checked, , data in textboxes. not checkboxes have textboxes. asp.net <asp:placeholder id="phmystuff" runat="server"></asp:placeholder> c# using (sqldatareader dr = cmd.executereader()) { while (dr.read()) { myflag= bool.parse(dr["myflag"].tostring()); checkbox cb = new checkbox(); cb.text = dr["stuffname"].tostring(); cb.id = dr["stuffid"].tostring(); tablerow tr = new tablerow(); tablecell td = new tablecell(); td.contr

email - avoiding gmail's spam filter? -

i trying allow users on site send invitations friends. script works fine, except gmail thinks it's spam. i'm using own website's email address , name email , using correct first , last name of recipient. is there can prevent happening? same thing important notifications send out (like if account has been reported , in danger of being banned, etc) route emails through real smtp service. sending email webserver headers altered (correctly) identified looking spam.

Salesforce extract substring from string with regex -

i developing application in salesforce apex , need extract substring other string . original string : string str = 'product: multi screen encoder version: 3.51.10 (008) order number: 0030000a9ddy part number: 99-00228-x0-y-ww02-na01 comment: comments'; i want extract value of part number using matcher , pattern classes : pattern p = pattern.compile('part number: (.+)\\s'); matcher pm = p.matcher(str); if (pm.matches()) { res = 'match = ' + pm.group(1); system.debug(res); } else { system.debug('no match'); } but getting no match . how can fix regex match correctly string you need use find function instead of matches in if condition. pattern p = pattern.compile('part number: (\\s+)\\s'); matcher pm = p.matcher(str); if (pm.find()) { res = 'match = ' + pm.group(1); system.debug(res); } else { system.debug('no match'); } \\s+ matches 1 or more non-space characters.

vba - access2010 form with a non selectable combo box -

i have access 2010 form combo box. when run ado query drop down list shows when try , select nothing selected , message @ bottom of screen says form 'readonly'. i think problem using same recordset form , combo box. you can use sql statement populate combo box using row source property , set bound column 1. cboassociate.rowsource = "select distinct assignedto pc3claims assignedto not null order assignedto" cboassociate.boundcolumn = 1 this populate combo assignedto values , can set control source assignedto field in form's recordset.

Can I Deserialize a JSON string that contains 0.0 in C#? -

the json i'm getting webservice has integer incorrectly represented 0.0. deserialization code looks this: var serializer = new jsonserializer(); var ret = serializer.deserialize<t>(jsontextreader); and error this: input string '0.0' not valid integer. my question is, there way specify less strict deserialization method can parse string? edit: web service returns no schema don't know why deserializer tries convert int instead of float or double. i'd should go ahead , creat classes on json -> c# var o = (jobject)serializer.deserialize(myjsondata); you can use c# dynamic type make things easier. technique makes re-factoring simpler not rely on magic-strings. use jsonconvert.deserializeobject<dynamic>() to deserialize string dynamic type access properties in usual way in c#. im not sure why youre getting input string '0.0' not valid integer. since if dont have json data should left @ null , shouldnt have p

shell - Extracting data from a particular column number in csv file -

i have csv file looks this: arruba,jamaica, bermuda, bahama, keylargo, montigo, kokomo 80,70,90,85,86,89,83 77,75,88,87,83,85,77 76,77,83,86,84,86,84 i want have shell script set can extract out data can categorize data columns. i know line of code: ifs="," read -ra arr <"vis.degrib" ((i=0 ; i<${#arr[@]} ; i++));do ifname=`printf "%s\n" "${arr[i]}"` echo "$ifname" done will print out individual column components first row. how again subsequent rows? thank time. i'm extrapolating op awk -f, 'nr==1{for(i=1;i<=nf;i++) {gsub(/^ +/,"",$i);print $i}}' vis.degrib will print arruba jamaica bermuda bahama keylargo montigo kokomo note there trimming of space beginning of each field. if remove condition nr==1 , same done rows. request? please comment... perhaps want convert columnar format row based format (transpose)? there many ways, awk script do awk -f, -v ofs

r - do.call vs rbind, keeping rownames -

when using rbind vs do.call(rbind, x) . why , how do.call operation maintain parent list names , not rbind ? also, if replicate behaviour of do.call within rbind, retrieving parent list name , pass along row-name, how done smooth possible? consider named list: (l <- list(a=data.frame(x=1, y=2), b=data.frame(x=2, y=3))) # $a # x y # 1 1 2 # # $b # x y # 1 2 3 as note, do.call rbind passes names of list elements, results in row names combined data frame: do.call(rbind, l) # x y # 1 2 # b 2 3 to these names using rbind alone, need provide named arguments function: rbind(a=l[["a"]], b=l[["b"]]) # x y # 1 2 # b 2 3

Python: replace a decimal number in a string -

i have strings in number of files: step.m 0.02540:step length (notice space in first character of string) in of files, there additional spaces between characters: step . m 0.02540 : step length how can replace decimal number decimal number? i.e. want this: step.m 1.50000:step length edit add: naturally, decimal number not same in each file. think mean this, re.sub(r'\d+\.\d+', '1.50000', s)

windows - Script to enable services one after the other, waiting for the previous one to start fully -

i'm trying write code start list of services 1 after other, next service cannot start until first 1 has had chance start. # define system variables $workingdirectory="c:\powershell\" $currentdate = date -uformat "%d%m%y-%h%m" $logfile = ($workingdirectory+"startlog-$currentdate.txt") $tslist=import-csv($workingdirectory+"start.csv") #logwrite function append log file function logwrite { param ([string]$logstring) add-content $logfile -value $logstring } #write current date log file logwrite ("starting esb services") $startlogdate = get-date -format "mm-dd-yyyy - hh:mm:ss" logwrite ($startlogdate) logwrite ("-----------------") #runs through each entry in csv file defined $tslist foreach ($_.ts in $tslist) { $svc=get-service $_.ts logwrite ("starting service -", $_.ts) start-service $svc.name #if 2nd column set true need wait until starts if ($_.wait -eq "true&quo

android - Collapsing Toolbar. How to adapt custom Layout instead of default ImageView -

Image
i want make collasping toolbar, in custom layout . on image below presented use of new released design.support lib. on img.1, element (imageview) disappearing. in project want disappear layout. because inside layout viewpager can not resized image, should dissolve in toolbar background - should become transparent. img. 1 additionaly want open/hide toolbarlayout moving toolbarfooter - belt move - bright blue layout. expand/collapse not in img.1 instead should works status bar shifts , down blick on toolbarfooter. img.2 the think read lot ( collapsing button , layout inside ) of i've found clue or implementation. don't know how approach topic. suppose viewpager , relativelayout(or whatever) should outside of toolbar. , should take place of toolbar view this: <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="m

c - rfid and lcd interfacing with atmega16? -

i doing project on rfid module(em18). problem unable take card number on lcd display.it shows random value(hex or other constant same card again ). how manage , display proper value(exact value) of card on lcd(16*2)? #define f_cpu 16000000ul #define usart_baudrate 9600 #define baud_prescale (((f_cpu / (usart_baudrate * 16ul))) - 1) #include <avr/io.h> #include <util/delay.h> #define lcd_data porta // lcd data port #define ctrl portb #define en pb1 // enable signal #define rw pb2 // read/write signal #define rs pb0 // register select signal void lcd_cmd(unsigned char cmd); void init_lcd(void); void lcd_write(unsigned char data); void usart_init(); unsigned int usart_getch(); unsigned char i, card[10]; void getcard_id(void); void lcd_display(void); int main(void) { ddra=0xff; // lcd_data port output port ddrb=0x07; // ctrl out put init_lcd(); // initialization of lcd _delay_ms(50); // delay of 50 mili seconds lcd_write_string("hello world!

java - spring-security with angularjs integration -

i have jersey rest-service i'm using provide data angularjs application. want make of rest methods secure methods under template (myapp/data/**). have spring @repository class users' usernames , passwords. how can achieve this? i tried like: @configuration @order(2147483636) @enablewebsecurity public class securityconfiguration extends websecurityconfigureradapter { @autowired private userservice userservice; @override protected void configure(httpsecurity http) throws exception { http.httpbasic().and().authorizerequests() .antmatchers("/rest/**", "/").permitall().anyrequest() .authenticated().and().csrf() .csrftokenrepository(csrftokenrepository()).and() .addfilterafter(csrfheaderfilter(), csrffilter.class) .userdetailsservice(userservice); } private filter csrfheaderfilter() { return new onceperrequestfilter() { @override protected void dofilterinternal(httpservl