Posts

Showing posts from June, 2014

c - Data sending between master process and slaves -

i need send pretty large amount (logs) amount of data multiple processes 1 master processes. running independent on system. what best way this? interprocess communication way or should use shared memory? maybe there different way don't know yet. the language used c on linux, because have implement in existing program. how accomplish it? apart inter process communication using pipes/named pipe see question , shared memory see question , so question fastest , large size data discussion .(it directs on using shared memory(fast , large) , pipes(easy). you can try using sockets. master listens on port , slaves connect port , master accepts connection.but may lead packeting , resource overhead.

Access 2013 calculated field too complex -

apparently, calculated field way complex. suggest better way accomplish i'm trying do? goal: value entered in strength field determines value appears in calculated field. in advance help! [strength] number field [strmod] calculated field below expression tried build support [strmod] calculated field. iif([strength]=1,-5, iif([strength]>=2 , [strength]<=3,-4, iif([strength]>=4 , [strength]<=5,-3, iif([strength]>=6 , [strength]<=7,-2, iif([strength]>=8 , [strength]<=9,-1, iif([strength]>=10 , [strength]<=11,0, iif([strength]>=12 , [strength]<=13,1, iif([strength]>=14 , [strength]<=15,2, iif([strength]>=16 , [strength]<=17,3, iif([strength]>=18 , [strength]<=19,4, iif([strength]>=20 , [strength]<=21,5, iif([strength]>=22 , [strength]<=23,6, iif([strength]>=24 , [strength]<=25,7, iif([strength]>=26 , [strength]<=27,8, iif([strength]>=28 , [strength]<=29,9, iif([strength]=30,10,null) ...

php - SQL Foreign Key General Error 1215 when creating migrations -

