Posts

Showing posts from July, 2012

flash - why my .swf file show "undefine" word instead of text? -

when view .swf file online work gud when try watch file on local drive show "undefined" word instead of text , of text become useless word.i think because don't have font site use.how know font site use? thanks this doesn't sound font issue. 'undefined' indicates script problem. swf must trying load dynamic text, not finding local drive. if want see fonts used, check option include file size report in fla's publish settings.

vba - Paste values in first row and then every fourth row in excel -

i have workbook with range of values (k3:k89) want transform formulas , paste somewhere in workbook. problem want able paste these values in first row , every fourth row. code have far. sub copy() range("k3:k89").select activewindow.smallscroll down:=-60 selection.copy range("r3").select selection.pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks _ :=false, transpose:=false application.cutcopymode = false selection.copy range("l3").select sheets("sheet2").select end sub i can´t solve part of pasting values every fourth row. appreciated. how this? assuming column of data in column k , want data pasted column r. sub test() dim firstrow integer, lastrow integer, totallines integer, integer, k integer dim ws worksheet set ws = activesheet k = 0 firstrow = 3 lastrow = cells(3, 11).end(xldown).row ' how many total values have? totallines = lastrow - firstrow + 1 'now, loop through range of values, pasti

java - Android latlng distance calculation port from javascript -

this code used in javascript check if 2 latlangs near. want same in android. how can it? var samethreshold = 0.1; if (google.maps.geometry.spherical.computedistancebetween(latlng1,latlng2) < samethreshold)

Per-bundleid Facebook iOS url scheme -

i have encountered unfortunate design issue facebook ios sdk. problem our company produces many branded apps same prototype codebase (think restaurant ordering) need interact same facebook app. the problem if user has multiple brands installed on phone, url schemes conflict , when authenticating 1 app, user may returned wrong app! i looked facebook's url scheme suffixes, documentation says multiple suffixes searched in order (!), not relative corresponding bundle id. horrible. if associated suffix particular bundle id, our problem go away, documented, place precedence on brands on other brands, no better default behavior. is there way associate url scheme suffix specific bundle id? you can explicitly specify suffix each app setting facebookurlschemesuffix in application's plist. when happens, purposes of login , share dialog, facebook app know right suffix use. the time searches down list of suffixes deep linking, may or may not use. in case, might want

MuleSoft and SQL Server DB connection failure -

