query_id stringlengths 4 64 | query_authorID stringlengths 6 40 | query_text stringlengths 66 72.1k | candidate_id stringlengths 5 64 | candidate_authorID stringlengths 6 40 | candidate_text stringlengths 9 101k |
|---|---|---|---|---|---|
55b5f65ff079b9bee0acf8d4b865202500bf50c786f0b8a1ff6bca0ec281750e | ['cf0529d11b27486fb9beeb9842d41898'] | I'm trying to create a formula that will give me the distance in days between 2 different days of the week with min/max of +7/-7. So for instance is there a formula to find that the days between this Monday and the coming Thursday is 3 but the distance between this Tuesday and the next Sunday is 5. Also in reverse, the distance between this Wednesday and the previous Monday should return -2, and the distance between this Friday and the previous Saturday is -6. This formula should work for calculating the distance between days for all combinations. Is there such a formula or will I just need to put a series of if/else statements in my code?
Thanks for any help!
| 2084788c0768a91c00d3354f4eddf560bba507ae982a40634ac15cf814d7e313 | ['cf0529d11b27486fb9beeb9842d41898'] | I'm trying to switch the colors of a 4-bitmap image using VHDL .
In a 4 bit-image .
Which means we have these types of colors .
r_in : in std_logic_vector(7 downto 0);
g_in : in std_logic_vector(7 downto 0);
b_in : in std_logic_vector(7 downto 0);
r_out : out std_logic_vector(7 downto 0);
g_out : out std_logic_vector(7 downto 0);
b_out : out std_logic_vector(7 downto 0);
Assuming we have these vectors in the entity .
Is it possible check the color of the image using the Hexadecimal code ?
for example :
if ( r_in = #16#AA0000 )
THEN
r_out <= #16##0000AA;
b_out <= #16#AA0000;
Something like that .
Otherwise what can I do instead ?
|
cd877bab221487bda745c4159f5a5fe65f7a69796e3eb399845146263e598d30 | ['cf2809640a32403d92b8da9199094a8e'] | @江洋大盗 is right, if the build system or gemfile.lock lock the build toolchain version, you may need to down-grade the concurrent-ruby and concurrent-ruby-ext version. Command as below.
$ gem uninstall concurrent-ruby -v 1.1.4
or
$ gem uninstall concurrent-ruby-ext -v 1.1.5
Hope it will help.
| df20b077a93f8b1b7f2ff8f8fc85a5cf4266b9739f6f0704fd31785c6cf08eef | ['cf2809640a32403d92b8da9199094a8e'] | As iOS13 release, there are more and more mapKit VectorKit crashes on the app which we are working on. We can not reproduce the crash internally and there are over 200 crashes collected by our own crash reporter everyday.
From all the information we have got, the crash always happens when the application come to active from background, and at that time, the ViewController view has a MKMapView subview. Maybe something wrong when the system rendering the map UI.
This problem seems a long-lasting iOS problem since iOS11 or even earlier. Now, The crash related iOS13 system version includes 13.0, 13.1, 13.1.1, 13.1.2. I have reported the problem on the Apple bug report system, but no any response from Apple until now.
Any advice or hint will be greatly appreciated.
FYI. The crash stack as below.
Exception Type: SIGABRT
Exception Codes: #0 at 0x1a8530ebc
Crashed Thread: 0
Thread 0 Crashed:
0 libsystem_kernel.dylib __pthread_kill + 8
1 libsystem_c.dylib abort + 100
2 libsystem_c.dylib __assert_rtn + 204
3 Metal MTLIOAccelCommandBufferStorageGrowSegmentList.cold.1 + 0
4 Metal MTLReportFailure + 476
5 Metal -[MTLTextureDescriptorInternal validateWithDevice:] + 2124
6 AGXMetalA11 0x00000001a85f93e8 + 64
7 VectorKit ggl<IP_ADDRESS>MetalResourceManager<IP_ADDRESS>newTexture(ggl<IP_ADDRESS>Texture const*) + 596
8 VectorKit ggl<IP_ADDRESS>MetalRenderer<IP_ADDRESS>prepareTexture(ggl<IP_ADDRESS>MetalResourceManager*, ggl<IP_ADDRESS>Texture const*) + 44
9 VectorKit ggl<IP_ADDRESS>MetalRenderer<IP_ADDRESS>_processQueue(ggl<IP_ADDRESS>RenderTarget*, ggl<IP_ADDRESS>RenderQueue*, id<MTLCommandBuffer>) + 3220
10 VectorKit ggl<IP_ADDRESS>MetalRenderer<IP_ADDRESS>_processQueue(ggl<IP_ADDRESS>RenderTarget*, ggl<IP_ADDRESS>RenderQueue*, id<MTLCommandBuffer>) + 96
11 VectorKit invocation function for block in ggl<IP_ADDRESS>MetalRenderer<IP_ADDRESS>frame(ggl<IP_ADDRESS>RenderTarget*, ggl<IP_ADDRESS>RenderQueue*, std<IP_ADDRESS>__1<IP_ADDRESS>function<void ()>, std<IP_ADDRESS>__1<IP_ADDRESS>function<void ()>) + 56
12 VectorKit invocation function for block in geo<IP_ADDRESS>TaskQueue<IP_ADDRESS>sync(std<IP_ADDRESS>__1<IP_ADDRESS>function<void ()>) + 60
13 libdispatch.dylib _dispatch_client_callout + 16
14 libdispatch.dylib _dispatch_async_and_wait_invoke_and_complete_recurse + 228
15 libdispatch.dylib _dispatch_async_and_wait_f + 100
16 VectorKit ggl<IP_ADDRESS>MetalRenderer<IP_ADDRESS>frame(ggl<IP_ADDRESS>RenderTarget*, ggl<IP_ADDRESS>RenderQueue*, std<IP_ADDRESS>__1<IP_ADDRESS>function<void ()>, std<IP_ADDRESS>__1<IP_ADDRESS>function<void ()>) + 544
17 VectorKit ggl<IP_ADDRESS>RenderFrame<IP_ADDRESS>execute(ggl<IP_ADDRESS>RenderTarget*, ggl<IP_ADDRESS>RenderQueue*, std<IP_ADDRESS>__1<IP_ADDRESS>function<void ()>, std<IP_ADDRESS>__1<IP_ADDRESS>function<void ()>) + 120
18 VectorKit -[MDDisplayLayer drawToTexture:withRenderQueue:completionHandler:] + 348
19 VectorKit -[MetalLayer _onTimerFired:withPresent:] + 280
20 VectorKit md<IP_ADDRESS>MapEngine<IP_ADDRESS>renderScene(double, std<IP_ADDRESS>__1<IP_ADDRESS>function<void ()>) + 104
21 VectorKit md<IP_ADDRESS>MapEngine<IP_ADDRESS>onRenderTimerFired(double) + 328
22 VectorKit ggl<IP_ADDRESS>DisplayLink<IP_ADDRESS>onTimerFired(double) + 40
23 VectorKit -[_GGLDisplayLinkTarget displayLinkFired:] + 84
24 QuartzCore <IP_ADDRESS>Display<IP_ADDRESS>DisplayLink<IP_ADDRESS>dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 632
25 QuartzCore display_timer_callback(__CFMachPort*, void*, long, void*) + 264
26 CoreFoundation __CFMachPortPerform + 172
27 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
28 CoreFoundation __CFRunLoopDoSource1 + 444
29 CoreFoundation __CFRunLoopRun + 2168
30 CoreFoundation CFRunLoopRunSpecific + 464
31 GraphicsServices GSEventRunModal + 104
32 UIKitCore UIApplicationMain + 1936
33 homebrew main (main.m:16)
34 libdyld.dylib start + 4
|
842d3775ab336486b55dfd33efcadcdf00f66df3462a16165393499136ecacd3 | ['cf32f774c2d647d195ba153fa5799cf5'] | I want to mount linuxmint hard drive using other linuxmint laptop,
this is display of lsblk command on my linuxmint :
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465,8G 0 disk
├─sda1 8:1 0 93,1G 0 part /
├─sda2 8:2 0 1K 0 part
├─sda5 8:5 0 368,8G 0 part /home
└─sda6 8:6 0 3,8G 0 part [SWAP]
sdb 8:16 0 298,1G 0 disk
sr0 11:0 1 1024M 0 rom
but when I try to mount this hard drive with this command
sudo mount /dev/sdb /media/newhd/
this process uses a lot of time, about 30 minutes, but no results Note: The hard drive to be mounted containts these partisions : /home, /swap and / , and this size : 300 GB
How to mount this hard drive ?
| 1d43e016bf18eeb84c06d6ad2dae9f6b3affe82b0327af656d626504bf866b6e | ['cf32f774c2d647d195ba153fa5799cf5'] | While doing some web development work on a website for a client I realised that their server (windows 2003 VM) has Anonymous ftp enabled. This is not something they want.
I'm attempting to turn it off for them as follows:
under
IIS Manager -> FTP Sites -> Properties -> Security Accounts
there is a checkbox Allow anonymous connections which I assume I need to uncheck. BUT when I uncheck it the following warning message appears:
The authentication option you have selected results in passwords being transmitted over the network without data encryption. Someone attempting to compromise your system security could use a protocol analyzer to examine user passwords during the authentication process. For more detail on user authentication, consult the online help. This warning does not apply to HTTPS (or SSL) connections.
now, that doesn't sound like something I want either.
Is this my only option - disable anonymous ftp but enable unencrypted passwords - or is the unencrypted passwords not a relevant issue?
I am a developer and I usually work in linux environments so I'm a bit out of my depth here on two counts.
|
ba54a02269edf30d7cc8caa3d52ad543a36f0b9e22e36c1bb698e553c58e1d60 | ['cf339cef39fc44078502d5617f93ef4d'] | //Enviando <PERSON>
lista.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1,
int position, long id) {
String <PERSON> = itens.get(position);
Integer id = ids.get(position);
Intent intent= new Intent(Main2Activity .this, SUA_OUTRA_ACTIVITY.class);
intent.putExtra("descricao", descricao);
intent.putExtra("id ", id);
startActivity(in1);
}
});
//recebendo <PERSON>
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
String <PERSON> = getIntent().getStringExtra("descricao");
Integer id= getIntent().getIntegerExtra("id", 0);
}
Espero que ajude!
| 6dced92141627b41265ceac04213dbc1bc6ae8f82c9d998911c0474045e2edbc | ['cf339cef39fc44078502d5617f93ef4d'] | The php solr client isn't doing anything special here, the numFound is exactly what Solr itself is returning. Which should be based on committed documents at the time of the query.
I'm slightly confused by your question though. Is your complaint that you're seeing documents being autocommitted before you expect them to be? If so, you should be testing the opposite way that you are - increasing the number of maxDocs in the autoCommit block. I'm not sure what guarantees solr itself makes for how close to that maxDocs it will allow before triggering a commit. Typical settings are 1,000 or 10,000 depending on your indexing characteristics. And then time is usually used as an upper bound as to how long you're willing to wait for a document to show up in the index. You're trying to reach a balance between efficiency and latency.
In any case, the only way you'll get to the bottom of what is happening is by looking at the log for Solr - it will have entries for the add, the query, and the commit and you can see how close or far apart they are from one another, or if there is an explicit commit that you don't know about in the code.
If you could update your question with a portion of that log it'd be helpful in helping you diagnose.
|
c97e2c55bdd5daa8cfb3e04768c214591cf0b55d43378158643af00ff4d27939 | ['cf47d7f8c491474da13f0ff7069c3d6d'] | I am working on a winforms application where I have to load data from Web API calls. Few million rows of data will be returned and had to be stored in a Dictionary. The logic goes like this. User will click on an item and data would be loaded. If the user clicks on another item, another new dictionary would be created.During the course of time several such heavy weight Dictionary objects would be created. The user might not use the old Dictionary objects after some time. Is this a case for using WeakReference?. Note that recreating any Dictionary object would take 10 to 20 secs. If I opt to keep all the objects in memory, the application performance degrades slowly after some time.
| 0bb30ac0562fd2c2fa7633d537cf8a8994476fc6fca833e660341230d1b9e1d2 | ['cf47d7f8c491474da13f0ff7069c3d6d'] | I need to implement a stored procedure - where I would be calling another AuditStoredProcedure passing some information.
My current implementation using temp table..
SELECT * INTO #Temp FROM @RowIds
WHILE EXISTS (SELECT * FROM #Temp)
BEGIN
SELECT TOP 1 @RowId = RowId from #Temp
--PRINT @RowId
EXEC @StoredProcName @RowId, @Action
DELETE #Temp WHERE RowId = @RowId
END
END
Is there a better way to do this using CTE or some other mechanism?.
For my case the temp tables won't have more than 100 rows.
|
c26ae605e69371be765122464ba1291c43cb51cc8dcb99853dae4230ed192073 | ['cf4a3fdc4f884ad1afa60f512c07ed45'] | While reading about AOT in Angular from here, I can across the flow of how actually the .ts files are loaded to browsers. Being new to Angular, I would be really grateful if someone can explain me the inner working of how it all works. I tried to search on google but there are no question where this has been explained.
With angular2, if you go with JIT (which is default), both the compiles happen after the code is loaded in the browser (i.e. TS -> JS -> binary). Not only is it an additional overhead to do the TS -> JS compilation on the fly on the browser, but also, the angular2 compiler is almost half the size of the angular2 package so if we avoid this, we can reduce the size of the payload significantly.
My question against above paragraph:
How does both the compiles happen after the code is loaded in the browser happen ? I mean, do TypeScript compiler does this ?
where does TypeScript compiler resides which converts TS to JS files ? is it on the local dev server ?
Basically I want to know how the ts gets rendered in Angular. I hope it's a good question to be asked on SO.
| 790f85cf3e26a6f0cc44e7cb9460729eaf55ae0b6648bbfcd2200982cfe42619 | ['cf4a3fdc4f884ad1afa60f512c07ed45'] | In Machine learning course, I am unable to visualize below input.
we have below equation in Logistic Regression :
We can write it in octave as below in sigmoid.m:
g = (1 ./ ( 1 + e.^(-z)));
Now, to calculate costFUnction.m, we are getting probability as:
h = sigmoid(X*theta);
From, the above picture, shouldn't it be:
h = sigmoid(theta'*X);
What am I missing here. I am newbie to ML so forgive me if I am missing something here.
|
6a2dc239b230b917551bb9deb97c4b9363bae43cf7486e156ef10e2df816d1ee | ['cf63e9ed78ac47a89836bb2ae9f29b16'] | In this document,In the section, "In-house apps | Providing updated apps", it states:
For users who already have the app, you may want to time your next released version so
that it includes the
new provisioning profile. If not, you can distribute just the new
.mobileprovision file so users won’t have to install the app again.
The new provisioning profile will override the one that’s already in the app archive.
We tried this last week when our own in-house provisioning profiles all expired (to correspond with an expired enterprise certificate). Despite installing the new profiles (and leaving the expired profiles on the device), we found that our applications would not launch. The device refused to open the applications even after a hard reset (press and hold the lock and home buttons for a long time).
Eventually, I had to advise our team to install updates of the affected applications, all of which had deployed with the renewed provisioning profile. The newly installed apps successfully replaced the ones that didn't open, which to me is a proof that the new provisioning profile included the same bundle ID.
To conclude, I feel like the device refused a replacement profile for my applications, and I don't know why. My questions are:
Under what conditions will the device accept a replacement provisioning profile?
Is there any way to test that the replacement will be successful before the provisioning profile actually expires?
Is there any restriction about whether the user must install the new provisioning profile before, or after, the old profile expires?
| f5cbb025f2620e92868ebaab508295a01cadb7db146961db96a7299d767cb387 | ['cf63e9ed78ac47a89836bb2ae9f29b16'] | This issue was driving me insane, and I had given up hope of fixing it without some ugly hack on XCode's configuration. I passed through this very forum thread a stack overflow of times. Then one day, I happened to accidentally fix it. I'm not sure if you need all these steps, but I've found this a sure-fire way to fix XCode's indexing issues:
Clean your project (Command-shift-K)
Open organizer, close your project.
Under the "Projects" tab in organizer, remove the derived data for the project you want to reset.
Quit XCode
In the terminal, run:
sudo mdutil -a -i on
This seems to reset spotlight indexing (I don't know much about it because I don't use spotlight).
When the command finishes, Spotlight will have to re-index. Look up to see a little dot in the magnifying glass for your spotlight's icon. When the dot leaves, spotlight has re-indexed. You can check the progress by opening spotlight.
Re-open XCode, and wait for it to re-index all your files.
Build the project.
On build success, you should now have appropriate syntax highlighting again. I hope you guys find this little discovery as useful as I did :)
EDIT:
I should probably add that the syntax highlighting sometimes seems to re-break when the debugger hangs the simulator during app launch. I just try to avoid this by being more careful about letting the process hang.
EDIT2: (sorry first contribution)
Works on XCode 4.6 and 4.6.2.
|
d23b208e67ed3980f6d5df8786f303a93946f9b3f478a5838c1149d4462d016f | ['cf72a47348444821b9ee673b9868d47e'] | AWS Kinesis Producer Library may be configured to aggregate records before sending to AWS Kinesis Stream. For example we may set:
final KinesisProducerConfiguration config = new KinesisProducerConfiguration();
config.setRecordMaxBufferedTime(1000);
config.setAggregationMaxCount(100);
config.setRegion("eu-west-1");
return config;
Is this buffer only in memory or is it saved on the file system? Mostly, I would like to know, if the current buffer is lost when the producer node is restarted.
| 76e4cbcf9c0909f5adb1690c7eb588ed84b085d4b4d6c6f82cb32674d23daba9 | ['cf72a47348444821b9ee673b9868d47e'] | What is an openssl equivalent of using jasypt with algorithm PBEWithMD5AndDES?
Example using jasypt:
java -cp ~/.m2/repository/org/jasypt/jasypt/1.9.2/jasypt-1.9.2.jar org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI input="contactspassword" password=supersecretz algorithm=PBEWithMD5AndDES
----ENVIRONMENT-----------------
Runtime: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.112-b15
----ARGUMENTS-------------------
algorithm: PBEWithMD5AndDES
input: contactspassword
password: supersecretz
----OUTPUT----------------------
H4usVG7JPI7wwbUeLUVZ3x+nJY17LCnvlA254v355Cw=
|
4df1880966fc9bd5109d41b415908ef6d125fbd7c60766f5110411421363c0cc | ['cf75e03eccae46a3859b6933ea266af1'] | I have a few blogs/websites hosted on my vps. Recently I've decided to move a db on a single central server/vps because all the blogs have the same structure in terms of code and structure of the db.
The problem is, how can I effortlessly start using "application_id" in my db? It will denote a website data belongs to.
Say, I have these tables:
-- users
-- articles
-- categories
-- tags
and others. Now I'll have to insert one additional column in each table: "application_id"
Not a big deal. I think. But perhaps there's a simple and more smart way to archieve the same goal?
And in general, is it a good idea to move it to a central, single vps/server/db?
| 7beb27eba32ce15c962b27ffebb12df27f2f02833f6c0bf4dae8f3856587caad | ['cf75e03eccae46a3859b6933ea266af1'] | Am trying to show a popup dialog or custom view on clicking of the widget (Something similar to quick contact badge). Am able to launch the Quick Contact badge on click of the widget but am not able to display this right next to the widget :(
Could you anyone give me any example source code to display a pop up dialog right next to the widget?
|
968f18704085d08edf4034e4cdea2d57a4ed74316e36d0676355668e764c5aeb | ['cf7e00d49e7849f19271c058c381057d'] | Could someone tell me more explicitly how I can make this question more focused (which is the reason for why it was closed)? Please help, this is not the usual resource recommendation with a specific topic, but rather a request for study resources of a certain style/type, and I don't know how to make it more focused. | 9765a491d9a62d57d2d8187ec12c0e76880c9518bf530c35eb5d3d14e26c110e | ['cf7e00d49e7849f19271c058c381057d'] | This looks like an error on the Cucumber/Gherkin side, before anything goes to Cuke4Nuke. The language declaration is only handled on the Cucumber side. By the time the step details get to Cuke4Nuke, the keywords are gone. You're likely to get more help on the cukes group (groups.google.com/group/cukes/); I think the Cucumber developers are more active there.
That said, Cuke4Nuke doesn't handle languages yet. You'd still have to use Given/When/Then attributes on your step definitions rather than Gitt/Når/Så, and string conversions for step definition arguments won't use the correct culture, which may cause you problems. The next Cuke4Nuke release will include language support. The i18n attributes are already in the latest source, and I'm working on the culture stuff.
|
18dbaf8e33ed62008081bf3427e80aa11af06eee9c32529c827fc00a1e8a2683 | ['cf7e94b28810484e8ea1aec0ece52d28'] | I'm trying to create a bootable and writeable USB-stick with Fedora 30, because on the one side I want to be able to add and modify a Kickstart-File and on the other side I want to install additional software during the automatic installation process (e.g. Dell Command Configure) which I have to copy to the stick.
Because my knowladge regarding partioning is quite limited, the original Fedora 30 Stick (created with dd bs=4M if=Fedora-Workstation-Live-x86_64-30-1.2.iso of=/dev/sda) is a bit strange for me:
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 57.3 GiB, 61505273856 bytes, 120127488 sectors
Disk model: Ultra
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x34258370
Device Boot Start End Sectors Size Id Type
/dev/sda1 * <PHONE_NUMBER>.8G 0 Empty
/dev/sda2 172 20119 19948 9.8M ef EFI (FAT-12/16/32)
/dev/sda3 20120 62103 41984 20.5M 0 Empty
Why are those partitions created as type "Empty" and why are the partitions overlapping?
Command (m for help): v
Partition 1: overlaps partition 2.
Partition 1: overlaps partition 3.
Remaining 116348670 unallocated 512-byte sectors.
I read about that this is the case with extended/logical-partitions, but that seems not to be the case here.
The filesystems of the stick:
$ df -T /dev/sda*
Filesystem Type 1K-blocks Used Available Use% Mounted on
devtmpfs devtmpfs 1911628 0 1911628 0% /dev
/dev/sda1 iso9660 1889408 1889408 0 100% /tmp/1
/dev/sda2 vfat 9936 9464 472 96% /tmp/2
/dev/sda3 hfsplus <PHONE_NUMBER> 8952 58% /tmp/3
Those overlapping partitions are the main point, why I was not able to "reverse engineer" the stick 1:1. A test with non-overlapping partitions, vfat and rsyncing the files to the stick resultet in that it booted but I got the following output and that's it.
error: ../../grub-core/fs/fshelp.c:254:file '/images/pxeboot/vmlinuz' not found
error: ../../grub-core/loader/i386/efi/linux.c:206:you need to load the kernel first.
How can I build a working bootable and writeable Fedroa-Stick?
| 53f36a2713807f641f73fd30c8a679081a82170f7cd8ac800cbc7b0dd7cb9512 | ['cf7e94b28810484e8ea1aec0ece52d28'] | First of all: My primary problem is solved with <PERSON>'s answer.
Secondly fyi: The input are shell-commands for look-up purposes (a cheat-list) with a caption/description, e.g.:
`Mit Grep gefilterten Output an weiteren Befehl weiterleiten
ls ${BLUE}/pfad${NC} | grep -e '${GREEN}Regular Expression${NC}' | xargs -I{} sudo mv {} ${BLUE}/pfad${NC}
Löschen mit Fortschrittsanzeige
sudo rm -rv ${BLUE}/pfad${NC} | pv -l -s $(sudo find ${BLUE}/pfad${NC} | pv -l | wc -l) > /dev/null`
I should have mentioned it at the first place, so maybe I open a followup question regarding that. |
f87e2e28b06facd896c411aa728fd65e53d515d10f4ec223d391a3350ce0e1f8 | ['cf7ef455b8104219a23e0433723f7eae'] | Ive had strange things happen from images that appeared ok in windows photo viewer but when loaded into adobe fireworks the colours go wrong in a similar way.
Im assuming that the pictures display incorrectly on the 'front end' of Wordpress too, therefore i think its some weird .jpg format issue.
If you have just a few images maybe worth manually screen grab and edit screen grab if you have a viewer that works, then save out and try to re-upload to wordpress.
Or batch process the files into a different format, say bump and use a wordpress plugin like insanity that has the option to automatically convert to .jpg, to in effect clean or at least change the image format on upload.
| 6d8ede5622712451a4745da45d14ba9ad829de7575f49c50397b7669a783ee37 | ['cf7ef455b8104219a23e0433723f7eae'] | I suppose the best way forward is to first figure out which part of the process is failing, browser, computer or web server.
Determine the most likely point of failure
If the fault occurs on more than one computer, and with different browsers then it not likely to be browser or computer issue. Therefore the next step is to look at the webserver.
if it looks like a computer or browser issue
If its only failing on one computer or browser the try flushing your browser cache, if that fails then it could be a network setup issue. You could try setting you computers DNS network settings to point to your internet router and to your web servers IPs.
if it seems like a web server issue
1) Check settings of your network, try setting DNS to router and webserver.
2)If you have a spare computer install fresh webserver and try using new test webserver to see if you get the same problems
and if all else fails get windows PC install WAMP;) or the ultimate solution switch it off and go the pub.
|
b3fc4340f753951e8ce38e59fc08d0dbf111ca14925f3f8178c9c3063277e7ef | ['cf8ba9a4beb04933a154fc3031a77abc'] | Сергей, спасибо за ответ. ПО - ЦАБС 21 век Инверсия. Самое интересное следующее: я сейчас на windows 7 установил java 8 и у меня также вместо папки "client", появилась папка "server". Когда несколько лет назад на этот же сервер поставили java 7, папка "client" была и она есть до сих пор | 616cae89ad7e2ca76bc2b64a3994dd90f58d85d7678b1fc7d595a2af0bcc8797 | ['cf8ba9a4beb04933a154fc3031a77abc'] | Добрый вечер. Вопрос покажется простым, но у меня проблема с решением.
ОС - Windows Server 2008 R2 x64. При установке Java 8 в папке
C:\Program Files\Java\jre1.8.0_151\Bin не появляется папка "client". Вместо неё появляется папка "server". Связано ли это с тем, что операционная система серверная, не знаю. Разработчики, поставляющие нашей организации программное обслуживание, утверждают, что вне зависимости от версии ОС, папка "client" должна появиться. Из-за этого я не могу дальше настроить ПО. Может кто-нибудь сталкивался с такой проблемой? Просьба большая помочь
|
39adb2e1e8b98807791bd753ff749cb2a88ea22b24fe172eb9ff661f88cf8ead | ['cf940b0f4aa14ac69a632daf02118ae8'] | I am new to Rails and working on a blog project.
I have articles and categories. Each article can have multiple categories and each category can belong to multiple articles.
I also have a join table articles_categories
My migrations:
class CreateArticles < ActiveRecord<IP_ADDRESS>Migration[5.2]
def change
create_table :articles do |t|
t.string :title
t.text :body
t.timestamps
end
end
end
class CreateCategories < ActiveRecord<IP_ADDRESS>Migration[5.2]
def change
create_table :categories do |t|
t.string :name
t.timestamps
end
end
end
class CreateArticlesCategoriesJoinTable < ActiveRecord<IP_ADDRESS>Migration[5.2]
def change
create_join_table :articles, :categories do |t|
t.index :article_id
t.index :category_id
end
end
end
My model associations:
class Article < ApplicationRecord
has_and_belongs_to_many :categories
end
class Category < ApplicationRecord
has_and_belongs_to_many :articles
end
This all makes sense so far.
What I am struggling with now, is how do I add categories when creating a new Article? I want to be able to select pre-defined categories from a list (stored in Category table) through a form.
What model and/or URL (if any) do I use in the form_with helper?
Is the following anywhere close?
<% form_with model: ???, url: ??? do |f| %>
<%= f.collection_select :category_id, Category.order(:name), :id, :name %>
<% end %>
| 019ef86f92814246e13a834c059eeb20f3681e13a7283d6c9e540a9cae50b6d0 | ['cf940b0f4aa14ac69a632daf02118ae8'] | With the Join Table already created you can use has_and_belongs_to_many association for both models.
volunteer.rb:
class Volunteer < ApplicationRecord
has_and_belongs_to_many :registrations
end
registration.rb:
class Registration < ApplicationRecord
has_and_belongs_to_many :volunteers
end
This will allow you to access registrations through a volunteer (volunteer.registrations) and volunteers through a registration (registration.volunteers)
See here: https://guides.rubyonrails.org/association_basics.html#the-has-and-belongs-to-many-association
|
b696ab1134b0d00efd779b9c32cfa147ebadac419d1bcb7642d3c71208fd3ca7 | ['cf986e6b75594a969e08c2c0057b70cf'] | I have a set of tables with children of children, like so:
Clients (PK ClientID) which is parent (one to many) to
Property (PK PropertyID, FK ClientID) which is parent (one to many) to
Property Detail (PK PropDetailID, FK PropertyID) and Case (PK CaseID, FK PropertyID).
Should the foreign keys for the parent tables be repeated further down? That is, should my tables look like this:
Clients (PK ClientID)
Property (PK PropertyID, FK Client ID)
PropertyDetail (PK PropDetailID, FK PropertyID, FK Client ID)
Case (PK CaseID, FK PropertyID, FK ClientID)
instead? And if neither setup is normalized, what's the normalized way to do this?
| 5830de95003960f3ebf4d819dd6582ab87abb6506472e9d183d38e4b8332c5fb | ['cf986e6b75594a969e08c2c0057b70cf'] | I'm building a client and case database in Access 2003. The parent client table has fields for the clients' names, company (if any), status (value list) an additional note (text or memo type), and a Y/N toggle box for our mailing list. The PK is in incrementing AutoNumber. Following a normalization tip from a thread elsewhere, addresses and phone numbers will get their own tables, like so:
tbl_Client
tbl_Address
tbl_AddressType
tbl_Phone
tbl_PhoneType
(tbl_Client will link to tbl_Address and tbl_Phone via junction tables, but I don't know how to represent that.)
My research suggests that tables should have at least two indexed, non-duplicated columns -- one PK, and one additional unique field. The only other guaranteed unique column in tbl_Client is the memo field -- last names may reappear and we may have more than one client at a given company.
So here's my question: Is it better to index the Note field, disallowing duplicates, or to just accept that the ClientID AutoNumber will be the only unique value?
(Of course, this question is predicated on the assumption that the entire above structure is not irredeemably flawed. If that's the case, please feel free to express your horror.)
|
909392bf8b3f0fb331abb47c42d64f9bad18eace365eb0d9596dd490bd64f6a8 | ['cf9cc80c162d402aaf49efffeac46270'] | The above answer is correct, this is another way to solve the validation problem on laravel 5.5 I asked
$validation = validator<IP_ADDRESS>make($request->all(), [
'tenant_id' => 'required',
'asset_id' => 'required',
'description' => 'required',
'address' => 'required',
'price' => 'required',
'occupation_date' => 'required',
]);
For more information visit https://laravel.com/docs/5.5/validation#manually-creating-validators
| cab9de776a07cebd00b905e421c0f7c4b7372187fa17b806679597916efccb5d | ['cf9cc80c162d402aaf49efffeac46270'] | After various attempts to solving this issue, the following are the steps that worked for me:
brew install brew tap homebrew/dupes
which shows "Warning: homebrew/core is shallow clone." To solve this problem, I ran
git -C "$(brew --repo homebrew/core)" fetch --unshallow
then
brew install brew-php-switcher
The above command installed brew-php-switcher dependencies and also php version 7.2.6. Running
vim ~/.bash_profile
to insert export PATH=/Applications/MAMP/bin/php/php7.2.6/bin:$PATH
Checked my php version with "php -v"
PHP 7.2.6 (cli) (built: Jun 5 2018 10:09:45) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.6, Copyright (c) 1999-2018, by Zend Technologies
P.S: I noticed that when I check the version using which the answer I got was
/usr/local/bin/php
I dont know why that is but just in case you encounter this, try using php --version or php -v
|
7b12ad275f3c54c4705b9e0ec044607843cc300aefd3045e1440f011b9d3be85 | ['cf9ff35af8b9495eb7dd02ded893d93e'] | necesito un poco de ayuda, necesito unir 3 dataframes en un dataframe nuevo. son dataframes sencillos, donde tienen una columna en comun con el mismo nombre, pero no consigo unir los 3 en un dataframe solo. He probado con Join y con Merge pero no consigo dar con la clave. Podrian ayudarme por favor?
Estos son los 3 dataframes
Esta seria la estructura de uno de ellos
Necesito crear un dataframe que sea: EQUIPO,GOLESTOTALES,DISPAROSTOTALES,VICTORIASTOTALES.
Puedo usar Pandas o Pyspark.
He probado con join pero me duplica columnas, he probado con merge pero me dice que una dataframe no puede ser objeto de un merge. En fin, llevo varios dias con esto y no consigo avanzar.
Estoy aprendiendo y estoy usando Databricks.
Muchas gracias.
| 74bcf0c65970b2f657d080fac3cecf456a9e0fd401fc7ce4add38fa8803bfcd6 | ['cf9ff35af8b9495eb7dd02ded893d93e'] | This answer is the straight forward way, but if you have a style that you want to add this functionality to, see below.
It is possible by writing a custom bibliography style (.bst) file or modifying one you already have. You would need to declare a new ENTRY field, such as "annotation", add functions for formatting the annotation and then indicate where the annotation should appear for different kinds of references (article, book, etc.). This sounds like a lot of work, but it isn't terrible if you start from a style file that is close to what you need. See this question for help with the syntax.
You might add something like:
ENTRY
{
annotate
...other entries...
}
then
FUNCTION {format.annotation}
{ annotate empty$
{ "" }
{ " \begin{quotation}\noindent "
annotate
* " \end{quotation} " *
}
if$
}
and then
FUNCTION {article}
{
...rest of function...
format.annotation write$
newline$
}
|
4e80d65e1b77082d313248ad330a50c2f42797ed203f8d18a0620740b9dd2b10 | ['cfa655bfdab9482686d280713b8a4046'] | Check your XML code You should Start and End within the same entity. Like this
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
</LinearLayout>
| 7fc2171ec92830af1789cb2da4583ddc62e82378c6be512d0537a1d0ba434d13 | ['cfa655bfdab9482686d280713b8a4046'] | Just changed the code like...
package com.example.lightbluered;
import androidx.appcompat.app.AppCompatActivity;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
public class MainActivity extends AppCompatActivity {
Button button;
@Override
protected void onCreate(Bundle
savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ConstraintLayout bgElement = (ConstraintLayout ) findViewById(R.id.cl);
bgElement.setBackgroundColor(Color.RED);
myButtonListenerMethod();
}
public void myButtonListenerMethod() {
button = (Button)findViewById(R.id.button);
button.setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View v) {
RelativeLayout bgElement =
(RelativeLayout)findViewById(R.id.activity_main);
int color = ((ColorDrawable)
bgElement.getBackground()).getColor();
if (color == Color.RED) {
bgElement.setBackgroundColor(Color.BLUE);
}
else {
bgElement.setBackgroundColor(Color.RED);
}
}
});
}
}
And the xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:id="@+id/cl"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.532"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.524" />
</androidx.constraintlayout.widget.ConstraintLayout>
|
8cd652823d2ad72194e9b1a9b00c6848bb83206f4fcd0698f0f3051a8b6019ba | ['cfaada273096450f9062933196c3552a'] | There docent seem to be a way to assign multiple delimiters or comments using numpys genfromtext. I would recommend looking elsewhere. Try https://docs.python.org/2/library/configparser.html. Here's a link with a quick example so you can get a feel for how to work with the module https://wiki.python.org/moin/ConfigParserExamples
| c52d45ffdbd76ee21517f912d3ddc5134425d17cfbe4e892ebb9914510ad6854 | ['cfaada273096450f9062933196c3552a'] | You can also create a virtual environment for your project and install all the modules you would like to use. It looks like you are using a windows machine. The commands would be as follows
C:dirrectory_for_your_project>c:\Python34\python.exe c:\Python34\Tools\Scripts\pyvenv.py env #create your environment
C:dirrectory_for_your_project>env\Scripts\activate.bat #activate your enviornment
(env) C:dirrectory_for_your_project>pip install requests #pip modules you would like to include in your project
(env) C:dirrectory_for_your_project>python script.py #run script
There is also a deactivate script for when you would like to exit the env. Make sure to activate the env whenever you are trying to run the script from the command line and all should be fine.
Note: This is just another solution to your problem and is based on personal preference. You should still add the necessary scripts to your path as this might come in handy in the future.
|
a51dbb400cb2a48d14bcbc0eb834fa5a4c912c49831ec88e35ef793b91996692 | ['cfbb0e4f9c4545eeae9248a4b44b0cd4'] | I have Visual Studio 2010 and InstallShield Limited Edition Project installed, when I build I get these warnings and an error:
ISEXP : warning : -6245: One or more of the project's components contain .NET properties that require the .NET Framework. It is recommended that the release include the .NET Framework.
Adding merge module 'Visual C++ 10.0 CRT (IA64)' that is a dependency of component 'AK_B_Receipts.exe'
Adding file 'MySql.Data.dll' that is a dependency of component 'AK_B_Receipts.exe'
Merging Visual C++ 10.0 CRT (IA64): C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC100_CRT_ia64.msm
ISEXP : error : -6058: Error merging Visual C++ 10.0 CRT (IA64) with module ID C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC100_CRT_ia64.msm
ISEXP : warning : -7205: Skipping file F_CENTRAL_msvcr100_i64.5912DA89_A865_3286_983F_6D24CEB5C300 due to unmerged or missing component C_CENTRAL_msvcr100_i64.5912DA89_A865_3286_983F_6D24CEB5C300 in merge module
ISEXP : warning : -7205: Skipping file F_CENTRAL_msvcp100_i64.5912DA89_A865_3286_983F_6D24CEB5C300 due to unmerged or missing component C_CENTRAL_msvcp100_i64.5912DA89_A865_3286_983F_6D24CEB5C300 in merge module
How can I solve this?
| 380b192c7d65366a177090efc418c025fee665638ca3ee18686f9c60d9fbc3f4 | ['cfbb0e4f9c4545eeae9248a4b44b0cd4'] | I'm relatively new to VC++. I made a program that outputs a .txt file to a folder in my computer. I'm wondering if there is a method that allows me to send that file to the system's default printer (in this case my home printer) without needing to see the printer dialog box, just send the file to the pinter's queue and print it.
Thanks
|
e7cc778fcb1170d971451484935238aa209c2d87cb493deda875fff8dc5ed2eb | ['cfc2b8f6eda544c0b312fe7eeb05870c'] | See the EJB spec (e.g. EJB 3.2 core, chapter 16.2.2 "Programming Restrictions":
An enterprise bean must not attempt to listen on a socket, accept connections on a socket, or use a socket for multicast.
The EJB architecture allows an enterprise bean instance to be a network socket client, but it does not allow it to be a network server. Allowing the instance to become a network server would conflict with the basic function of the enterprise bean— to serve the EJB clients.
| 26dadb3c93c57f8ddcceae265fbb3135e48bd287df412b4a5dc649cead5127c7 | ['cfc2b8f6eda544c0b312fe7eeb05870c'] | Database connections are closed according to your configured connection pooling policy of the used application server.
When talking about session beans and container managed transactions, the connection is returned at the end to the transaction scope of the called business method.
Since session beans with @Asynchronous annotations do not support transaction propagation (e.g. see EJB 3.2 spec 4.5.3), a new transaction is created with every call to a business method if the method is configured with REQUIRED or REQUIRES_NEW. Thus, this transaction scope ends with the called business method returning.
|
33ab8c47f38282bd648a2e3c8595d5af8e4359100e0f268786bae8fc5666878f | ['cfceffeea65b47bbb1d9aa5e93887b7e'] | On WooCommerce I have a hook being called that will show an error message if there are too many items of a certain tag in the cart. The issue is that if I scroll down in the page and then hover over the cart it causes the notice to show up at the top and middle of the screen. Any ideas?
im using this add action
add_action('woocommerce_mini_cart_contents', 'i9wtl_cart_hider_free');
and this is how i am calling the notice
wc_print_notice( $i9wtl_errorOutput, "error" );
| e57acd305d446546b20e7a8d80c52e3f3cc110c0f8a41c96efa08e0a7b49b713 | ['cfceffeea65b47bbb1d9aa5e93887b7e'] | I'm not sure how to ask this so I'll explain my problem first. I have a plugin for Wordpress that updates a calendar and some databases that have multiple id's. So I have a hook for a page "editrental.php" which works fine but then when I click on a link for a certain item and goes to something like this
"editrental.php?id=3828" it won't let the page show. I'm guessing it has something to do with the way i set up the hook which is like this
add_submenu_page(null,'Wasatch Front Waste Calander Manage Editrental',
'WFWRD Calendar Manage Editrental', 'manage_options', 'trailer-scheduler-
editrental', 'trailer_admin_editrental');
Any ideas on how to set this up correctly or links to send me in the right direction? Thanks everybody.
|
70f1713aa0eba889a492b2ee2f13cfa868f05384f69eeb585ed4b54af8f2006e | ['cfd58b9d782c433b94331fe8668e5a86'] | I am using v3.11.1 of math.net.
MathNet.Numerics.MKL.Win v2.0 is already installed using NuGet.
x86 and x64 folders are already exist in debug directory.
Related DLLs such as 'MathNet.Numerics.MKL.dll' and 'libiomp5md.dll' and 5 more are already exist in x86 and x64 folders.
'Control.UseManaged' is available but many commands like 'Control.UseNativeMKL' are not available.
How could I solve my problem?
| 242f5fb47d3d82215fd71f6ac918123e3a82755843f6553282ccd2b5435609a4 | ['cfd58b9d782c433b94331fe8668e5a86'] | I am comparing speed of my iterative solver in VB.NET and iterative solvers in Math.NET.
When I am using preconditioner with Math.NET iterative solvers, everything is good and it converged at about 0.1~0.2(s) but without preconditioner calculation was canceled at about 0.03(s). Status is Canceled (by user). Since I didn't cancel the calculation and I even don't know how I could cancel calulation by myself. I don't know source of problem.
I have my own iterative solvers and sometime when convergence is not fast and it takes more than 2 minutes, visual studio became paused by itself, I don't know why?!
I think visual studio canceled the calculation. Do you know how to solve this weird problem?
By the way, I am using VS2015.1 and Math.NET 3.4, and I am using VB over 10 years.
|
6be9fa199e11c962cef1201f6ebdbc5625752ac2d24c0433371d7d2988229cba | ['cfd590221c9f48eeb3149062292eed0c'] | To me continuity in the 1st and second dimension implies that for a point c, if I take the lim of my function and make it tend towards c it the limit would be f(c). I visualize it as drawing a straight line without taking my pen of the paper.
I have a difficult time geometrically interpreting continuity for higher dimensions in Rn. | 6cd7e0fce6e4ec7162298045558cca8bcc089c126ff0acc7781703cbd36ae5be | ['cfd590221c9f48eeb3149062292eed0c'] | Try HotKeyz from Skynergy. You can download it from a variety of freeware download mirrors, such as: http://hotkeyz.en.softonic.com/
It's free and a fantastic, easy to use tool for remapping/customizing windows hotkeyz. I don't think the developer updates it anymore, as ver 2.8.3 is the latest and dated 2010.
|
1d9fbe0cd93fcce6b3e663f570c66c9f4115274892c56a1565f0d94f4105ad05 | ['cfe1bc29e7154d28b4deb7c2cadb44c1'] | Let's say I have a dictionary:
dict = {'a' : [1, 2], 'b' : [1], 'c' : [3, 3, 3]}
How do I find which keys have the lowest amount of unique values? In this case, it would be the dictionary with the keys 'b' and 'c' as they each only have 1 unique value.
| 595cb9f7afbd7f8d59f2ed8a6a1c22b7acffb23889fd9e0b5b565dea3fad76a5 | ['cfe1bc29e7154d28b4deb7c2cadb44c1'] | My goal is to create a line graph showcasing:
1. Each line is one different person
2. The line plots the person's ranking over time
Since I'm trying to display ranks (eg. A person is ranked 2nd on the first month, but moves down to 4th the next month, and so on...), I would prefer the point of #1 on the Y axis to be at the top rather than at the bottom. Is that possible?
I've already created the line graph of everyone and their ranks along each timeframe, I just need a way to flip the scale of the Y axis. Thank You for your help!
|
8dc1434817586b8cf82fe4901cf80b14d4313495257b1e5607d6b2af24bcecd2 | ['cfe1d8da395f49c5af68b40e1aedceb0'] | I want to signup a new user if the email he has entered does not exist in the database. I have a custom sessions controller with the following code:
resource = warden.authenticate!(:scope => resource_name, :recall => :failure)
scope = Devise<IP_ADDRESS>Mapping.find_scope!(resource_or_scope)
resource ||= resource_or_scope
sign_in(scope, resource) unless warden.user(scope) == resource
How do I instruct Devise to sign-up the user in the 'failure' method?
| eebd8ba58cfbc16a8026e5daf0ed71655f158a4a4458942d2fbd41fc0ebe7005 | ['cfe1d8da395f49c5af68b40e1aedceb0'] | You should use result[:body] and not result[body]. body is a variable, whereas :body is a symbol (similar to a string).
Notice that you have stored values in the hash with symbols. {:envelope => envelope; :body => body} is storing the content of the variable envelope (the one on the right) as the value against the key :envelope (and the same for body and :body).
Note: This is a nice write up on how Symbols differ from Strings - http://www.robertsosinski.com/2009/01/11/the-difference-between-ruby-symbols-and-strings/
|
f412abb17430b59d5d506212bc4bcbd92011cf0e9e32e07c9f7063b72fc661c9 | ['cfe76bfced604d698d01b1d8c397c262'] | It doesn't matter whether theta is in radians/degrees/what-so-ever. The result will remains the same (as long as the the units you use are linear to radians. meaning, theta units could not be radians squared, because then the limit will change (and will be 0 in that case).
| 3ca62e10f58f4883cb9532b3bc5a4a405979afa6be7df2f417b83cd4eb92bd08 | ['cfe76bfced604d698d01b1d8c397c262'] | The point I was trying to make was simply that for most choices of $c$, the equation would not have any solution $f$ (which wasn't clear to me apriori the way you had formulated the question). But I think we agree now. Let me know if you want me to elaborate on some step of the argument in this edit. |
c97421ce5dc9e1a526e058df42270522f4a06ef0b0931d6fc535719837607612 | ['cfecc0e04449476cba41f080f32c8884'] | There are several issues with your code, which various people have pointed out.
Walker <PERSON> correctly notes that date.GetHours() and date.getMinutes() will both return numbers, while the values returned from strthour.value and strtmin.value will be strings. When JavaScript compares these two, it will always evaluate to false. To fix this, try running the user input through parseInt, as in hr = parseInt(strthour.value, 10);. The 10 is important because it tells parseInt to create a number of base 10 (you don't need to know what that means, just make sure to include the 10).
Your need for the seconds to match is probably unnecessary, and does not match up with the interval you chose. TheMintyMate made this correction in their code snippet by simply removing the comparison for seconds. If you really need to make sure the seconds match up perfectly, pick an interval of less than 1000 milliseconds, so you know it is going to check at least once every second, guaranteeing that you will run the check on that 0th second of the desired time.
You could run into some trouble with single digit minutes if you try to compare them as strings, rather than converting to numbers as recommended in point 1. The .getMinutes() method will return a single digit 0 for a time like 6:00, while your example is implicitly prompting the user to enter in two digits for that same time. Again, you can avoid this issue entirely by using parseInt as recommended in point #1.
I do have to throw in a plug for using Cron jobs for running tasks on a known schedule like this. I know you said the user requested JS in this case, so they may not apply for this specific situation. Since you didn't mention Cron jobs though, I have to include them here to make sure you and future readers are aware of them, because they are designed for exactly this situation of running a task on an automated schedule.
Good luck!
| 1402065c3efc541b2c7214a22c0d1b8cb2335870d4a140d3661aeec84ee4b3a3 | ['cfecc0e04449476cba41f080f32c8884'] | "Post Only" buy orders must have a price that is less than the current market price that people are willing to sell at.
Put differently, if you want the buy order to go on the order book, and not fill immediately, you must bid less than people are currently willing to sell for.
When you try to post an order at <last_price>, there's a decent chance that price was at the lowest ask price, i.e., the price that people are currently willing to sell for.
And then certainly when you increase your bid, you're easily going into territory that people are already willing to sell for.
To solve this, simply bid less, not more.
The 1.8A section is saying exactly this, though it is ambiguous the way you're looking at it. They're saying you cannot post a buy order to the order book if someone is already on the order book saying they're willing to sell at that price. You certainly can post a buy order at the same buy price as other people are already willing to buy at.
|
3122d4ffe13715d4ba961d662d8001198c38b28368c6ec50338d8280a1b7d320 | ['d00790e45e0545318699a759cf10115c'] | (same comment as the one on the other answer) I never realized the question "which file extensions SHOULD i back up?" would be more realistic (and concise). Can you check the edit I made to my question dealing with backup files? Is there an equivalent to the .bak and .trn files that I currently back up in MS SQL? | 5848d05df6a46105c986019ec9a11a5b66f79429b0df1328b7ec76da9feb1fc7 | ['d00790e45e0545318699a759cf10115c'] | According the CPSC (linked in my question), the exploding hoverboards came from Chinese manufacturers, not Samsung. Some of the Chinese manufacturers put fake Samsung labels on their products. I was told by an Electrical Engineer who works at Samsung that the Samsung TABLET fires were caused by failure to accommodate off-gassing of the lithium cells (is that related to the stacking issue you mentioned?). But that's tablets, not hoverboards. |
da47b643ed17f81251393a083b2615d2d2888eae121691a72681fdb737024656 | ['d00d4465dc2e4a938696610d35f172ac'] | Maybe you need something like this
const DUMMY_PLACES = [ { todos: { allIds: [1, 2, 3, 4], byIds: { "1": { content: "test1", completed: false, }, "2": { content: "test2", completed: false, }, "3": { content: "test3\\", completed: false, }, "4": { content: "test4", completed: false, }, }, }, visibilityFilter: "all", }, ];
function pushObject(id, content) {
DUMMY_PLACES[0].todos.allIds.push(id);
DUMMY_PLACES[0].todos.byIds[id] = { ...content, completed: false };
}
pushObject(5, { content: "test5" });
console.dir(DUMMY_PLACES);
| fd1f71c12484a9b9c3a47c6d927d32f4ec4ceb208b872e89cca5189d65b881d5 | ['d00d4465dc2e4a938696610d35f172ac'] | This error means that you are trying to run a module unsupported.js from a folder that doesn't contain it, to solve this look in the folder pallet locate the unsupported.js file and then check the root folder where this file is located, and access the folder from terminal or locate the folder in your computer and then open the folder from your IDE so that you will be able to access the files in the folder
|
e154ff048f15dbe4a7402d92b54c53cb26acebd7760c92c69d6655edd52da79f | ['d0214fa804e7446c846849556842c548'] | I agree with the recommendation of adding a serial. But if what you are trying to do doesn't merit a schema change, you could use the system column xmin to separate rows with the same timestamp but from different transactions.
SELECT ts, xmin, count(1)
FROM foo
GROUP BY ts, xmin
| bb7c33c715766713fd55d1d1617afe1e1d587f7eea7274a423c07a04fffee4d5 | ['d0214fa804e7446c846849556842c548'] | You have yours grouped down to the minute. Which I'm going to assume is wrong because these are typically done by day. If I'm wrong, you'll have to change it back.
SELECT DISTINCT contract_id, ts<IP_ADDRESS>date,
min(price) OVER w,
max(price) OVER w,
first_value(price) OVER w,
last_value(price) OVER w
FROM fill
WINDOW w AS (PARTITION BY contract_id, ts<IP_ADDRESS>date ORDER BY ts)
ORDER BY 1,2
|
1ea04319418153292e4fcfa0d38832044bced36496dd1c1e1bfdeb9c64bf259c | ['d02aaa5da4cd44319ad0b1e42b06e0d6'] | I'm working on a project using Isabelle.
For some reason I have to simulate a bit/byte system, like this:
type_synonym bit = bool
datatype byte = B bit bit bit bit bit bit bit bit
fun byte_inc <IP_ADDRESS> "byte => byte" where
"byte_inc (B a7 a6 a5 a4 a3 a2 a1 False) = (B a7 a6 a5 a4 a3 a2 a1 True)" |
"byte_inc (B a7 a6 a5 a4 a3 a2 False True) = (B a7 a6 a5 a4 a3 a2 True False)" |
"byte_inc (B a7 a6 a5 a4 a3 False True True) = (B a7 a6 a5 a4 a3 True False False)" |
"byte_inc (B a7 a6 a5 a4 False True True True) = (B a7 a6 a5 a4 True False False False)" |
"byte_inc (B a7 a6 a5 False True True True True) = (B a7 a6 a5 True False False False False)" |
"byte_inc (B a7 a6 False True True True True True) = (B a7 a6 True False False False False False)" |
"byte_inc (B a7 False True True True True True True) = (B a7 True False False False False False False)" |
"byte_inc (B False True True True True True True True) = (B True False False False False False False False)" |
"byte_inc (B True True True True True True True True) = (B False False False False False False False False)"
lemma [simp]: "b ≠ byte_inc b"
sorry
I use (B T T T T T T T T) to represent (11111111), (B F F F F F F F F) to represent (00000000).
But I can not prove such an obvious lemma: b != b + 1
I really need some help.
| d5ab1e5178f9f83e94052827debe625eb9a4ed79fbe55c2a9761caef03876226 | ['d02aaa5da4cd44319ad0b1e42b06e0d6'] | I use vim to write C code. When I write something in the middle of a line and then try to jump to the end of this line using Shift+A, it sometimes jumps a bit further than I wanted.
Like this:
I don't know what's wrong with my .vimrc. Who can tell me how to deal with it?
|
4e7d5da6f148817275d96137641ffda2e7ba4f96bdeb1c5c89561b6d9030fa88 | ['d02b24918dfd4972b26c7ddcc1786e54'] | which version of liferay are you using?
How are you changing them? You can change them in two ways, try both:
Double click on the title (this will change it for the language you are currently in)
From the look and Feel pop up (this should allow you to change the title for any language, althoug this was not working properly in some older versions)
| 1915773e5ba58fcd3c284d5e11e41f3820dca40586bb987fe889c41b83586e22 | ['d02b24918dfd4972b26c7ddcc1786e54'] | This is not a duplicate of listing all files a package provides, i want to list all binaries a certain package provides that are in the standard location for binaries.
I know this can be done with some text processing tool along with dpkg -L but i am not very good at those. Please suggest something.
|
d2aabf119e99e4effd766d6a1daf900faa5ad7844aa3aec8568db8af08ac5ce4 | ['d02b4c3c9b5b4daf86d1ebfda99b21e9'] | Thank you for the response. I should clarify - it’s not my machine. The owner is away on vacation. I just pressed restart, and this happened. How can I change the partition the MBR points to? If it helps, I noticed that “OS” was in the “media” directory, which I thought was strange. | 231e8f2f9c0bb6ee4527f7b68f9da9abc5c346e2ba72dce893c2a8e9b614ff40 | ['d02b4c3c9b5b4daf86d1ebfda99b21e9'] | I just restarted Linux, and a purple GNU GRUB 2.02 screen came up. When I press “c” to enter the command line and enter “ls,” it says “error: no such partition.”
I am completely new to Linux, and there is some very important data on this machine. Any help appreciated and I’ll respond quickly to comments. Thanks!
|
2e6bbcb49cdd65fa1dbbaa982ee93ea06b1f81e19e0b2126401c28ba8673985b | ['d02ce3d6229246ad92465bbd49ff177a'] | Yes, I can give a number of instances where he can't complete technical work, and he can't do any planning. The work he does take on for himself is what I would assign to a new hire out of high school. How could I respect someone who wields authority without being properly suited for it?
As for pay, the issue of his inability is what causes the resentment. If he is less performant and less capable, why should he be paid more than us? What value is he exchanging that we aren't that merits his higher pay? | 766c1e4d4d1f70b15714215e7ca7526aa7fa93046b4d0edaa7be054ff3b05271 | ['d02ce3d6229246ad92465bbd49ff177a'] | I don't get credit for it. When talking to outside people he actually avoids answering the common question of how the project got started. His purpose for getting involve is to get credit among the people he is trying to impress and to fit his naïve vision of a boys club hangout. I started the project as a way to give our overworked staff a place to relax and take reprieve from their work. His motivation is not about the organization, it's about his own vision. |
621d6f4f614be0a6103ea24acb2cfb050f3f54794817416a82a47854b66120f7 | ['d04273df6adb40b490f3a245cb9a535b'] | First of all
iptables is the right command to do the job. But generaly you would use a reasonable amount of commands to set up a complete table. 1 command is one alternation to the table.
To find out the tables already in place and the default policy if no rules are matched use iptables -L. Usualy ine would write a bash script containing all the iptables setting. Where, at first you flush all the chains and then put everything in at once. This is to prevent losing track of what's in and out.
Also, check your init implementation if there are init scripts available to make your changes persistent over power cycles. (Normally your tables are lost after reboot).
Just create a script to include all your iptables commands:
#!/bin/bash
# Flush all chains
iptables -F
#Set defaults policies
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
# Don't block localhost traffic
iptables -A INPUT -i lo -j ACCEPT
# Don't re-evaluate already accepted connections
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
#Allowed incomming tcp ports
iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT # SSH
# Add watherver you wish to allow more
See this article for more tips on standard iptable rules.
Now to answer your question
First we needed to make sure you have a basic firewall up and running. Now, you can add your rule to your script to take effect. Please take in account suggestions from the other answers: an user can easily by-pass two blocked ports with a proxy or alternate ports.
Furthermore, your syntax was not correct. --dport can use only one port. You need to use the multi port module or chain multiple rules to do so.
However, blocking all outgoing connections for this user, will cause many applications to fail because they depend on the lo connection located at localhost or <IP_ADDRESS>. (Eg. if you are using KDM/KDE, your system freezes up during login.)
So you need to exclude the lo network interface from your rule. If still you want to allow the user to access only certain services, just create a rule before the DROP rule allowing those ports. I would suggest the following:
# Don't re-evaluate already ACCEPTed connections:
iptables -A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# Allow an outgoing connection, like SSH
iptables -A OUTPUT -p tcp --dport 22 -m owner --uid-owner $USERNAME -j ACCEPT
# Drop anything else that not on localhost
iptables -A OUTPUT ! -o lo -m owner --uid-owner $USERNAME -j DROP
| b2b41953a3037fb27a2015a9e65e8fb2d06b40a7d11bfb31e3b5bffaf5a4bfc7 | ['d04273df6adb40b490f3a245cb9a535b'] | My MacBook Air (Retina, 13-inch, 2019) keeps on shutting down overnight. When I come to it in the morning and try to turn it on, it takes at least 10 seconds of holding the power button to turn it on. If I check the kernel logs, among the normal codes, like 5 and sometimes 3, I see this:
kernel: (AppleSMC) Previous shutdown cause: -59
I've done some looking, and can't find the code -59 anywhere.
Could anyone help me with this?
|
3c446b13e946634c2163f3cd5ecae735ec9f6f49899f4fe4090e412a3f3eed16 | ['d05c317a44864569acc1578029e4990d'] | You have to recursively call sd card root folder and iterate through each folder and extract the image files add the file to an array list or array.Try below code.
public static ArrayList<File> getFolderList(File f, ArrayList<File> dir) {
if (f == null) {
return dir;
} else
try {
if (f.isDirectory()) {
File[] listFile = f.listFiles();
if (listFile != null) {
fileCount = listFile.length;
for (int i = 0; i < fileCount; i++) {
if (listFile[i].isDirectory()) {
dir = getFolderList(listFile[i], dir);
} else {
if (fName.endsWith(".png")
|| fName.endsWith(".jpeg")
|| fName.endsWith(".jpg")
|| fName.endsWith(".bmp")) {
dir.add(listFile[i]);
}
}
}
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return dir;
}
Parameters :
File f : pass f as sdcard root folder path or any folder path you want to get the count
ArrayList dir : pass an empty arraylist to get the file list. If you want the file count only, then change the return type of the function and also pass any parameter that counts the number of file.
| f08bfa4f0bc5db588825bd43becaa1ec60f9cc4459f79bf13c2948f7d6822f92 | ['d05c317a44864569acc1578029e4990d'] | Am developing an app with multiple screen support. Before start developing i read developer site for multiple screen support. Currently i had an issue regarding device density. I tested my application in Samsung Tab 10inch, Toshiba Regza, Customized 10inch tab,Samsung tab3, Lenova tabs. The deviece mentioned here all are mdpi devices. So i used layout-sw-720 for 10 inch tablets and layout-sw-600 for 7 inch tablets. When i tried to run on ASUS MeMO Pad HD 7inch whcih is an high density device it didn't takes layout from none of my layout folders specified. ASUS MeMO Pad HD 7'c confoguration is 7" LED Backlight WXGA (1280x800) Screen. Please help me with exact folder structure by considering the device density also. It's been a head ache for me since one week. Please help me. Any help would be appreciated
|
ff1cba89006ebd90778b1ffd3fb7671bed3c8a965913dec87a906a931d9485a3 | ['d089ca7520e340b89619ebe9cf4a5901'] | I'm trying to subset a list which contains dataframes:
Folkersen_IL6.txt
Folkersen_IL16.txt
Folkersen_IL1.txt
Height.txt
Met_Ile.out.txt
etc
I've tried this with the following code:
protein <- list.txt[grepl('Folkersen', list.txt)]
This line only returns me a list of 1 (containing Folkersen_IL16.txt). How can I get a subset containing all 3 desired dataframes?
| e0d1db0e94070eba61058ce68dc7ce6b499a4970f451d402f52de46ca34ce521 | ['d089ca7520e340b89619ebe9cf4a5901'] | I want to create a myID dataframe which contains columns SNP, trait, protein, protein.x, protein.y, metabolite, metabolite.x, metabolite.y of merged. The following code works:
myID <- subset(merged, select = c(SNP, trait, protein, protein.x, protein.y, metabolite, metabolite.x, metabolite.y))
However, I would like this to work with a piece of code that doesn't need all the colnames to be written out (as I later need to select 100+ columns).
Something like starts_with("SNP","trai","protei","metabolit") would be perfect (this doesn't work)
My data:
dput(merged[1:4,])
structure(list(SNP = c("rs1001567", "rs1002076", "rs1002365",
"rs1002480"), trait = c("complex", "complex", "complex", "complex"
), beta_g = c(-0.0021, 2e-04, -0.0141, -0.0082), df_g = c(699247, 709315, 708183, 695786
), protein.x = c("IL16", "IL16",
"IL16", "IL16"
), beta_p.x = c(-0.0874, 0.0335, -0.0268, 0.0923), df_p.x = c(3392, 3392, 3392, 3392),
protein.y = c("IL18", "IL18",
"IL18", "IL18"
), beta_p.y = c(-0.0542, 0.0257, 0.0124, 0.0846), df_p.y = c(3392, 3392, 3392, 3392
), protein = c("IL6", "IL6",
"IL6", "IL6"
), beta_p = c(0.0323, 0.0371, -0.0368, 6e-04), df_p = c(3392, 3392, 3392, 3392),
metabolite.x = c("Ile", "Ile",
"Ile", "Ile"), beta_m.x = c(0.006018,
-0.01177, 0.008134, 0.001025), df_m.x = c(21354, 23576, 21355,
23577), metabolite.y = c("Leu", "<PERSON>",
"<PERSON>", "<PERSON>"), beta_m.y = c(0.010107,
-0.000184, 0.017055, -0.000436), df_m.y = c(21306, 23528, 21306,
23530), metabolite = c("Val", "Val",
"Val", "Val"), beta_m = c(0.007908,
-0.002337, 0.01489, 0.0028), df_m = c(21478, 23700, 21479,
23704)), .internal.selfref = <pointer: (nil)>, sorted = "SNP", row.names = c(NA,
4L), class = c("data.table", "data.frame"))
|
4c2732783dd551d820a69a578cb67ed4f34b3cfa972ef0ee46d3cb0407b304bf | ['d09c2f3fa3ff42609af75984bc2281f4'] | I'm working on a Java program in Spark Stream which requires process tasks has many steps. The problem is every tasks has different steps to run. In traditional program it may looks like that
Params params = initParams();
for (Step step : task.steps()) {
Result result = step.execute(params);
params = result.convertToParams();
}
Because the steps are not hard coded. I have to use loop to walk through all steps one by one. But how do I write those steps in Spark Streaming and link them together?
PS: I can't put all those steps in one single function call because there are some steps I need to use RDD joinByKey operation.
Thanks.
<PERSON>
| 2930b2551e5318ce033372582220ab411cedc464fcd9e6b613811a6b07222a33 | ['d09c2f3fa3ff42609af75984bc2281f4'] | I am learning the Rust and Rusoto with this example https://www.rusoto.org/futures.html
And I found many of the code are outdated. So I changed the code like this:
use rusoto_core::{Region, RusotoError};
use rusoto_dynamodb::{
AttributeDefinition, AttributeValue, CreateTableError, CreateTableInput, CreateTableOutput,
DynamoDb, DynamoDbClient, GetItemError, GetItemInput, GetItemOutput, KeySchemaElement,
UpdateItemError, UpdateItemInput, UpdateItemOutput,
};
use std::collections::HashMap;
use std::error::Error;
use tokio_core::reactor::Core;
fn main() {
let item = make_item();
let client = get_dynamodb_local_client();
let mut core = Core::new().unwrap();
let chained_future = chain_futures(&client, &item);
let item_from_dynamo = match core.run(chained_future) {
Ok(item) => item,
Err(e) => panic!("Error completing futures: {}", e),
};
println!("item: {:?}", item_from_dynamo);
}
async fn chain_futures(
client: &DynamoDbClient,
item: &HashMap<String, AttributeValue>,
) -> Result<GetItemOutput, RusotoError<impl Error>> {
let _ = make_create_table_future(client).await;
let _ = make_upsert_item_future(client, item).await;
make_get_item_future(client, item).await
}
async fn make_create_table_future(
client: &DynamoDbClient,
) -> Result<CreateTableOutput, RusotoError<CreateTableError>> {
let attribute_def = AttributeDefinition {
attribute_name: "foo_name".to_string(),
attribute_type: "S".to_string(),
};
let k_schema = KeySchemaElement {
attribute_name: "foo_name".to_string(),
key_type: "HASH".to_string(), // case sensitive
};
let make_table_request = CreateTableInput {
table_name: "a-testing-table".to_string(),
attribute_definitions: vec![attribute_def],
key_schema: vec![k_schema],
..Default::default()
};
client.create_table(make_table_request).await
}
async fn make_upsert_item_future(
client: &DynamoDbClient,
item: &HashMap<String, AttributeValue>,
) -> Result<UpdateItemOutput, RusotoError<UpdateItemError>> {
let add_item = UpdateItemInput {
key: item.clone(),
table_name: "a-testing-table".to_string(),
..Default::default()
};
client.update_item(add_item).await
}
async fn make_get_item_future(
client: &DynamoDbClient,
item: &HashMap<String, AttributeValue>,
) -> Result<GetItemOutput, RusotoError<GetItemError>> {
// future for getting the entry
let get_item_request = GetItemInput {
key: item.clone(),
table_name: "a-testing-table".to_string(),
..Default::default()
};
client.get_item(get_item_request).await
}
fn make_item() -> HashMap<String, AttributeValue> {
let item_key = "foo_name";
let mut item = HashMap::new();
item.insert(
item_key.to_string(),
AttributeValue {
s: Some("baz".to_string()),
..Default::default()
},
);
item
}
fn get_dynamodb_local_client() -> DynamoDbClient {
// Create custom Region
let region = Region::Custom {
name: "us-east-1".to_owned(),
endpoint: "http://localhost:8000".to_owned(),
};
DynamoDbClient::new(region)
}
Then I found this compile error:
error[E0277]: the trait bound `impl std::future::Future: futures::future::Future` is not satisfied
--> cmd/src/main.rs:18:43
|
18 | let item_from_dynamo = match core.run(chained_future) {
| ^^^^^^^^^^^^^^ the trait `futures::future::Future` is not implemented for `impl std::future::Future`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
error: could not compile `cmd`.
To learn more, run the command again with --verbose.
make: *** [run] Error 101
Can anyone explain the error? What's the difference of those 2 Future traits? And what the code should be look like?
This is my cargo dependencies:
[dependencies]
rusoto_core = "0.44"
rusoto_dynamodb = "0.44"
futures = "0.3"
tokio = { version = "0.2", features = ["full"] }
tokio-core = "0.1"
Thanks
<PERSON><IP_ADDRESS>collections<IP_ADDRESS>HashMap;
use std<IP_ADDRESS>error<IP_ADDRESS>Error;
use tokio_core<IP_ADDRESS>reactor<IP_ADDRESS>Core;
fn main() {
let item = make_item();
let client = get_dynamodb_local_client();
let mut core = Core<IP_ADDRESS>new().unwrap();
let chained_future = chain_futures(&client, &item);
let item_from_dynamo = match core.run(chained_future) {
Ok(item) => item,
Err(e) => panic!("Error completing futures: {}", e),
};
println!("item: {:?}", item_from_dynamo);
}
async fn chain_futures(
client: &DynamoDbClient,
item: &HashMap<String, AttributeValue>,
) -> Result<GetItemOutput, RusotoError<impl Error>> {
let _ = make_create_table_future(client).await;
let _ = make_upsert_item_future(client, item).await;
make_get_item_future(client, item).await
}
async fn make_create_table_future(
client: &DynamoDbClient,
) -> Result<CreateTableOutput, RusotoError<CreateTableError>> {
let attribute_def = AttributeDefinition {
attribute_name: "foo_name".to_string(),
attribute_type: "S".to_string(),
};
let k_schema = KeySchemaElement {
attribute_name: "foo_name".to_string(),
key_type: "HASH".to_string(), // case sensitive
};
let make_table_request = CreateTableInput {
table_name: "a-testing-table".to_string(),
attribute_definitions: vec![attribute_def],
key_schema: vec![k_schema],
..Default<IP_ADDRESS>default()
};
client.create_table(make_table_request).await
}
async fn make_upsert_item_future(
client: &DynamoDbClient,
item: &HashMap<String, AttributeValue>,
) -> Result<UpdateItemOutput, RusotoError<UpdateItemError>> {
let add_item = UpdateItemInput {
key: item.clone(),
table_name: "a-testing-table".to_string(),
..Default<IP_ADDRESS>default()
};
client.update_item(add_item).await
}
async fn make_get_item_future(
client: &DynamoDbClient,
item: &HashMap<String, AttributeValue>,
) -> Result<GetItemOutput, RusotoError<GetItemError>> {
// future for getting the entry
let get_item_request = GetItemInput {
key: item.clone(),
table_name: "a-testing-table".to_string(),
..Default<IP_ADDRESS>default()
};
client.get_item(get_item_request).await
}
fn make_item() -> HashMap<String, AttributeValue> {
let item_key = "foo_name";
let mut item = HashMap<IP_ADDRESS>new();
item.insert(
item_key.to_string(),
AttributeValue {
s: Some("baz".to_string()),
..Default<IP_ADDRESS>default()
},
);
item
}
fn get_dynamodb_local_client() -> DynamoDbClient {
// Create custom Region
let region = Region<IP_ADDRESS>Custom {
name: "us-east-1".to_owned(),
endpoint: "http://localhost:8000".to_owned(),
};
DynamoDbClient<IP_ADDRESS>new(region)
}
Then I found this compile error:
error[E0277]: the trait bound `impl std<IP_ADDRESS>future<IP_ADDRESS>Future: futures<IP_ADDRESS>future<IP_ADDRESS>Future` is not satisfied
--> cmd/src/main.rs:18:43
|
18 | let item_from_dynamo = match core.run(chained_future) {
| ^^^^^^^^^^^^^^ the trait `futures<IP_ADDRESS>future<IP_ADDRESS>Future` is not implemented for `impl std<IP_ADDRESS>future<IP_ADDRESS><IP_ADDRESS>{Region, RusotoError};
use rusoto_dynamodb<IP_ADDRESS>{
AttributeDefinition, AttributeValue, CreateTableError, CreateTableInput, CreateTableOutput,
DynamoDb, DynamoDbClient, GetItemError, GetItemInput, GetItemOutput, KeySchemaElement,
UpdateItemError, UpdateItemInput, UpdateItemOutput,
};
use std::collections::HashMap;
use std::error::Error;
use tokio_core::reactor::Core;
fn main() {
let item = make_item();
let client = get_dynamodb_local_client();
let mut core = Core::new().unwrap();
let chained_future = chain_futures(&client, &item);
let item_from_dynamo = match core.run(chained_future) {
Ok(item) => item,
Err(e) => panic!("Error completing futures: {}", e),
};
println!("item: {:?}", item_from_dynamo);
}
async fn chain_futures(
client: &DynamoDbClient,
item: &HashMap<String, AttributeValue>,
) -> Result<GetItemOutput, RusotoError<impl Error>> {
let _ = make_create_table_future(client).await;
let _ = make_upsert_item_future(client, item).await;
make_get_item_future(client, item).await
}
async fn make_create_table_future(
client: &DynamoDbClient,
) -> Result<CreateTableOutput, RusotoError<CreateTableError>> {
let attribute_def = AttributeDefinition {
attribute_name: "foo_name".to_string(),
attribute_type: "S".to_string(),
};
let k_schema = KeySchemaElement {
attribute_name: "foo_name".to_string(),
key_type: "HASH".to_string(), // case sensitive
};
let make_table_request = CreateTableInput {
table_name: "a-testing-table".to_string(),
attribute_definitions: vec![attribute_def],
key_schema: vec![k_schema],
..Default::default()
};
client.create_table(make_table_request).await
}
async fn make_upsert_item_future(
client: &DynamoDbClient,
item: &HashMap<String, AttributeValue>,
) -> Result<UpdateItemOutput, RusotoError<UpdateItemError>> {
let add_item = UpdateItemInput {
key: item.clone(),
table_name: "a-testing-table".to_string(),
..Default::default()
};
client.update_item(add_item).await
}
async fn make_get_item_future(
client: &DynamoDbClient,
item: &HashMap<String, AttributeValue>,
) -> Result<GetItemOutput, RusotoError<GetItemError>> {
// future for getting the entry
let get_item_request = GetItemInput {
key: item.clone(),
table_name: "a-testing-table".to_string(),
..Default::default()
};
client.get_item(get_item_request).await
}
fn make_item() -> HashMap<String, AttributeValue> {
let item_key = "foo_name";
let mut item = HashMap::new();
item.insert(
item_key.to_string(),
AttributeValue {
s: Some("baz".to_string()),
..Default::default()
},
);
item
}
fn get_dynamodb_local_client() -> DynamoDbClient {
// Create custom Region
let region = Region::Custom {
name: "us-east-1".to_owned(),
endpoint: "http://localhost:8000".to_owned(),
};
DynamoDbClient::new(region)
}
Then I found this compile error:
error[E0277]: the trait bound `impl std::future::Future: futures::future::Future` is not satisfied
--> cmd/src/main.rs:18:43
|
18 | let item_from_dynamo = match core.run(chained_future) {
| ^^^^^^^^^^^^^^ the trait `futures::future::Future` is not implemented for `impl std::future::Future`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
error: could not compile `cmd`.
To learn more, run the command again with --verbose.
make: *** [run] Error 101
Can anyone explain the error? What's the difference of those 2 Future traits? And what the code should be look like?
This is my cargo dependencies:
[dependencies]
rusoto_core = "0.44"
rusoto_dynamodb = "0.44"
futures = "0.3"
tokio = { version = "0.2", features = ["full"] }
tokio-core = "0.1"
Thanks
Bruce
|
6f9c69f2870d8468ca97a3ea47321baa63a5575dc56e08d8556d59f3c78fdc27 | ['d0a55fabea1446e6b719a1056465a730'] | Suppose that we have two variables A & B (each one takes the value 1 or 0).
We also know that:
P(A | B=0) = 0.37
P(A | B=1) = 0.17
P(B=0) = 0.29
We need to calculate P(B=1 | A=1).
I guess that initially we have to find that P(B=1) = 0.71 However i need somehow to deduct that P(A) to use <PERSON> formula! Any inputs much appreciated!
| 32fb745f86de33acd628df6bf729336ba364d2659841c1bbb0164ec1140939e7 | ['d0a55fabea1446e6b719a1056465a730'] | My Burg Boot Loader in Ubuntu 14.04 , isn't showing themes.
I have Tried Installing Burg Many Times by different methods . but the themes are not working at all
They are not shown up on burg-emu nor are they shown during Boot Time.
Burg was working fine in my 14.04 until I tried to change the theme using grub-customizer , after that it is not working. Please Help .
|
75f9341e33b2a1aabff3a7a492407ded79a74add1b64e4c5ccb5b372aaba754c | ['d0a79faa2a3a4475bd2cc43bf74d0578'] | I have an webview which load an URL(www.google.com). How can I change the webview to load an different url externally like by writing the url in firebase? Is it possible? I want an option to change the url externally without having to change the url in the activity an reinstall the app.
| c21cdd6f5f4c50c21f2570e6d1f81349f49b78b580a5911ac2276b4361e66118 | ['d0a79faa2a3a4475bd2cc43bf74d0578'] | I have recyckeview in an fragments which contains contact list , I want to set onclick listener to recycleview which uses the recycleview phone number and send it to dialller screen using ACTION_DIAL.
myfragment:
public class HomeFragment extends Fragment {
ArrayList<ExampleItem> exampleList = new ArrayList<>();
Context context;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_home,container,false);
context=getContext();
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycleview_home);
RecycleViewadapter recycleViewadapter =new RecycleViewadapter(getActivity(),exampleList);
recyclerView.setHasFixedSize(true);
recyclerView.setAdapter(recycleViewadapter);
setuprecycleview();
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
return view;
}
private void setuprecycleview() {
exampleList.add(new ExampleItem("sagar","student","************","*******.com"));
exampleList.add(new ExampleItem("sagar","student","************","*******.com"));
exampleList.add(new ExampleItem("sagar","student","************","*******.com"));
}
}
myrecyclevieeadapter:
public class RecycleViewadapter extends RecyclerView.Adapter<RecycleViewadapter.ViewHolder> {
private ArrayList<ExampleItem> mexampleList = new ArrayList<>();
Context mcontext;
RecyclerView recyclerView;
public RecycleViewadapter(Context mcontext, ArrayList<ExampleItem> mexampleList) {
this.mcontext = mcontext;
this.mexampleList = mexampleList;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder( ViewGroup viewGroup, int i) {
View view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.layout_cardview,viewGroup,false);
ViewHolder viewHolder=new ViewHolder(view);
return viewHolder;
}
public RecycleViewadapter(ArrayList<ExampleItem> exampleList){
mexampleList= exampleList;
}
@Override
public void onBindViewHolder(final ViewHolder viewHolder, final int i) {
final ExampleItem currentItem = mexampleList.get(i);
int lastPosition=-1;
viewHolder.name.setText(currentItem.getName());
viewHolder.phone.setText(currentItem.getPhone());
viewHolder.email.setText(currentItem.getEmail());
viewHolder.profession.setText(currentItem.getProfession());
viewHolder.phone.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String phoneno =viewHolder.phone.getText().toString();
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse(phoneno));
// mcontext.startActivity(intent);
}
});
if (i>lastPosition){
Animation animation= AnimationUtils.loadAnimation(mcontext,R.anim.contacts_anim);
viewHolder.itemView.startAnimation(animation);
lastPosition=i;
}
}
@Override
public void onViewDetachedFromWindow(@NonNull ViewHolder holder) {
super.onViewDetachedFromWindow(holder);
holder.itemView.clearAnimation();
}
@Override
public int getItemCount() {
return mexampleList.size();
}
public class ViewHolder extends RecyclerView.ViewHolder{
TextView name;
CircleImageView image;
TextView phone;
TextView profession;
TextView email;
ImageView whatsapp;
CardView cardView;
public ViewHolder(View itemView) {
super(itemView);
whatsapp =itemView.findViewById(R.id.image_phone);
profession=itemView.findViewById(R.id.profession);
email =itemView.findViewById(R.id.email);
image = itemView.findViewById(R.id.image);
name = itemView.findViewById(R.id.name);
phone=itemView.findViewById(R.id.phone_no);
recyclerView= itemView.findViewById(R.id.recycleview_home);
cardView=itemView.findViewById(R.id.cardview);
cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String phoneno =phone.getText().toString();
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse(phoneno));
//mcontext.startActivity(intent);
}
});
}}}
I tried using intent to ACTION_DIAL but the app crashes when I click on the recycleview card view. how can I use ACTION_DIAL from fragment recycleview.
THanks in advance.
|
22886dbcdf376c26d67a0fda9df7d067b9052875fd8950a5874028025a3fa587 | ['d0ac2499e3744b1998316b881b64361b'] | This is the way I configure my client to render the proper language through react-intl.
import localeData from './translations/en.json';
//import localeData from './translations/xx.json'; <-- any language
const render = routes => {
match({ history, routes }, (error, redirectLocation, renderProps) => {
ReactDOM.render(
<HotEnabler>
<IntlProvider locale={locale} messages={localeData}>
<Provider store={store} app={app} restApp={restApp} key="provider">
<Router {...renderProps} render={renderRouter} history={history}>
{routes}
</Router>
</Provider>
</IntlProvider>
</HotEnabler>,
dest
);
});
};
render(getRoutes(store));
However I would like to import the localeData dynamically based on the locale within a cookie. So if the locale of my user is "en", I will only load in the en.json file.
const locale = Cookie.get('locale') || 'en';
const render = routes => {
match({ history, routes }, (error, redirectLocation, renderProps) => {
ReactDOM.render(
<HotEnabler>
<IntlProvider locale={locale} messages={localeData}>
<Provider store={store} app={app} restApp={restApp} key="provider">
<Router {...renderProps} render={renderRouter} history={history}>
{routes}
</Router>
</Provider>
</IntlProvider>
</HotEnabler>,
dest
);
});
};
render(getRoutes(store));
What would be the proper way of doing this? Tried creating a function but I can't pass the data properly to messages.
Thanks
| d349f153428bdb9d4239dd75fe7e320a11a503886fa93162e342cf72570ce86d | ['d0ac2499e3744b1998316b881b64361b'] | I'm using react-router to navigate to a certain page after logging in through my REST api.
Here's the sample of my codes, tried this:
export default {
loginUser: (jwt, rememberMe) => {
var savedJwt = localStorage.getItem('jwt');
AppDispatcher.dispatch({
actionType: 'LOGIN_USER',
jwt: jwt
});
if (savedJwt !== jwt) {
browserHistory.push('/');
localStorage.setItem('jwt', jwt);
}
},
And this based on react-router tutorial.
export default {
loginUser: (jwt, rememberMe) => {
var savedJwt = localStorage.getItem('jwt');
contextTypes: {
router: React.PropTypes.object
}
AppDispatcher.dispatch({
actionType: 'LOGIN_USER',
jwt: jwt
});
if (savedJwt !== jwt) {
this.context.router.push('/')
localStorage.setItem('jwt', jwt);
}
},
However, both are not working. First one complaining about "Error logging in TypeError: Cannot read property 'push' of undefined", while second one complaining about "Error logging in TypeError: Cannot read property 'context' of undefined".
Can anyone help me up with this? Been stuck here for hours. Thanks!
|
3ae09a0bfb99b95849685be5ef148e1ae01b86c95c6d01b90067cad3f0726906 | ['d0baf949cbc9412d9f733c3ffe087b5d'] | I am new to Ember, so my approach can be incorrect.
I am using latest Ember 2.9.1
My plan is to update route's model and cause all components to render newly added/saved item in a collection.
(I want to update my route's model (userRoles array) with a new record of userRole after I have call save (on createRecord)).
So far I have a route that has a model like this:
model(){
// this is my "user.edit" route
let user = this.modelFor('user');
let newUserRole = this.get('store').createRecord('userRole');
newUserRole.set('user_id', user.get('id'));
return RSVP.hash({
user: user,
userRoles: store.query('userRole', { user_id: user.get('id') }),
roles: store.findAll('role'),
newUserRole: newUserRole
});
}
I then have a controller and couple of components that modify newUserRole.
In a route I have an action for saving new user role:
actions: {
saveNewUserRole: function () {
let currentModel = this.modelFor('user.edit');
currentModel.newUserRole.save().then(function (newUserRole) {
currentModel.userRoles.addObject(newUserRole);
});
}
}
What's interesting is that a new item (newUserRole) gets added to a collection, but in console logging of model tells me that the new object is kind of different from other objects in the collection.
Looking through similar issues for ember I find that people use:
_internalModel or toArray(): here and here or services (?) for storing/updating data.
(also changed from using pushObject to addObject (v1.3+); plus observers listening for userRoles changes don't get triggered inside of components, or if I call toArray() I get 'Invalid value used as weak map key' error)
Question: What is the correct/Ember way to update my route's model with new item and cause to re-render my template. If I should use services for data, should service keep all items in a toArray() or POJOs?
| 4511dcfd0dda5096077faa4cb53cfb61a9966213f1c5229b3bc4a22aa3271412 | ['d0baf949cbc9412d9f733c3ffe087b5d'] | I know it's kind of late, but I had similar issue when using the Symfony\Component\HttpFoundation\StreamedResponse.
As you said the problem was the
Call to undefined method ... <IP_ADDRESS>header()
So clearly the header method is not present on an object.
For me the solution was to use headers method, which returns you the \Symfony\Component\HttpFoundation\ResponseHeaderBag.
Use it like so:
public function handle($request, Closure $next)
{
$response = $next($request);
$response->headers->set('Access-Control-Allow-Origin', '*');
$response->headers->set('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE, OPTIONS');
$response->headers->set('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-XSRF-TOKEN');
return $response;
}
|
a00f8210fdd7a8503d72c63c663fb0e7c08438df38055ceda68eecc5f43ef417 | ['d0bfba16cb7d4f68b6def6e09f061e12'] | 1) To Setup action-mailer views for the mails, you can do it as follows:
Create a view file in app/views/mailer_name/ with the same name as your mailer action (which in this case is "simple_mail" )
Alternatively if you want to use a different view altogether you can also do it as :
def simple_mail(to, subject, body)
attachments.inline['Logo.png']=File.read( Rails.root.join("public", "Logo.png"))
mail(:to => to, :subject => subject, :body => body) do |format|
format.html { render :partial => "/path/to/partial"}
end
end
In the above case, the content of the partial will be rendered as the body of the mail.
2) To attach a inline image you will also need to mention the attachment in the mailer action view file as follows:
<%= image_tag attachments['Logo.png'].url %>
| faa5ff4b6aba035b79187f1cc6c3723adc3141a31b3e3add0c870c0e7e0aa194 | ['d0bfba16cb7d4f68b6def6e09f061e12'] | Did you mention the attachments in your mail-content view file?
Add this code in you mail-content view file:
<%= image_tag attachments['image1.gif'].url %>
<%= image_tag attachments['image2.gif'].url %>
<%= image_tag attachments['image3.gif'].url %>
You can also have a look at a more detailed explanation available at:
http://technical-feeds.blogspot.in/2014/02/how-to-add-attachments-and-inline.html
|
a2417f99ceb5f7c7b64df5eff09b6fc896631337e843eef3dd69435bfae300e1 | ['d0c577ab7bcf4300b4b8bd6c8d1c93a9'] | The code works fine for me. Below, I have added some debug prints to your code (using pprint) to view the attributes of the IMAP4_SSL object M. My Gmail uses two factor authentication so I needed to setup a gmail app password
from pprint import pprint
# ....
M = imaplib.IMAP4_SSL(IMAP_SERVER)
print('---- Attributes of the IMAP4_SSL connection before login ----')
pprint(vars(M))
M.login(EMAIL_ACCOUNT, PASSWORD)
print('\n \n')
print('---- Attributes of the IMAP4_SSL connection after login ----')
pprint(vars(M))
# open specific folder
rv, data = M.select(EMAIL_FOLDER)
print('\n \n')
print('---- Data returned from select of folder = {}'.format(data))
Check the first pprint(vars(M)) for:
'welcome': '\* OK Gimap ready for requests from ...
'port': 993,
Check the second pprint(vars(M)) for:
_cmd_log for a successful login: 6: ('< PJIL1 OK **@gmail.com authenticated (Success)
data returned from M.select(EMAIL_FOLDER) should be the number of emails available to download.
| 9c72b28f265abd18b127afe626a4f6ebead6af2750fb39aebc50d41c51ac2b45 | ['d0c577ab7bcf4300b4b8bd6c8d1c93a9'] | Also, since nums is already a list do not use range(nums). Range returns a list given start and stop values. Iterate through your list nums in this way (part of your list comprehension):
[SQUARING OPERATION HERE for num in nums MODULO TEST HERE]
since this is homework I won't write it all out.
|
8c14799d430b7f57635cbab3e2e9107e9874c83b682856273bf435bf9a006fbd | ['d0c6100baea74d5e8d8d9a19c44248e8'] | When my app is backgrounded, the audioplayer continues to play, but i cant hear any sound. When i open my app again, it plays from the point where it would have been had the app not been backgrounded at all. This shows that the app is playing in the background though it is not audible. Why could this be happening?
I have set the audio key in the info.plist for the UIBackgroundModes array. Also my audioplayer is set to the "AVAudioSessionCategoryPlayback" category with an override to allow for audio mixing. So what am i doing wrong that im unable to hear the audio even though it is playing in the background?
Could this be an issue with the simulator alone as i have not been able to test this on a device with iOS4 so iv only been testing it on the simulator.
| 9c34bf20a96fbddb4449996189a22f0eb35c6575e3dcdcdc983493aa3306a095 | ['d0c6100baea74d5e8d8d9a19c44248e8'] | I am new to PHP. Surprisingly i didn't find any previous question that deals with this.
Anyway, my goal is to add the openssl extension to my existing Linux server
I didn't find that this extension is available when running:
sudo /usr/local/bin/pecl list-all | grep ssl
A few other details:
OS Type: Red Hat Enterprise Linux Server release 7.2 (Maipo)
Full spec: Linux <PHONE_NUMBER>.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
PHP Version: PHP 7.0.10
|
0f2b6a787690d569300eda985c94df6364b2edb779bdea83deb68a72a869a335 | ['d0c8dd85ca1340ce8fca680001505e8e'] | I have a c# dll with custom types that I am using in my scripts. I want to create a class that uses the custom types but I cant seem to import the dll before the class is parsed:
Import-Module CustomModule #contains type CustomType
Class Test
{
[void]Foo([CustomType]$x)
{
...
}
}
I get the following error:
Unable to find type [CustomType]
But this will work:
Import-Module CustomModule #contains type CustomType
function Foo()
{
Param(
[CustomType]$x
)
...
}
I have tried putting the class in a .ps1 and a .psm1 file and both dot-sourcing and using module for importing. Any ideas?
| fdcca8a73a617be3494dbc643447b2c26f8dc53c5795682230b12b18682ac160 | ['d0c8dd85ca1340ce8fca680001505e8e'] | I have a .ps1 file with variables I need to import, but I do not know the path at startup and need to import the script within a function. I can verify that the script exists, but none of the variables are imported.
vars.ps1:
$var1 = 4
class Foo
{
static [string]GetFilename()
{
return join-path $path "vars.ps1"
}
static [void] ImportScript()
{
$settingsFile = GetFilename()
Import-Module $settingsFile
write-host "testing settings path $settingsFile : $(Test-Path $settingsFile)"
}
static [void] Print()
{
$var1= $script:var1
write-host "var1: $var1"
}
}
output:
var1:
It seems like there is a limitation to importing modules within functions. I also tried using $global and a regular function instead of a class method but got the same result.
pulling the logic out of the functions and running it at script level works.
|
50428559ea020b85f2fdc694923ebaac9d4be12822bb8ff45cf6177be1888924 | ['d0d9e27f6539465282c6b96ac0b22332'] | The system has no real purpose, its just there for a little bit of fluff. It lets you hear the protagonists voice, and gives you a small selection of different lines you can make them say whenever you want them to. It's a neat little feature, but is completely irrelevant to gameplay and only there if you choose to use it every now and then.
| 828470d7f184b95046224d0887ab170a73651362abf16b6c4661872f44466fe6 | ['d0d9e27f6539465282c6b96ac0b22332'] | @chrsblck: No, because `export` exports the name (eg `TERM` in this case) as an environment variable rather than a local variable. If you used `export $TERM` in this example then the `$TERM` var would resolve to `xterm` you would set the env var `$xterm`, which is probably not defined. Good question though, it always looks wrong to me too. |
b875311007e14b512a68865b0d4727da63811f8e3750beacfbe14748a47ae6c0 | ['d0dd9a9076844058b759a7b329fc385f'] | In the end we decided to have our unit tests import entirely separate context files. Now we have a project-context.xml file that imports a project-neo4j.xml file that we for real setup, and a separate project-test-context.xml that we use for our unit tests. The project-test-context.xml has nothing about neo4j in it.
| c64b793bc166599c86e9a2b9b9795cbff78f033b668fbd161993cf6ac9461195 | ['d0dd9a9076844058b759a7b329fc385f'] | I have a project set up using spring-data-neo4j. We're trying to have our build process be as lean as possible but I'm not able to build the project unless Neo4j is running. If it's not running the application context fails to load because it cannot connect to the graph. We don't have any Neo4j unit tests set up so we could skip loading any Neo4j information entirely but I don't see a way of lazy loading neo4j:repositories and neo4j:config beans. Is there any way of doing this? Is there a workaround?
Here's my spring-data-neo4j setup:
<neo4j:repositories base-package="com.xxx.graph.repository" />
<neo4j:config graphDatabaseService="graphDatabaseService" base-package="com.xxx.domain" />
<bean id="graphDatabaseService"
class="org.springframework.data.neo4j.rest.SpringRestGraphDatabase"
scope="singleton">
<constructor-arg value="${graph.db.url}" />
</bean>
|
b5bb347ddedf5ef55d28a6973644a8b699f6ce0e47a34fe91a823a511c98ffb9 | ['d0f179fdf9e24858945ea8633ce1f720'] | I have a class of type Installer where TModel has a constraint.
I want to create an extension method with the type signature :\
public static void DoRepetitiveStuff<TOtherObject, TModel>(this Installer<TModel> installer)
where TModel : class, IConstraint, new()
where TOtherObject : class, IOtherConstraint, new()
{
installer.DoSomeStuff<TOtherObject>(c => { });
}
the goal being that eventually I can call the function using a simple installer.DoRepetitiveStuff<TOtherObject>();
For some reason when I call that function on my other file. It complains there isn't any extension method that accept a Installer in existance... I need to use it with:
installer.DoRepetitiveStuff<TOtherObject, TModel>();
Anyone knows why ?
| 7884d29927aefa97206b00d325e099bb3b565dae0e8559f85112b29d2fc2b93a | ['d0f179fdf9e24858945ea8633ce1f720'] | 16 bit code from Windows 95 will still run on 32 bit windows at least until windows 7 (I don't have the software to try it on Windows 10).
However for 32 and 64 bit code, you have to start using the win32 api which use the less exciting "call" instruction instead of interrupts.
|
3f070cf6c8727e279a073fc4ca43e6e3007d9e8de7f8376398fa63b1f3eae03c | ['d0f48062031d41f3bb4afde1693f7af3'] | So I have looked into why this error occurs but I couldn't find any helpful answer. One person answered for another question that its because in the sql statement, the column name used for multiple tables may be the same. However, I tried to change that and yet I got the same error. Here is my sql statement:-
SELECT CLASSID INTO V_ID FROM CLASSES INNER JOIN BOOKING ON BOOKING.CLASSID=CLASSES.CLASSID WHERE BOOKING.BOOKINGID=:NEW.BOOKING_ID;
What did I do wrong?
| eec3296354ab61ae0f487114562e08665c94ef83fa4192b8001dcd65ca35b9ff | ['d0f48062031d41f3bb4afde1693f7af3'] | So I am trying to create this trigger that checks whether the number of availabletickets is greater than 0 and if it isn't, it throws an error while booking but while creating the trigger, i am getting the following error
PLS-00103: Encountered the symbol ""
here is my code:
create or replace trigger booked_ticket before insert OR UPDATE on booking for each row
declare
v_available NUMBER;
begin
SELECT AVAILABLETICKETS into v_available from HALLSEAT WHERE HALLSEAT .STAGEID=:NEW.STAGEID;
IF v_available<1 THEN
Raise_Application_Error(-20343, 'You cant book');
END IF;
end;
|
d75295132aaaebb144f3f9243e8c560a0b7e8f3fd7c12d6e63d62602c0c62a3d | ['d10cf56c078f42e69d2d3bb73001d8a9'] | The problem exists in Android's implementation of the onInterceptTouchEvent() method for RecyclerView.
This blog calls out the problem and fixes it as well - http://nerds.headout.com/fix-horizontal-scrolling-in-your-android-app/.
The only difference is that there the parent scrolls vertically and child horizontally. But the solution takes care that it should work for your situation as well.
| 1aa100c3142c926d6628b395da035cff18f63912059a8d32961f3136e09ba884 | ['d10cf56c078f42e69d2d3bb73001d8a9'] | public class Temp{
static int add(int m,int n){
if(m==0)
return n+1;
else if(n==0)
return add(m-1,1);
else
return add(m-1,add(m,n-1));
}
public static void main(String[] a){
System.out.println(add(3,3));
}
}
I am not able to understand what this function is achieving. The output for (2,2) is 7 and for (3,3) is 61. I understand that the value of n decreases then value of m and then the base case is reached but how can I get the output without running the code for a given input?
|
e28ec97e93a15bb37f462064c6733603693e51316d3b5e091acaae269ababb2a | ['d115bca8061a456b9cd067f2afbd52b5'] | I am developing a json parser to xml using xslt transformer, thatis the output is type text. However does not provide the output data types.
For example, the input xml has data that are string or int or date, and the xslt does not realize what kind they are and parse them all the same.
My query is whether there is any way to import a xsd file (has the data types) within a xslt, xsd then you can check for the type of data and transform Finar accordingly.
From already thank you very much!
| 615c2989c26d762d8d3053f3d6915975c81273e185cde3f5fe16f3ffadd3ac4e | ['d115bca8061a456b9cd067f2afbd52b5'] | I'm working on a android application with SQLite, but I have a problem with charterers not ASCII. I researched about that and I found the solution is compile a new SQLite version with ICU activated.
I downloaded the NDK, ICU and I follow the guide of this page:
http://www.sqlite.org/android/doc/trunk/www/index.wiki
However this page only shows how to compile the a new SQLite, I do not how to add ICU on this process.
How can I compile the SQLite with ICU ? (I'm using Windows)
Thanks.
|
ce49da36cf8087f718e783dedebacc832eb2faa01f5e0f2bb64e25f9c16459cb | ['d12972bff5534c64b578957398a7a5d4'] | in my game i added a simple game object to follow my player , but the problem is it is not showing the follower when i click play , i'm new to unity , can any one help me . ill be attaching the script that i tried and output screenshot that i'm getting now.
(the follower is visible in scene window , disappears when i click play button)
script :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FollowPlayer : MonoBehaviour {
public GameObject playerobj ;
public float smoothtime = 0.3f ;
Vector2 velocity = Vector2.zero;
public int yoffset;
void Start () {
}
void Update () {
Vector2 targetPosition = playerobj.transform.TransformPoint(new
Vector3(0,yoffset));
if(targetPosition.y < transform.position.y)
return;
targetPosition = new Vector3(0 , targetPosition.y);
transform.position = Vector2.SmoothDamp(transform.position,targetPosition,ref velocity,smoothtime);
transform.position = new Vector3(transform.position.x ,transform.position.y ,-10) ;
}
}
thanks in advance guys !
| edfa452eaf84ea6a68bbfa5857def80669fe15eaf29c9ab87b3a092e072dc9ee | ['d12972bff5534c64b578957398a7a5d4'] | after doing so many search and reference i finally got a working solution.
i changed these values in update method. hope my answer helps some one.
void Update () {
Vector2 targetPosition = playerobj.transform.TransformPoint(new Vector3(0,yoffset));
if(targetPosition.y < transform.position.y)
return;
targetPosition = new Vector2(0 , targetPosition.y-8);
transform.position = Vector2.SmoothDamp(transform.position,targetPosition,ref velocity,smoothtime);
transform.position = new Vector2(transform.position.x ,transform.position.y) ;
}
|
3f080878ecc1d9b7a04d173d6c7e32a8b45b94d906a3601638db23d886d52e4f | ['d12dd37cf5f1449b91e8469f6fded067'] | First of all, I don't think there is one answer to this question. As you point out, it differs a lot between individuals and projects.
I apply something like the idea of SoC (Separation of Concerns) to commits. That is, I try to commit on a "per task" basis. Or, in other words, avoid committing "several areas of work" at once. In that sense, there is no such thing as a commit too small.
| 6574d038a47c1aeaa1d2e9764d90f83c5d98e63cfa447de59d133d047bd2ffea | ['d12dd37cf5f1449b91e8469f6fded067'] | Ok this is what i've referenced thesqldude.com/tag/makecert for creating self signed certificate. JIST :
1) MAKECERT tool used for preparing certificate with command mentioned in link above –
FYR :
makecert -r -pe -n "CN=cs020.classic.classicinformatics.net" -b 01/01/2000 -e 01/01/2036 -eku <IP_ADDRESS>.<IP_ADDRESS>.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12
Where "cs020.classic.classicinformatics.net" is my system FQDN.
2) Then open mmc and added console to view certificate, And it was automatically restored in the certificate store under "personal"
3)Then opened SCM and view properties of SQL SERVER protocal.
FYI: My system hostname was "cs020" and its in domain "classic.classicinformatics.com".
If it was in workgroup then creating certifcate with "CN=cs020" would have worked,
but i check my fullcomputer name and it was stating something else
i.e. "cs020.classic.classicinformatics.net" , so there was it, i've used the above command and got my results.
|
89b14bd9024addc79795a6e4aee5066d08ce10fad98dad44c901a9446c830338 | ['d12e4314a72d4f1289837dace9888b98'] | In Orient 3.0, the recommended querying mechanism via multi-model API is the set of query/execute/command methods that always take in "strings" as queries. How would we go about executing OSQLAsynchQuery and OSQLNonBlockingQuery type queries in the new 3.0 multi-model API without resorting to deprecated methods?
| 4ac945acaf9e2d3e6c64b45ffabcd461731814cbb5eab7831e493af43057fe38 | ['d12e4314a72d4f1289837dace9888b98'] | My conclusion is that streaming works well when scrolling through a large result set without consuming a large amount of memory or having to keep re-executing offset/limit queries (similar to forward only scrolling over JDBC resultsets). A typical use case is an export scenario.
For forward and backward paging, in Orient at least, you likely need an indexed property/properties and perform range queries - you'll need to make sure the index is SB-tree so that it supports range queries.
FYI, Solr has a cursor mechanism which works pretty well for forward pagination on sorted results - but if you keep some simple state markers on the client you can also go back to results already encountered. "go to" random pages is not supported in Solr cursors but you can always re-sort/filter on some other criteria in order to move "useful" results to the top of the resultset instead of deep paging (https://lucene.apache.org/solr/guide/6_6/pagination-of-results.html)
|
a7588af874168e724b072f4de5765270dd5512e2989d2c13ef1f7eecbbc9e5ba | ['d140aa48b0904756b36f08852129dba0'] | I have a particular use case for multiple in memory key value maps that need very fast lookup time. They are set just set once a day so can be considered immutable for all practical purposes. Redis is not an option since it gets CPU throttled in case of multiple threads accessing it. Multi instance redis takes up too much memory because of data replication. The important thing to consider here is that the read rate is very high in bursts. Around 10 million requests in bursts from around 40-50 workers simultaneously.
I was thinking of creating a simple client server architecture with multiple readers connecting to a server to read from shared memory maps. However I wonder if such an architecture already exists and has been tested profusely for this use case in which case I should not be reinventing the wheel.
So to sum up what is my best alternative? TIA.
| 2ff3287e9cd06dbe10a9951614cbfd1bb64bcb54159a437fdbdf597f99d3df46 | ['d140aa48b0904756b36f08852129dba0'] | This question was asked in an interview.
You have an array of small integers. You have to multiply all of them. You need not worry about overflow you have ample support for that. What can you do to speed up the multiplication on your machine?
Would multiple additions be better in this case?
I suggested multiplying using a divide and conquer approach but the interviewer was not impressed. What could be the best possible solution for this?
|
ba9fc8d2c83015a6a5132d9add489d4aca856b5b99b26f239f0ea1e30f557689 | ['d140f99e27c8466fbb8c7819329e5dfe'] | Looks like the problem was with the scale of input data. With values being between 0 and 255 that scale was more or less kept in the next layers, giving pre-activation outputs of the last layer having large enough differences to decrease softmax gradient to (almost) 0.
It was observable only with relu-like activation functions because other, like sigmoid or softsign, kept values ranges in network smaller, with an order of magnitude of 1 inststead of tens or hundreds.
The solution here was to just multiply input to rescale it to 0-1, in case of bytes by 1/255.
| dc14ff9db473bfe3305361e8ff41485ed324e1f2a913b49e96021f028639a06d | ['d140f99e27c8466fbb8c7819329e5dfe'] | I'm trying to read UTF-8 encoded polish characters from console for my c++ application.
I'm sure that console uses this code page (checked in properties).
What I have already tried:
Using cin - instead of "zażółć" I read "za\0\0\0\0"
Using wcin - instead of "zażółć" - same result as with cin
Using scanf - instead of 'zażółć\0' I read 'za\0\0\0\0\0'
Using wscanf - same result as with scanf
Using getchar to read characters one by one - same result as with scanf
On the beginning of the main function I have following lines:
setlocale(LC_ALL, "PL_pl.UTF-8");
SetConsoleOutputCP(CP_UTF8);
SetConsoleCP(CP_UTF8);
I would be really greatful for help.
|
4cd9219c86dc5dabc20a13d9634715da65e0b326f980c0202a2dd0581e883473 | ['d142efc076144e63b761c791e9170e19'] | So, after several hours of trying hard, I've figured out the solution.
First, a response from the Solr saying OK like below does not mean it's done... (That was my first mistake) The restoration file I was using was corrupt (partially made).
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">8</int></lst><str name="status">OK</str>
</response>
Next, I was looking at the logs, and it said that it was out of memory, and kept dying because the restore file was 13GB big and certainly wasn't enough with the default Solr configuration.
I restarted Solr with
./solr restart -m 16g
And it was successfully imported.
Lesson learned: be patient, and think about memory size.
| 97275eae44c2d1c2ded5ef067daa06b2c23a4c21bf3356f2540616c9d4f31531 | ['d142efc076144e63b761c791e9170e19'] | I am running Solr 6.0 on a dedicated server with a Core 2 Duo 2.66GHz CPU and 4GB of RAM.
I am using the below PHP script to upload multiple CSVs (a few dozen at once, each file averaging 40MB) from the browser to Solr. As I used top command to monitor server CPU usage while the CSV is being indexed, CPU usage is maxing out on its 2 cores. It sometimes makes the Solr server go down after a lot of CSV uploads.
Is this a script side problem that I should be fixing, and should I put some sort of sleep function somewhere in the code to ease the stress on the server?
Or is this a server spec issue, that I need a better server to do this kind of work?
<?php
// apt-get install php5 libapache2-mod-php5 php5-curl
// curl 'http://localhost:8983/solr/update/csv?fieldnames=url,keywords,description,title&commit=true' -H 'Content-type:text/plain; charset=utf-8' --data-binary @$file
$fileoutput = 'solr-upload.txt';
date_default_timezone_set("UTC");
$timestamp = time();
$servertime = date('m/d/Y H:i:s', $timestamp);
$SOLR_SERVER = '<IP_ADDRESS>';
$CORE = 'core1';
ob_start();
$callback = &$_REQUEST['fd-callback'];
$url = 'http://'. $SOLR_SERVER .':8983/solr/'. $CORE .'/update/csv?fieldnames=id,keywords,description,title&commit=true';
if (!empty($_FILES['fd-file']) and is_uploaded_file($_FILES['fd-file']['tmp_name'])) {
$name = $_FILES['fd-file']['name'];
$data = file_get_contents($_FILES['fd-file']['tmp_name']);
} else {
$name = urldecode(@$_SERVER['HTTP_X_FILE_NAME']);
$data = file_get_contents("php://input");
}
$header = array("Content-type:text/csv; charset=utf-8");
$post = $data;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
//curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_exec($ch);
curl_close($ch);
if ($ch) {
$outputstring = $name . ' success ' . $servertime . "\n";
$output = 'Upload Success!';
file_put_contents($fileoutput, $outputstring , FILE_APPEND | LOCK_EX);
}else {
$outputstring = $name . ' failed ' . $servertime . "\n";
$output = 'Upload did not work!';
file_put_contents($fileoutput, $outputstring , FILE_APPEND | LOCK_EX);
}
// $opt = &$_REQUEST['upload_option'];
// isset($opt) and $output .= "\nReceived upload_option with value $opt";
if ($callback) {
header('Content-Type: text/html; charset=utf-8');
$output = addcslashes($output, "\\\"\0..\x1F");
echo '<!DOCTYPE html><html><head></head><body><script type="text/javascript">',
"try{window.top.$callback(\"$output\")}catch(e){}</script></body></html>";
} else {
header('Content-Type: text/plain; charset=utf-8');
echo $output;
}
?>
|
fa75e896c60fa26f8c30799508b6e9937f04ace4c95f138de7774c60e7d4881c | ['d152cfbb0829463b830f99e122f22c22'] | I have been running into the same thing, and it seems to be an issue with the released version of the cramp 0.15.1 gem versus what you get from the github repo (https://github.com/lifo/cramp) thought is still marked as 0.15.1.
Try this experiment which works for me:
Clone the GH repo locally
Copy in the bin/ and lib/ folders, as well as the cramp.gemspec file from the repo to your test cramp project
Change your gemfile, instead of just
gem 'cramp'
Include the local copy of code:
gemspec
gem 'cramp', :path => File.dirname(__FILE__)
Erase your Gemfile.lock and re-bundle, see that bundler now reports it will use the local copy of the cramp gem
Try your app again, in my scenario, this now works exactly as expected.
It would appear there is either a fix in github they have not released yet (but have not incremented the working version in their gemspec) or some other version snafu, but either way the code in GH works whereas a "gem install cramp" doesn't give you working code for websockets.
| 910e73db0544afee91503c9995f95a76ea4a979294e22a1aa119b901e3eaf119 | ['d152cfbb0829463b830f99e122f22c22'] | While I realize this question was from a year ago, I did run into the same issue just recently, and found I had to manually delete the entire pub cache - as if the cache had become corrupted.
I just cd over to the pub cache dir and deleted everything, so a new pub get would re-get it all.
At least on mac, the pub cache dir is ~/.pub-cache/hosted/pub.dartlang.org/.
|
6571f7a251871ad73fb546ba15345f49826acd354c254d6e42c9e2d96cd4aac7 | ['d15b096c7b4d42bcb18b2ec2bed9f56f'] | I don't think there is a way to make more space than is available when you first open the Colab document. What is already there is there for a reason, it is there to run your environment. You can still try to remove existing files at your own risk by running the linux remove command like so in a cell.
!rm <path>
Otherwise, you'll have to switch to GPU because I know it offers a whole lot more space at the expense of longer training time. I think another option might be to pay to upgrade, but I don't know if it only gives you more TPU time or if it increases your RAM as well.
| 1bd5f7400f50d5843bfc01277e97be6096e92f7ec7a6d5fc8416a93cf9499424 | ['d15b096c7b4d42bcb18b2ec2bed9f56f'] | Using SharedPreferences is very easy. You need to define a key which you will use to retrieve the data later. You can store Strings, ints, floats, booleans... You need to provide the context.
Context context = getApplicationContext();
To write data, use this code.
SharedPreferences mPrefs = context.getSharedPreferences("YourApp", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = mPrefs.edit();
editor.putString("color", "blue");
editor.apply();
To retrieve data, use this
SharedPreferences mPrefs = context.getSharedPreferences("YourApp", Context.MODE_PRIVATE);
String color = mPrefs.getString("color", "defaultValue");
You can easily change the type from String to other types that might best suit your needs.
Hope it helps.
|
68ccbec9a26770f9575d8ca70bc5839d02194446087d3c0f6fd3c242326db453 | ['d15cb9e023014325ab46940790d83571'] | First step is download fonts from fortawesome
Second include them in to css. Be careful with the paths to the font files:
@font-face {
font-family: 'FontAwesome';
src: url('../font/fontawesome-webfont.eot?v=3.0.1');
src: url('../font/fontawesome-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'),
url('../font/fontawesome-webfont.woff?v=3.0.1') format('woff'),
url('../font/fontawesome-webfont.ttf?v=3.0.1') format('truetype');
font-weight: normal;
font-style: normal;
}
And at last, replace content rule for hr selectior from "§" to "\f005"
hr:after { content: "\f005";}
| f1f0b4d3d1028ea6cdc2a5a9cd7e4dcc3e097de8576ac3bb28e614ab0f2e99bd | ['d15cb9e023014325ab46940790d83571'] | You are trying to run the script which works with undefined HTML. To solve this you can either move your script after defining HTML or use jquery shortcut document.ready function such as $(function(){<your code here>});.
In first case event handler has to be a global variable right away. Otherwise you declare this variable before shortcut scope.
Next you define that event handler function obtains input value ($('input[name="numserver"]').val()). And now you can generate as many divs as defined by the value(Array.apply(null, [+value]).map(function(){<generator here>})). To generate copies clone method may be used and generated divs should be inserted into div container as you do.
Looks like you're trying to generate divs by "GO" button click. In your case to do that event handler function should be named "new_server". And you don't call this function in "onclick" attribute you just declare it.
|
39b67edc8595421b6c2af40d91d7db5931c0c56f140c1e0c5313a2b13260939d | ['d15dd8e34a7945fb84902924c71d52d7'] | To anyone who is still looking at this post, what I did was put everything in a single recyclerview (first cell had the "imageview and some relative elements", second cell had the horizontal recyclerview and from the third on the data of the vertical one).
This however did not fix the smooth scroll problem. What I found out is that in the vertical one, I was using some images (drawables) that were too large, so they had to be scaled down during runtime, thus causing slowdown.
My tip on that is use a caching image loading library whenever you can (Glide is great!) for example when downloading from internet. Also when you want to load images from a drawable (using 'android:src' in xml) be sure to utilize the different drawable folders that android provides. That can really help performance-wise!
| 3174afadff936f14ffff568b2137dfd6422db4a68e4469d7560091d02d99955f | ['d15dd8e34a7945fb84902924c71d52d7'] | To all those that are familiar with rapidjson i have the following issue:
I have a certain function that accepts as parameter a date and if that date exists in the json file the method does some operations and if not some other operations.
Generally it looks like this: (not actual code more like pseudo)
Function:
void updateData(string date) {
//
//code to turn date from string to const char* (tested)
//
if (v.HasMember(date)) { //v is a value
Value d;
d=v[date];
//
//code that involves getting data from d (d is object) using HasMember
//
} else {
//generic code that has nothing to do with json
}
JSON file:
{
"main": {
"v": {
"2014-10-02" : {
//some fields
},
"2014-10-03" : {
//some fields
}
}
}
}
So the first time that i call updateData for date "2014-10-02" it runs correctly(executes the if part).
The problem is when i call updateData for another date (like "2014-10-03" that is supposed to work well) it always executes the wrong part(else part) and even when i switch back to the first date it still executes the else part. (while popping many assertions (mostly isString())).
So is HasMember really the problem here, in the sense that it is maybe altering the object?
And are there any alternative ways to search for a member, other than that?
Any tip is appreciated...
|
aa43c9cddc2aa49bba8d124cf4728f14577b26c74d75d002908723dd38702fa6 | ['d178760c4db146719f71d767a0b1b5c1'] | In Visual C++ (VS 2015) I can define a managed enum as follows:
public enum class Pet {
Cat,
Dog,
Hamster,
};
and the keyword "public" is vitally important. Without it, it will not treat Pet as a managed enum, and you will not be able to access the text associated with the members of the enum using Enum::GetName, for example.
However, if I try and declare an enum inside a class, like so:
class Construction {
public :
public enum class Fixing {
Nut,
Bolt,
Rivet,
};
};
I get this error message :
error C3379: 'Construction::Fixing': a nested class cannot have an assembly access specifier as part of its declaration
If I remove the "public" from the declaration, like this:
class Construction {
public :
enum class Fixing {
<PERSON>,
<PERSON>,
<PERSON><IP_ADDRESS>GetName, for example.
However, if I try and declare an enum inside a class, like so:
class Construction {
public :
public enum class Fixing {
Nut,
Bolt,
Rivet,
};
};
I get this error message :
error C3379: 'Construction<IP_ADDRESS>Fixing': a nested class cannot have an assembly access specifier as part of its declaration
If I remove the "public" from the declaration, like this:
class Construction {
public :
enum class Fixing {
Nut,
Bolt,
Rivet,
};
};
and then add the following code:
int main(array<System<IP_ADDRESS>String ^> ^args)
{
array<String^> ^names = Enum<IP_ADDRESS>GetNames( Construction<IP_ADDRESS>Fixing<IP_ADDRESS>typeid );
for ( int i = 0; i < names->Length; ++i ) {
Console<IP_ADDRESS>WriteLine( names[ i ] );
}
return 0;
}
then it will compile without complaint, but the output is not what I might expect. There is no output at all. Delving deeper I find that Enum<IP_ADDRESS>GetNames is returning a zero length array. It seems the compiler is treating Fixing as an unmanaged enum, and is using the C++ 11 syntax for "enum class".
So, how do I change the code so that Fixing is a managed enum?
| ab48199d95896a3a6bf391eeb6f910bac6ae098c37f44f05ae531b0079b1aeaf | ['d178760c4db146719f71d767a0b1b5c1'] | I figured it out. I need to make sure the class in which the enum is declared is a managed class, like so:
ref class Construction {
public :
enum class Fixing {
Nut,
Bolt,
Rivet,
};
};
Then the code that writes out the names of the members works. However, I still think the line "enum class Fixing" looks rather ambiguous. It isn't immediately clear that this is a managed enum.
|
16e5860675b8b132381be5d68fbd7eb6322876a0b1c9f3e5bcc4ea77741eb983 | ['d17e920893384dc496fc4e2088689dc5'] | RMagick is really annoying to install because it requires system binaries for ImageMagick.
Specifically, a slightly older version of ImageMagick. As of January 2018, 6.9.1 at the latest, which is no longer archived on the ImageMagick site. Older versions are a bit hard to find, particularly for Windows but here's one ftp archive: http://ftp.icm.edu.pl/packages/ImageMagick/binaries/
Once you have a correct version of ImageMagick installed, be sure that you have your PATH settings configured. The up-to-date RMagick guide for the Windows installation process is at: https://github.com/rmagick/rmagick/wiki/Installing-on-Windows
| 3b6ae6d67f3c6cd77542ee09a99433b4ffc8be2c60babb3175c2f9a5eda112cd | ['d17e920893384dc496fc4e2088689dc5'] | Slightly unusual constraint solving problem I'm trying to implement in MiniZinc: I have a CSP that has some hard constraints and a soft constraint that the relations in the solution should have a statistically similar profile to an example solution. That is, if the input has 5 'red' and 12 'green', the found solution doesn't have to have exactly 5 and 12, but should be statistically likely to have a similar distribution...but also allow rare solutions that, for example, have no red.
While I could have a hard constraint that the distribution must exactly match the distribution, or get all of the possible solutions and sample from that, I'd prefer a search strategy that can get one solution that is statistically likely to have similar distribution (but can vary). Or a performance-equivalent way to do it.
Using the indomain random for the assignmentannotation seems like it might work, but from my understanding the only way to use weighting with it is to populate the domains with multiple values to pad out the domain with the correct weighting.
I could, alternately, frame it as an optimization problem and look for a solution that maximizes the similarity to the desired distribution, but I'd prefer something that meets the hard constraints and does a weighted sample from the entire possible solution space for the soft constraints.
|
b3fe4157cef8ad37afb76263bc77fd84f639c886ba8d2051ba475a94f7288a0d | ['d17f076c598e4944bd34c5b3316cec6a'] | Although this is an old post, and the question is specifically about WebPack...
If you're using Typescript and a boilerplate such as create-react-app, and if you have your video on the static folder, then please check out this solution, of adding the type to src/react-app-env.d.ts, before ejecting your app:
https://github.com/facebook/create-react-app/issues/6822
| 88589ec844deba10d1889f764faf4e959b1b44d90f60eedee5424809daea339b | ['d17f076c598e4944bd34c5b3316cec6a'] | It’s interesting in that my mother, a fairly formal southern belle by background (here in the US), once our homes began having space for such, would typically refer to our room where we gathered, for tv and games, reading and whatever, as the family room (some in the US call it a great room.
Meanwhile the very formal room near the front door, and across the foyer from the formal dining room, and where those younger than 16 did not tread, she called the living room and sometimes the parlor. It was strictly for entertaining guests, no tv, stereo, or anything else. It was suitable only for conversation and liquid refreshment. Coasters were available, ashtrays were not as no smoking was permitted indoors.
|
8d508853e44d66e4e1edb7ea126d2328a2aff3e470e946c849bc6894d035c6cf | ['d188afe8cbf64f26a22f8f20f5b5a6c0'] | To days of stomach pains is over.
I decided to make a copy of my, now not working, app.
After more tries than I can think of, I did the following:
backup of localization folders in the project
Removed localization from the main storybord
removed all localization files from supporting files
removed localization folders from the project
Re-added localization to main storyboard.
Checked the three languages I need.
Moved the localization files back to the project folder.
Clean build folder
Remove app from iOS simulator
Run the app.
It works again.
It still does not make any sense to my, as to how added one more localization can mess everything up so much.
Well, that and I will never rely on snapshots again. Until I get time capsule, manual backup is the way to go. I was a fool not to add version control from the beginning. Lessons learned.
cheers.
| d1f744b2311d10ea0273560d644e542864cf5a290fa1624cb0c514f75bbefc89 | ['d188afe8cbf64f26a22f8f20f5b5a6c0'] | I have created a small app with just three views. I have only selected LandscapeRight orientation. in the iOS simulator only the first view shows up in landscape. The other views are in portrait. I can rotate the simulator, but the storyboard layout rotates with it and does not display correct.
the info.plist file has only the (Landscapre Right) orientation item.
Kind regards
<PERSON> |
0dd67e5989b29e679914dc8abd3a069378d2848f977a13e33070ca55bf4a0236 | ['d194d4ef0d224052981581a70e5f9042'] | I'm trying to make a template for science exercises, the way our students have to solve them in secondary school, using the keywords "Given", "Asked" and "Solution" in the margin. I used Latex quite a lot some years ago, but forgot a lot since.
First of all, I'd like to find a way to automatically cycle through these three labels (every question needs to use each label only once). Is it possible to choose a string from a list or an array based on a counter, or something like that?
Second, I don't really dig the workflow I constructed below, needing to make environments in environments and so on. I would like to construct something like
\begin{question}{3}
Question Three in words
\given Something automatically in math mode
\asked Something automatically in math mode
\sol (No bullet when only a single step)
\step First step, math mode
\step First step, math mode
\end{question}
This is my code. As you can see, I only get the keyword "given:" so far
\documentclass[a4paper,12pt]{article}
\usepackage{enumitem}
\usepackage[marginparwidth=1in, reversemp]{geometry}
\newlist{exercise}{enumerate}{3}
\setlist[exercise]{wide = 0pt, listparindent=\parindent,labelsep = 0pt,leftmargin =\labelwidth}
\setlist[exercise, 1]{label =\llap{\textbf{Ex~\arabic*.}\hskip\marginparsep}}
\setlist[exercise, 2]{label = \itshape Given:, labelwidth = 3.5em, leftmargin =\labelwidth}
\setlist[exercise, 3]{label=$\bullet$,labelwidth = 1.333em, leftmargin =\labelwidth}
\let\cat\item
\let\step\item
\begin{document}
\begin{exercise}
\item Calculate the volume of a cylinder with a radius of 2m and a height of 3m.
\begin{exercise}
\cat $r = 2 \qquad h = 3$
\cat $V$
\cat
\begin{exercise}
\step $A = 2 \pi r = 2 \cdot \pi \cdot 2 \Rightarrow A = 12.57 m^2$
\step $V = A h = 12.57 \cdot 3 \Rightarrow V = 37.70 m^3$
\end{exercise}
\end{exercise}
\end{exercise}
\end{document}
| 7fad0d78e19bd428993075bfa3a8dc2db4820e58d87e89d82017acc2bf976e96 | ['d194d4ef0d224052981581a70e5f9042'] | I am conducting a survey that will identify and quantify the extent to which businesses in a certain industry reuse, recycle and dispose of their waste. I am trying to figure out how I would be able to express the confidence of my results where the responses would be weighted.
For example, let’s assume there are 20 businesses in a particular industry and I get survey responses from 5 businesses that account for 50% (Bus A), 5% (Bus B), 2% (Bus C), 2% (Bus D), and 1% (Bus E) of the total waste generated. I therefore have data from 25% of the population (5 out of 20 businesses) which accounts for 60% of the total waste generated.
Businesses A and B recycle their waste, Businesses C and D landfill their waste, and Business E disposes its waste.
I could simply scale to results to show that 92% of the waste is recycled ([50+5]/60), 7% is landfilled ([2+2]/60) and 1% reuses its waste (1/60).
However, given the low sample size I know there would be a wide confidence interval. How would I construct these confidence intervals with weighted proportions?
|
433e7312bb6ec74a56e72fe5ce2328178a419e5cbca4c6ddb82d20f775d6137c | ['d19d1155c9494ca78d4f0d6b9cb5e22c'] | The file access from "/data/data/..." is not reliable since I think it is not the same path for all the phones (Samsung devices namely are different AFAIK).
I prefer the following method which basically 'replicates' the old shared prefs and then clears it. This method does not remove the old shared prefs file itself but more relibale IMHO.
SharedPreferences settingsOld = context.getSharedPreferences(nameOld, Context.MODE_PRIVATE);
SharedPreferences settingsNew = context.getSharedPreferences(nameNew, Context.MODE_PRIVATE);
SharedPreferences.Editor editorNew = settingsNew.edit();
Map<String, ?> all = settingsOld.getAll();
for (Entry<String, ?> x : all.entrySet()) {
if (x.getValue().getClass().equals(Boolean.class)) editorNew.putBoolean(x.getKey(), (Boolean)x.getValue());
else if (x.getValue().getClass().equals(Float.class)) editorNew.putFloat(x.getKey(), (Float)x.getValue());
else if (x.getValue().getClass().equals(Integer.class)) editorNew.putInt(x.getKey(), (Integer)x.getValue());
else if (x.getValue().getClass().equals(Long.class)) editorNew.putLong(x.getKey(), (Long)x.getValue());
else if (x.getValue().getClass().equals(String.class)) editorNew.putString(x.getKey(), (String)x.getValue());
}
editorNew.commit();
SharedPreferences.Editor editorOld = settingsOld.edit();
editorOld.clear();
editorOld.commit();
| 9749ca0a19f86bde94773033c00a3f67a049ede6eb31bfdea08cb7ec131fc67c | ['d19d1155c9494ca78d4f0d6b9cb5e22c'] | I had the same issue and the best solution I have reached is two repeat the same data attributes but with slightly different pathPatthern to cover all cases.
In your case:
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.ext"/>
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.Ext"/>
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.eXt"/>
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.exT"/>
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.EXt"/>
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.eXT"/>
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.ExT"/>
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.EXT"/>
|
b699ee4321586d03e7c96dadeb8f23d2c54c9441afc938282a6289d1f17ebe31 | ['d1b138abd7214a20b2bf8e6c46aa4cf0'] | I'm querying an MS Access database and getting the following error:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
The relevant code:
private SimpleStringProperty getProduct(String bc) {
Connection conn;
String dbDriver;
Statement st;
ResultSet rs;
SimpleStringProperty prod = new SimpleStringProperty();
System.out.println("BC sent to db is: " + bc.toString());
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
dbDriver = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};"
+ "DBQ=Inventario.mdb;";
conn = DriverManager.getConnection(dbDriver, "", "");
st = conn.createStatement();
String getProduct = "SELECT * FROM Articulos "
+ "WHERE BarCode = " + bc; // .toString();
Where bc is a parameter obtained from a TextField box as a string, passed to this method as a string and the BarCode field in MS Access is of type Text.
As an aside, I am obviously working with a bar code, which is a number, but some of my bar codes have leading 0s, which is why I have it as text. Is there a way to work with bar codes of varying lengths and varying amounts of significant leading zeros as anything other than text/string? As you can see in my code, I even tried explicitly sending bc.toString() from JavaFX to MS Access, but I keep getting the data type mismatch error.
Final note: at various points I have placed System.out.println() to see what data is being passed, and at all points it appears correct. I have even taken out the criteria clause and just printed my result set, and all the proper data is coming back from Access.
| fe452e1e6394367fe709ad5927ee9f7dfceeab90a15e8a94b9820f00ac40c202 | ['d1b138abd7214a20b2bf8e6c46aa4cf0'] | Ok, I'm having trouble making a Menu with Menu Items.
I was following this tutorial ( http://docs.oracle.com/javafx/2/ui_controls/menu_controls.htm ), but when I run it I get a nullpointer error. My code looks like this:
@Override
public void initialize(URL fxmlFileLocation, ResourceBundle resources) {
ventas.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
FXMLLoader ventasloader;
ventasloader = new FXMLLoader(getClass().getResource("VentasGUI.fxml"));
Stage ventasstage = new Stage();
AnchorPane ventas = null;
try {
ventas = (AnchorPane) ventasloader.load();
} catch (IOException ex) {
Logger.getLogger(PuntoDeVentaController.class.getName()).log(Level.SEVERE, null, ex);
}
Scene ventasscene = new Scene(ventas);
ventasstage.setScene(ventasscene);
ventasstage.setTitle("Venta");
VentasGUIController controller = ventasloader.<VentasGUIController>getController();
controller.setUser(userID);
ventasstage.show();
}
...but even when I leave just the skeleton code that NetBeans automatically adds:
@Override
public void initialize(URL fxmlFileLocation, ResourceBundle resources) {
ventas.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
throw new UnsupportedOperationException("Not supported yet.");
}
...rather than get the "Not supported yet" I get the nullpointerexception. I looked at the docs on http://docs.oracle.com/javafx/2/api/javafx/scene/control/MenuItem.html but I don't see that my event handler is empty, and it seems to be exactly the same as in the tutorial.
Anyone know what I'm doing wrong?
Thanks!
|
3d09748ec3e86ecf3e01d74813d9d67d6907902f287adaf8c4c965cdabada254 | ['d1c29c32aaad4d4190817cda44cec85f'] | You can use the Python builtin function which name is any(). here is my code which will check if your list have any even number. You will get true value if there is any even number in your list otherwise it will return false.
list1 = [3,105,97,17,68241,5,3,8,]
print(any(num%2 == 0 for num in list1))
| 28efa05ba83ab36f185468fc697df3154b7673aba39657a03be2a670cee1a8ae | ['d1c29c32aaad4d4190817cda44cec85f'] | I want to scrape product information from this page . This product have three different size and price will be change if I select different size from drop-down section. Right now my scraper only can scrape default price after first time initially page load which is 35 for 1kg. How I will scrape price for 500g and 250g. here is my code:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
#argument for incognito Chrome
#argument for incognito Chrome
option = Options()
option.add_argument("--incognito")
browser = webdriver.Chrome(options=option)
browser.get("https://boutique.cafebarista.ca/products/cremone?variant=18033418797121")
product_title = browser.find_element_by_xpath('//h1[@class="product-name"]')
long_description = browser.find_element_by_xpath('//div[@class="product-landing-container"]')
price=browser.find_element_by_xpath('//div[@class="product-btn-price ProductPrice"]')
print(product_title.text,long_description.text,price.text)
browser.quit()
|
67a893b7c31d79b993d2a4c744c621109cb2d817fee5f504816a7520ce6551bd | ['d1d47cab98b744ceb7f2d7f4b8468da1'] | I need to do a boolean subtraction between two models in C#. One of the meshs will be entirely within the other mesh, so I was hoping to reverse the normals for the one model and add the two models together. I am at a loss on how to invert the normals though.
This is how I'm calculating a surface normal:
//creates surface normals
Vector3D CalculateSurfaceNormal(Point3D p1, Point3D p2, Point3D p3)
{
Vector3D v1 = new Vector3D(0, 0, 0); // Vector 1 (x,y,z) & Vector 2 (x,y,z)
Vector3D v2 = new Vector3D(0, 0, 0);
Vector3D normal = new Vector3D(0, 0, 0);
// Finds The Vector Between 2 Points By Subtracting
// The x,y,z Coordinates From One Point To Another.
// Calculate The Vector From Point 2 To Point 1
v1.X = p1.X - p2.X;
v1.Y = p1.Y - p2.Y;
v1.Z = p1.Z - p2.Z;
// Calculate The Vector From Point 3 To Point 2
v2.X = p2.X - p3.X;
v2.Y = p2.Y - p3.Y;
v2.Z = p2.Z - p3.Z;
// Compute The Cross Product To Give Us A Surface Normal
normal.X = v1.Y * v2.Z - v1.Z * v2.Y; // Cross Product For Y - Z
normal.Y = v1.Z * v2.X - v1.X * v2.Z; // Cross Product For X - Z
normal.Z = v1.X * v2.Y - v1.Y * v2.X; // Cross Product For X - Y
normal.Normalize();
return normal;
}
I was advised to reverse the normal by negating it:
n = CalculateSurfaceNormal(p1, p2, p3);
n = new Vector3D(-1 * n.X, -1 * n.Y, -1 * n.Z);
I find the values are negated, but when I view the model in a 3D program, there is no change in the model.
Another suggestion was to try backface culling by changing the order of the vectors. I tried this by swapping the order of v1 and v2:
//creates invertedsurface normals
Vector3D CalculateInvertedSurfaceNormal(Point3D p1, Point3D p2, Point3D p3)
{
Vector3D v1 = new Vector3D(0, 0, 0); // Vector 1 (x,y,z) & Vector 2 (x,y,z)
Vector3D v2 = new Vector3D(0, 0, 0);
Vector3D normal = new Vector3D(0, 0, 0);
// Finds The Vector Between 2 Points By Subtracting
// The x,y,z Coordinates From One Point To Another.
// Calculate The Vector From Point 2 To Point 1
v2.X = p1.X - p2.X;
v2.Y = p1.Y - p2.Y;
v2.Z = p1.Z - p2.Z;
// Calculate The Vector From Point 3 To Point 2
v1.X = p2.X - p3.X;
v1.Y = p2.Y - p3.Y;
v1.Z = p2.Z - p3.Z;
// Compute The Cross Product To Give Us A Surface Normal
normal.X = v1.Y * v2.Z - v1.Z * v2.Y; // Cross Product For Y - Z
normal.Y = v1.Z * v2.X - v1.X * v2.Z; // Cross Product For X - Z
normal.Z = v1.X * v2.Y - v1.Y * v2.X; // Cross Product For X - Y
normal.Normalize();
return normal;
}
No change in the model.
Here is the whole code:
private void SaveMoldMeshtoStlFile(MeshGeometry3D mesh, string filename)
{
if (mesh == null)
return;
if (File.Exists(filename))
{
File.SetAttributes(filename, FileAttributes.Normal);
File.Delete(filename);
}
Point3DCollection vertexes = mesh.Positions;
Int32Collection indexes = mesh.TriangleIndices;
Point3D p1, p2, p3;
Vector3D n;
string text;
using (TextWriter writer = new StreamWriter(filename))
{
writer.WriteLine("solid Bolus");
for (int v = 0; v < mesh.TriangleIndices.Count(); v += 3)
{
//gather the 3 points for the face and the normal
p1 = vertexes[indexes[v]];
p2 = vertexes[indexes[v + 1]];
p3 = vertexes[indexes[v + 2]];
n = CalculateInvertedSurfaceNormal(p1, p2, p3);
text = string.Format("facet normal {0} {1} {2}", n.X,n.Y, n.Z);
writer.WriteLine(text);
writer.WriteLine("outer loop");
text = String.Format("vertex {0} {1} {2}", p1.X, p1.Y, p1.Z);
writer.WriteLine(text);
text = String.Format("vertex {0} {1} {2}", p2.X, p2.Y, p2.Z);
writer.WriteLine(text);
text = String.Format("vertex {0} {1} {2}", p3.X, p3.Y, p3.Z);
writer.WriteLine(text);
writer.WriteLine("endloop");
writer.WriteLine("endfacet");
}
}
}
//creates inverted surface normals
Vector3D CalculateInvertedSurfaceNormal(Point3D p1, Point3D p2, Point3D p3)
{
Vector3D v1 = new Vector3D(0, 0, 0); // Vector 1 (x,y,z) & Vector 2 (x,y,z)
Vector3D v2 = new Vector3D(0, 0, 0);
Vector3D normal = new Vector3D(0, 0, 0);
// Finds The Vector Between 2 Points By Subtracting
// The x,y,z Coordinates From One Point To Another.
// Calculate The Vector From Point 2 To Point 1
v2.X = p1.X - p2.X;
v2.Y = p1.Y - p2.Y;
v2.Z = p1.Z - p2.Z;
// Calculate The Vector From Point 3 To Point 2
v1.X = p2.X - p3.X;
v1.Y = p2.Y - p3.Y;
v1.Z = p2.Z - p3.Z;
// Compute The Cross Product To Give Us A Surface Normal
normal.X = v1.Y * v2.Z - v1.Z * v2.Y; // Cross Product For Y - Z
normal.Y = v1.Z * v2.X - v1.X * v2.Z; // Cross Product For X - Z
normal.Z = v1.X * v2.Y - v1.Y * v2.X; // Cross Product For X - Y
normal.Normalize();
return normal;
}
Is there an error with my code? Am I missing something? I've tried out the exported models in a few different programs, and all are showing the exported model still has the normals facing outwards. I tried flipping the normals in Blender and found the other programs also showed the normals flipped, so I'm fairly sure it's a problem with my program.
| 8e3d52f7108071c6eb20b6356f0810b4c3a1cae6563ab3e48d92a21a31e4cee6 | ['d1d47cab98b744ceb7f2d7f4b8468da1'] | I have an issue where the following SQL command returns the column name, not the value in the column.
string sql = "SELECT @resource FROM db1.stuff WHERE (username = @userid)";
MySqlCommand cmd = new MySqlCommand(sql, command); //command was set earlier
cmd.Parameters.AddWithValue("@resource", "cash");
cmd.Parameters.AddWithValue("@userid", "testguy");
connection.Open();
var result = cmd.ExecuteScalar();
result returns "cash".
If I remove @resource and replace it with "cash", I get the desired value.
Am I doing something wrong? How do can I make this work with a Parameterized value?
|
2e6d1718b7934bd330dfbded03c937b7db4c6d6219047ba5349aafa28c06d7ff | ['d1d4951f48334a138de385e444c8c86b'] | It is a JavaScript rendered page
When you look at the raw HTML output from BeautifulSoup, it cannot find anything because that element does not yet exist on the page. There is some JavaScript which first needs to execute for that element to be there. You need to use a scraping solution that allows JavaScript execution such as Selenium Webdriver.
| e1bd4ef04e3fd3ebb8680fa960928fd10334f1f02bcaf431961c0c770a3fadc5 | ['d1d4951f48334a138de385e444c8c86b'] | You could use pathlib which is part of Python 3. No pip installation required as it is included.
from pathlib import Path
your_file = Path("C:/script/FOLDER/target.txt")
#get the parent directory with
print(your_file.parent)
For reference, "one folder up" is typically referred to as the "parent directory"
You would find a lot of search results on this using that terminology. The current file/directory is referred to as the child.
|
de685dcb24c9370a5c309160a22bf0a53ecf24c7759b861e0e3cd5ae0e4bc058 | ['d1d50636f26844c2a6aa4b0eaee73ccc'] | I have a table for detecting views of articles - it should have one unique row for each article_id&&NULL&&IP when noone is logged in and unique row for each article_id&&loggedInUser&&IP. So I thought that when noone is logged in I will just add a NULL instead of user_id. But MySQL suprised me - when I've added UNIQUE KEY like article_id&&user_id&&IP it worked fine for logged in users, but if no user logged in it started to add rows like (e.g.):
article_id | user_id | IP
5 NULL <IP_ADDRESS>
5 NULL <IP_ADDRESS>
5 NULL <IP_ADDRESS>
5 NULL <IP_ADDRESS>
This doesnt seem much unique - I know it is caused by NULL but how to solve this? Should I just rely on the fact that no user will have user_id "0"?
Thanks.
| 9b26e0abe1c00575333a3733f07a0d96c7b62574c88f9f309c84c84c7421b77f | ['d1d50636f26844c2a6aa4b0eaee73ccc'] | By default, the messages WILL show.
So especially if youre using wordpress and there is no javascript error - there is like 90% chance that your app is in conflict with some other app (plugin/theme), which could redefine the messages or completely clear them.
To fix this look for lines similar to this:
jQuery.validator.messages.required = "";
// or just:
jQuery.validator.messages = "";
Remember that $ = jQuery so it can also start with $ instead.
|
49637f5bf674bcd4869e9b5ee875f8c53c8a1a7e2f945ea0c512b100b3d68b34 | ['d1fa35e06c30430ea3fabed56cd87e0f'] | You had the printf in the else{printf} it should be outside:
int first, second, third;
printf("Please enter three numbers:\n");
scanf("%d %d %d", &first, &second, &third);
int min;
if (first<second && first<third) {
min = first;
} else if (second<first && second<third) {
min = second;
} else {
min = third;
}
printf("The minimum value is: %d\n", min);
}
| 09b1eae9fb6aeb3335126455fa2489e286a180783e5bc2cfd5b563fde70f8a22 | ['d1fa35e06c30430ea3fabed56cd87e0f'] | This method is if you want to use parent variable when returned.But I would use <PERSON>, it's a bit better.
class A:
def foo(self, num):
num1 = num + 3
return num1
class B(A):
def foo(self, num):
num1 = super().foo(num)
num2 = num1+3
print(num2)
G = B().foo(4)
|
1cfb5f77753709fe4a3d33d10209661cbc09a946cd38ce1f0181d8ae4107cbd3 | ['d209f335d4b7498aaab9403bfbc0bfa2'] | There is only one standard definition I've ever encountered that adequately covers all uses of these terms:
Alpha software is software which the originator has labeled "alpha".
Beta software is software which the originator has labeled "beta".
Gamma software is software which the originator has labeled "gamma". (Rarely used anymore.)
RC software is software which the originator has labeled "RC ".
No other "standard" definition comes close to this one in accuracy and applicability.
| 3b0eeb8b11f3671641a5b54b0f78b4f7bafc234ee7a4633b8a95088f27c6160a | ['d209f335d4b7498aaab9403bfbc0bfa2'] | Thanks! worked to clear the errors. There is a js function that passes the toQuery to the method. For this to work would I need to add the searchField to this as well?
example
function getRecords(toQuery, searchFields) {
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.SearchAllBusinessesControllerV3.getAccounts}',toQuery, SearchFields,
function(result, event) { |
b341e5f8b7721be09780c4be2fc617993fb38e96f91957c730c9349b54c92faf | ['d20b34019fdb40d5b579f35cbb350004'] | In XNA 4.0 3D. I want to Drag and Drop one model 3D.So,I must check mouse in a Model or not. My problem is I don't know change position and rate this Model from 3D to 2D. It's related Matrix View and Matrix Projection of camera??
This is my code:
http://www.mediafire.com/?3835txmw3amj7pe
| 3c3904524b95c0f02312c8189c2d16c130b7f11555f3aa44f88603c5fd0f4bde | ['d20b34019fdb40d5b579f35cbb350004'] | I have solution for you.First, you create paramaters:
MouseState nowMouseState, lastMouseState;
In LoadContent():
lastMouseState = Mouse.GetState();
Create one function :
public void ChangeState()//I check button have position:Vector2(0,0) and hight= width=100
{
nowMouseState= Mouse.GetState();//click
if (Mouse.GetState().X>0&&Mouse.GetState().X<100
&&Mouse.GetState().Y>0&&Mouse.GetState().Y<100
&&nowMouseState.LeftButton==ButtonState.Pressed
&&lastMouseState.LeftButton==ButtonState.Released)
{
if (Button_Tile)
Button_Tile=false;
else
Button_Tile= true;
lastMouseState = nowMouseState;//click
}
if (Mouse.GetState().LeftButton==ButtonState.Released)
{
lastMouseState = Mouse.GetState();
}
}
And then you can put ChangeState() in Update().
|
c7dd9bf8184be5599902a07910b5e94602758656070aa970eec898b30d1a2cc4 | ['d20ed6b350e44cb59220628ad3787db2'] | you are using "data.videolink+i" and javascript does not evaluate the value after the "." instead it is treated as the object's property. you need to use [] for evaluation. try this I hope this will work
if (doc.exists) {
for (var i = 1; i == videocount; i++) {
var data = doc.data();
var videolink = data[videolink+i];
//creating new paragraph
var p = '<p class ="trackvideostyle">'+"Your Video Link :
"+String(videolink)+'</p>\';
document.getElementById("btn").insertAdjacentHTML('beforebegin',
p);
}
| 815c72d68d0fc015d48d7d66dd869c5136f4a7f7e6f8072505afbfdfc148aa75 | ['d20ed6b350e44cb59220628ad3787db2'] | I'm making an order APP where orders will be shown on the dashboard, but my one function is not getting called in react code. The oneDayOrder() is not getting called at any time, it is supposed to be called in fetchOrderDetails(). If anyone knows the logic behind this or how could I fix this issue, please help. Thanks in advance.
Code
const useStyles = makeStyles((theme) => ({
grid: {
width : '100%',
margin : '10px',
},
paper: {
padding : theme.spacing(2),
textAlign : 'center',
color : 'blue',
background: 'pink',
},
}));
//this function is not getting called
const oneDayOrder = (day, month, year, orders) => {
for(let x in orders) {
const orderDate = orders[x].date.split('-');
console.log(orderDate);
}
}
const fetchOrderDetails = ( orders ) => {
const date = new Date();
const month = date.getMonth();
const year = date.getFullYear();
const day = date.getDate();
const todayOrder = oneDayOrder(day, month, year, orders);
}
const Tile = ( Props ) => {
const classes = useStyles();
const orderDetails = fetchOrderDetails( Props.orders );
console.log('ssdcd')
return (
<Container maxWidth="lg">
<Grid container className={classes.grid} spacing={2}>
<Grid item xs={3}>
<Paper className = {classes.paper} > Order 1 </Paper>
</Grid>
<Grid item xs={3}>
<Paper className = {classes.paper} > Order 2 </Paper>
</Grid>
<Grid item xs={3}>
<Paper className = {classes.paper} > Order 3 </Paper>
</Grid>
<Grid item xs={3}>
<Paper className = {classes.paper} > Order 4</Paper>
</Grid>
</Grid>
</Container>
)
}
export default Tile;
|
e19abe6c02de16bde590f520e26faacf233825f5444dc98b24be909e8f6d0442 | ['d226a85b2a454866880e1887f6d4aa57'] | I'm teaching my first class this semester, and was quite happy with Gradescope when I used it as a TA last semester. Does anyone have experience using Gradescope with large (100+ student) classes for evaluating exams?
Is it worth having a teaching assistant help me scan the quizzes?
Is there anyway to structure my quiz to streamline the scanning process?
| 3768cfa3be7cdd05917e79ae350b8223e7b1ff8763727de9e15d0b56d916affc | ['d226a85b2a454866880e1887f6d4aa57'] | This is a fascinating bioinformatics dynamic programming that I am solving. I am not looking for an answer to the problem, but rather any algorithms, research papers, or other pointers that could be helpful.
SETUP
You are working in a lab as a microbiologist and would like to formulate an algorithm to interleave two DNA sequences m and n to form a larger DNA sequence k.
m and n are comprised of the elements a, b, and c.
For example:
m = [a, b, c, c, a]
n = [b, a, c, c, a]
The italic elements represent members of m, and bold elements represent members of n.
THE PROBLEM
As stated above, we would like to use dynamic programming to interleave the elements of m and n to form a larger sequence k. Some examples of k could be:
k = [a, b, a, c, b, c, a, c, c, a]
or
k = [b, a, c, c, a, a, b, c, c, a]
Note that the elements of m must appear in k in the same order that they appeared in m, the same applies to the elements of n.
FURTHER COMPLICATIONS
A collision occurs if >= 2 elements of the same type are contiguous in k. Three examples are if k contains the sub-array [a, a] or [b, b, b] or [c, c].
If there is a collision of a's a penalty of u is applied for every consecutive a.
If there is a collision of b's a penalty of o is applied for every consecutive b.
If there is a collisions of c's a penalty of p is applied for every consecutive c.
For example:
A subarray of [a, a, a] in k will incur a penalty of u*3.
A subarray of [b, b] in k will incur a penalty of o*2.
A subarray of [c, c, c, c] in k will incur a penalty of p*4.
OUR TASK
We would like to use dynamic programming to interleave m and n to form k such that the total collision penalty is minimised.
EXTENSION
Complete the task with minimal space and time complexity.
|
70e359bb40b0e1a7e0f38db35f49a903fa1fda896d2fcabad953cc7fcf5adfeb | ['d235a030665c43de94ff7713ec829000'] | Try this:
Open the bash terminal
cd ~
vi .bashrc
press i to go edit mode and update it with you alias command.
press Esc and press :wq(save and exit)
now close and reopen the bash terminal
check the alias command.
if this didn't work create the .bash_profile in the same way and add the line
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
| 338b30a3e8ce0d201b909a9a8bdf6b212490fc4ffadbba8956c1aeb7914e50f3 | ['d235a030665c43de94ff7713ec829000'] | Use readlines()
i = 0;
lines = f.readlines()
while 1:
line = lines[i]
if not line:
break
if "Maximum Velocity Error:" in line:
velerror.append(float(line[32:40]))
if "Grid Dimensions, Mesh" in line:
mesh.append(int(line[27]))
if "Time Step " in line:
timestep.append(int(line[17:27].strip()))
if "Total time:" in line:
totaltime.append(float(line[47:57].strip()))
i = i + 8
i++
|
55ac04690c480c903c8b6f4dc2368d90378ecce8f473b32cc816a7ca891ebdab | ['d24759e7e6664e19a3f5162b54a62df0'] | I had the same issue using node.js and phantom in a windows machine, what I found that you need some special treatment on the windows enviroment. the npm document is here.
var phantom = require('phantom');
phantom.create(function(ph) {
return ph.createPage(function(page) {
return page.open("http://www.google.com", function(status) {
console.log("opened google? ", status);
return page.evaluate((function() {
return document.title;
}), function(result) {
console.log('Page title is ' + result);
return ph.exit();
});
});
});
}, {
dnodeOpts: {weak: false}
});
notice phantom.create(function, options, callback), and here options uses dnodeOpts: {weak: false}
| 31eafb8501a7e0a95f2816a727f8d33ceeea5c2e142c5f9204014ba8cbac0d78 | ['d24759e7e6664e19a3f5162b54a62df0'] | After read Coder_Dan's comment and MSDN article "http://msdn.microsoft.com/en-us/library/bb775947(v=vs.85).aspx#related_topics" about the button types, I finally sort it out.
BS_GROUPBOX is just an "eye candy" and it did no contribute to the group of the radio box!! The critical parameter to control the grouping is the "WS_GROUP"
How to group the radio box: Put the WS_GROUP in the first radio button's style. It will group the current radio button until it see the second WS_GROUP as mentioned by Coder_Dan.
Modification on my previous code
a. use hWnd as parent for all 4 radio buttons
b. Put WS_GROUP in the first and third button style so that we group the 1,2 and 3,4 radio buttons
c. Now you can go to the WM_COMMAND, and listen to the messages from the 4 buttons according to their IDs under the main window's handle hWnd
case WM_CREATE:
{
/*Group for Radio button for preview/single or batch operation */
hGrpButtons=CreateWindowEx(WS_EX_WINDOWEDGE,
L"BUTTON",
L"Select Process Mode:",
WS_VISIBLE | WS_CHILD|BS_GROUPBOX,// <----BS_GROUPBOX does nothing on the grouping
10,280,
350,100,
hWnd,
(HMENU)IDC_GRPBUTTONS,
hInst, NULL);
CreateWindowEx(WS_EX_WINDOWEDGE,
L"BUTTON",
L"first radio button",
WS_VISIBLE | WS_CHILD|BS_AUTORADIOBUTTON|WS_GROUP, // <---- WS_GROUP group the following radio buttons 1st,2nd button
10,520,
300,20,
hWnd, //<----- Use main window handle
(HMENU)IDC_CHK1,
hInst, NULL);
CreateWindowEx(WS_EX_WINDOWEDGE,
L"BUTTON",
L"second radio button",
WS_VISIBLE | WS_CHILD|BS_AUTORADIOBUTTON, // Styles
10,545,
300,20,
hWnd,
(HMENU)IDC_CHK2,
hInst, NULL);
CreateWindowEx(WS_EX_WINDOWEDGE,
L"BUTTON",
L"third radio button",
WS_VISIBLE | WS_CHILD|BS_AUTOCHECKBOX|WS_GROUP, //<---Start second group for 3rd,4th button
10,570,
300,20,
hWnd,
(HMENU)IDC_CHK3,
hInst, NULL);
CreateWindowEx(WS_EX_WINDOWEDGE,
L"BUTTON",
L"forth radio button",
WS_VISIBLE | WS_CHILD|BS_AUTORADIOBUTTON, // Styles
500,545,
300,20,
hWnd,
(HMENU)IDC_CHK4,
hInst, NULL);
|
d7def106d8e175848620cc350defe1b99c8ef24ffcb6066c1a93beba76a26cb7 | ['d24a938339064ab8ad612e68085cde1b'] | My main problem was, that I didn't set the encoding in VS in the beginning. So, I make new project and set the codepage to 1251. This is my code:
#include<iostream>
#include<string.h>
#include<map>
#include<windows.h>
#include<locale>
using namespace std;
bool CheckLetters(wchar_t letter)
{
bool isCyrillic = 65472 <= letter && letter <= 65535;
if ((letter >= 'a' && letter <= 'z')
|| (letter >= 'A' && letter <= 'Z')
|| isCyrillic)
{
return true;
}
return false;
}
int main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
wstring input;
map<wchar_t, int> letters;
getline(wcin, input);
for (int i = 0; i < input.size(); i++)
{
char currentLetter = input[i];
if (CheckLetters(currentLetter))
{
map<wchar_t, int><IP_ADDRESS>iterator elementIter = letters.find(currentLetter);
if (elementIter == letters.end())
{
letters[currentLetter] = 1;
}
else
{
letters[currentLetter] ++;
}
}
}
for (map<wchar_t, int><IP_ADDRESS>iterator current = letters.begin();
current != letters.end(); current++)
{
pair<wchar_t, int> currentElement = *current;
cout << (char)(currentElement.first) << " = " << currentElement.second << endl;
}
return 0;
}
Thanks to all that gives me advice.
| 4be32d65e2819d095936da438a712bd0bb3937b5af65c8866f28c4d17748e8b2 | ['d24a938339064ab8ad612e68085cde1b'] | I'm trying to read cyrillic( "Иванчо говори само глупости") from the console, but everything I get is "????". For the first time i write on C++ and I will be very greatful if someone help me to solve this problem.
This is my code
#include<iostream>
#include<string>
#include<map>
#include<Windows.h>
#include<clocale>
using namespace std;
bool CheckLetters(int letter)
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
bool isCyrillic = ('\u0410' <= letter && letter <= '\u044f');
if ((letter >= 'a' && letter <= 'z')
|| (letter >= 'A' && letter <= 'Z')
|| isCyrillic)
{
return true;
}
return false;
}
int main()
{
string input;
map<unsigned char, int> letters;
getline(cin, input);
for (int i = 0; i < input.size(); i++)
{
unsigned char currentLetter = input[i];
if (CheckLetters(currentLetter))
{
map<unsigned char, int><IP_ADDRESS>iterator elementIter = letters.find(currentLetter);
if (elementIter == letters.end())
{
letters[currentLetter] = 1;
}
else
{
letters[currentLetter] ++;
}
}
}
for (map<unsigned char, int><IP_ADDRESS>iterator current = letters.begin();
current != letters.end(); current++)
{
pair<unsigned char, int> currentElement = *current;
cout << currentElement.first << " " << currentElement.second <<endl;
}
return 0;
}
|
b0b196ef6d307be4862925795da994153183bce14a4e4313d6c3896782d905a3 | ['d25233309a5042f990c3023ac25ab14c'] | This is very interesting. I am not 100% sure of my answer but just throwing it out here.
It depends what the noun of the sentence is or more specifically what they first of are.
Are they before anything Users or Bots?
In my opinion, bots are users too and users are people so by extension; bots are people too and for people the correct pronoun would be "Who".
So personally, I would use who. But with that said, which can work as well if you analyse it differently.
| ce0cfca1c2c8866829d8d40702016d77933c78ebe8da288ead0f8f447a0cf253 | ['d25233309a5042f990c3023ac25ab14c'] | What is the history behind the word "free" that made it necessary for the clarification "free as in free speech, not free beer"?
In the context such as "free press", it means libre from censorship, "gluten-free" means libre from gluten and so on.
Then there is "free stuff", why is the same word used? Does it imply libre from cost or was this meaning given in another way?
|
59765a75077b914787b02f95c2d11284958c05449ef4461d0358720d23312f2f | ['d254a705efed43348bf808ce344ad5f3'] | I am trying to dynamically add state to an array from my form in such a way that multiple inputs can eventually be saved as state in the same array, much like the redux form but I don't know Redux yet.
I don't know how to access the current array I am in so I can set the current input value as state. In this case, I am trying to save the name of the ingredient inside the ingredient array within the recipe state by mapping over the current array. Problem is when I try to map over the current array it apparently isn't an array at all and I get the following error when I try to enter data into the input..
TypeError: currentIngredients.map is not a function
(anonymous function)
src/components/recipes/Recipe_Form.js:68
65 | <input
66 | onChange={e => {
67 | const name = e.target.value;
> 68 | setRecipe((currentIngredients) =>
| ^ 69 | currentIngredients.map(x =>
70 | x.id === i.id
71 | ? {
. I am unsure how to access the ingredient array in such a way that I can edit state.
thanks
export const Recipe_Form = () => {
const recipeContext = useContext(RecipeContext);
const [recipe, setRecipe] = useState({
title: "",
img: "",
ingredients: [{ id: "1", name: "cheese", amount: "200" }],
method: "",
serves: "",
time: "",
});
const onChange = (e) =>
setRecipe({ ...recipe, [e.target.name]: e.target.value });
const onSubmit = (e) => {
e.preventDefault();
recipeContext.addRecipe(recipe);
setRecipe({
title: "",
img: "",
ingredients: [],
method: "",
serves: "",
time: "",
});
};
const { title, img, ingredients, method, serves, time } = recipe;
return (
<div className='row center-align'>
<form className='col s12' onSubmit={onSubmit}>
{/* Image */}
<div className='input-field col s12 center-align'>
<input
type='text'
placeholder='Please enter an image url'
name='img'
value={img}
onChange={onChange}
/>
</div>
{/* Title */}
<div className='input-field col s12 center-align'>
<input
type='text'
placeholder='Please enter recipe title'
className='validate'
name='title'
value={title}
onChange={onChange}
/>
</div>
{ingredients.map((i) => {
return (
<div key={i.id}>
<input
onChange={(e) => {
const name = e.target.value;
setRecipe((currentIngredients) =>
currentIngredients.map((x) =>
x.id === i.id
? {
...x,
name,
}
: x
)
);
// e.target.value
}}
value={i.name}
placeholder='ingredient'
/>
<input value={i.amount} placeholder='amount' />
</div>
);
})}
{/* Method */}
<div className='methodContainer'>
<div className='row method-line'>
<div className='input-field col s12 center-align'>
<input
type='text'
placeholder='Please enter method'
className='validate'
name='method'
value={method}
onChange={onChange}
/>
</div>
</div>
</div>
<a className='btn-floating btn-large waves-effect waves-light red'>
<i className='fas fa-plus'></i>
</a>
{/* Serves */}
<div className='input-field col s12 center-align'>
<input
type='number'
placeholder='Number of servings'
className='validate'
name='serves'
value={serves}
onChange={onChange}
/>
</div>
{/* Time */}
<div className='input-field col s12 center-align'>
<input
type='text'
placeholder='Time to compelete...'
className='validate'
name='time'
value={time}
onChange={onChange}
/>
</div>
<br></br>
<button
className='btn waves-effect waves-light'
type='submit'
name='action'>
Submit
</button>
</form>
</div>
);
};
export default Recipe_Form;
| de75cfdcf065b9ffac8f07552f3f5c6aebb2d1b8671f1d0ae29b1f04ed50167c | ['d254a705efed43348bf808ce344ad5f3'] | I'm trying to make a game which is based on a sampler. The aim of the game is to copy a sequence generated using random numbers. I have an array which has the randomly generated numbers and using .each() i'm trying to get each value to play a sample which is working but playing all the samples at the same time. I've got the samples to each play for one second each but what i need is one sample to be playing every second, sequentially.
Here is what i have so far:
$('#play').on("click", function(){
startGame();
message("Player 1 will start. You have 3 lives remaining. Input the correct sequence so you dont get booed off stage...Everyone is watching");
$.each(generatedArray, function(index, value){
var audio = new Audio("Sounds/" + value + ".wav");
audio.play(audio.duration * 1000);
});
Thank you
|
d113750bb26751b8ac393ed3c6d4fc474e3a5b7d8f9274e8624653e1a6088948 | ['d257de075718416faa5927c9c24cc25f'] | I am making a GUI for a board game. My game logic counts the pieces of both the black and white colors and returns the amount. In the GUI I use 2 pairs of labels to display the info.
self._white_score_label = tkinter.Label(
master = self._info_frame, text = 'White:', font = default_font)
self._white_score_label.grid(
row = 0, column = 0, padx = 0, pady = 10,
sticky = tkinter.E)
self._white_score_num = tkinter.Label(
master = self._info_frame, text = str(self._white_count), font = default_font)
self._white_score_num.grid(
row = 0, column = 1, padx = 0, pady = 10, sticky = tkinter.W)
self._black_score_label = tkinter.Label(
master = self._info_frame, text = 'Black:', font = default_font)
self._black_score_label.grid(
row = 1, column = 0, padx = 0, pady = 10, sticky = tkinter.E)
self._black_score_num = tkinter.Label(
master = self._info_frame, text = str(self._black_count), font = default_font)
self._black_score_num.grid(
row = 1, column = 1, padx = 0, pady = 10, sticky = tkinter.W)
The problem is when one count has a two-digit string and the other one-digit string then the one-digit string gets a random number added to it. HERE is a screenshot. The shell shows that the count functions are correct, showing a 9 and 16. However the label is wrong.
| 0a39b69ca32d5e59f82b98c16649b59fbd23d1c2db4402c6490b9d56b28ebd5b | ['d257de075718416faa5927c9c24cc25f'] | def f(iterable):
i = iter(iterable)
int_list = []
n2 = next(i)
while True:
n1, n2, n3 = n2, next(i), next(i)
print('n1', n1)
print('n2,', n2)
print('n3', n3)
if n2 > n1 and n2> n3:
int_list.append(n2)
return int_list
In this case, the iterable is a list. I want to check if the integer is bigger than both the previous integer and next integer. However I can't figure out how to assign the proper values to check using the next() method
|
d2781722d3110ee4ddf6d541fac283113a246a6325293a4f79158f5b2fc31c2e | ['d26f0e7a162543a7ae963cbbe9884626'] | Tried using wubi which creates a virtual install (I read up on it) but doesn't work. I **DO** get a menu with Windows 7 first and UBUNTU second, but when I click on UBUNTU it executes about 3 commands so fast I can't read the screen then comes up with the GRUB> prompt and sits there. The windows selection boots windows just fine. I tried uninstall and re-install several times with exactly the same result. I also tried to get a verbose run of the grub but no luck there either. (boo hoo). | 5677e41aa8c7f7bd2a93b7853f5a8dafaddd051db2d193a0d76a525bc3aebc1e | ['d26f0e7a162543a7ae963cbbe9884626'] | Set A is finite with n elements. Suppose a and b are elements of a set A with a != b. Let R be a relation on the set A so that there is a path from a to b of length at least 1. Show there is a path from a to b of length not exceeding n − 1.
I understand the proof for when a does equal b. And though I understand conceptually how this proof works, I am unable to put it in words.
|
880bbd74b3d0f80435c8f74601d2834202b9febc375272423f1ba0a4f1200086 | ['d27dc0151e864385ac6e0f7c43f62b1d'] | I have implemented a customer interface using java (multithreaded). On the client side customer logs in when the server is already running. Multiple clients can login creating a thread for each client. What I want to achieve is when multiple clients are logged in I want to enter a command in server console(eclipse) that lists all the clients logged in after i input something on console.
ClientSide of the code:
btnLogin.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
Connection conn = null;
try // try block
{
// declare variables
String username = "";
String pwd = "";
// get values using getText() method
username = loginEmail.getText().trim();
pwd = new String(loginPassword.getPassword());
// check condition it field equals to blank throw error
// message
if (username.equals("") || pwd.equals("")) {
JOptionPane.showMessageDialog(null, " name or password or Role is wrong", "Error",
JOptionPane.ERROR_MESSAGE);
} else // else insert query is run properly
{
String IQuery = "select accountnumber, customername, address from `customeraccount` where emailaddress=? and password=?";
String accnum = null;
System.out.println("Connecting to a selected database...");
// STEP 3: Open a connection
conn = DriverManager.getConnection(DB_URL, user_name, password);
System.out.println("Connected database successfully...");
PreparedStatement stmt = conn.prepareStatement(IQuery);
stmt.setString(1, username);
stmt.setString(2, pwd);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
detailName.setText(rs.getString("customername"));
detailAddress.setText(rs.getString("address"));
accnum = rs.getString("accountnumber");
}
out.println(accnum);
out.println(detailName.getText());
rs.close();
((java.sql.Connection) conn).close();
}
} catch (SQLException se) {
// handle errors for JDBC
se.printStackTrace();
} catch (Exception a) // catch block
{
a.printStackTrace();
}
}
});
Server Side of the code:
public class StoreServer {
static ArrayList<String[]> list2 = new ArrayList<String[]>();
public static void main(String[] args) throws IOException {
System.out.println("The server is running.");
int clientNumber = 0;
ServerSocket listener = new ServerSocket(3355);
try {
while (true) {
new Thread(new Customer(listener.accept(), clientNumber++)).start();
}
} finally {
listener.close();
}
}
private static class Customer implements Runnable {
private Socket socket;
private int clientNumber;
public Customer(Socket socket, int clientNumber) {
this.socket = socket;
this.clientNumber = clientNumber;
// log("New connection with client# " + clientNumber + " at " +
// socket);
}
/**
* Services this thread's client by first sending the client a welcome
* message then repeatedly reading strings and sending back the
* capitalized version of the string.
*/
public void run() {
try {
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
while (true) {
System.out.println("Account Number: " + acnum + " Name: " + name);
if (acnum == null || acnum.equals(".")) {
break;
}
// out.println(input.toUpperCase());
}
} catch (IOException e) {
log("Error handling client# " + clientNumber + ": " + e);
} finally {
try {
socket.close();
} catch (IOException e) {
log("Couldn't close a socket, what's going on?");
}
// log("Connection with client# " + clientNumber + " closed");
}
}}}
| 71e4c0a75247dc0cddc650da292f2fad6d2faf292c796211a3aaf842f6b62efb | ['d27dc0151e864385ac6e0f7c43f62b1d'] | I have this google pie chart in my mvc application wherein i need to move on to next action on another controller on click of google pie chart section.Here is my pie chhart and eventhandler function
<script>
function drawCharts() {
// Create the data table.
var dataP = google.visualization.arrayToDataTable([
['Risk Level', 'Number Of Patients'],
['Low', @Model.RiskLevel[0]],
['High', @Model.RiskLevel[1]],
['Medium', @Model.RiskLevel[2]]
]);
var optionsP = {
is3D: true,
colors: ['#109618', '#DC3912', '#FF9900'],
title: 'Risk Level'
};
var chartP = new google.visualization.PieChart(document.getElementById('piechart_3d'));
google.visualization.events.addListener(chartP, 'select', selectHandler);
chartP.draw(dataP, optionsP);
function selectHandler() {
var selectedItem = chartP.getSelection()[0];
if (selectedItem) {
var topping = dataP.getValue(selectedItem.row, 0);
if (topping == "High") {
//go to action?
}
}
}
</script>
can anybody help me with this?
|
7c6470192580742ec8401cb870abb9377ef4fb4b0f17c4016062b819195fa083 | ['d295deeca76c4f5fba542d6c2f79bbb6'] | So I've added the the BootStarterReceiver receiver in the manifest,
I've added the OnBootCompletedListener implementation in the module file.
(is this the correct practice btw? in the module class)
Now how do I start the application?
what do I implement in the OnBootCompleted method?
There's the
cyborg.startActivity()
but I don't know how to use the Intent here as I don't have any activities, only controllers.
| b48ff5291777697e07fcd694c801a9031669776c4def2e0801c2344be8080dd5 | ['d295deeca76c4f5fba542d6c2f79bbb6'] | The remount didn't work for me (it requires Disabling SIP, which I didn't want to do)
So instead I moved the mongo folder.
You should have the old folder under the 'Relocated items' folder on your desktop
so just copy it wherever you want (I moved it to my user folder)
and then in the terminal go
mongod --dbpath /users/<username>/data/db/
hope this helps
|
a313ab43507ccc0ae14ee09a57004f3c9bae59b660fb061bd869a09c649fe809 | ['d29a129ccb9044dfaf5eb57476b14563'] | Somebody help me, I'm spending much time trying to create any netbeans project such as java library, when i change the target path to outside from workspace i can create, if the target is workspace show the message project folder cannot be created. I tried to change the permissions workspace with chmod 777 but not work, operation system Ubuntu 14.04 and netbeans 8.0 follow the image, thank you!
[netbeans error]http://i62.tinypic.com/20thr7l.png
| 06651aa49ead3263e76c5b86f70e95794ed25c5b56d8d3b0bec6256c1d6fe7d3 | ['d29a129ccb9044dfaf5eb57476b14563'] | this is my scenario, i have a Excel VSTO Document-Level customization which i need to install two different versions in one box(QA version and Development version), i am using ClickOnce strategy to achieve this scenario and it works fine i am deploying the application to development file share, and after that i change the assembly name and product name just adding the word QA, and i deploy the application again, into QA server. So the user is able to install both application but seems they are conflicting when the customization opens it only able to get the settings from only one of the environments, depends on which of those was installed latest, such a weird behavior, even if i open for example the development customization it is pointing to QA file share server, has anyone faced the same? Or had accomplished this scenario in a other way
|
73c8474ae1eba82d2cfa5383f1fa471669f9aa145c76a25ca0673692e2af10d1 | ['d2a0b63884f4437796efd75817158ca3'] | I am defining a context manager class and I would like to be able to skip the block of code without raising an exception if certain conditions are met during instantiation. For example,
class My_Context(object):
def __init__(self,mode=0):
"""
if mode = 0, proceed as normal
if mode = 1, do not execute block
"""
self.mode=mode
def __enter__(self):
if self.mode==1:
print 'Exiting...'
CODE TO EXIT PREMATURELY
def __exit__(self, type, value, traceback):
print 'Exiting...'
with My_Context(mode=1):
print 'Executing block of codes...'
| 6e65751f6fb6fc9f49f5bd573023c5502e4403c5d0db3597b15a38c950c4ff90 | ['d2a0b63884f4437796efd75817158ca3'] | I am starting a website, thus I'm learning how to program in html/css/php. For other languages I have learnt so far, there has always been an IDE or interactive console that I can type in codes directly to see how they works, access variable types etc., which makes learning and debugging a breeze. (E.g. bash, python, matlab, perl, tcl...)
Can I do the same for html and php? In the spirit stackoverflow's questions style, lemme try to make the questions a little more specific.
I know I can use php interactively on a terminal.
But that is insufficient if I want to see how it works in a html script.
Is there a browser/IDE with a console where I can input commands interactively and see the results?
|
78b74329953088daf42264d7747386fed672cac0d39777ef6b6fd85aa8a20524 | ['d2b932fb84ab4738944890926c99dd3e'] | I am trying to follow through with the answer to a problem (I have no internet on Ubuntu right now), but it is asking me to do USB tethering. I tried USB tethering with my Android phone, but it isn't working (it doesn't show up in ifconfig -a).
Here is a link to the answer: https://unix.stackexchange.com/a/423250
What does one do in this situation?
It is a catch 22... I need internet in order to have internet...
I already looked around for help on USB tethering with Android, but nothing is working.
Is this the end of the road? Do I have to go back to Windows?
Also: I recently upgraded from Ubuntu 18 to 20.
Thanks in advance.
| 9582e60fec3a3e9f9cd371bafcfeb1cd594642a8daf819a65aaaa3fca154d9e2 | ['d2b932fb84ab4738944890926c99dd3e'] | I just had the same problem, a completely blank page with no source output except for IE which was displaying a bare bones document outline. I also have TinyMCE installed and I'm using the Smarty template engine.
I was using the Smarty filter escape:'htmlall', which was converting the TinyMCE enabled textarea submitted content prior to display. As soon as I swapped in a direct PHP call to htmlspecialchars the problem cleared.
I'm guessing the TinyMCE parser fell into a non-terminating recursive loop and the browser bailed out. Even if you aren't using Smarty it might be worth letting unfiltered data through to TinyMCE (in a non-production environment of course!) to see if that helps. If so you can then step up the filtering a little at a time to find out what you can get away with before TinyMCE has a problem.
|
683430c053357a1983344e9b81911da2061285a7877e823f6543a3863b416400 | ['d2bfc0b23b26499e845ff6ee2890917c'] | Seems you want to run some task in a loop in an asynchronous way. You can use 'async' module for this. Otherwise, if you don't want to use any modules, you should be using callbacks for your purpose.
var arr = [...]
function A(i) {
if( i < arr.length ) {
some_process( arr[i], function(err) {
if( err ) {
console.log('error: '+err)
}
else {
A(i+1)
}
})
}
}
A(0)
You can also use 'setInterval' for setting up a time interval between the processes. You can even use 'sleep' npm module for setting up time intervals between processes. Hope this works for you :)
| 01ada0dfea7513e34c1ad51af5a1bfcac9c81b3974d08ae753a4497737a8c343 | ['d2bfc0b23b26499e845ff6ee2890917c'] | First of all you should know that you should be running the command in the same directory where the file is. In cygwin, first you will have to locate to the folder in which the file is present, then you can run these make commands. Better since you are using Windows. You should better use any other windows based client for C. But if I were at your place. I would have installed a virtual Linux environment on my local windows computer and would have worked on that. You should try that once. Linux Terminal gives a lot of power to the developer. There are a lot of things which you can do on a terminal which is not supported by cygwin. For compiling C programs on Cygwin, I believe you should check if it supports compiler commands or not. :)
|
c91587c4f4e7265c568fe1788e467607c1629371b277adaa9472aadf6b5318b6 | ['d2c665028c554e988b1eea48d36a9a2e'] | If you want to check if a view doesn't not exist in the hierarchy, please use below assertion.
ViewInteraction.check(doesNotExist());
If you want to check if a view exist in the hierarchy but not displayed to the user, please use below assertion.
ViewInteraction.check(matches(not(isDisplayed())));
Hope this helps.
| f706f32c866e2dc3826280d8f8e1d5d799666c120b46be8e72849cdf33aa1aa8 | ['d2c665028c554e988b1eea48d36a9a2e'] | Found this solution when browsing through internet, hope this helps
Navigate to C:\Program Files\Mozilla Firefox\defaults\pref
Create a file local-settings.js
Add below code to the .js file
pref("general.config.filename", "mozilla.cfg");
pref("general.config.obscure_value", 0);
Now create mozilla.cfg in **C:\Program Files\Mozilla Firefox"
Add below code to .cfg file
//
pref("security.sandbox.content.level", 5);
(Don't forget the // at the beginning of the file )
Rerun the <PERSON> build
Source: https://forum.katalon.com/discussion/4208/jenkins-new-katalon-studio-5-1-0-2-firefox-wont-work
|
6881c9105b58fc92066a4b6ab71fe9314e1ffde55d9646445dd80c6eb63c091b | ['d2cdc1d7f4ea4915b104707d55c04f13'] | The { [...]: ... } syntax in Flow does not mean the same thing as it does in ES6. { [k]: K, [v]: V } does not mean that the object must have a key k of type K and a key v of type V. Instead, the syntax is used to denote an indexer property in Flow. Thus, { [k]: K, [v]: V } is invalid since you may only specify a single indexer property. However, lets say we only had { [k]: K }. This still wouldn't work as intended because this would represent the type "an object with keys of type k that map to values of type K."
Unfortunately, I don't think Flow currently supports what you are trying to do. I believe this type would fall under dependent types, which is not supported by Flow at the moment, since the type of the array depends on the values of k and v.
| 17017e580f56318e9ab7a8ba0b812ad471a2b2a145a26171a8c66f0a21380642 | ['d2cdc1d7f4ea4915b104707d55c04f13'] | This should be a comment but I'm not able to yet. Anyways, it looks like your example repo is using an older version of Flow. As of version 0.89.0, Flow's support for higher order components (HOCs) has increased tremendously. If you are still facing this issue, or something similar, I would recommend that you upgrade to 0.89.0, use react-redux's flow typings, and investigate again.
|
cb8f65fe22bd6fa6891c32e92acd859d175481152612510d262b847d0c0344a6 | ['d2d5fe6d145a48eabc1c7e6b648e4e95'] | I created an amazon ec2 t2micro instance and installed on it Wordpress Multi Site (Bitnami) from the aws marketplace. After the installation I couldn't add a site to the network.
I decided to change the mode to sub_folder instead of sub_domain, so I connected through ssh to edit the wp-config file.
I changed define('SUBDOMAIN_INSTALL', true); to define('SUBDOMAIN_INSTALL', false);
After this editing nothing changed so I decided to look for the .htaccess file. I edited the htaccess this way
`RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]`
Now I'm trying again to add a site to the network but after the creation of the new site I can't see the dashboard.
What should I do?
| f7b0bb3f7807820919fd6285b1753075e52340c2f5a27c6ab31289bf80d82962 | ['d2d5fe6d145a48eabc1c7e6b648e4e95'] | After changing the access_key and deleting the last space of the string; To solve the error about keypair:
I added the user to a group in Amazon AWS IAM and added the policy found on the Packer documentation:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action" : [
"ec2:AttachVolume",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:CopyImage",
"ec2:CreateImage",
"ec2:CreateKeypair",
"ec2:CreateSecurityGroup",
"ec2:CreateSnapshot",
"ec2:CreateTags",
"ec2:CreateVolume",
"ec2:DeleteKeypair",
"ec2:DeleteSecurityGroup",
"ec2:DeleteSnapshot",
"ec2:DeleteVolume",
"ec2:DeregisterImage",
"ec2:DescribeImageAttribute",
"ec2:DescribeImages",
"ec2:DescribeInstances",
"ec2:DescribeRegions",
"ec2:DescribeSecurityGroups",
"ec2:DescribeSnapshots",
"ec2:DescribeSubnets",
"ec2:DescribeTags",
"ec2:DescribeVolumes",
"ec2:DetachVolume",
"ec2:GetPasswordData",
"ec2:ModifyImageAttribute",
"ec2:ModifyInstanceAttribute",
"ec2:ModifySnapshotAttribute",
"ec2:RegisterImage",
"ec2:RunInstances",
"ec2:StopInstances",
"ec2:TerminateInstances"
],
"Resource" : "*"
}]
}
It worked.
|
b8a261493ec598ca50a722861cc19825615a317b33251967b95c66422dd40110 | ['d2d83039e0194636b18299899f3b8289'] | In lambda it can be done like this:
var results = tcs.Skip(searchModel.PageSize * (searchModel.Page - 1))
.Take(searchModel.PageSize)
.AsEnumerable()
.Select(x => new
{
trackId = x.TrackId,
trackName = x.TrackName,
category = _weCategoryService.FindAll().Where(y => y.WorkExperience_Track.TrackId == x.TrackId)
.Select(y => new {
categoryId = y.CategoryId,
categoryName = y.CategoryName,
skill = _skillsService.FindAll().Where(z => z.CategoryId == y.CategoryId)
.Select(z => new {
skillId = z.SkillId,
skillName = z.SkillName
}).OrderBy(z => SortSkills ? z.skillName : "").OrderByDescending(z => !SortSkills ? z.skillName : "").ToList()
}).OrderBy(y => SortCategory ? y.categoryName : "").OrderByDescending(y => !SortCategory ? y.categoryName : "").ToList()
}).OrderBy(x => SortTrack ? x.trackName : "").OrderByDescending(x => !SortTrack ? x.trackName : "").ToList();
Else you need to use expressions like this:
var x = widgets.Where(w => w.Name.Contains("xyz"));
if (flag) {
x = x.OrderBy(w => w.property);
} else {
x = x.OrderByDescending(w => w.property);
}
| 57419dfdb94c5aa99b650207a683ea5e48597a9b5f7fcd6ad87767f7e5ed844b | ['d2d83039e0194636b18299899f3b8289'] | I want to execute code before the hashchange event affects the page. how can i execute before hash change event? I want to use a confirm box on before hash chnage so that if i press cancel button of confirm box it does not navigate to new hash. I do not want to change hash on cancel button because it opens the page as new again and my changes to page state are lost. Please provide me a quick solution.
|
a09dcea09fbf027a412438993eb3eece8aa3aef5dfa3b7beba2e38e3b316e12f | ['d2e104db5ea84e148afaa37705e80c38'] | I’m new at working with WIFI Network connected devices so please excuse my ignorance. I need to be able to receive GPS location data via the GDL90 protocol from a WIFI connected external GPS and integrate that into my app.
How do I access the data? JSON? Other? I’ve looked at the GDL90 protocol and am not seeing anything that stands out as a starting point. Again, I’ve not worked with network data so I’m not sure what I know or don’t know.
Once I’ve figured out how to access and read the data, I’ll be good from there, but I’ve hit a wall.
Any help/guidance will be appreciated.
| ede5818981fb9c9a4505a5b899f11df2b3e0cdd88a3135fc96358a6691aacd6f | ['d2e104db5ea84e148afaa37705e80c38'] | I've been using background location updating since iOS 9 with no problems and this issue just showed up now in iOS 13. The debugger console identifies this issue when the app enters the background: "Can't end BackgroundTask: no background task exists with identifier 3 (0x3), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug."
Here's how boilerplate code for location updates in the background:
First, the code in the AppDelegate:
if CLLocationManager.authorizationStatus() == .notDetermined {
locationManager.requestAlwaysAuthorization()
locationManager.allowsBackgroundLocationUpdates = true
}
The info.plist:
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>"MY APP" is optimized to run in the background as well as when your using it directly. For best results, choose ALWAYS.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>"MY APP" is optimized to run in the background. Please choose ALLOW.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Please choose ALLOW WHILE USING APP. "MY APP" needs to use your location to get its altitude data.</string>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
As far as I can tell there's nothing that should be causing this issue. And why it's just started makes no sense.
|
f216959df8a258fd6ae085425e107de32bc7343e4a80cbf767219609cef7c445 | ['d2e53b219cc444b29fa1536155c4e484'] | i want to do 'check in' to code uses Nuget package.
what is the the best way to do it?
Do i need to do 'check in' to the package folder?
Is there any way to put the dll's (nuget's dlls) in GAC and add them public key token?
My solution is written in c# .net framework 4.5. TFS version - 2015
thanks!
| 030ac0751bc2eefc489a93ce8e7c13ab4fe2658713d442a8946aaf49b871824c | ['d2e53b219cc444b29fa1536155c4e484'] | i have a div with attribute data-toggle=collapse. This div contains child element (a tag - a link) and i want that the a elemnt will not refer to the data-toogle attribute.
<div data-toggle="collapse" data-target="#someElement">
<span>click here to collapse</span>
<a (click)="anyFunction($event)">open new window</a>
</div>
i don't want that click on a element will collapse the panel.
how can i do it?
|
03b812dcba870062e98cb23140a86dcd95ade9d714594e5f382fe078c296022d | ['d2f7b58b8a244ff0ab645e1155de14fd'] | That error often means it's had some problem loading the file in question. Is the Admin module defined at that point? You can try:
module Admin
module ArticleCategoriesHelper
end
end
instead. This will work whether Admin exists or not.
Simplest solution would be to just remove the file entirely, since you don't seem to be using it for anything.
| 81a4a91ea36aa4d4eeb4eb64ffe16bd45f35039e7c9ea796648b3cee46414852 | ['d2f7b58b8a244ff0ab645e1155de14fd'] | Also highly recommend the pattern. No gems that I know of, but it's pretty easy to do. One tip: include the ability to auto-set the initial state to either on or off:
feature_flag('third_party_tool', :default => true) do
... # this is on by default
end
This will save you headaches at deployment time.
|
c989c72e9f092635aafcd57406ba6e01f16f3e55d4c31508dbbd6e0515769489 | ['d2fca5c4def146a58426fa5fbbeb8af3'] | I saw this problem and this is how it got solved:
Host the SDK samples (or the project) on the Local IIS (not IIS Express).
This way you can access the site with the machine IP (ex. http://<IP_ADDRESS>/ or http://<IP_ADDRESS>/sdksamples/) and not http://localhost/.
Now add this IP to the trusted connections by Lync server as described here in this article (Step 3).
You should now be able to complete the sign in process.
Regards
| edb209bf0834327d6f6fe0b8afcb1fed4eea9b96b7a79068f49f613827b5ccb7 | ['d2fca5c4def146a58426fa5fbbeb8af3'] | I'm sending SIP requests to Twilio SIP Trunk, using Node.js and Kirm/Sip module, I'm trying to cancel the call after receiving '180 Ringing' response.
The problem is that the [CANCEL] SIP request is sent but the server never replies with status '200 Canceling' like it should, instead it replies with a TCP [ACK] and the call remains ringing..
The Cancel request is a copy from the Invite request but changed the Method and CSec Method.
INVITE request:
INVITE sip:<EMAIL_ADDRESS> SIP/2.0
From: <sip:<EMAIL_ADDRESS>>;tag=168502
To: <sip:<EMAIL_ADDRESS>>
Call-ID: 284466
CSeq: 969240 INVITE
Content-Type: application/sdp
Contact: <sip:test@192.168.61.4>
Via: SIP/2.0/TCP 192.168.61.4:61244;branch=z9hG4bK847573
Content-Length: 363
Proxy-Authorization: Digest realm="sip.twilio.com",username="test",nonce="XXXX",uri="sip:<EMAIL_ADDRESS>",nc=00000001,cnonce="XXXXXXX",qop=auth,opaque="XXXXXXX",response="XXXXXXX"
v=0
o=- 3700480907 3700480907 IN IP4 192.168.61.4
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4012 RTP/AVP 123 8 0 101
c=IN IP4 192.168.61.4
b=TIAS:64000
a=rtcp:4013 IN IP4 192.168.61.4
a=sendrecv
a=rtpmap:123 opus/48000/2
a=fmtp:123 maxplaybackrate=16000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
CANCEL request:
CANCEL sip:<EMAIL_ADDRESS> SIP/2.0
CSeq: 969240 CANCEL
Call-ID: 284466
From: <sip:<EMAIL_ADDRESS>>;tag=168502
To: <sip:<EMAIL_ADDRESS><IP_ADDRESS>>
Via: SIP/2.0/TCP <IP_ADDRESS>:61244;branch=z9hG4bK847573
Content-Length: 363
Proxy-Authorization: Digest realm="sip.twilio.com",username="test",nonce="XXXX",uri="sip:123456789@sample.pstn.ie1.twilio.com",nc=00000001,cnonce="XXXXXXX",qop=auth,opaque="XXXXXXX",response="XXXXXXX"
v=0
o=- 3700480907 3700480907 IN IP4 <IP_ADDRESS>
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4012 RTP/AVP 123 8 0 101
c=IN IP4 <IP_ADDRESS>
b=TIAS:64000
a=rtcp:4013 IN IP4 <IP_ADDRESS>
a=sendrecv
a=rtpmap:123 opus/48000/2
a=fmtp:123 maxplaybackrate=16000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
CANCEL request:
CANCEL sip:123456789@sample.pstn.ie1.twilio.com SIP/2.0
CSeq: 969240 CANCEL
Call-ID: 284466
From: <sip:test@sample.pstn.ie1.twilio.com>;tag=168502
To: <sip:123456789@sample.pstn.ie1.twilio.com>
Via: SIP/2.0/TCP <IP_ADDRESS><PHONE_NUMBER>
To: <sip:123456789@sample.pstn.ie1.twilio.com>
Call-ID: 284466
CSeq: 969240 INVITE
Content-Type: application/sdp
Contact: <sip:test@192.168.61.4>
Via: SIP/2.0/TCP 192.168.61.4:61244;branch=z9hG4bK847573
Content-Length: 363
Proxy-Authorization: Digest realm="sip.twilio.com",username="test",nonce="XXXX",uri="sip:123456789@sample.pstn.ie1.twilio.com",nc=00000001,cnonce="XXXXXXX",qop=auth,opaque="XXXXXXX",response="XXXXXXX"
v=0
o=- 3700480907 3700480907 IN IP4 192.168.61.4
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4012 RTP/AVP 123 8 0 101
c=IN IP4 192.168.61.4
b=TIAS:64000
a=rtcp:4013 IN IP4 192.168.61.4
a=sendrecv
a=rtpmap:123 opus/48000/2
a=fmtp:123 maxplaybackrate=16000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
CANCEL request:
CANCEL sip:123456789@sample.pstn.ie1.twilio.com SIP/2.0
CSeq: 969240 CANCEL
Call-ID: 284466
From: <sip:test@sample.pstn.ie1.twilio.com>;tag=<PHONE_NUMBER>
To: <sip:123456789@sample.pstn.ie1.twilio.com>
Via: SIP/2.0/TCP 192.168.61.4:61244;branch=z9hG4bK847573
Content-Length: 0
So any ideas?
Thanks
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.