Posts

Showing posts from July, 2015

jquery - Issue with offset top on chrome -

Image
i issue òffset().top property in jquery. works on every browsers except chrome. i'm working on table, offset().top on cells... my code : var topofcell = $('td').offset().top; var bottomofcell= $('td').offset().top + $('td').outerheight(); result on chrome : result on firefox, ie, ect... offset() method gets position relative document , may vary browsers browsers, using position() method solve problem gets position relative parent offset. , should apply css position in parent element. so, try using position() method or, may offset top getting value before content loaded try using on ready: $(document).ready(function(){ //do stuff here }); or, try using on window load function: window.onload = function(){ //do stuff here }

ios - Does my iPhone app have to work on iPad too? -

Image
i reading apple guidelines there point says iphone apps must run on ipad without modification, @ iphone resolution, , @ 2x iphone 3gs resolution does mean if app doesn't work fine on ipad, gets rejected? i'm posting here found many contradicting information regarding this. it means has run , not has optimized ipad. there big difference in that. don't have create ipad storyboard in order make app run on ipad - xcode lets ipad use iphone storyboard , open if iphone. view shrunk smaller rectangle. you aiming this:

asp.net - Transfer Data from azure VM to Azure Website instance in realtime -

i have multi-tier asp.net application , want move on azure cloud. currently workflow of application this: user uploads file, file processed , user gets live feedback of calculations. in documentation of azure read, azure website frontend , cloud service or vm businesslogic appoach. so calculations done in vm. uploaded data users in blob storage. vm , azure website can access them both right? for live feedback vm has send data azure website instance launched calculation. possible in way? believe solved webservices there prettier way in azure cloud? thanks help the uploaded data users in blob storage. vm , azure website can access them both right? yes. files stored in blob storage accessible both azure website , vm. for live feedback vm has send data azure website instance launched calculation. possible in way? believe solved webservices there prettier way in azure cloud? again, possible. 1 way handle communication utilizing messaging infrast

How to calculate distance between two android device using Bluetooth signal strength? -

i'm working on android application. in project want show bluetooth scanning device, mac address, bluetooth signal strength , distance between 2 android device. i have done 3 requirements don't know how distance using signal strength. package com.example.bluetoothdemo; import java.util.arraylist; import java.util.list; import java.util.set; import android.content.context; import android.content.intent; import android.content.intentfilter; import android.net.wifi.wifiinfo; import android.net.wifi.wifimanager; import android.os.bundle; import android.app.activity; import android.bluetooth.bluetoothadapter; import android.bluetooth.bluetoothdevice; import android.content.intent; import android.view.menu; import android.view.view; import android.widget.arrayadapter; import android.widget.button; import android.widget.listadapter; import android.widget.listview; import android.widget.textview; import android.widget.toast; import android.content.broadcastreceiver; public clas

asp.net - Calling a stored procedure with varchar as output parameter -