i hope can me, it's been 2 days mulesoft(ms) guru side , cannot figure issue out. put, cannot connect sql server database. using generic_database_connectory following information: url: jdbc:jtds:sqlserver://ba-crmdb01.ove.local:60520;instance=crm;user=rcapilli... driver class name: com.microsoft.sqlserver.jdbc.sqlserverdriver it's sqljdbc4.jar file, latest. "test connection" works fine. no issues there. when run app, error (below) anyone been able sql server db connection work??? error 2015-04-09 14:05:31,106 [pool-17-thread-1] org.mule.exception.defaultsystemexceptionstrategy: caught exception in exception strategy: null java.lang.nullpointerexception at org.mule.module.db.internal.domain.connection.defaultdbconnection.isclosed(defaultdbconnection.java:100) ~[mule-module-db-3.6.1.jar:3.6.1] at org.mule.module.db.internal.domain.connection.transactionaldbconnectionfactory.releaseconnection(transactionaldbconnectionfactory.java:136) ~[mule-mod

linux - How to extend bash-completion with the already exist completion in another file? -

for example, there bash-completion rar on linux, want extend, make more completions same command - rar, maybe own filename extension, don't want touch existing completion script, how start it? thanks! the base support usally in /etc/bash_completion , details in directory /etc/bash_completion.d for more information, see: an introduction bash completion: part 1 general knowledge an introduction bash completion: part 2 details on scripts in /etc/bash_completion.d

android - How can i make a fixed size for button -

when make button in xml... it's size change 1 device it's seem small in 1 device , big on , how can make constant size @ every device "apk" setup ? define exact width , height button on layout xml, android:layout_width="100dp" android:layout_height="30dp"

Why is printStackTrace() a security risk for mobile (Android) applications? -

i found several places on internet mention using method throwable.printstacktrace() in android application poses security risk (and bad coding practice.) understand why security risk? attacker using information provided by e.printstacktrace(); where e of type exception, instance? well , developer never want end user understand happening @ of application. following points can think of right now. a stack trace should never visibile end users generating stack trace relatively tedious process many logging frameworks available printing stack trace not constitute error handling. should combined other information logging , exception handling. i have used same link answer question both related!

c# - Exception: System.InvalidOperationException Trying to validate a login information -

i trying create login form. having problems database. have created windows form consists of user name , password, , login button. think statement : dataadapterobject.fill(datatableobject) has error. using visual studio profesional 2013 update 4 , sql server 2014 enterprise editon. the code follows : using system; using system.collections.generic; using system.componentmodel; using system.data; using system.data.sqlclient; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; namespace society_accounting_software { public partial class loginscreen : form { sqlconnection databaseconnect = new sqlconnection(); public loginscreen() { sqlconnection databaseconnect = new sqlconnection(); databaseconnect.connectionstring = "data source=gaurav-pc;initial catalog=societyaccountingdatabase;integrated security=true"; initializecomponent(); } private void label1

ios - Issue with Google Analytics in Swift 2 or 3 -

i have problem swift 2 (swift 3) , google analytics. this line problem: tracker.send(gaidictionarybuilder.createscreenview().build()) xcode tell's me: cannot invoke 'send' argument list of type '(nsmutabledictionary!)' update swift 3 (2016.10.19) let tracker = gai.sharedinstance().defaulttracker let build = (gaidictionarybuilder.createscreenview().build() nsdictionary) as! [anyhashable: any] tracker?.send(build) still ugly approach, let me know if there's cleaner conversion. original same here, struggling resolve tons of errors. what did (deprecated): var build = gaidictionarybuilder.createappview().build() [nsobject : anyobject] tracker.send(build) edit (2015) thanks @george poulos. . updated options, createappview deprecated, should use createscreenview instead. var build = gaidictionarybuilder.createscreenview().build() [nsobject : anyobject] tracker.send(build)

ios - viewDidGetCoveredUpByModalPresentationFormSheet? -

i have app has different integrations such evernote , dropbox. when user authenticates them, uiviewcontroller presents authentication view uimodalpresentationformsheet. doesn't trigger viewdiddisappear view makes sense since doesn't disappear. is there method can implement notified? i assume want know when modal view been presented? assuming using presentviewcontroller:animated:completion , can use completion handler know when viewcontrollers view has been presented here ref

Python subprocess.Popen scapy -

i'm running scapy pcap analyzer p = subprocess.popen(run_cmd, shell==true, stdin=subprocess.pipe, stdout=subprocess.pipe) the script runs correctly, unless there error pcap file. if pcap file doesn't work whatever reason, following: raise scapy_exception("not pcap capture file (bad magic)") anyone know of way handle these errors? goal write error file can reference later. dumping ton of pcaps @ once, if don't work, don't want errors being printed screen. outputted file if occur. assume has stdout, how can catch these errors? i have tried if "proc.returncode != 0": print "error" , same "proc.poll() != 0". no luck either of those. thanks insight community may have.

android - Get app's storage path without context -

i have background service activates broadcastreceiver class when receives content. want save app's path in external dir, returned calling context.getexternalfilesdir() (/sdcard/android/data/com.example.app/). however, since happens in background, have no context , cannot path. absolutely not wish hard code path , want data deleted when app uninstalled. other way in can complete path? service context http://developer.android.com/reference/android/app/service.html can use. this.getexternalfilesdir() on service.

arrays - Write a function to compute the n'th power of a (nxn)matrix in C -

i've added multiplication of 2 matrices algorithm seems it's not working.i need task without using pointers,memory allocation , using basic instructions(for's,while's,...) void product(double a[][20],double c[][20],int n,int d) { int i, j, k, l; for(l = 1;l <= d; ++l) { for(i = 0; < n; i++) { for(j = 0; j < n; j++) { c[i][j] = 0; for(k = 0; k < n; k++) { c[i][j] += a[i][k]*a[k][j]; } } } } } this function should calculate a^d , store in c[][20]; your code tries compute a^(2^d), instead calculates a^2 d times. you can't matrix multiplication in place, because calculate result, overwrite values. need temporary space 1 copy (unless d = 0, 1 or 2). set c identity matrix , return if d = 0. otherwise set c = copy of a, allocate matrix b, l = 1 d - 1 copy c b, let c = * b.. deallocate b.

python - remove silence at the beginning and at the end of wave files with PyDub -

Image
how can remove silence beginning , end of wave files pydub? i guess should access segment segment , check whether it's silent or not (but i'm not able it) :/ e.g. have wave file silence @ beginning, end, or both (like below) , want remove silence @ beginning , @ end of file: e.g. want import sound = audiosegment.from_wav(inputfile) cycle every sample of sound check whether it's silent , mark last silent sample since when waves starts (marker1), last sample before wave ends (marker2) , can export new sound file 2 markers newsound = sound[marker1:marker2] newsound.export(outputfile, format="wav") i advise cycle in chunks of @ least 10 ms in order little more (less iterations) , because individual samples don't have "loudness". sound vibration, @ minimum take 2 samples detect whether there sound, (but tell high frequency). anyway… work: from pydub import audiosegment def detect_leading_silence(sound, silence_threshold=

r - ggplot2 3D Bar Plot -

Image
i know sounds basic, have been searching literally more hour without success. i'm trying plot 3d bar plot in 'r' using 'ggplot2' package. dataframe looks this: x y z t1 5 high t1 2 low t1 4 med t2 8 high t2 1 low t2 3 med t3 50 high t3 12 med t3 35 low and want plot on it: any more appreciated!! as mentioned in comments, 3d plots aren't choice (when other options available) since tend give distorted/obscured view of data. that said, here's how can plot data desired latticeextra : d <- read.table(text=' x y z t1 5 high t1 2 low t1 4 med t2 8 high t2 1 low t2 3 med t3 50 high t3 12 med t3 35 low', header=true) library(latticeextra) cloud(y~x+z, d, panel.3d.cloud=panel.3dbars, col.facet='grey', xbase=0.4, ybase=0.4, scales=list(arrows=false, col=1), par.settings = list(axis.line = list(col = "transparent")))

algorithm - What is the wrong with my java code, its not clearing all the tests? -

though problem easy. here : problem statement password security important topic today. define password system here set of requirements valid password in system must fulfill. in each such system every valid password consists of digits [0−9]. in addition, each such system there 2 requirements valid password must fulfill: minimum length of valid password. maximum length of valid password. we password system secure if , if there more 1 million (106) different possible passwords in system. task, security expert, decide given password system if secure. note repetition of digits allowed. 111 valid password of length 3. leading 0's allowed. 001 , 000 valid password of length 3. you have consider sum of passwords length lies in range of minimum , maximum value. if minimum length 3 , maximum length 5, have find total count of passwords length either 3, 4 or 5. input format in first line there single integer, t, denoting number of test cases. t lines follow. the i

google chrome - Trouble building V8 on Windows 7 -

i have need build desktop app using embedded v8. online documentation says need use gyp. ok, can't seems download gyp. keep getting "unable connect repository @ url" message. there way build v8? there url besides 1 published google can use? tia

Visual studio android emulator will not start fully -

Image
i create blank cordova application in visual studio 2015 , start debugging visual studio android emulators (first lollipop , kitkat). xde starts , screen displays os starting... . stays quite while until displays the emulator unable connect device operating system; device did not response connect request. functionalities might disabled' after closing dialog, stays there forever until kill emulator. killing emulator triggers error visual studio. could not start emulated device 'vs emulator lollipop phone'. when open hyper-v, see vm in list , shown running. when connect, see console screen below i know issue has been around while now, have found new solution people may still encounter issue... i had same issue (stuck on "os starting") api v 21 & 22. api v23 images start, not debug - app crash launched. the following fixed issue: shut down emulator open hyper-v manager go settings android image expand "processor" config

php - Replace text from generated RSS feeds -

here page problem, http://knowgreaterpartnership.com/secrets/ . the rss generator use inserting inline html tags on "events" feed such <br> , <i> , </i> . here code i've ended try , remove these bits code: <div id="right" class="last"> <h1><?php esc_html_e( 'buchanan events', 'fusion' ); ?></h1> <article id="jobs"> <?php if ( function_exists( 'fetch_feed' ) ) { ?> <?php include_once(abspath . wpinc . '/feed.php'); $feed = fetch_feed( 'http://www.bipc.com/rssfeeds/rss.aspx?id=35' ); $feednew = str_replace( array( '<br>', '<i>', '</i>' ), '', $feed ); $limit = $feednew -> get_item_quantity(5); $items = $feednew -> get_items(0, $limit); if ( !$items ) { echo "p

php - How do I access each value in array? -

i have attempted numerous times trying access each value in array. array contains database results retrieved select query. $query = db::getinstance()->query("select orderstatus customerorders"); foreach ($query->results() $orderered) { $result_array = array($orderered); //print_r($result_array); $orderdata = array_map(function ($object) { return $object->orderstatus; }, $result_array); $test = json_decode(json_encode($result_array), true); $orvalue = serialize($test); $orvalue2 = unserialize($orvalue); $ordervaluenew = call_user_func_array('array_merge', $orvalue2); print_r($ordervaluenew);//debug }//close foreach loop result prints are: array ( [orderstatus] => 0 ) array ( [orderstatus] => 0 ) array ( [orderstatus] => 0 ) array ( [orderstatus] => 1 ) array ( [orderstatus] => 1 ) what you're doing should work retrieve each row, if want access orderstatu

c# - My elapsed time is only going up to 60 -

how can create elapsed time method goes beyond 60 seconds , counts in seconds. current implementation repeats every 60 seconds. code: void timer_tick(object sender, eventargs e) { time = datetime.now.second.tostring(); //datetime.now.tolongtimestring(); } public void timesetup() { timer = new dispatchertimer(); timer.interval = new timespan(0, 0, 1); //timer.interval = timespan.fromseconds(1); timer.tick += timer_tick; timer.start(); } no need make things harder necessary: class timerclass { public int time; void timer_tick(object sender, eventargs e) { time++; } public void timesetup() { timer = new dispatchertimer(); timer.interval = new timespan(0, 0, 1); timer.tick += timer_tick; timer.start(); } } this calls tick handler every second , counts number of times called. can imprecise measuring long periods of time. long run, use time = (datetime.now - start

Docker run command overhead -

i'm curious amount of overhead (time taken start running, assuming i've pulled docker image) docker gives when doing docker run opposed me writing script installs same things docker would. experience, docker run seems execute instantly , ready go, imagine more complicated dockers might have additional overhead? i'm thinking using yarn bring services on fly docker, wondering if might come quicker without docker. thoughts on this? note: i'm not concerned performance after docker right now, i'm concerned time taking bring service. docker pretty quick start, there things consider. the quickest way test overhead using time executable , running command: docker run --rm -it ubunbu /bin/bash echo test which gives this: $ time docker run --rm -it ubuntu echo test test real 0m0.936s user 0m0.161s sys 0m0.008s what can read this, cpu took 0.16 sec run command, took little less sec in real time, includes (disk i/o, other process) but in gene

psutil - Get IO Wait time as % in python -

i writing python script basic system stats. using psutil of , working fine except 1 thing need. i'd log average cpu wait time @ moment. top output in cpu section under %wa. i can't seem find how in psutil, know how it? go down road don't want go on.... that entire cpu row rather nice, since totals 100 , easy log , plot. thanks in advance. %wa giving iowait of cpu, , if using times = psutil.cpu_times() or times = psutil.cpu_times_percent() under times.iowait variable of returned value (assuming on linux system)

javascript - Got runtime error, when inserting list item <li> in to a paragraph <p> tag -

look @ following code example: <%@ page title="home page" language="c#" autoeventwireup="true" codebehind="default.aspx.cs" inherits="webapplication18._default" %> <!doctype html> <html> <body> <p id="someid"></p> <script type="text/javascript"> document.getelementbyid("someid").innerhtml = "<ul><li>some content</li></ul>"; </script> </body> in visual studio 2013, debug mode, got runtime error. have noticed p tag doesn't allow block-level tags within according w3c rules. but if created static html file, runs fine. <!doctype html> <html> <body> <p id="someid"></p> <script type="text/javascript"> document.getelementbyid("someid").innerhtml = "<ul><li>some content</li></ul&

sql server - Should I partition by tenant or group of tenants for offline data store? -

i'm in process of designing offline data store used improve performance of lists , reports in asp.net application. considering adopting sql server partitioning , looking guidance around number of partitions use. the offline data store use multi-tenant using shared database, shared schema approach , sql server 2014. contains tenantid column uses uniqueidentifier datatype. on regular schedule schedule throughout day, etl process consisting of several ssis packages pull data source databases offline data store. single instance of offline data store need pull 500-1,000 single-tenant sql server source databases. process takes between 1-2 minutes. ideally, we'd able run etl process multiple tenants @ time minimize latency of data store. in preliminary testing handful of tenants, encountered number of deadlocks writing destination tables in offline data store. around this, tried implementing partitioning on tenantid column using below partition function creates 16 partition

java - No-args constructor for class XXX does not exist -

i new android development. here, making get call - protected string doinbackground(string... params) { list<namevaluepair> namevaluepairs = new arraylist<namevaluepair>(1); namevaluepairs.add(new basicnamevaluepair("email", "guest@example.com")); jsonhttpclient jsonhttpclient = new jsonhttpclient(); productdetail[] products = jsonhttpclient.get(serviceurl.product, namevaluepairs, productdetail[].class); return null; } this get call in jsonhttpclient file - public <t> t get(string url, list<namevaluepair> params, final class<t> objectclass) { defaulthttpclient defaulthttpclient = new defaulthttpclient(); string paramstring = urlencodedutils.format(params, "utf-8"); url += "?" + paramstring; httpget httpget = new httpget(url); httpget.setheader("accept", "application/json"); httpget.setheader("acc

c++ - C++11 How to use lambda and higher order functions to transform a vector to a vector of different type -

is there way return vector of different type using higher order functions in c++11? have std::vector<std::string> , want convert std::vector<foo> enum of own device. assume have method foo tofoo(std::string) . i've tried: std::vector<foo> m_foos = std::for_each(m_foo_strings.begin(), m_foo_strings.end(), [this](std::string &s){ tofoo(s); } ); and tried: std::vector<foo> m_foos = std::transform(m_foo_strings.begin(), m_foo_strings.end(), m_foo_strings.begin(), [this](std::string &s){ tofoo(s); } ); but neither compiles. complains no operator= defined std::string foo. there has common way i'm trying here, missing? std::transform not return vector , applies specified transformation , stores results in destination range pass it std::transform(m_foo_strings.begin(), m_foo_strings.end(), std::back_inserter(m_foos), [this](std::string &am

PHP how to get a random number that is different from values of an array -

example: have array 3 values: 0 = 1 1 = 4 2 = 5 i want random number like $random = rand(1, 5); but need number different array values. need return 2 or 3. this should work you: (here create range random number range() . rid of these numbers don't want array_diff() . , @ end can use array_rand() random key/number) <?php $blacklist = [1, 4, 5]; $range = range(1, 5); $randomarray = array_diff($range, $blacklist); echo $randomarray[array_rand($randomarray, 1)]; ?> output: 2 or 3 edit: just did benchmarks , method loop slower code above! i created array(blacklist) 1...100'000 , random number array 1... 100'001. so script should create one/unique random number. loop method error: fatal error: maximum execution time of 30 seconds exceeded and posted code above takes 1.5 sec in average.

c# - Why does SoundEffect.FromStream() throw InvalidOperationException when reading "valid" WAV files? -

i'm trying load sound effects game (c#/xna 4.0, visual studio 2013 on win8.1). game "clone" of existing mmorpg client , should compatible existing directory structure - meaning sound effects stored in directory named 'sfx' in game's working directory. i came across soundeffect.fromstream when attempting accomplish this. works great of files have, files throw invalidoperationexception. stack trace reveals error located in internal wav file constructor within xna dll. i'm aware of restrictions on wav files soundeffect.fromstream method: 8 or 16 bit, mono or stereo, pcm, sample rate between 8khz , 48khz. problem having best of knowledge, specific wav files failing load meet of these requirements. here how loading wav files: //soundinfo wrapper around soundeffect // implementation details not relevant question private readonly list<soundinfo> m_guitarsounds; private readonly list<soundinfo> m_harpsounds; private readonly list<sou

telescope - Getting an error while trying to deploy with Modolus -

i following this tutorial (using meteor on modulus) test telescope app , how deploy works i getting error : unable connect application instances. and log: /mnt/data/1/node_modules/fibers/future.js:245 throw(ex); ^ typeerror: cannot read property 'name' of undefined @ app/server/migrations.js:469:43 @ [object object]._.extend.foreach (packages/mongo/mongo_driver.js:965:1) @ [object object].cursor.(anonymous function) [as foreach] (packages/mongo/mongo_driver.js:812:1) @ object.migrationslist.updateusernames (app/server/migrations.js:462:14) @ runmigration (app/server/migrations.js:45:52) @ app/server/migrations.js:10:5 @ array.foreach (native) @ function. .each. .foreach (packages/underscore/underscore.js:105:1) @ meteor.methods.removemigration.migrations.remove.name (app/server/migrations.js:9:5) @ /mnt/data/1/programs/server/boot.js:229:5 [2015-

How to open a list of files in Python -

i'm reading data file (text), , generating number of reports, each 1 written different output file (also text). i'm opening them long way: fp = open('file1','w') invp = open('inventory','w') orderp = open('orders','w') ... , on, corresponding group of close() lines @ end. if open them loop, using list of fp names , file names, guarantee closing same files. i tried using dictionary of fp:filename , [obviously] didn't work, because either fp variable undefined, or string 'fp' isn't file object name. since these output files, don't need check open errors - if can't open 1 or more, can't go on anyway. is there way open group of files (not more 10 or so) list of names, in loop? yes, can use list comprehension: filenames = ['file1.txt', 'file2.txt', 'file3.txt'...] filedata = {filename: open(filename, 'w') filename in filenames} now, of opened

javascript - Bootstrap modal issue on iOS 8.1.3 -

i having issue in bootstrap modal on ios 8.1.3 version only. have vertical scroll able div inside modal. when touch modal background try scroll text inside div, text vanished or freeze after few secs again can scroll. weird. appreciable. thanks!

Accessing Struct members using memcpy in C -

i have structure : struct x{ int a; int b; int c; } i have array : unsigned char bytes[8]; bytes[0] = 1 bytes[1] = 128 bytes[2] = 0 bytes[3] = 0 bytes[4] = 255 bytes[5] = 255 bytes[6] = 0 bytes[7] = 0 i want copy bytes[0] bytes[3] in struct element "a", bytes[4] bytes[6] in struct element "b" , bytes[7] in struct element "c". have use memcpy. how can that? please help. my try : struct x test; memcpy( &test.a, bytes, 4); memcpy( &test.b, bytes + 4, 3); memcpy( &test.c, bytes + 7, 1); but showing different results every time run it. in code don't initialize test . ends happening is: the fields have undefined ("garbage") data you partially write fields for example when memcpy( &test.b, bytes + 4, 3); if have sizeof(int) == 4 (likely) end writing 3 bytes leaving 1 byte undefined . try easy initializing object: struct x test = {0};

c# - Dependency Injection: ASP vNext. How is this working? -

so in cqrs-based bug-tracking web-api, refactoring code before progressing , implementing unit tests (which, admittedly, should have come first); have class , constructor: public class bugcommandhandler : ibugcommandhandler { private bugcontext db; public bugcommandhandler(bugcontext bugcontext) { db = bugcontext; } //interface implementation } in controller, have this: public class bugscontroller : controller { private ibugcommandhandler commandhandler; private bugcontext db; public bugscontroller(bugcontext bugcontext, ibugcommandhandler bugcommandhandler) { db = bugcontext; commandhandler = bugcommandhandler; } } and, finally, in startup class, have injected dependency with services.addsingleton<ibugcommandhandler, bugcommandhandler>(); my unit tests , manual integration tests working fine when manually calling without di. how bugcommandhandler implementation work though has been called data

node.js - How to pipe to local terminal/processes from node webkit desktop app? -

i'm writing node webkit desktop app ubuntu. want open terminal , type things in terminal click desktop app. modules can use hook desktop app terminal? do want terminal window open , visible? not, should able use node's child_process module execute command in background. on startup.

Getting JSON from a Function in javascript -

so lot of code, matter on line 22-25, , line 87-91. rest of code works. have nested function , want return json string. using console.log can tell running not return json string. part says //---------this part-------. there 2 parts asking about. exports.post = function(request, response) { var mssql = request.service.mssql; //var data = '{"userid":"ryan3030@vt.edu1"}'; var inputjson = request.body.jsontext; var json = json.parse(inputjson); var userid = json.userid; mssql.query("exec getmeetinginfo ?", [userid], { success: function(results3) { var meetingstoday = results3.length; var meetingid = results3[0].meetingid; var meetingname = results3[0].meetingname; var meetingdescription = results3[0].meetingdescription; var meetinglength = results3[0].meetinglength; var meetingnotes = results3[0].meetingnotes;

struct - Error: storage size of 'c' isn't known -

i'm getting "error: storage size of 'c' isn't known" when try create variable "c" of struct called "struct car" here code: teste.h #ifndef teste_h_included #define teste_h_included typedef struct car car; #endif // teste_h_included teste.c #include <stdio.h> #include <stdlib.h> #include "teste.h" struct car{ char name[20]; char model[20]; }; main.c #include <stdio.h> #include <stdlib.h> #include "teste.h" int main() { car c; return 0; } i can't figure out why i'm getting error... bet stupid... me? the car structure on header file forward declaration, when it's included on main.c, has knowledge of forward declaration no clue of how it's defined (or in case, size of struct is). define struct on header file. struct car { char name[20]; char model[20]; };

jquery - Bootstrap Woes. Resizing Google Maps -

i'm having sorts of problems re sizing google maps using twitter's bootstrap. stands right have gigantic white outline , nav bar covering area left of it. i'm tried sorts of wizardry full screen without cutting off controls attempts have been fruitless. there inline javascript tried use achieve did not seem trick. the code: <!doctype html> <html> <head> <title>map project</title> <link href="css/style.css" rel="stylesheet"> <link href="css/sidebar.css" rel="stylesheet"> <link href="css/bootstrap.min.css" rel="stylesheet"> <style type="text/css"> html, body, #map-canvas { height: 100%; margin: 0; padding: 0; display: block; } </style> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=aizasy

ember.js - Ember: The response from a findQuery must be an Array, not undefined -

i'm trying implement search functionality calling api /search?q=test . api returns following object: { "categories" : [ { "id" : 77, "name" : "animals", "output" : {} }, { "id" : 167, "name" : "fish", "output" : { "image" : { "mimetype" : "image/png", "path" : "/images/fish.png" } } } ], "designs" : [] // more arrays here } here ember search model: export default ds.model.extend({ categories: ds.hasmany('category'), designs: ds.hasmany('design') // more hasmany relationships here }); in search controller: model: function (params) { return this.store.find('search', { q: params.q });

php - Laravel 5 issue with wherePivot -

i working laravel 5 , having issue getting ->wherepivot() work on many-to-many relationship. when dd() sql looks eloquent looking records in pivot table `pose_state`.`pose_id` null`. i hoping simple error , not bug. ideas appreciated. database structure pose id name type state id name machine_name pose_state pose_id state_id status models pose <?php namespace app; use db; use app\state; use illuminate\database\eloquent\model; class pose extends model { public function states() { return $this->belongstomany('app\state') ->withpivot('status_id') ->withtimestamps(); } public function scopewithpendingreviews() { return $this->states() ->wherepivot('status_id',10); } } state <?php namespace app; use illuminate\database\eloquent\model; class state extends model { public function poses() { return $this->belongstoman

php - Text and input box align in form -

i align text left side , input box right side. this how site looks , how should be: [picture removed] however, did wanted using div tag inside div tag, so, if give background colour it, how looks like: the problem is, after green (on grey side) echo errors. because of div width of green area, cannot that. error goes under input box. so, wonder how can able show form did in pictures @ same time able show errors on right side, well. so, script calls javascript plugin ( http://jqueryvalidation.org ). , plugin add error right after input box, when sees problem. that's why not able put errors in div tag. error appear in class: "label.error". if there way make class "don't care fixed width" in css. work. basicly want create container <div /> element , put 2 <div /> elements inside it. since didn't give code, can give example: #container { width: 512px; height: 506px; border: 3px solid green; } #left {

conversion from javascript to jquery -

so have javascript code: var = 7; function addnumber(number) { document.getelementbyid("display").value = document.getelementbyid("display").value + number; } function calculate() { = eval(document.getelementbyid("display").value); document.getelementbyid("display").value = a; } function erase() { document.getelementbyid("display").value = ''; } and made jquery, not work var $j = jquery.noconflict(); $j( document ).ready(function() { var = 7; function addnumber(number) { $j( "#display").attr( "value", ( $j( "#display").val() + number )); } function calculate() { = eval($j( "#display").val()); $j( "#display").attr( "value", a) } function erase() { $j( "#display").attr( "value", ''); } }); the full code on jsfiddle here: https://jsfiddle.net/8z6vgnqk/

oop - How to access JavaScript object properties from a prototype method of the object -

this question has answer here: how access correct `this` inside callback? 6 answers i'm not sure how title question, here dilemma. have js object i've encapsulated , inherited methods. 1 of methods inserts anchor tag onclick event pointing 1 of inhereted methods of same object. in second method, run trouble because when user fires click event of anchor tag, "this" keyword anchor element. prevents me accessing properties in object through "this" keyword. here simplified code can see talking about. <!doctype html> <html> <head> <title>working out issue</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></