i built 2 migrations: public function up() { schema::create('incidents', function (blueprint $table) { $table->increments('id'); $table->string('user_id'); $table->integer('incident_type_id')->unsigned(); $table->string('type'); $table->string('incident_reference'); $table->integer('incident_id'); $table->date('date'); $table->time('time'); $table->string('location'); $table->string('street'); $table->string('city'); $table->double('latitude', 10, 6); $table->double('longitude', 10, 6); $table->smallinteger('incident_archived')->default(0); $table->timestamps(); }); } and other one: public function up() { schema::create('responders', function (blueprint $table) { ...

Google App Engine Python - YouTube API v3 - Insufficient Permission -

i duplicated tasks api this video, unable translate format using youtube api. here .py file: import httplib2 import os import sys import jinja2 import webapp2 import logging import pprint oauth2client import tools oauth2client.client import flow_from_clientsecrets oauth2client.client import oauth2webserverflow oauth2client.client import accesstokenrefresherror oauth2client.tools import argparser, run_flow oauth2client.appengine import oauth2decorator apiclient.discovery import build google.appengine.ext.webapp import util google.appengine.ext.webapp import template decorator = oauth2decorator( client_id = '*my client id*', client_secret = '*my client secret*', scope='https://www.googleapis.com/auth/youtube') service = build("youtube", "v3") class mainhandler(webapp2.requesthandler): @decorator.oauth_required def (self): self.response.headers['content-type'] = 'text/plain' chan...

iPhone app won't work on iPhone 3GS with iOS 4.3 -

i successful in creating android apps flashdevelop 4.7. however, apple makes me troubles, expected. have created on apple developer site, mobileprovision file app, .p12 file etc. ipa file has been compiled successfully. app has been installed successfully. won't run. after clicking icon, default.png displays maybe second, maybe less, , disappears. in app have used nothing, simple text displaying on stage... i don't know problem phone model (3gs 32 gb), or ios (4.3.3) or cause os jailbreaked... driving me nuts... nothing helps... restarting iphone, uninstalling, installing.. nothing.. default.png image , quits. when compile same code same mobileprovision , p12 file flash cs6, code "works", blank page displayed after default loading image. summary note: have tested phone simple app... cs6 - works, flashdevelop - no... regular app (works on android) cs6 - works default image, blank page, flashdevelop - nothing... i appreciate idea.

unity3d - Vuforia augment reality windows -

can please tell me, if vuforia can run on pc? have tried make .exe file, not work. please tell me how can run vuforia apps on pc? should build windows store using unity , run on windows 8? can please tell me vuforia can run on pc answer no . cannot build windows or mac app vuforia. vuforia supported on mobile platforms (ios, android). but want test on windows, can run app , test in unity editor mode webcamera attached. hope answer question.

database - Can we perform joins on tables in two different projects in BigQuery? -

i have 2 projects having datasets. want perform join of 1 table first project table in second project. how can that? query ? yes, can. need qualify table name project name, i.e. projectname:dataset.table here example of joining 1 of tables against table in publicdata project: select sum(a.is_male) (select is_male, year [publicdata:samples.natality]) inner join (select year [moshap.my_years]) b on a.year = b.year

ruby on rails - Created objects in Rspec test can be inspected but showing as blank? and !present? -

i have strange case i'm finding when i'm running rspec tests. after doing my_model = mymodel.create , can my_model.inspect , create properties of object, when my_model.blank? or my_model.present? shows true , false respectively i can further demonstrate strange behavior doing find_test = mymodel.find(my_model.id) and same results - object can inspected, shows properties, registers blank , not present. really weird , can't write reliable test behavior. how can "exist" both "blank" , not "present"? here code showing output in comments: def self.find_or_create(id, current_user) cart = cart.where(referral_guid: nil, id: id).first if !priority_cart?(cart) && !current_user.nil? cart = cart.where(referral_guid: current_user.referral_guid).order("id desc").first end cart.update_cart_with_referral_guid(current_user) unless current_user.nil? cart = cart.create unless cart ##### t...

amazon web services - Sinatra/Ruby DynamoDB get_item returning '#' sign instead of integers -

i using sinatra app retrieve item dynamodb. receiving # signs integers stored. using recent aws sdk. hk hash key. my dynamodb looks this: hk b 2015-06-13 4 4 my code in route looks like: resp = dynamo_client.get_item( # required table_name: "test", # required key: { "hk" => date.today.to_s }) resp.data[:item] what when hitting url is: ["a", #]["hk", "2015-06-13"]["b", #] why '#' signs instead of values?

Error reading file: uiskin.json - only on Android -

i have been using default uiskin pack menu screen: github: libgdx/test/gdx-tests-android/assets/data uiskin.atlas uiskin.json uiskin.png default.png default.fnt this works on desktop. on android, serializationexception : fatal exception: glthread 3432 process: com.ttocsneb.matrix.android, pid: 1506 com.badlogic.gdx.utils.serializationexception: error reading file: skins/uiskin.json @ com.badlogic.gdx.scenes.scene2d.ui.skin.load(skin.java:97) @ com.badlogic.gdx.scenes.scene2d.ui.skin.<init>(skin.java:82) @ com.ttocsneb.matrix.screen.menuscreen.show(menuscreen.java.35) ... the error comes initialization of skin: skin = new skin(gdx.files.internal("uiskin.json"), new textureatlas("uiskin.atlas")); you can not use string path directly. try pass string through gdx.files.internal(). skin = new skin(gdx.files.internal("uiskin.json"), new textureatlas(gdx.files.internal("uiskin.atlas")));

xpath - How to select text from table cell that includes <br>? -

i have table contains rows this: <tr class="premium"><td class="name"><div class="name">john doe</div>fancy company name<br />elmstreet 71<br />454378 ghostown<br />tel.: 123 4567 891<br /></td></tr> <tr class="basic"><td class="name"><div class="name">john smoe</div>fancy company name<br />elmstreet 73<br />456378 ghostown<br />tel.: 123 4567 891<br /></td></tr> i need xpath select company name rows class="premium" thanks in advance! xpath returns set of strings divided <br> tags. can use string() function take 1st past string(//tr[@class="premium"]/td[@class = "name"]/text()) or kjhughes has supposed //tr[@class="premium"]/td[@class = "name"]/text()[1] result string='fancy company name'

python - Works in shell but not as a program? -

i tried following in shell infile = open("studentinfo.txt", "r") infile.read() and returned text in file, want do. however, when wrote , saved program def main(): infile = open("studentinfo.txt", "r") infile.read() main() it returned blank lines. your function never returns values, discarded again. add return statement: def main(): infile = open("studentinfo.txt", "r") return infile.read() also, in interactive interpreter, expression results echoed automatically unless result none . in regular scripts, you'll have print results explicitly: print(main())

javascript - Unable to share image on Facebook shar.php -

i trying share website url specific image, unable so. i've tried 2 ways neither seem working. method 1: shows black image <meta property="og:title" content="default description"/> <meta property="og:type" content="default description"/> <meta property="og:url" content="http://vmallonline.com/"/> <meta property="og:image" content="http://vmallonline.com /skin/frontend/estore/default/images/logo.png"/> <meta property="og:site_name" content="imdb"/> <meta property="og:description" content="a group of u.s. marines, under command of renegade general, take on alcatraz , threaten san francisco bay biological weapons."/> <a href="http://www.facebook.com/sharer/sharer.php? u=http://myurl.com/">share ...

objective c - Assertion failure in -[UITableView layoutSublayersOfLayer:] -

i want use uisearchdisplaycontroller on uiviewcontroller , includes uitableview . use autolayout. when try put searchbar (_searchbar) in tableheaderview with self.tableview.tableheaderview = _searchbar; i error ' nsinternalinconsistencyexception ', reason: 'auto layout still required after executing -layoutsubviews. uitableview's implementation of -layoutsubviews needs call super.' disabling autolayout, error disappears, need autolayout... the error appears, when use custom cells or standardcells... the error appears, when tableview has no rows... as general solution problem, or @ least way of finding cause of it: turn on exception breakpoints subclass uitableview , override layoutsublayersoflayer: , calling super run app - stop in new method in debugger, type po [self _autolayouttrace] this show printout of every view in window, views auto layout has not been able come solution highlighted asterisks or ambiguous layout . these vi...

Remove all chars in java string, except '0' and '1' -

how can remove characters being neither '0' nor '1' in string, final string consists of 0s , 1s? i'm using java 8. my solution loop (i think it's not efficient way): string before = "012940124810"; string after = new string(); for(int = 0; < before.length(); i++) { if(before.charat(i) == '0' || before.charat(i) == '1') { after += before.charat(i); } } you can use regex , replaceall method string out = str.replaceall("[^01]", "");

javascript - JQuery slider doesn't work fine for next slides ( having error with .next() ) -

i have image slider . works fine if press next button . when press consecutive , next images shown without fade effect , irregular . by way , tried .stop() before .fade effect , .css . thanks http://jsfiddle.net/xocdq51a/15/ check work fine you must add jquery library on jsfiddle first and in localhost add code on head <head> <script>//your code here </script> </head> now can check here work good click here see it !

Cannot persist simple entity with Hibernate when run in an OSGI server(Works in a standalone Java application) -

i starting use hibernate-jpa. not know in deep how works, though know jpa specification fair extent. i have single entity address, has no relationships whatsoever. has primary key id has @generatedvalue annotation , 4 other fields. instantiated entitymanagerfactory, entitymanager, address object , called em.persist(address); i error org.hibernate.propertyaccessexception: not field value reflection getter of com.sac.hbn.address.id. i running in osgi server, when run in standalone application works without issues. https://hibernate.atlassian.net/browse/hhh-9434 issue facing asker there mentioned when changed 4.3.6 4.3.5 worked him. me tried 4.3.2,4.3.5,4.3.6 gave me same behavior. this stack trace getting. caused by: javax.persistence.persistenceexception: org.hibernate.propertyaccessexception: not field value reflection getter of com.sac.hbn.address.id @ org.hibernate.jpa.spi.abstractentitymanagerimpl.convert(abstractentitymanagerimpl.java:1763) @ org.hibernate....

ios - How to get back to the application which escapes control? -

scenario : "my application may escape control during ui automation application browser etc" solution : "i want application automating after loses control , moves app can proceed automation" tried : can figure out if application escapes control checking bundle id's after each action if actual , current bundle id's differ know application lost control. i blocked on how proceed further in getting application in case moves out of control thank time , effort in going through till end :) this limitation of "sandbox" in ios -- once app loses focus, uiautomation must terminate well. need launch instruments session automate browser (or whatever application you're switching to). see this question information on launching automation session against apps.

how to replace part of part of string in javascript -

i have 2 guids. looking replace c013d94e 1st guid cd11d94e of second guid in javascipt . i checked javascript replace() method not sure how can use specific case. c013d94e-3210-e511-82ec-303a64efb676 - 1st guid cd11d94e-3210-e511-82ec-303a64efb676 - 2nd guid following code trying for(var i=0; < response[1].length;i++) angular.foreach($scope.studentpermissions[i][0].children, function (subject) { string 1stguid= response[1].data[i].id; // contains cd11d94e-3210-e511-82ec-303a64efb676 subject.id = // contains c013d94e-3210-e511-82ec-303a64efb676 }); @jamen. yes other part of 1st string same. how can use concatenate? you don't need use replace then? make brand new string: var guid = "cd11d94e-3210-e511-82ec-303a64efb676"; but, answer question in title: var input = "c013d94e-3210-e511-82ec-303a64efb676"; var output = input.replace("c013d94e", "cd11d94e"); console.log(output); // cd...

linux - what is the difference between TTY and GNOME terminal -

operating system ubuntu, debian having gnome terminal real time usage. but, @ same time ctrl+alt+f2 shows terminal full fledged cui. if tty command executed in gnome terminal, shows output /dev/pts/3,4 etc. but, in cui environment shows "/dev/tty2". so, difference between these terminals. this stems way when had number of fixed screens attached unix box. these had /dev/tty1 , 2 ,... device file number known beforehand , allocation of physical device vs. device file fixed. when dialed in machine or had remote connections, "terminal" allocated dynamically , called "pseudo-terminals", hence device file /dev/pts/3 , 4 ... have own folder because there can many , clutter /dev directory if in there. number can vary according number of connections , device number can recycled. the /dev/ttyn still there "default" terminals can access using ctrl-alt-f2 etc. by way name tty comes era before terminals, , stems "tele typewriter...

wordpress - How to properly create a child theme structure -

i've read articles , i've understood there child theme files, totally override main theme files others not (like function.php example). @ point, know files included in child theme , how (regarding folder structure). most of modifications made in custom css main theme special field, i've modified directly app.css , app.min.js ​, header.php , script-calls.php (registering additional js files , applying tweaks)​. i have mention in case, stylesheets enqueued using inc/script-calls.php not function.php file. all files (no matter extension) treated in same way, ok if copy these files child theme folder or should create exact directory structure, have in main theme please? thank you, le: struggling make work without result. recreate same folder structure trying use these files in child: app.css , app.min.js ​, header.php , script-calls.php , file working it's header.php . thoughts? ​ you have follow directory structure of parent theme in child ...

jquery - Why Ajax post request is executed several times? -

here code: $(document).ready(function(){ $("#mainbutton").click(function(){ $("#ajaxform").submit(function(e){ var info = $(this).serialize(); $.ajax( { url : "userctrl", type: "post", data : info, success:function(data, textstatus, jqxhr) { console.log("success"); $('.valid-error').html(data); }, }); e.preventdefault() }); $("#ajaxform").submit(); //submit form }); }); and html <form id="ajaxform"> <input type="hidden" name="action" value="submit"/> <input...

MongoDB "join" (1-to-many and many-to-many manual references?) Help needed. NO ENBEDDING METHODS -

i new mongodb, know quite stuff in mysql. work in robomongo. let's have 2 collections: instruments: db.createcollection('instruments'); db.instruments.insert( [{ instrumentid : 1, instrumentname : "squier", instrumentmanufacturerid : 3, instrumentmadein: 'somecountry' },{ ... ]) and manufacturers: db.createcollection('manufacturers') db.manufacturers.insert([ { manufactid : 1, manufactname : 'fender', manufactcountry : 'united states', manufactfounded : 1946 },{ ... ]) i want "select" (find?) instruments whom manufacturers' country 'united states' ...and want "update" 'fender' instruments' instrumentmadein country 'japan' i don't want nest manufacturerinformation inside each instrument, becouse repeating same information oven , on again waste of time , space. i saw code, id field called '_id' , had large object value...

twitter - How to find the number of documents (and fraction) per topic using LDA? -

i trying extract topic 7 millons of twitter data. have assumed each tweet document. so, stored tweets in file each line (or tweet) treated document. used file input file mallet api. public static void ldamodel(int numofk,int numbofiteration,int numberofthread,string outputdir,instancelist instances) throws exception { // create model 100 topics, alpha_t = 0.01, beta_w = 0.01 // note first parameter passed sum on topics, while // second parameter single dimension of dirichlet prior. int numtopics = numofk; paralleltopicmodel model = new paralleltopicmodel(numtopics, 1.0, 0.01); model.addinstances(instances); // use 2 parallel samplers, each @ 1 half corpus , combine // statistics after every iteration. model.setnumthreads(numberofthread); // run model 50 iterations , stop (this testing only, // real applications, use 1000 2000 iterations) model.setnumiterations(numbofiteration); model.estimate(); // show words , topics...

java - Playing audio for given amount of time in Android -

i new android development. in application, wanted audio play duration (say 20 seconds). after 20sec should not start play. used getduration() method, didn't need to. code: protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); setvolumecontrolstream(audiomanager.stream_music); button button1=(button)findviewbyid(r.id.button1); button button2=(button)findviewbyid(r.id.button2); button1.setonclicklistener(this); button2.setonclicklistener(this); } public void onclick(view v) { int resid; switch (v.getid()) { case r.id.button1: resid = r.raw.a; break; case r.id.button2: resid = r.raw.b; break; default: resid = r.raw.a; break; } // release resources previous mediaplayer if (mp != null) { mp.release(); } mp = mediaplayer.create(this, resid); mp.start(); } @override public boo...

wordpress - Jquery - Replacing a Dom Element on load -

i need replace following html element <input type="submit" id="send_product_enquiry" value="send enquiry" class="button"> with this <input type="submit" id="send_product_enquiry" onclick="ga('send', 'event', { eventcategory: 'contact enquiry', eventaction: 'form entry', eventlabel: 'contact form enquiry'});" value="send enquiry" class="button"> i've been trying use jquery(document).ready(function($) { $('#send_product_enquiry').replacewith('<input type="submit" id="send_product_enquiry" onclick="ga('send', 'event', { eventcategory: 'contact enquiry', eventaction: 'form entry', eventlabel: 'contact form enquiry'});" value="send enquiry" class="button"> ' ); }); but keep getting below error "missing ) in arg...

Not able to import com.google.android.gms.common.GooglePlayServicesClient; -

i have installed google play services , have imported library project. dependencies: dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.google.android.gms:play-services:7.5.0' compile 'com.android.support:support-v4:22.2.0' } the third line google play services library imported. when try import com.google.android.gms.common.googleplayservicesclient error. solution? thanks:d follow steps import library , add dependencies drag , drop file lib folder right click on project select openmodule setting go dependencies tab click + button file dependencies , add library of gms have drag , drop hope clear!!!

javascript - Nodejs: 'require' a module in Nodejs doesn't work with certain filename -

long-time user, first time asking question. i have file (let's call file.js) in i'm attempting require file called user.service.js @ top of file: var userservice = require('./user.service'); i'm quite sure path correct , user.service.js file exporting populated object: in user.service.js: module.exports = { signin: signin, signup: signup, updateprofile: updateprofile }; however, userservice empty object {}. odd thing is, if recreate file name in same directory (e.g. user.service2.js), require statement works properly. or, if rename file.js else, e.g. file2.js, call works. additionally, if require file inside function within user.service.js, statement works well. however, i'd prefer have require statement @ top of file , available functions inside it. thanks in advance help. edit: here's sample code: var userservice = require('./user.service'); var testfunc = function () { console.log(userservice); // logs...

ssrs 2008 help - blank managment page -

i have installed sqlserver2k8r2 (with ssrs) on win 7pro virtual machine, every time try go report manager page though ie , firefox, chrome , blank page no header bar or blank page. every time try running admin in ie, have set http://win7vm trusted site, no error codes or messages access denied, turned off windows firewall cause test vm have no anti-virus installed on it. i have been on google last whole day trying find out why happening , have not been able find anything. luckily haven't had issue have heard of others having , due permissions issue. check out see if helps: http://dobrzanski.net/2008/03/28/reporting-services-blank-report-manager-screen/ https://social.msdn.microsoft.com/forums/sqlserver/en-us/fffa4d0d-6cc9-4385-8a30-8a1b8243f619/report-manager-blank-page

android - Could not parse boolean values in parse -

i trying parse boolean value after using parseobject , cannot parse it? here code: parsequery<parseobject> query = parsequery.getquery("smstable"); query.whereequalto("deviceid", android_id); query.findinbackground(new findcallback<parseobject>() { @override public void done(list<parseobject> objects, com.parse.parseexception e) { if (e == null) { (parseobject smsobject : objects) { if (smsobject!=null) { date time = (date) smsobject.get("date"); mymsg = (string) smsobject.get("message"); usrnum = (string) smsobject.get("phonenumber"); happend = (boolean) smsobject.get("happend"); result = time; } if (result != null) { if (system.currenttimemillis() >= result.gettime() && happend == false) { ...

ios - Switch UIViewController to any other UIControlller without drag and drop -

so know how drag , drop different uicontrollers , example uitabbarcontroller comes additional items, uisplitviewcontroller additional items, if want convert created uiviewcontroller uitabbarcontroller or uisplitviewcontroller . i've tried editing xml source, kinda broke flexible way achieve this. also, can set in xcode default value uicontrollers simulated size freeform of width: 350, height: 450 ? uisplitviewcontroller , uitabbarcontroller container view controllers uiviewcontrollers . container controllers don't replace or "switch" uiviewcontroller else. what drop uisplitviewcontroller or uitabbarcontroller storyboard, create (control-drag) connection between uiviewcontroller , side in split view, or tab in tab bar. as other question, want use adaptive ui techniques (i.e. size classes), instead of trying hardcode simulated values view's size. default view shows 600x600, corresponds wanyxhany. if need create different layout di...

Optional String Match in Python Regex -

i have code in python 2.7 used in finding information flight in given piece of text. come grouped (operators have standard format , fill in blanks , send message) import re line = "jetmobile:your flight 9w448 on 14jan2015 expected leave blr @ 19:00 hrs, reach bom @ 20:42 hrs. download our mobile app http://m.jetairways.com/mobileapps booking(s), flight status, check-in , more." matchobj = re.match( r'jetmobile\:your flight (.*?) on (.*?) expected leave (.*?) @ (.*?) hrs, reach (.*?) @ (.*?) hrs\. download our mobile app (.*?) booking\(s\), flight status, check-in , more\.', line, re.m|re.i) if matchobj: print "matchobj.group() : ", matchobj.group() print "matchobj.group(1) : ", matchobj.group(1) print "matchobj.group(2) : ", matchobj.group(2) print "matchobj.group(3) : ", matchobj.group(3) else: print "no match!!" however want match "jetmobile:your flight 9w448 on 14jan2015 expected lea...

ios - NSMutableURLRequest - HTTPBody from Swift Array -

i need send post request server httpbody of array. here's array of parameters: params = [ "message" : [ "alert" : "find iphone", "sound" : "binocular_default.caf" ] ] now need set nsmutableurlrequest 's httpbody array. how can that? create mutable request params. , try following code var request = nsmutableurlrequest(url: nsurl(string: "yoururl")) var session = nsurlsession.sharedsession() request.httpmethod = "post" //create dictionary parameters var params = ["username":"test", "password":"pass"] dictionary<string, string> var err: nserror? request.httpbody = nsjsonserialization.datawithjsonobject(params, options: nil, error: &err) request.addvalue("application/json", forhttpheaderfield: "content-type") request.addvalue("application/json", for...

web services - How to send SMS to mobile phone from java program- Using free APIs or WebServices -

this question has answer here: how send sms in java 14 answers i need write program should able send text sms mobile phone through java programming. got know far using sms gateways , connect modem sim card. but cannot install sms gateways , modem on client machine. can use smtp host. how can use web service send sms? your time , contribution highly appreciated. using twilio sms gateway, can accomplish this. import com.twilio.sdk.twiliorestclient; import com.twilio.sdk.twiliorestexception; import com.twilio.sdk.resource.factory.messagefactory; import com.twilio.sdk.resource.instance.message; import org.apache.http.namevaluepair; import org.apache.http.message.basicnamevaluepair; import java.util.arraylist; import java.util.list; public class example { // find account sid , token @ twilio.com/user/account public static final string account_sid...

javascript - need help to resolve - Uncaught ReferenceError: data is not defined -

i know there many questions/tutorials subject, cannot solve problem. have ask help. second day cannot find out solution simple problem. i trying in tutorial - http://www.c-sharpcorner.com/uploadfile/abhikumarvatsa/cascading-dropdownlist-in-asp-net-mvc/ working fine, once try db, getting error " uncaught referenceerror: data not defined " here web page @model testempty.models.address @{ viewbag.title = "create"; } @scripts.render("~/bundles/jquery") <script src="~/scripts/myscripts/myscripts.js"></script> <h2>create</h2> @using (html.beginform()) { @html.antiforgerytoken() <div class="form-horizontal"> <h4>address</h4> <hr /> @html.validationsummary(true, "", new { @class = "text-danger" }) <div class="form-group col-md-10"> @html.label("zone") @html.dropdownlist(...

windows - How to check OpenSSL library version of android application -

this related google play , openssl warning message . play store recommend use following command grep: $ unzip -p yourapp.apk | strings | grep "openssl" but on windows, command not running. have installed winzip, winrar, cygwin , mingw. please me run command can come know issue ? i have resolved issue facing i.e. unable run command $ unzip -p yourapp.apk | strings | grep "openssl" i installed unzip package in cygwin opening setup of cygwin , shows packages available cygwin, selected unzip package , updated. after above mentioned command work charm in cygwin terminal.

php - How to search set of specific pattern string using regular expression? -

i want search set of specific string word using php regular expression. pattern this the string of 6 character length first 5 characters of string number 0-9 last 1 character a-z or a-z alphabets there more 1 strings in word. so eg. word is 037165l_55084l_1959z then output of regular expression should return below 2 strings 37165l 55084l you can use use regex in preg_match_all function: \d{5}[a-za-z] regex demo

mixed models - Drop random effects parameters from output table in Stata -

i want create regression table (using esttab ) mixed-effects regression estimated via xtmixed in stata, want output without random effects parameters. how can drop random effects parameters output table? e.g., in case of 2 variables... xtmixed (dependent variable) (independent variable) || (grouping variable) ) ... don't want lns1_1_1 , lnsig_e values in esttab -table. best way this? there keep() , drop() option. example: webuse productivity, clear xtmixed gsp private emp hwy water other unemp || region: || state:, mle estimates store m1 // check result names matrix list e(b) // -keep()- option estout m1, keep(private emp hwy water other unemp gsp:_cons) // -drop()- option estout m1, drop(lns1_1_1:_cons lns2_1_1:_cons lnsig_e:_cons) in context of multiple equation estimation, resulting matrices have elements two-part names. general form equation-name:varname . result of matrix list shows this. afterwards, use appropriate names in keep() , drop() opt...

assembly - NASM issue on OSX 64-bit -

i'm learning asm , have small problem. can't "declare" more 1 string in "section.data". i'm trying this: section .data string1 db "test1 ", 0; string2 db "test2 ", 0; section .text global _test extern _puts _test: lea rdi, [rel string1] call _puts lea rdi, [rel string2] call _puts ret this function supposed print "test1 test2 " on stdout, doesn't work. result is: test2 it works last string stored! if know why, please tell me! if you're using nasm 2.11.08, there issue documented here relative addressing combined multiple entries in data section. you can 1 (or both) of 2 things certain. first, can have @ generated assembler code investigate it's actually churning out. that's definitive option since can see cpu running. second, can test code earlier release of nasm see if problem goes away. if so, that's indirec...

php - Need some help for radio button change function -

http://keralapsctuts.com/old/topic.php?id=14 the above page working on have problem. after loading questions , choices mysql database, have feature whereby user selects choice, checks see if answer correct or not, if selection correct text changes green or red (if incorrect selection). this layout of typical question/choice: '<div class="question_container"> <p class="questions">'.$question.'</p> <span class="group"> <input id="id_radio1" type="radio" name="group'.$id.'" value="'.$ans1.'" />'.$ans1.' <input id="id_radio2" type="radio" name="group'.$id.'" value="'.$ans2.'" />'.$ans2.' <input id="id_radio3" type="radio" name="group'.$id.'" value="'.$ans3.'" />'.$ans3.' ...

javascript - jQuery Refactoring - DRY -

i have these 2 functions, inside of main function. you'll see difference between 2 of them in middle how append/edit html. thinking nice come 2 new functions, 1 first half , other second half. i'm not sure if possible jquery, or javascript matter, don't know how call these new functions inside of these functions, if makes sense. help/guidance great! here first one $('#save').click(function(){ var title = $('#title').val(); var tags = $('#tags').val(); var notes = $('#notes').val(); var mydate = new date(); if (title.length < 1) { $('.title-warn').show(); } if (tags.length < 1) { $('.tags-warn').show(); } if (notes.length < 1) { $('.notes-warn').show(); } if (title.length >= 1 && tags.length >= 1 && notes.length >= 1) { $allnotes.prepend('<li class="note"><div><h1>' + title + '</h1><div class="date"> <...

php - Codeigniter Image Resize and Crop Error on big images -

im using basic php server 8gb ram, running lamp server. i have codeigniter v3 running , upload small images , crop resize them on fly easy. but if upload images bigger 540 x 540 following error a php error encountered severity: warning message: imagecreatetruecolor(): gd warning: product of memory allocation multiplication exceed int_max, failing operation gracefully filename: libraries/image_lib.php line number: 807 backtrace: file: /home/boomboomdead/public_html/application/controllers/file.php line: 127 function: crop file: /home/boomboomdead/public_html/application/controllers/file.php line: 173 function: generate_thumbs file: /home/boomboomdead/public_html/index.php line: 292 function: require_once php error encountered severity: warning message: imagealphablending() expects parameter 1 resource, boolean given filename: libraries/image_lib.php line number: 811 backtrace: file: /home/boomboomdead/public_html/application/controllers/file.php line: 127 func...

c# - How to Register the RowLeave event -

Image
i have form in vsto addin. want register formx_rowleave() method. register functions since using visual designer. this.clientsprojecthistorydatagridview.cellleave += new system.windows.forms.datagridviewcelleventhandler(this.clientsprojecthistorydatagridview_cellleave); but don't know how rowleave. can't find examples or find in docs. found method in docs not how register event handler. i've tried using visual studio's features display available methods or objects find datagridviewxxxeventhandler applies rowleave, cannot find one. not in docs or anywhere else i've looked. thanks but don't know how rowleave. suggestions? can't find examples or find in docs. found method in docs not how register event handler datagridview has rowleave event property can subscribe double-clicking in designer (ensure on events page clicking little lightning bolt icon):

rspec - Specific test behaviour for ruby gem -- mocking sleep -

so made ruby gem makes use of sleep function. using gem in applications causes sleep function called in tests. what preferred approach dealing this? right now, i'm mocking out sleep in application there way disable sleeping test environment in actual gem code? don't think can use rack_env since gem not specific web app. thank you as difficult know whether in test-like environment, solution not try: provide method allows users of gem indicate sleeps should not occur. you try , autodetect whether should default not sleeping (eg if looks rails loaded , rails.env.test? true) while still allowing users of gem explicitly activate no sleep mode cases can't autodetect.

android - Vector drawables that are automatically converted to pngs -

at google io, tools team briefly showed possibility define vector drawables specific suffix (e.g. ic_heart_ 48px .xml) converted pngs of necessary densities. unfortunately don't find documentation feature besides io recordings. is feature of build tools or of android studio? assuming it's part of build tools, available already? version should using? have enable feature explicitly? does google provide material icons in android xml vector format? google starting provide material design icons in vectordrawable xml format. the git repository hosted here: https://github.com/google/material-design-icons at start of google i/o material design icons in vectordrawable xml format added repository (along other updates documented here ). located in folders named drawable-anydpi-v21 . example, here communication icons in xml . here google's comments addition of these new vector drawables: add first cut @ vector drawables these icons. only black, 24dp...

Java Array Index Out of Bounds Exception saying that array is smaller than it actually is -

my program comparing 2 strings inside 2 loops. upon running, produces error: exception in thread "main" java.lang.arrayindexoutofboundsexception: 2 , though arrays initialized enough space. line of code is: if(keywords[a].equals(tokenizedstring[b])&&tokenizedstring[a].equals("1")) where keywords initialized: string[] keywords={"0","add","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"}...

bash - Putting a string on same line tcl -

i have nmap output , need put strings on different lines on same line. nmap output: nmap scan report 169.254.0.1 host (0.014s latency). not shown: 97 closed ports port state service 80/tcp open http 1720/tcp open h.323/q.931 5060/tcp open sip device type: voip adapter|wap|pbx|webcam|printer new ouput: 169.254.0.1,voip adapter how can on tcl or bash? in tcl , can use regexp extract required data. set nmap_output "nmap scan report 169.254.0.1 host (0.014s latency). not shown: 97 closed ports port state service 80/tcp open http 1720/tcp open h.323/q.931 5060/tcp open sip device type: voip adapter|wap|pbx|webcam|printer" if {[regexp {scan\s+report\s+for\s+(\s+).*device\s+type:\s+([^|]+)} $nmap_output match ip type]} { puts $ip,$type }

javascript - Displaying bubbles in Kartograph.js -

i trying create bubbles on svg map generated kartograph. want this: http://kartograph.org/showcase/symbols/ the map loads symbol not display. have no errors thrown in javascript console. $(document).ready(function() { var map = $k.map('#map'); map.loadmap("mapfinal.svg", function() { // add layers map.addlayer('background', { styles: { fill: '#e8f9fb', 'stroke': 'none' } }); map.addlayer('world', { styles: { fill: '#f5f3f2', 'stroke': 'none' } }); map.addlayer('states', { styles: { fill: '#fff', 'stroke': '#882222', 'stroke-width': 0.5, 'stroke-opacity': 0.4 } }); map.addlayer('urban', { styles: { fill: '#553344', 'fill-opac...

debugging - Reference - What does this error mean in PHP? -

what this? this number of answers warnings, errors , notices might encounter while programming php , have no clue how fix. community wiki, invited participate in adding , maintaining list. why this? questions "headers sent" or "calling member of non-object" pop on stack overflow. root cause of questions same. answers questions typically repeat them , show op line change in his/her particular case. these answers not add value site because apply op's particular code. other users having same error can not read solution out of because localized. sad, because once understood root cause, fixing error trivial. hence, list tries explain solution in general way apply. what should here? if question has been marked duplicate of this, please find error message below , apply fix code. answers contain further links investigate in case shouldn't clear general answer alone. if want contribute, please add "favorite" error message, warning or notic...