this question has answer here: ado.net - size property has invalid size of 0 7 answers i want assign output parameter of stored procedure session variable.so,basically,i looking call stored procedure has varchar out parameter.the stored procedure follows: alter proc spchecktaskperformed @taskid int, @email varchar(100), @status varchar(100) output begin select @status = status tbltaskperformed [email] = @email , [taskid]=@taskid end the code have below: private void checktaskperformed() { string cs = configurationmanager.connectionstrings["easyrozmoney_connectionstring"].connectionstring; using (sqlconnection con = new sqlconnection(cs)) { con.open(); sqlcommand cmd = new sqlcommand("spchecktaskperformed", con); cmd.commandtype = commandtype.storedprocedure;

javascript - How to move elements on scroll-down with scrolling down the page? -

please @ website . see in sections, when scroll down page, actual page not going down, elements , images start moving taking effect. did best implement such thing failed how can implement such thing (specially taking effect)? a nice site, , example of parallax scrolling . achieving site going take long time, can start looking @ parallax sites here , idea of source code , through demo's.

php - Syntax error when using simple query to database table -

i have simple setup in laravel while i'm learning , can't figure why i'm getting error. it's simple overlooking. i can this: route::get('users', function() { $users = user::all(); return view::make('users')->with('users', $users); }); example on laravel work perfectly, displaying information in users.blade.php view. in database have 'lists' table when copy structure of code above try , display lists receive following error. syntax error, unexpected '::' (t_paamayim_nekudotayim), expecting '(' on line $lists = list::all(); my code follows routes.php route::get('lists', function() { $lists = list::all(); return view::make('lists')->with('lists', $lists); }); list.php /models <?php class list extends eloquent {} lists.blade.php /views @extends('layouts.main') @section('content') @foreach($lists $list) <p>{{ $list->

asp.net - make the text for all textbox blue -

i have vb below: protected sub page_load(byval sender object, byval e system.eventargs) handles me.load textbox1.forecolor = system.drawing.color.blue end sub my multiline textbox <asp:textbox id="textbox1" runat="server" textmode="multiline" height="300px" width="99.6%" enabled="false" ></asp:textbox> i have 100 textboxes. wonder if there simple code can make of textboxes blue? thanks advice! best use css this: input[type=text] { color: blue; } it's practice have style defined in css file , reference asp.net page: <link rel="stylesheet" type="text/css" href="styles.css">

c# - Writing to text files using SaveFileDialog -

i'm working on add in microsoft excel in visual studio records balances each account (or worksheet) , saves them user-specified file. ability press button , select destination save work essential skill programmer, i'm perplexed why there little information on how it. closest thing found tutorial on msdn saves button icon image. the code i'm using follows: stringbuilder sb = new stringbuilder(); if (thisaddin.createdbudget) { string budget = "budget = " + thisaddin.blake.budget; savefiledialog savebudget = new savefiledialog(); savebudget.filter = "data files (*.dat)|*.dat|all files (*.*)|*.*"; savebudget.title = "save budget"; savebudget.showdialog(); if (savebudget.filename != "") { using (streamwriter sr = new streamwriter(savebudget.openfile())) { sb.appendline(budget); } } } else { messagebox.show("control disabled. budget not yet exist."

Open PDF-File in Android not working -

i try open pdf file apps directory through pdf viewer on device. packagemanager m = getpackagemanager(); string s = getpackagename(); packageinfo p; try { p = m.getpackageinfo(s, 0); s = p.applicationinfo.datadir; } catch (namenotfoundexception e) { log.w("error", "error package not found ", e); } intent intent = new intent(intent.action_view, uri.parse(s + "\\document.pdf")); intent.settype("application/pdf"); packagemanager pm = getpackagemanager(); intent crc = intent.createchooser(intent, "open file"); startactivity(crc); on test device pdf viewer installed. nevertheless i'm told no existing app able open file. doing wrong? if still interested, here solution: i changed code this: intent int

java - Return the index of the largest number in the array -

question: write method called largest takes array nums3 parameter. finds largest of numbers in array , returns index value of method. so know if return largest, that's value, how can return i, index? when compile, error: cannot find symbol i. public static int largest(int[] nums3) { int largest = nums3[0]; for(int i=0; < nums3.length; i++) { if(nums3[i] > largest) { largest = nums3[i]; } } return i; } one way can saving largest index, not value. need return value in case of empty array: public static int largest(int[] nums3) { if (nums3.length == 0) { return -1; } int largestindex = 0; for(int i=0; < nums3.length; i++) { if(nums3[i] > nums3[largestindex]) { largestindex = i; } } return largestindex; }

unity3d - Relational Queries In parse.com (Unity) -

i found example in parse.com. have 2 objects : post , comment, in comment objects have collumn: "parent" pointer post obj , want join them: var query = parseobject.getquery ("comment"); // include post data each comment query = query.include("parent"); query.findasync().continuewith(t => { ienumerable<parseobject> comments = t.result; // comments contains last ten comments, , "post" field // contains object has been fetched. example: foreach (var comment in comments) { // not require network access. string o= comment.get<string>("content"); debug.log(o); try { string post = comment.get<parseobject>("parent").get<string>("title"); debug.log(post); } catch (exception ex) { debug.log(ex); } } }); it worked! , then, have 2 objects: user , gamescore, in gamescore obj

python - Bash: Read UTC timestamp from a file and transform to Local Time for different Target Timezones -

i have utc timestamps in file generated using bash date following: 'sat mar 15 01:30:01 utc 2014' 'sat mar 15 01:30:16 utc 2014' 'sat mar 15 02:00:01 utc 2014' 'sat mar 15 02:00:12 utc 2014' i need transform timestamps local time of different regions. e.g. convert first entry above hongkong time, second singapore , on. can generate offsets can added local time. offsets following: 2:00 -5:00 . . one possible approach may parse date using python , add/subtract offset. however i'm wondering if can preferably in bash date . i've tried increment/decrement date such as: date -d 'sat mar 15 01:30:01 utc 2014 2 hours' however, above convert specified date system's date , add 2 hours, whereas need achieve particular target timezone , without having rely on specifying offsets manually. i avoid offset approach , specify target timezone directly. example convert date hong kong time using gnu date : $ tz='asi

android - Change corner radius of Imageview at runtime -

hello guys here xml file. want change corner radius of imageview @ run time in such way corner radius of bitmap in imageview should changed . have idea how can perform task. <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/maincontainer" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" > <tablelayout android:id="@+id/firstpictable" android:layout_width="102.5dp" android:layout_height="200dp" android:background="@drawable/tableborder" android:layout_margintop="5dp" android:padding="0.5dp" android:layout_marginbottom="5dp" > <imageview android:id="@+id/image1" android:layout_width="fill_parent" android:layout_height="fill_paren

Google Maps API and geocoding in Crimea -

i use google maps apis geocoding full address coordinates. worked fine before revolution in ukraine , fact crimea part of russian federation. result, nowadays receive this: { "results" : [], "status" : "zero_results" } do know wrong? thanks. fyi got answer google support: since crimea disputed territory ( http://en.wikipedia.org/wiki/list_of_territorial_disputes ), geocoder results not return results reverse geocoding.

windows phone 7 - Get list like CNN-app -

Image
i'm curious how (visual) list in cnn-app how multiple lines per item. if guess right searching listbox control. here , here examples may solve problem..

audio - Memory leak while playing sounds with java -

this code playing sounds: public class sound { public static void playsound(string path) { try { clip clip = audiosystem.getclip(); audioinputstream inputstream = audiosystem.getaudioinputstream(new file(path)); clip.open(inputstream); inputstream.close(); clip.start(); } catch (exception e) { e.printstacktrace(); } } } if call sound.playsound("xxx.wav"); many times see ram according task manager starts rise dramatically. how clean up? try close method. javadoc: void close() closes line, indicating system resources in use line can released. if operation succeeds, line marked closed , close event dispatched line's listeners.

Semi-random numbers generation in C++ -

this question has answer here: how select value list non-uniform probabilities? 4 answers suppose have set of numbers x = {0, 0, 0, 0, 1, 2, 2, 3}. there way me use rand() print out random numbers list proportion of generated numbers on time original proportion of numbers in set? in other words, proportion of zeros 0.5, ones 0.125, twos 0.25, , threes 0.125. you can specifying frequencies: #include <iostream> #include <random> int main() { using namespace std; mt19937_64 engine; discrete_distribution<int> numbers{4, 1, 2, 1}; cout << numbers(engine) << endl; }

javascript - How To Do Two Times String Charachets Replace/Remove at Once -

i have text string "1,000 kw" as var result = "1,000 kw" can please let me know how can clean display 1000 on 1 line? tried replace() as: var res1 = result.replace(',',''); var res2 = res1.replace(' kw',''); alert(res2); which working need have code in 1 line. thanks use regex replace that's not numbers nothing var res1 = result.replace(/\d/g,''); fiddle

regex - What is the RegExp Pattern to Extract Bullet Points Between Two Group Words using VBA in Word? -

Image
i can't seem figure out regexp extract bullet points between 2 group of words in word document. for example: risk assessment: test 1 test 2 test 3 internal audit in case want extract bullet points between "risk assessment" , "internal audit", 1 bullet @ time , assign bullet excel cell. shown in code below have pretty done, except cant figure out correct regex pattern. great. in advance! sub populateexceltable() dim fd office.filedialog set fd = application.filedialog(msofiledialogfilepicker) fd .allowmultiselect = false .title = "please select file." .filters.clear .filters.add "word 2007-2013", "*.docx" if .show = true txtfilename = .selecteditems(1) end if end dim wordapp word.application set wordapp = createobject("word.application") dim worddoc word.document set worddoc = wordap

c# - Office interop Chart autoscaling -

for generate 1 graph in word interop document use method below: public static void addsimplechart(document worddoc, microsoft.office.interop.word.application wordapp, string[,] data) { object omissing = system.reflection.missing.value; microsoft.office.interop.word.inlineshape oshape; object oclasstype = "msgraph.chart.8"; object oendofdoc4 = "\\endofdoc"; microsoft.office.interop.word.range wrdrng = worddoc.bookmarks.get_item(ref oendofdoc4).range; oshape = wrdrng.inlineshapes.addoleobject(ref oclasstype, ref omissing, ref omissing, ref omissing, ref omissing, ref omissing, ref omissing, ref omissing); //demonstrate use of late bound ochart , ochartapp objects //manipulate chart object msgraph. object ochart; object ochartapp; ochart = oshape.oleformat.object; ochartapp = ochart.gettype().invokemember("application"

Read a specific word in a file PERL using regex -

i have configuration file name movie.conf , want read specific word in file. configuration file looks : #this movie setting #read movie source ffmpeg -f movie4linux2 -i /folder/movie1 -vcodec libx264 -preset ultrafast -tune zerolatency -s qvga -r 30 -qscale 5 -an -flags low_delay -bsf:v h264_mp4toannexb -maxrate 750k -bufsize 3000k -rfbufsize 300k -f h264 how can reads /folder/movie1 part using regex? can show me how. know using split can done. if want use regex on this? appreciated. if (/^ffmpeg.*-i\s+(\s+)/) { print $1; }

java - How to track users viewing habit -

i need keep counter couple of pages each user visits. lets need keep counter page 1 , 2. usera visits page 1 10 times therefore counter should 10, , userb visits page 1 5 times , page 2 7 times user's counter page 1 should 5 , page 2 should 7. countertable ( shows number of times each page has been visited each user) username page counter 1 10 b 1 5 b 2 7 to achieve this, have table in db keep usernames, page numbers , counters, every time user visits page associated counter in db incremented. my question that, if increment required counter, every time want retrieve pages (1 or 2) user needs wait application required record updated before visiting page. to avoid this, should use jms send asynchronous requests increment counters in database? option, use ajax maybe send async request server. is there more efficient method it? if not 1 more efficient? making assumption counter audit purposes instead of display purposes, o

c++ - OpenCV binary adaptive threshold OCR -

Image
i need convert images binary ocr. here functions using: mat binarize(mat & img, mat& res, float blocksize, bool inverse) { img.convertto(img,cv_32fc1,1.0/255.0); calcblockmeanvariance(img,res, blocksize, inverse); res=1.0-res; res=img+res; if (inverse) { cv::threshold(res,res,0.85,1,cv::thresh_binary_inv); } else { cv::threshold(res,res,0.85,1,cv::thresh_binary); } cv::resize(res,res,cv::size(res.cols/2,res.rows/2)); return res; } where calcblockmeanvariance : void calcblockmeanvariance(mat& img,mat& res,float blockside, bool inverse) //21 blockside - parameter (set greater larger font on image) { mat i; img.convertto(i,cv_32fc1); res=mat::zeros(img.rows/blockside,img.cols/blockside,cv_32fc1); mat inpaintmask; mat patch; mat smallimg; scalar m,s; for(int i=0;i<img.rows-blockside;i+=blockside) { (int j=0;j<img.cols-blockside;j+=blockside) {

To create a Email Id and enable it using vbscript in an active directory -

can me create email id , enable it, using vbscript , active directory. kind of appreciated. thanks in advance! source code attempted in comments: dim oiadsuser dim omailbox set oiads = getobject("ldap://rootdse") strdefaultnc = oiads.get("defaultnamingcontext") 'msgbox findanymdb("cn=configuratio set oiadsuser = getobject("ldap://cn=test1,cn=users," & strdefaultnc) if oiadsuser nothing msgbox "the oiadsuser nothing." else msgbox "the oiadsuser created successfully." end if set omailbox = oiadsuser omailbox.createmailbox findanymdb("cn=configuration," & strdefaultnc) oiadsuser.setinfo function findanymdb(strconfigurationnc) dim oconnection dim ocommand dim orecordset dim strquery ' open connection. set oconnection = createobject("adodb.connection") set ocommand = createobject("adodb.command") set orecordset = create

php - Cart Become empty in codeigniter when I logged in through Google api -

every thing ok in site. adding products in cart ok. , when login through facebook, twitter , registered account cart records show . unfortunately when login google api login cart become empty. ////// here code when google come @ page after getting data.///// $this->user_model->insert('users', array('email'=>$users_info['email'], 'fname'=>$users_info['given_name'], 'lname'=>$users_info['family_name'], 'pic'=>$users_info['picture'] )); $id = $this->user_model->get_last_insert_id(); ////////setting session values////////////////////////// $sess_array = array( 'id' =>$id, 'email' => $users_info['email'], 'is_logged_in' =>true

javascript - meteor: design pattern : create template helper for each field (column) of collection -

using meteor js, notice if have documents {"q1":"somevalue1","q2":"somevalue2","q3":"somevalue3","q4":"somevalue4"} quite helpers end edit: end repeating creation of helper-per-field lot template.whatever.helpers({ gimmeresults1: function(){return mycollection.find({},{fields:{"q1":1}})}, gimmeresults2: function(){return mycollection.find({},{fields:{"q2":1}})} }); with averaging 1 field in ugly way such as q1avg: function () { var count = mycollection.find({},{fields:{"q1":1}}).count(); var total = 0; mycollection.find({},{fields:{"q1":1}}).map(function(doc) { total += doc.q1; }); return avg = (math.round((total / count)*100))/100; } (using variable still entail multiple db queries, correct?) is there design pattern should using iterate on fields of document and-autocreate template helpers? what other ways can eliminate spaghetti co

android - Application crashes after notification -

*notification working fine problem crashed after clicking button *it says add @ add@suppresswarnings 'deprication' n , add @ add@suppresswarnings 'deprication' onclick public class testinput extends activity { button setbutton; location location, locationa, locationb; locationmanager locationmanager; notificationmanager nm; public static final int uniqueid =1; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.showcoords); nm = (notificationmanager) getsystemservice(context.notification_service); nm.cancel(uniqueid); setbutton = (button) findviewbyid(r.id.btnshowlocation); setbutton.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { intent intent = new intent(testinput.this, goin.c

debugging - red dot in chrome debugger when writing LESS? -

Image
i'm transforming css files less file. only part of less working , see weird red dot line in chrome debugger problematic lines, any idea means? http://codemirror.net/doc/releases.html says version 2.33 of codemirror introduced "show non-printing characters red dots."

ios - Google Drive API : login programmatically -

i developing application required upload file google drive. started learning api following link. https://developers.google.com/drive/ios/quickstart currently,i have login first time upload file. in application, every time there same account used uploading file. so, there way can bypass gtmoauth2viewcontrollertouch (login screen). please me. thankful replay. most google apis require oauth 2 token, , far available via user-directed sign-in flow, gtm-oauth2 provides.some older google apis support clientlogin protocol, in username , password supplied directly application, newer apis not. remember hardcoding account authorization(especially account password) application's binary security risk , poor practice.

What will happen if document size more than 16mb in MongoDB? -

i have document witch size 15 mb.what happen if size more 16 mb? have more nested arrays in document (not files)? please tell me? thanks! to answer actual question: operations try insert document larger 16mb or try update existing document in way makes grow past 16mb fail, server return error. documents of size sign of (very) bad design, there exceptions of course...

oracle - How can I check if a role has "grant references" on a given table? -

i've got table (myschema.mytable) want grant select , references role (myrole). so, when logged on "sys sysdba", executed following: grant select, references on myschema.mytable myrole; i can see grant permission when execute: select * role_tab_privs role = 'myrole' however, doesn't seem show references privilege. need query see that?

sql - How can I temporarily disable constraints on my table? -

after going through this post , trying add following command in stored procedure: alter table mytable nocheck constraint but editor underlines , shows error: sql70005: option cannot used modify constraints. must use individual constraint names instead i'm using vs2013 express web sql server 2008 r2 express. missing here? you can write script generate statements disable each 1 (and hten re-enable appropriate.

javascript - workaround for session cookies not being removed in chrome -

i need display popup user once per session. thought create session cookie creating cookie no expiration date track if popup has been displayed. these cookies should removed when browser closed. have since learned chrome has "feature" session cookies not removed ( chrome doesn't delete session cookies ). i not asking why cookies aren't deleted in chrome. asking if there way force chrome remove cookies or other solution display popup once per session. you can maybe use sessionstorage store flag? http://www.w3schools.com/html/html5_webstorage.asp or information required sent server on every request?

PHP float to int cast erratic behavior -

at least on machine: $var = php_int_max; var_dump($var); $var++; var_dump((int)$var); $var += 10; var_dump((int)$var); $var += 10000; var_dump((int)$var); results: int(9223372036854775807) int(-9223372036854775808) int(-9223372036854775808) int(-9223372036854765568) why behavior crazy? understand returing php_min_int every time, if add numbers changes? i these results when run code here: http://writecodeonline.com/php/ it's undefined, float doesn't fit in integer. can happen. it's php, quirks. operation of casting implemented using (long) cast operation in c, undefined in case, shouldn't depend on particular behavior (in fact, on platforms, mips64, cause cpu exception, stop php). source: http://www.php.net/manual/en/language.types.integer.php#language.types.integer.casting.from-float

php - if date time difference is over cetain amount -

$now = new datetime(); $future_date = new datetime($date); $interval = $future_date->diff($now); echo $interval->format("%d days, %h hours, %i minutes, %s seconds"); basically want use difference between 2 dates , whatever person has booked. need use if statement check if difference between 24 hours / 1 day. how use datetime in if statements? like if ($interval > 24 hours) { allow } problem how write 24 hours in php? sounds dumb know. $now_ts = $now->gettime(); $future_date_ts = $future_date->gettime(); if ($future_date_ts - $now > 60 * 60 * 24) { // more 24 hours before $future_date } if want diff other way add: $now - $future_date_ts > 60 * 60 * 24 // more 24 hours after $future_date this gives 48 hour range around $future_date .

c++ - Call to operator new results in segmentation fault in MPI code -

so following line in mpi code results in segfault: mya = new double[nummyelements*numrows]; , nummyelements , numrows both int -s , none of them garbage. in test runs nummyelements*numrows = 235074 . line of code above gets called in constructor object , double* mya member of class. using: g++ (ubuntu/linaro 4.6.3-1ubuntu5) 4.6.3 , mpirun (open mpi) 1.4.3 for running program 1 processor i.e. mpirun -np 1 ./program on laptop. the exact error following: [user:03753] *** process received signal *** [user:03753] signal: segmentation fault (11) [user:03753] signal code: (128) [user:03753] failing @ address: (nil) after code hangs , have abort manually. don't think i'm running out of heap since when looking @ processes through top program uses 2.1% of memory. however! interestingly enough if decrease size i.e. replace nummyelements*numrows small constant 10 or 100 don't error. can't go higher 1000. mya = new double[1000]; would result in s

wordpress - Restrict Related Products by Product Categories Woocommerce -

i have done fair bit of searching on no avail. my question wish narrow term woocommerce defines related product. uses categories & tags define related products, wish remove tags , link product categories. result of products in store same category defined related product. note not using subcategories. can me out code need use achieve this? thanks! in abstract-wc-product.php file in woocommerce/includes/abstracts/ folder remove following line (on line ~1154): // tags $terms = wp_get_post_terms( $this->id, 'product_tag' ); foreach ( $terms $term ) { $tags_array[] = $term->term_id; } removing above should work.

php - Generating getters and setters for entities out of a bundle -

i created models in orm-designer , changed doctrine config file know application structure in following format -app -src -acme - model - model_1.php - model_2.php - ... - applicationbundle - ... doctrine config: # doctrine configuration doctrine: dbal: driver: "%database_driver%" host: "%database_host%" port: "%database_port%" dbname: "%database_name%" user: "%database_user%" password: "%database_password%" charset: utf8 # if using pdo_sqlite database driver, add path in parameters.yml # e.g. database_path: "%kernel.root_dir%/data/data.db3" # path: "%database_path%" orm: auto_generate_proxy_classes: "%kernel.debug%" # auto_mapping: true mappings: model: type: yml dir: %kernel

javascript - Text Box not saving in wordpress theme settings -

i creating wordpress theme theme options in wordpress. add dynamic add , remove textbox using jquery inside theme settings page. query is, theme_settings.php <?php function theme_settings_init(){ register_setting( 'theme_settings', 'theme_settings' ); } function add_settings_page() { add_menu_page( __( 'theme settings' ), __( 'theme settings' ), 'manage_options', 'settings', 'theme_settings_page'); } //add actions add_action( 'admin_init', 'theme_settings_init' ); add_action( 'admin_menu', 'add_settings_page' ); //start settings page function theme_settings_page() { if ( ! isset( $_request['updated'] ) ) $_request['updated'] = false; ?> <div> <div id="icon-options-general"></div> <h2><?php _e( 'theme settings' ) //your admin panel title ?></h2> <?php //show saved options message if ( false !== $_req

eclipse - How to solve org.openqa.selenium.NoSuchElementException: no such element -

Image
i trying login facebook using excel sheet .in program excelsheet imports username , password shows error while login functionality calls , shows no such element error my excel sheet is fileinputstream fi=new fileinputstream("e:\\workspace99\\seleniumautomations\\or\\login_or.xls"); workbook w=workbook.getworkbook(fi); sheet s=w.getsheet("login"); driver.findelement(by.id(s.getcell(0,1).getcontents())).sendkeys("rishy9999@gmail.com"); driver.findelement(by.id(s.getcell(1,1).getcontents())).sendkeys("chandu"); thread.sleep(1000); driver.findelement(by.id(s.getcell(2,1).getcontents())).click(); thread.sleep(5000); throws: org.openqa.selenium.nosuchelementexception: no such element (session info: chrome=34.0.1847.116) (driver info: chromedriver=2.6.232923,platform=windows nt 6.1 x86) (warning: server did not provide stacktrace information) comman

KineticJS - Docs for previous version -

where can find docs of previous release of kineticjs. @ http://kineticjs.com/docs/ there doc of current release. since kinetic api changing fast need have @ older version 4.6.0 hope can waiting better answer : https://web.archive.org/web/20130812021657/http://kineticjs.com/docs/index.html 4.6 release date of august 12, , date of shot... seems 4.5.5 doc... however, differences few.

ms word - Mergeseq disappears in my mail merge code -

i'm new mail merge documents. i'm trying simple thing, explained in source: http://support.microsoft.com/kb/294686/en-us just trying out basic code: {if {mergeseq} = "1" "true" "false"} but if switch "preview results" on , off, code becomes {if = "1" "true" "false"} what's going on? can tell syntax should have been correct. why did word kick mergeseq away? { mergeseq } generates sequence number when merge. when you're previewing, doesn't generate result (or if prefer, generates empty result). alt-f9 once or twice should reveal field code again. so behaviour in fact "expected", if rather confusing, particularly since { mergerec } behaves differently. (as aside, preview guide happen when merge. it's best test actual merge need).

objective c - Unable to pass data between MasterVC to DetailVC in iOS -

i'm trying pass data(_claimreporttodetailview) viewdidload (of mastervc ) detailvc . it's null . @interface lamasterviewcontroller () { nsarray *_claimreports; } - (void)viewdidload { [super viewdidload]; _claimreports = [[ladatamodelcontroller getsingleton] getclaimreportsorderedbyaccesseddate]; ladetailviewcontroller *detailviewcontroller = [[ladetailviewcontroller alloc] init]; detailviewcontroller.claimreporttodetailview = (laclaimreport *)_claimreports[0]; nslog(@"claim%@",detailviewcontroller.claimreporttodetailview); // captures here properly. } @interface ladetailviewcontroller : uiviewcontroller @property(nonatomic ) laclaimreport *claimreporttodetailview; @end - (void)viewdidload { [super viewdidload]; nslog(@"sdfdf%@", _claimreporttodetailview); // logs null always. } your viewdidload seems strange. have line: ladetailviewcontroller *detailviewcontroller = [[ladetailviewcontroller alloc]ini

php - How to read XML data from api request -

Image
i making call url : http://example.com/service.asmx/gettodaysdiscussionforum xml data please see screenshot : $response = file_get_contents('http://103.1.115.87:100/service.asmx/gettodaysdiscussionforum'); $response = new simplexmlelement($response); print_r($response);exit; it display following output : simplexmlelement object ( [table1] => array ( [0] => simplexmlelement object ( [id] => 1210 [title] => test discussion, dont reply [createddate] => 4/25/2014 10:42:49 [status] => not sent ) [1] => simplexmlelement object ( [id] => 1182 [title] => negotiation skills discussion [createddate] => 4/25/2014 7:47:51 [status] => not sent ) ) ) how can store each data in variables ? i new xml

rest - How to use Spring Hateoas with the most decoupling possible -

basically want generate restful service spring-data restrepositories need add significant amount of domain logic services in addition use 2 different data sources. poc. of tutorials have found reference building links either in controller when creating resource or using resource assembler , pointing methods. there few examples have found use entity links, appears more "decoupled" way of doing this. furthermore, have no clear way of generating landing page @ context root without writing own controller , spitting out instance of resource support (which fine thinking there better way). know new project, of examples find copy/paste of each other. my requirements such: have landing page @ context root exposing of rels decouple resources framework's resourcesupport decouple creation of links controllers themselves apply both collection , singleton patters hal browser shows links correctly i sure there best practices in someone's mind, maybe oliver's, , ca

php - Fetch comma separated values in correspondent checkbox -

i working on property web site. want enter specifications of house or apartment. want fetch data 1 database field. please check example picture: http://i.stack.imgur.com/7xbei.jpg if value see in cafe,yp online both see in cafe & yp online check boxes must checked. example form, have more 100 checkboxes. not want make 100 fileds checkboxes. looking forward reply. do want right database entry based on checkboxes selected, or automatically highlight checkboxes in database well? <?php /* * assuming mysqli initialized $mysqli * assuming <input type="checkbox" name="checkbox[]" /> */ $found = array(); foreach($_post['checkbox'] $checkbox) { if(!$s = $mysqli->query("select `id`, `value` `table` `value` '%$checkbox%'")) { // no result } else { $result = $s->fetch_assoc(); $found[$result['id']] = $result['value'

jquery - AutoRender = False doesn't work in CakePHP -

been trying figure out hours can't work! i'm following this tutorial implement simple shopping cart feature using ajax , cakephp in cartscontroller, have set: $this->autorender = false; since ajax call doesn't need load 'add' view. however, when click 'add cart' button, returns blank page correct quantity number. if go page , refresh it, can see item has been added cart. how disable blank page (with qty) loading , have ajax update cart counter? cakephp: public function add() { $this->autorender = false; if ($this->request->is('post')) { $this->cart->addproduct($this->request->data['cart']['product_id']); } echo $this->cart->getcount(); } fyi: addproduct loops through array in session , increments variable (if found) or adds array (if not found) getcount returns count of items in array. ajax: <script> $(document).ready(function(){ $('#add-form').sub

ruby - How to return the exception stack trace to normal, when using win32console gem? -

ruby 1.8.7 (2010-12-23 patchlevel 330) [i386-mingw32] win32console (1.3.2 x86-mingw32) wirble (0.1.3) windows 7 i've started using wirble colorize irb output , read needed have win32console gem have color, otherwise color codes. that has worked until noticed exception stack trace looked different , missing information. i've narrowed down win32console. simple example without win32console: irb(main):001:0> 1/0 zerodivisionerror: divided 0 (irb):1:in `/' (irb):1 c:/ruby193/bin/irb:12:in `<main>' irb(main):002:0> simple example win32console: irb(main):003:0> 1/0 #<class:0x57a7598>: divided 0 (irb):3:in `/' (irb):3 irb(main):004:0> is there way change keep colored output? found out issue has been logged before , guess never added actual gem see here since posts 4 years old. basically change line s = t.dup.to_s s = t.to_s.dup in lib\win32\console\ansi.rb in def _printstr

methods - C# Sorting - not all code paths return a value -

thanks answers, said before, beginner, maybe i'll try show problem other side. @ beginning wrote working program below, realised task use sealed class , difficult me @ moment. using system; using system.collections.generic; using system.linq; using system.text; namespace projekt_1__konsola { sealed class element { int val; public element(int e) { val = e; } public int v { { return val; } } } class program { static void ustawieniestylu() { console.title = "projekt"; console.backgroundcolor = consolecolor.white; console.foregroundcolor = consolecolor.black; console.clear(); } static void podajliczbę(string komunikat, out int liczba) { while (true) { console.write(komunikat); string str = console.readline(); try { liczba = int.parse(str); break;

lispworks - Lisp Illegal argument in functor position -

hello can me out? (defun f(x) (list ((* 2 x) (* 3 x))) ) (f 1) i this, illegal argument in functor position: (* 2 x) in ((* 2 x) (* 3 x)) . it should be: (defun f (x) (list (* 2 x) (* 3 x))) you have set of parentheses around arguments list . when expression list, first thing supposed function call, ((* 2 x) (* 3 x)) is not valid expression because (* 2 x) not function.

Trying to convert from C# to VB.net -

i trying change c# code vb.net , running issue username select box not populating list of membership users. c# code displays users list. c# using system; using system.collections.generic; using system.linq; using system.web; using system.web.security; using system.web.ui; using system.web.ui.webcontrols; public partial class admin_change_change : system.web.ui.page { membershipusercollection users; protected void page_loadcomplete(object sender, eventargs e) { users = membership.getallusers(); if (!ispostback) { username.datasource = users; username.databind(); } } protected void btnchange_click(object sender, eventargs e) { membershipuser usertochange = membership.getuser(username.selecteditem.value); if (usertochange != null) { usertochange.changepassword(usertochange.resetpassword(), newpassword.text); response.redirect("/admin/"); } else { message.text = "invalid username or

ios7 - iOS 7 Tab bar icons temporarily disappear when on More tab -

Image
when add view controller embedded navigation controller, tab bar, icon + title disappear briefly when coming more tab. however when view controller added such, icon+image okay , don't disappear. i've tried many things already, , out of options. ideas? here's appdelegate code: - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; self.tabbarcontroller = [[uitabbarcontroller alloc] init]; // must placed here, before tabs added. otherwise navigation bar // overlap status bar. [[uiapplication sharedapplication] setstatusbarhidden:no withanimation:uistatusbaranimationslide]; [self addviewcontrollerstotabbar]; self.window.rootviewcontroller = self.tabbarcontroller; self.window.backgroundcolor = [uicolor whitecolor]; [self.window makekeyandvisible]; return yes; } - (void)addviewcontrolle

Ember.js create a child controller without route -

i'm trying create child controller limit number of articles retrieved. idea have that: var homesectioncontroller = ember.objectcontroller.extend({ selectedarticles: functioin(){ // code here }.property('articles') }); first real project using ember , ember-cli i'm still digesting concepts. this how things looking far: models/home.js var home = ds.model.extend({ sections: ds.hasmany('homesection', {async: true}) }); home.reopenclass({ fixtures: [ { id: 1, sections: [1, 2] } ] }); export default home; models/home-section.js var homesection = ds.model.extend({ title: ds.attr('string') }); homesection.reopenclass({ fixtures: [ {id: 1, title: 'about', articles: [1,2,3,4,5]}, {id: 2, title: 'contact'} ] }); export default homesection; models/home-article.js var homearticle = ds.model.extend({ title: ds.attr('string') }); homearticle.reopenclass({ fixtures: [

math - For a beginner, how to combine Python and Sage with Emacs text editor? -

i'm beginner in three: python, sage , emacs. i've installed 3 of them on pc , quick-started sage in emacs, i'll doing now. pointers in direction of following appreciated! how can start writing sage/python program in emacs? apparently there no way start writing new file in emacs (there options open files, visit new files, etc.). read in tutorial emacs has python mode, , when open python program (which did testing), automatically switches python mode, can't figure out how open new python file. i know how open, save , compile program in python alone, not in sage. apparently sage requires separate text editor (like emacs), if don't use online sage writing resources sagenotebook, sagemathcloud, etc. after writing sage code in python, how run, compile , fix bug in emacs?

angularjs - $index is not working inside of ng-repeat -

i have following ng-repeat html code: <group ng-repeat="group in groups" groups="groups" group="group"></group> which works great me @ generating groups object. problem having $index though doesn't work inside of directive. so in group template: <div> {{$index}} - {{group.name}} {{group.target}} </div> the $index undefined. here directive: app.directive('group', function () { return { restrict: 'e', scope: { groups: '=', group: '=' }, templateurl: '../../content/templates/recruitinggroups/group.html', link: function (scope, el) { //set rules if (scope.group.rule) { scope.rulerules = scope.group.rule.rules; } } } }); your directive uses isolate scope. access $index inside parent scope need use $parent : <div> {{$parent.$i